Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Adding Multiple Tracking Numbers With New Fulfillment API Endpoints

Adding Multiple Tracking Numbers With New Fulfillment API Endpoints

Ralph-HA
Shopify Partner
108 7 46

Hey Everyone,

   I'm working on migrating to the new Create Fulfillment and Update Tracking Number REST Fulfillment API's and I noticed there is only support for adding a single tracking number per fulfillment.  We work with merchants who's current workflow forces them to associate multiple tracking numbers to a single fulfillment.

 

   The old Fulfillment API supported adding multiple tracking numbers to a single Fulfillment as there was a `tracking_numbers` attribute associated to the Fulfillment.  It looks like this is no longer possible with the new Fulfillment API's that are a part of version 2022-04.  There is a single `tracking_info` attribute that can be provided with the Create Fulfillment and Update Tracking Number endpoints.

 

I'm looking for some guidance on how we communicate this change to merchants.  Is this something that is no longer going to be supported?  Is the only option to break the single fulfillment into multiple Fulfillments and associate the tracking numbers as such? 

 

Thanks for your help!

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
Replies 5 (5)

JansenOUW
Tourist
4 0 7

Bump! We're discussing this on the Discord as well. Feel free to join the thread https://discord.com/channels/842813079926603828/994369878330966067

E-Commerce Ambassador and Front-end Developer @ Oneupweb, a full-service digital marketing agency in Traverse City, MI.
jgd
Shopify Partner
6 0 1

Hi. Was this possible to achieve?

Ralph-HA
Shopify Partner
108 7 46

Hi @jgd,

   I never heard from Shopify about this, but based on their documentation and my tests, you can only add a single tracking number to a Fulfillment Order.  If your order has multiple tracking numbers, it should have multiple Fulfillment Orders.

 

The create Fulfillments and Update Tracking numbers endpoints only accept a single tracking number.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
jgd
Shopify Partner
6 0 1

Hi.

 

Yes, I got the same impression.

 

Thanks for your response!

cottton
Shopify Partner
11 0 13

Just had this problem.

The order : fulfillment order : fulfillment relation is weird.

From what i just tried: it is possible to add multiple tracking numbers.

 

You cannot get multiple fulfillment orders (or can we? I mean they are created automatically).

But we can call POST /fulfillments.json multiple times without closing the fulfillment order.

 

Example:

1 order,

3 items

^= 1 fulfillment order (i.e. 11001100)

with 3 fulfillment order line items (i.e. 111, 222, 333)

 

Calling POST /fulfillments.json 3 times -

with 111, then 222 and then 333:

 

[
'fulfillment' => [
'notify_customer' => true,
'line_items_by_fulfillment_order' => [
[
'fulfillment_order_id' => '11001100',
'fulfillment_order_line_items' => [
[
'id' => 111, // fulfillment order line item id
'quantity' => 1,
],
],
],
],
'tracking_info' => [
'number' => 1122334455,
'url' => 'https://www.my-shipping-company.com',
'company' => 'my-shipping-company',
],
],
]

 

This works somehow but is a pain in the ***.

Had similar with another API. 

Imagine you got 

1 order 

with 3 items in NOT just qty 1.

 

And now imagine you do NOT have 1 tracking number per item qty.

 

Example:

order items:

SKU A, qty 2, parcels 1, tracking numbers 1

SKU B, qty 1, parcels 2, tracking numbers 2

SKU C, qty 3, parcels 2, tracking numbers 2

 

Now find out how many call to make and where to put the tracking numbers.

 

There SHOULD be a REST API endpoint like "take this number and ADD it to SKU XYZ"

(or to (w/e)item id 123).

Everything else is just a lot of code in front of a simple task: adding a number to another one.