Cannot update tracking info after a complete fulfillment

Hello,

I have to update the fulfillment in 2 times.
The first one to fulfill the items, this step causes the fulfillment_status to close.

/admin/api/{{api_version}}/fulfillments.json

{
“fulfillment”:
{
“line_items_by_fulfillment_order”:
[
//GET “/{{api_version}}/orders/{{order_id}}/fulfillment_orders.json”
{
“fulfillment_order_id” : {{fulfillment_id}},
“fulfillment_order_line_items”:
[
{
“id”: {{line_item_id[0]}},
“quantity”: {{quantity[0]}}
},
{
“id”: {{line_item_id[1]}},
“quantity”: {{quantity[0]}}
}
]
}
],
“tracking_info”: null,
“notify_customer”: true
}
}

After that, I have to update the tracking info but it tells me that it is closed.

/admin/api/{{api_version}}/fulfillments/{{fulfillment_id}}/update_tracking.json

{
“fulfillment”: {
“tracking_info” : {
“number” : {{number}},
“url” : {{url}}
},
“notify_customer”: true
}
}

And the response:

{
“errors”: “Not Found”
}

If I try to update the tracking info in /admin/api/{{api_version}}/fulfillments.json, the response is:

{
“errors”: [
“Fulfillment order {{fulfillment_id}} has an unfulfillable status= closed.”
]
}

I can’t report the tracking info in the same call of the fulfillment.

How can I update the tracking info once I have fulfilled each item in a second call?

Thanks in advance.

Hi SiLogisticsSup,

For the Not Found error, it could be due to the fulfillment_id being incorrect or that the fulfillment does not exist in the system. Ensure that you are using the correct fulfillment_id.

For the error Fulfillment order {{fulfillment_id}} has an unfulfillable status= closed, it could be because the fulfillment is already fulfilled and closed in the system, so you cannot update the tracking info.

You could try the following steps:

  1. Use the fulfillmentTrackingInfoUpdateV2 mutation to update the tracking information for a fulfillment. This mutation takes in a fulfillmentId and a trackingInfoInput object as parameters.

Here is an example:

mutation fulfillmentTrackingInfoUpdateV2($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) { 
  fulfillmentTrackingInfoUpdateV2(fulfillmentId: $fulfillmentId, trackingInfoInput: $trackingInfoInput, notifyCustomer: $notifyCustomer) {
    fulfillment {
      id
      status
      trackingInfo {
        company
        number
        url
      }
    }
    userErrors {
      field
      message
    }
  }
}

  1. For the fulfillmentId, input the fulfillment_id that you have. For the trackingInfoInput object, input the tracking information. For example:
{
  "fulfillmentId": "gid://shopify/Fulfillment/255858046",
  "notifyCustomer": true,
  "trackingInfoInput": {
    "company": "UPS",
    "number": "1Z001985YW99744790"
  }
}

This should update the tracking information for the fulfillment. Hope this helps!

1 Like

Thank you very much!

For anyone getting the “NOT Found” error - the Fulfillment ID is NOT the Order ID.

You have to query the Order ID to find the fulfillment ID within the “fulfillments” object.