Submitting Returns Information Error

I get an error when submitting to the reverseDeliveryCreateWithShipping endpoint:

[{
field: null,
message: must receive either return_label_file or tracking_info
}]

I don’t understand why you can only send one or the other? The customer needs the label file and also the tracking number?

Hey @edstevo :waving_hand: - that definitely seems a bit odd for sure. Looking at our docs here: reverseDeliveryCreateWithShipping - GraphQL Admin, it doesn’t seem like the label or tracking inputs are necessarily marked as required fields (just the reverseDeliveryLineItems and the reverseFulfillmentOrderIdreverseFulfillmentOrderId).

Could you share the full mutation call you’re using including the inputs. If you’re able to share the X-Request-ID header from the response headers we send out, that would be helpful too. I can check our logs if you are able to share that request ID and investigate further on our end here.

Hope to hear from you soon!

Hi Alan,

I can’t replicate this request right now because I’ve had to manually add the relevant details via the Admin dashboard. So I can’t “create” the reverseDelivery again. But the error message is valid. See attached:

The update request I have tested and that doesn’t have any problems with a payload with both the “labelInput.fileUrl” and “trackingInput.number”.

I’ll see if I can find the X-Request-ID in any logs.

1 Like

I can’t find the X-Request-ID unfortunately. I have set it to pick it up the next time it happens.

No problem @edstevo - thanks for sending that screenshot my way. I think I was able to replicate the issue on my end here. Here’s the syntax I used:

mutation {
  reverseDeliveryCreateWithShipping(
    reverseFulfillmentOrderId: "gid://shopify/ReverseFulfillmentOrder/id-here"
    reverseDeliveryLineItems: [
      {
        reverseFulfillmentOrderLineItemId: "gid://shopify/ReverseFulfillmentOrderLineItem/id-here"
        quantity: 1
      }
    ]
  ) {
    reverseDelivery {
      id
    }
    userErrors {
      field
      message
    }
  }
}

It looks like when a reverse delivery is created without either the tracking info or the label info, we’ll return that error. If you include both though, it should work like this:

mutation {
  reverseDeliveryCreateWithShipping(
    reverseFulfillmentOrderId: "gid://shopify/ReverseFulfillmentOrder/id-here"
    reverseDeliveryLineItems: [
      {
        reverseFulfillmentOrderLineItemId: "gid://shopify/ReverseFulfillmentOrderLineItem/id-here"
        quantity: 1
      }
    ]
    labelInput: {
      fileUrl: "https://example.com/return-label.pdf"
    }
    trackingInput: {
      number: "1Z999AA10123456784"
      url: "https://www.tracker-shipping-fake.com/track?tracknum=1Z999AA10123456784"
    }
  ) {
    reverseDelivery {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Could you let me know if the above formatting works for you? I just tested it on my end here and I was able to create a reverse delivery using the mutation in my last example there on my test shop. Hope this helps!

The data I used for my request was as so (redacted):

{
  "labelInput": {
    "fileUrl": "https://----.----.com/0----------------J.pdf"
  },
  "notifyCustomer": false,
  "reverseDeliveryLineItems": [
    {
      "quantity": 1,
      "reverseFulfillmentOrderLineItemId": "gid://shopify/ReverseFulfillmentOrderLineItem/7---------0"
    }
  ],
  "reverseFulfillmentOrderId": "gid://shopify/ReverseFulfillmentOrder/4---------2",
  "trackingInput": {
    "url": null,
    "number": "Cxxxxxxxxxxxxxx2"
  }
}

As I say, I’ll have to wait for the next customer to request a return to get a X-Request-ID. If it doesn’t work again I’ll follow up with you here.

Thank you for getting back so swiftly.

1 Like

Hi edstevo,

Just wanted to follow up here - can I mark this as solved/closed?

Hi - I haven’t had another return requested yet, so I cannot confirm this has been resolved. I don’t have test credentials to trigger a fake “return” either.

Hello,

I had a return today. It failed for the same reasons.

The X-Request-ID is: “c10884e6-3d48-4f08-8c54-77d8e26cd3dc-1744114816”

Payload is:

{
  "labelInput": {
    "fileUrl": "https://xxxxxxx/xxx/xx/xxxxx/xxxx/xxxxxxxxx?start_from=0"
  },
  "notifyCustomer": false,
  "reverseFulfillmentOrderId": "gid://shopify/ReverseFulfillmentOrder/xxxxxxxxxx",
  "trackingInput": {
    "url": "https://xxxxxxx/xxxxxxxx/xxxxx",
    "number": "Hxxxxxxxxxxxxxx6"
  },
  "reverseDeliveryLineItems": [
    {
      "quantity": 1,
      "reverseFulfillmentOrderLineItemId": "gid://shopify/ReverseFulfillmentOrderLineItem/xxxxxxxx"
    }
  ]
}

As you can see the payload has both labelnput and the tracking details. My customer needs to download the label as well as have access to the tracking number.

The error says “must receive either return_label_file or tracking_info”.

Why can I only submit one piece of information?

I’m not sure what happened here, but the mutation wasn’t copied over correctly from the documentation. I copied it over again today and it had more inputs specified and it now works fine.

Thank you for your help, this is now resolved.