Add Tracking To Order via API

Hi All, New to Shopify. Successfully created a shop, got the API integrated with a custom ERP creating draft orders and other functions.

What I need help with is adding tracking info to an order. I’ve gone through everything online and in the API docs, but really confused by the process. From what I can see, it was supposed to be the mutation fulfillmentCreate, but that seems to be expecting a Fulfilment ID - which I don’t have - only order IDs.

Note I am using GraphQL (not the depreciated REST API)

Any idea of the workflow/how to do this please?

You’ll need to query fulfillmentOrders against the order to get the ID then you can use fulfillmentCreate, and then also pass in trackingInfo within the mutation.

Read more on the fulfillment flow here:

Thanks for this. Trying to get the query to work but as fairly new to GraphQL.

If I do a cURL for following:

{

“query”: "{ fulfillmentOrders { id: 12345 } } "

}

(Where the 12345 should be the orderID)

It returns an error of

“syntax error, unexpected INT (\“12345\”) at [1, 28]”

Any chance you can help with the right code for this please?

I’n not sure what you got that code from, but I’d suggest either reading the documentation or using Shopify’s Dev Assistant.

I need some help with this please.

I’ve spent literally days trying to figure how to construct the GraphQL, just to try and get a Fulfillment ID so I can then submit the tracking information.

I’ve tried everything - searching online, creating queries, trying many different ways in the query builder - It never returns the information I need.

Surely some one here can help please.

All I want to do is get a fulfillment ID for an order (I have the order ID), so I can submit the tracking information against that order.

Everything else has been super easy, but this simple little task is doing my head in.

Is anyone able to send me an example GraphQL query to do what I need please?