FulfillmentService

Version 2019-10

A Fulfillment Service is a third party warehouse that prepares and ships orders on behalf of the store owner. Fulfillment services charge a fee to package and ship items and update product inventory levels. Some well known fulfillment services with Shopify integrations include: Amazon, Shipwire, and Rakuten. When an app registers a new FulfillmentService on a store, Shopify automatically creates a Location that's associated to that fulfillment service.

Using the Fulfillment Service API, you can register, edit and delete a new fulfillment service. When you register a new fulfillment service, you will need to expose the two following GET endpoints rooted in the callback_url:

  • fetch_tracking_numbers: Where Shopify can retrieve tracking numbers for orders.
  • fetch_stock: Where Shopify can retrieve inventory levels.

Testing the GET endpoints

To make sure you have everything set up correctly, you can test the GET endpoints in your development store by completing the following steps:

  1. Install your app on a development store.
  2. Create a fulfillment service using an API request from the app.
  3. Create at least one product that uses the fulfillment service to manage its inventory (either in the Shopify admin or using the API).

A sample Shopify request for tracking numbers:

Once per hour Shopify will make a request to this endpoint if there are any completed fulfillments awaiting tracking numbers from the remote fulfillment service.

GET
/fetch_tracking_numbers

Get tracking numbers for orders

order_names

The fulfillment names we require tracking numbers for (i.e. #1001.1)

shop

The shop's myshopify url

Get a list of tracking numbers for the following fulfillment names.

http://myapp.com/fetch_tracking_numbers.json?order_names[]=#1001.1&order_names[]=#1002.1&order_names[]=#1003.2
                  { "tracking_numbers": {
                      "#1001.1": "qwerty",
                      "#1002.1": "asdfg",
                      "#1003.2": "zxcvb"
                    },
                  "message": "Successfully received the tracking numbers",
                  "success": true
                  }
                

A sample Shopify request for inventory levels:

Shopify will make a request for the inventory of an individual SKU when the product is set up initially, its SKU is changed in the Shopify admin, or its inventory management is set to use the fulfillment service. A request for all inventory data will happen once every hour to keep our system up to date with the remote fulfillment service.

GET
/fetch_stock

Get inventory levels

max_retries

The maximum amount of times Shopify will send the request for inventory levels.

shop

The shop's myshopify url.

sku

The SKU for the Product Variant we need stock levels for.

timestamp

The Unix timestamp from when the inventory request was made.