I am getting {"errors":"Internal Server Error"} while updating tracking info

Ahsan3
New Member
22 0 0

Hi,

I am getting this error while updating tracking information:

HTTP/2 500

{"errors":"Internal Server Error"}

I tried to update tracking information using the same API yesterday in my development store and it worked but now I am doing it for my client on his live store but it is giving me this error. Please help since it is urgent.

Here is my x-request-id: 0ed506a6-f7de-41b8-8e01-a50cb0a9c76b

Here the API call: "https://$API_KEY:$PASSWORD@$SHOP_URL//admin/api/2021-01/fulfillments.json";

And I am using the POST method for this API

Here is my payload and what I am posting to Shopify:

{
    "fulfillment":[
        {
            "notify_customer":true,
            "tracking_info":{
                "number":"dPSSTVG82v",
                "url":"https:\/\/www.ups.com\/track?loc=en_CA&requester=ST\/",
                "company":"UPS"
            },
            "line_items_by_fulfillment_order":[
                {
                    "fulfillment_order_id":"4627845906589",
                    "fulfillment_order_line_items":[
                        {
                            "id":"9756998303901",
                            "quantity":"1"
                        }
                    ]
                }
            ]
        },
        {
            "notify_customer":true,
            "tracking_info":{
                "number":"ZKxB8dO5fM",
                "url":"https:\/\/www.ups.com\/track?loc=en_CA&requester=ST\/",
                "company":"UPS"
            },
            "line_items_by_fulfillment_order":[
                {
                    "fulfillment_order_id":"4627845906589",
                    "fulfillment_order_line_items":[
                        {
                            "id":"9756998336669",
                            "quantity":"1"
                        }
                    ]
                }
            ]
        }
    ]
}

 

 

0 Likes
Ahsan3
New Member
22 0 0

It's been almost 3 days that I haven't got any response from anybody. I have a task to complete and I have already crossed the deadline so please someone kindly help me so that I can deliver work to the client. 

0 Likes
_JCC_
Shopify Staff
Shopify Staff
160 21 28

Hey @Ahsan3 

Happy to help you out with this.

The fulfillments endpoint is returning the error because of the format of the request. In the payload of the request fulfillment is an object not an array. The fulfillments (/admin/api/2021-01/fulfillments.json)  endpoint only supports specifying a single instance of tracking info for multiple fulfillment orders for the same order and location. If you'd like to specify a tracking number and optionally url per line item you could use /admin/api/2021-01/orders/someordernumber/fulfillments.json, and specify an array of tracking_numbers, and optionally tracking_urls in the order the line items appear in the fulfillment request.

If a single tracking number for the fulfillment is acceptable your example can be tweaked to

{
    "fulfillment":{
            "notify_customer":true,
            "tracking_info":{
                "number":"dPSSTVG82v",
                "url":"https:\/\/www.ups.com\/track?loc=en_CA&requester=ST\/",
                "company":"UPS"
            },
            "line_items_by_fulfillment_order":[
                {
                    "fulfillment_order_id":"4627845906589",
                    "fulfillment_order_line_items":[
                        {
                            "id":"9756998303901",
                            "quantity":"1"
                        },
                       {
                            "id":"9756998336669",
                            "quantity":"1"
                        }
                    ]
               }
            ]
      }
}

I Hope this helps, if you have any other questions please don't hesitate to reach out.

Regards,

John

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes