Dev.to WebDev 🛠 Dev 👁 0 📖 6 min read

Shopify Fulfillment Order API 2026: Fulfill Orders & Add Tracking Numbers from Your App

Shopify fulfillment order API tutorial (2026): ship orders from your own Shopify app with the GraphQL Admin API - fulfillment orders and remaining quantities, shipping part of an order, tracking numbers (and when Shopify

Shopify fulfillment order API tutorial (2026): ship orders from your own Shopify app with the GraphQL Admin API - fulfillment orders and remaining quantities, shipping part of an order, tracking numbers (and when Shopify builds the tracking link for you), updating tracking, and cancelling a shipment. Shopify app development series, episode 16 - everything shown is real, nothing skipped.

What you'll learn

  • Scope write_merchant_managed_fulfillment_orders
  • Orders → fulfillment orders → line items
  • fulfillmentCreate: part or all
  • Tracking: company, number, URL
  • fulfillmentTrackingInfoUpdate + fulfillmentCancel
  • Real errors

💻 Free source code for this episode: https://github.com/fayyaz315/shopify-app-development-2026/tree/ep16

3 quick fixes from this episode

Shopify Fulfill Order API: Ship 2 of 3 Items (Partial Fulfillment)

Shopify fulfill order API (2026-10): you don't fulfill the order - you fulfill its fulfillment order, line item by line item. Ship 2 of 3 and the order turns partially fulfilled with 1 left; ask for more than is left and Shopify says 'Invalid fulfillment order line item quantity requested'.

▶ 60-second video: https://youtube.com/shorts/tQchfTpCMCA

Shopify API Tracking Number: Let Shopify Build the Tracking Link

Shopify API tracking number (2026-10): send the carrier as 'DHL Express' and Shopify builds the tracking URL itself. For a carrier Shopify does not list, it may guess wrong (our TCS number got a Purolator link), so send your own URL; a bare number gets no link at all. Update it later with fulfillmentTrackingInfoUpdate.

▶ 60-second video: https://youtube.com/shorts/zDGdhugosCg

Shopify Fulfillment API: Cancel a Shipment (and Its Quiet Surprise)

Shopify fulfillment API (2026-10): fulfillmentCancel undoes a shipment - the items go back to the fulfillment order and the order is unfulfilled again. Cancel it a second time and there's no error at all: the status just stays cancelled. Tested on a real store.

▶ 60-second video: https://youtube.com/shorts/w8KPUpDoKHc

Step by step

Preview + intro (0:00)

In the next ten minutes, your app ships an order, part of it first, with a tracking number. Shopify even builds the tracking link for you, if you name the carrier the right way, and a cancelled shipment puts the items right back. This is the Shopify fulfillment order API at work.

Our app just shipped two of three shirts, with a tracking number. This is episode sixteen of the Shopify app development series. Last time, orders.

Today: shipping them. The full code is free on GitHub, and the link is in the description.

Fulfillment orders (0:36)

You don't fulfill an order directly. Shopify splits every order into fulfillment orders. One fulfillment order per location that ships it.

Each of its line items knows how many are still left to ship. And every parcel you send is a fulfillment, with its own tracking number. When does an app ship orders?

Syncing tracking numbers from a warehouse, printing labels, or shipping many orders at once. The scope is write merchant managed fulfillment orders: orders you ship from your own locations. As before, I restarted the dev server and opened the app once to grant it.

Ready to ship (1:12)

The new Fulfillments page. At the top, Sara Khan's order: three shirts and one pair of pants, from Shop location. The loader reads the latest orders, with their fulfillment orders and their shipments.

Why not ask Shopify for unshipped orders only? I tried. That search filter lags a few seconds behind a new shipment, so the page filters the fresh data itself.

Each fulfillment order brings its location and its line items, with the remaining quantity. We keep only the ones that can still be shipped: open or in progress, and only items with something left. A fulfillment order also tells you what you may do with it.

In my tests: create fulfillment, hold, split, and report progress. Its status moves from open, to in progress after a partial shipment, to closed when everything has shipped. Each line gets a number field, starting at what's left, and it can't go higher.

Ship part of it (2:08)

Only two shirts are packed today. Two shirts, zero pants. Carrier: D H L Express.

Tracking number one two three four, and so on. Fulfill. Shipped, two items.

The order is now partially fulfilled. One of three shirts left, and the pants. That's fulfillment create.

For each line item we ship: its fulfillment order line item id, and how many. They're grouped by fulfillment order, with the tracking info and whether to email the customer. Every action returns userErrors, and the page shows Shopify's message in a red toast.

Leave the line items out completely, and Shopify ships everything that's left on that fulfillment order.

Tracking links (2:56)

Under shipped, the parcel. And look: a tracking link. I never sent a link, only D H L Express and the number.

Shopify knows that carrier, so it builds the tracking address itself. That's why our picker uses Shopify's own carrier names. Our picker offers D H L Express, U P S, Fed Ex, U S P S, and other.

But careful with carriers Shopify doesn't list, like T C S. In GraphiQL you'll see what Shopify does with those.

Ship the rest (3:26)

Now the rest, with a carrier Shopify doesn't name: other, and a postal tracking number. Fulfill. Shipped, two more: the last shirt and the pants.

Two parcels now. The second one has a number, but no carrier and no link. The shipped list takes every successful fulfillment of those same orders.

Shopify lists an order's fulfillments newest first, so our page sorts them back into the order they were shipped. Update tracking uses fulfillmentTrackingInfoUpdate, for when the courier gives you a new number. Coming up: what happens when a parcel comes back.

Cancel a shipment (4:06)

Now the D H L parcel came back. Cancel. Fulfillment cancelled.

And the two shirts are back in ready to ship. The order is partially fulfilled again. That's fulfillment cancel.

Just the fulfillment's id.

In the admin (4:22)

In Shopify's own order page, the same story. And the timeline even says it: my store helper cancelled a fulfillment. Now GraphiQL.

The order's fulfillment orders, straight from the API. Status, location, and every line item with its total and remaining quantity. Surprise one: ship five shirts when only two are left.

Invalid fulfillment order line item quantity requested. Shopify checks the remaining quantity. Surprise two: a carrier Shopify doesn't know, T C S.

Shipped, and Shopify built a link anyway, to Purolator, a Canadian courier. Wrong carrier. For carriers Shopify doesn't list, send the tracking URL yourself.

Surprise three: cancel the D H L shipment again. No error at all. It just stays cancelled.

Want to practise? Add a Hold button with fulfillment order hold, for orders waiting on a payment check.

Honest notes (5:22)

A few honest notes before the recap. One: we didn't email the customer. Tick the box, and Shopify sends its shipping confirmation with the tracking link.

Two: apps that ship for many stores, like warehouses, are fulfillment services. They use assigned fulfillment orders and requests instead. Three: a bug I found while recording.

After the first shipment, the form kept my typed two, but only one shirt was left, so Shopify refused it. The fix: the form's key includes the remaining quantities, so React rebuilds it with fresh numbers after every shipment. Four: this order was made through the API for the demo, from the draft orders of the last episode.

And everything you saw was tested on my real development store, on API version 2026-10, before I pressed record.

Recap (6:15)

So, the recap. Add the merchant managed fulfillment orders scope. Read the order's fulfillment orders and what's left on each line.

Ship part or all of it with fulfillment create, and name the carrier the way Shopify knows it. And undo a shipment with fulfillment cancel. That's the Shopify fulfillment order API in 2026, inside a real app, on a real store.

The full code for this episode is free on GitHub. The link is in the description. Next episode: themes.

Reading and changing theme files from your own app. See you there.

📖 The full written tutorial with every episode: https://www.wixob.com/shopify-fulfillment-order-api-tutorial/
📚 Course page: https://www.wixob.com/shopify-app-development-2026/
🔔 New episodes on YouTube: https://www.youtube.com/@fayyaz-ahmed-shopify-developer?sub_confirmation=1

Questions about the Shopify GraphQL Admin API? Ask in the comments — I answer every one.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.