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.

Re: Adding multiple tracking numbers using New Fulfillment API

Adding multiple tracking numbers using New Fulfillment API

VCIH
Shopify Partner
8 0 2

We are working on migrating to the new fulfillmentOrder API route due to the fulfillment deprecations.

 

I am working with the REST API and it looks like you can only add one tracking number per fulfillment. The old create Fulfillment API supported adding more than one tracking number to a single fulfillment by using the tracking_number array.

 

We work with companies that could have multiple products within one sku that ship in different packages. With this new workflow we are only provided the 'tracking_info' attribute. This would result in us not being able to provide the end user with all applicable tracking numbers that they would need.

 

Example below to try to explain what I'm saying

Thanks!

 

 

 

old way that supported this
{
    "location_id": 1234567,
    "tracking_numbers": [
        "1245",
        "123456"
    ],
    "line_items": [
        {
            "id": 1,
            "qty": 1
        }
    ]
}

new way
request 1: would succeed
{
    "fulfillment": {
        "tracking_info": {
            "number": 1245
        },
        "line_items_by_fulfillment_order": [
            {
                "fulfillment_order_id": 1469493,
                "fulfillment_order_line_items": [
                    {
                        "id": 1,
                        "qty": 1
                    }
                ]
            }
        ]
    }
}

request 2: would fail because line item is already fulfilled/fulfillment order is closed
{
    "fulfillment": {
        "tracking_info": {
            "number": 123456
        },
        "line_items_by_fulfillment_order": [
            {
                "fulfillment_order_id": 1469493,
                "fulfillment_order_line_items": [
                    {
                        "id": 1,
                        "qty": 1
                    }
                ]
            }
        ]
    }
}

 

Replies 6 (6)

Marco98
Visitor
1 0 0

Has anyone solved the problem so far?

Jesse-James
Shopify Partner
22 0 9

Heya @Marco 

Ya, that did feel weird as I ran into the same limitation.  I guess Shopify addressed this gap in their 2022-07 version:

 

JesseJames_0-1668647024234.png

 

f.y.i, hope that helps, Jesse

Mercantile Apps - simple apps for enterprise growth
Learn more
VCIH
Shopify Partner
8 0 2

Unfortunately this looks like it is only for the GraphQL API, not the REST API. I tested it in rest 2022-10 just in case. It responds with a 201 created, but only with the first tracking number. Looks like there's still this functionality gap in the REST.

We'd have to completely rewrite to use the functionality in GraphQL.

VCIH
Shopify Partner
8 0 2

I did look into the GraphQL version of the API to see if this could help us. I have a question around functionality. Is it expected behavior that the 'notify customer' only triggers sending the first tracking number to the customer? I would expect all of them to be included in the email.

_Kevin_A
Shopify Partner
8 0 3

Hello @VCIH,  

 

I too am looking into a solution for this same exact situation.  Our system also allows a Parent SKU to be submitted to the Fulfillment System, which then has a feature that understands how to split the Parent SKU into the actual shippable SKUs for fulfillment.  We have a number of scenarios where we need to submit back to Shopify multiple Tracking Numbers for a single fulfillment.

 

Our team is working on updating our plugin to the new FulfillmentOrders API.  While looking for a solution I ran across this Shopify thread where a user named ShopifyDevSup mentioned that the dev team has plans to update the REST API to once more allow multiple tracking numbers.

I'm hoping this is still Shopify's plan.

 

Were you able to find a workaround?  Did you end up partly using GraphQL to accomplish this part of your requirements?

I'd be interested to know what you and your team figured out on this.

 

Sincerely,

Kevin

VCIH
Shopify Partner
8 0 2

Hello,

 

We were not able to find a workaround for this, I don't recall why but when we attempted to use the GraphQL solution it did not fit our needs.

We had to make a compromise with our users to only send the first tracking number if this occurs, since then it's been a waiting game for the update to be released to send multiple tracking numbers.