REST Admin API - Multiple Tracking Numbers to a single Fulfillment

  1. https://community.shopify.com/c/payments-shipping-and/mutiple-tracking-number-on-shopify-fulfillment/m-p/1909415#M68643

  2. https://community.shopify.com/c/forums/postpage.searchbeforepostfield:searchbeforepostitemselected/message-uid/1601100/node-display-id/community%3Acovpk78932/search-action-id/114414393387?t:ac=board-id/shopify-apis-and-technology&t:cp=search/contributions/messagesearchcontributionspage

  3. https://community.shopify.com/c/payments-shipping-and/mutiple-tracking-number-on-shopify-fulfillment/m-p/1909415#M68643

  4. https://community.shopify.com/c/fulfillment-api-deprecation/adding-multiple-tracking-numbers-with-new-fulfillment-api/m-p/1601100#M18

We need the ability to add multiple tracking numbers/urls to a single fulfillment, as it was possible before 2022-07.

You are deprecating an API without a viable replacement solution to this issue. I’m making an integration from a warehouse management system. and this will affect all my clients negatively.

  • We don’t want to create multiple fulfillments, this will trigger multiple emails, and worst case multiple invoices. for a single shipment.

Without a solution before April 1. we will be forced to fulfill with a single tracking number, giving the end customer a degraded experience. (not knowing about multiple packages)

I hope you will be able to fix this ASAP.

Best Regards.

1 Like

I’ll try to keep this simple. Here is what I have done to achieve a process very similar to the soon to be deprecated procedure. I’m going to make a couple of assumptions.

Based on the old logic, you probably already have a way to figure out the order id of your order you want to do a fulfillment on. Don’t need to change that. On my end, I just updated to 2023-01 and still worked.

Now for the added steps.

admin/api/2023-01/orders/{orderid found above}/fulfillment_orders.json?status=open

This call will get you the open fulfillment order id and all the line item ids for that fulfillment (note they are different than the order so if you were using those in the above step to process tracking number for individual line items, you need them from here now. Once the order is “fulfilled” this id becomes locked. In testing, I went to the manually went to the admin panel and cancelled the fulfillment. When I ran this again for the same order, I got an entirely new ID.

Do to no multiple tracking numbers via REST API, you need to use GraphQL.

admin/api/2023-01/graphql.json

Still unsure on Content-Type. Some say application/json and some say application/graphql. From Postman, my Content-Type says application/json however on the Body section, there is a radio button for GraphQL and I selected that.

For the body, this will update an entire order with multiple tracking numbers and close the whole order. Basically all the similar functionality we were used to the old way with a little different syntax. And yes, you have to use the gid url instead of just the number now.

mutation { fulfillmentCreateV2(fulfillment: {
lineItemsByFulfillmentOrder: [
{
fulfillmentOrderId: “gid://shopify/FulfillmentOrder/{fulfillmentorderid}”,
}
],
notifyCustomer: true,
trackingInfo: {
company: “FedEx”,
numbers: [
“394061616238”,“394061616239”
]
}
},
message: “”
) {
fulfillment {
legacyResourceId
}
userErrors {
field
message
}
}
}

Directly below fulfillmentOrderId, you could add the below to update specific line items/qty to not close the entire order with a single set of tracking numbers.

fulfillmentOrderLineItems: {
id: “gid://shopify/FulfillmentOrderLineItem/{fulfillmentorderlinenumber}”,
quantity: 1
}

You can add the urls right below the number if it’s not a common carrier that Shopify already translates for you.

urls: [
“https:/track.com/12345”,“https://track.com/1234”
]

1 Like