returnCalculate - INTERNAL_SERVER_ERROR

Hi,

I am trying to work with the returnCalculate mutation, and am getting the INTERNAL_SERVER_ERROR when testing (my dev store is jake-apr-29).

Here is the payload I used:

{
  "input": {
    "orderId": "gid://shopify/Order/6374622560494",
    "exchangeLineItems": [
      {
        "variantId": "gid://shopify/ProductVariant/45210836959470",
        "quantity": 1
      }
    ],
    "returnLineItems": [
      {
        "fulfillmentLineItemId": "gid://shopify/FulfillmentLineItem/13534238015726",
        "quantity": 1
      }
    ],
    "returnShippingFee": {
      "amount": {
        "amount": -14.37,
        "currencyCode": "CAD"
      }
    }
  }
}

Here is the query I used:

query ($input: CalculateReturnInput!) {
  returnCalculate(input: $input) {
    ...CalculatedReturnInfo
  }
}

And here is the response I got:

Internal error. Looks like something went wrong on our end.\nRequest ID: eb0deed7-1569-4f7a-964e-fd3101428c3c-1743793421 (include this in support requests).

Please help me get this working!

1 Like

I just fixed it by making the shipping fee amount positive instead of negative

1 Like

Hey @Jake_Goodman

The problem looks to be the return shipping fee you’re providing in your payload. You’re currently using -14.37 which is a negative value, but the API requires this to be a positive number (greater than or equal to 0).

Awesome, thanks @KyleG-Shopify! It would be helpful to include this in the documentation or error message for the next dev to stumble into this error!

For sure! Just so you know, if you come across anything else, all of our docs have a feedback option. All feedback shared here is reviewed by our docs team.

1 Like