# FulfillmentService

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 the fulfillment service. To learn more about fulfillment services, refer to Manage fulfillments as a fulfillment service app guide.

Using the FulfillmentService resource, you can register, edit, and delete a new fulfillment service.

Hosted endpoints

Fulfillment service providers integrate with Shopify by providing Shopify with a set of hosted endpoints that Shopify can query on certain conditions. These endpoints must have a common prefix, and this prefix should be supplied in the callback_url parameter in the request that creates the fulfillment service.

To make sure you have everything set up correctly, you can test the callback_url-prefixed endpoints in your development store.

Resources and webhooks

There are a variety of REST resources and webhooks that enable a fulfillment service to work. To exchange fulfillment information with Shopify, fulfillment services use the FulfillmentOrder, FulfillmentRequest, and CancellationRequest, Fulfillment and Order resources. To act on fulfillment process events that happen on the Shopify side, besides awaiting calls to callback_url-prefixed endpoints, fulfillment services can subscribe to the fulfillment order and order webhooks.

## Resource Properties ### FulfillmentService * admin_graphql_api_id: The GraphQL GID for this fulfillment service. * Type: x-string * Example: "gid://shopify/FulfillmentService/1" * callback_url: The callback URL that the fulfillment service has registered for requests. The following considerations apply: * Type: x-string * Example: "http://myapp.com" * fulfillment_orders_opt_in: Whether the fulfillment service uses the fulfillment order based workflow for managing fulfillments.
As of 2022-07 API version, the fulfillment order based workflow is the only way to manage fulfillments, and fulfillment_orders_opt_in must be set to true.
As the migration is now finished, the fulfillment_orders_opt_in property is deprecated and is always set to true on correctly functioning fulfillment services. * Type: x-string * Example: true * permits_sku_sharing: Whether the fulfillment service can stock inventory alongside other locations. * Type: x-string * Example: true * handle: Human-readable unique identifier for this fulfillment service. * Type: x-string * Example: "my-fulfillment-service" * inventory_management: Whether the fulfillment service tracks product inventory and provides updates to Shopify. Valid values: true and false. * Type: x-string * Example: true * location_id: The unique identifier of the location associated with the fulfillment service * Type: x-string * Example: 19 * name: The name of the fulfillment service as seen by merchants. * Type: x-string * Example: "My Fulfillment Service" * provider_id: A unique identifier for the fulfillment service provider. * Type: x-string * Example: nil * requires_shipping_method: Whether the fulfillment service requires products to be physically shipped. Valid values: true and false. * Type: x-string * Example: true * tracking_support: Whether the fulfillment service provides tracking numbers for packages. Valid values: true and false. * Type: x-string * Example: true ## Receive a list of all FulfillmentServices ### Endpoint /admin/api/#{api_version}/fulfillment_services.json?scope=all (GET) ### Parameters * api_version (required): * scope: Specify which fulfillment services to retrieve. ### Responses #### 200 Receive a list of all FulfillmentServices Examples: ##### List all of the shop's fulfillment services Request: ``` GET /admin/api/unstable/fulfillment_services.json ``` Response: ``` HTTP/1.1 200 OK {"fulfillment_services":[{"id":611870435,"name":"Venus Fulfillment","email":null,"service_name":"Venus Fulfillment","handle":"venus-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":611870435,"callback_url":"http://google.com/","tracking_support":false,"inventory_management":false,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/611870435","permits_sku_sharing":false,"requires_shipping_method":true},{"id":755357713,"name":"Mars Fulfillment","email":null,"service_name":"Mars Fulfillment","handle":"mars-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":24826418,"callback_url":"http://google.com/","tracking_support":true,"inventory_management":true,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/755357713","permits_sku_sharing":true,"requires_shipping_method":true}]} ``` ##### List your app's fulfillment services Request: ``` GET /admin/api/unstable/fulfillment_services.json ``` Response: ``` HTTP/1.1 200 OK {"fulfillment_services":[{"id":755357713,"name":"Mars Fulfillment","email":null,"service_name":"Mars Fulfillment","handle":"mars-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":24826418,"callback_url":"http://google.com/","tracking_support":true,"inventory_management":true,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/755357713","permits_sku_sharing":true,"requires_shipping_method":true}]} ``` ## Create a new FulfillmentService ### Endpoint /admin/api/#{api_version}/fulfillment_services.json (POST) ### Parameters * api_version (required): * callback_url: The callback URL that the fulfillment service has registered for requests. The following considerations apply: * fulfillment_orders_opt_in: Whether the fulfillment service uses the fulfillment order based workflow for managing fulfillments.
As the migration is now finished, the fulfillment_orders_opt_in property is deprecated and will be removed in the next API version. This API version defaults it to true for a smooth migration experience. Do not set the fulfillment_orders_opt_in argument, and you are ready for the next API version release. * inventory_management: Whether the fulfillment service tracks product inventory and provides updates to Shopify. Valid values: true and false. * name: The name of the fulfillment service as seen by merchants. * permits_sku_sharing: Whether the fulfillment service can stock inventory alongside other locations. * requires_shipping_method: Whether the fulfillment service requires products to be physically shipped. Valid values: true and false. * tracking_support: Whether the fulfillment service provides tracking numbers for packages. Valid values: true and false. ### Responses #### 201 Create a new FulfillmentService Examples: ##### Create a fulfillment service Request: ``` POST /admin/api/2024-04/fulfillment_services.json {"fulfillment_service":{"name":"Jupiter Fulfillment","callback_url":"http://google.com","inventory_management":true,"tracking_support":true,"permits_sku_sharing":true}} ``` Response: ``` HTTP/1.1 201 Created {"fulfillment_service":{"id":1061774487,"name":"Jupiter Fulfillment","email":null,"service_name":"Jupiter Fulfillment","handle":"jupiter-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":1072404544,"callback_url":"http://google.com/","tracking_support":true,"inventory_management":true,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/1061774487","permits_sku_sharing":true,"requires_shipping_method":true}} ``` ## Receive a single FulfillmentService ### Endpoint /admin/api/#{api_version}/fulfillment_services/{fulfillment_service_id}.json (GET) ### Parameters * api_version (required): * fulfillment_service_id (required): ### Responses #### 200 Receive a single FulfillmentService Examples: ##### Get a single fulfillment service by its ID Request: ``` GET /admin/api/unstable/fulfillment_services/755357713.json ``` Response: ``` HTTP/1.1 200 OK {"fulfillment_service":{"id":755357713,"name":"Mars Fulfillment","email":null,"service_name":"Mars Fulfillment","handle":"mars-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":24826418,"callback_url":"http://google.com/","tracking_support":true,"inventory_management":true,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/755357713","permits_sku_sharing":true,"requires_shipping_method":true}} ``` ## Modify an existing FulfillmentService ### Endpoint /admin/api/#{api_version}/fulfillment_services/{fulfillment_service_id}.json (PUT) ### Parameters * api_version (required): * fulfillment_service_id (required): * callback_url: The callback URL that the fulfillment service has registered for requests. The following considerations apply: * fulfillment_orders_opt_in: Whether the fulfillment service uses the fulfillment order based workflow for managing fulfillments.
As the migration is now finished, the fulfillment_orders_opt_in property is deprecated. * inventory_management: Whether the fulfillment service tracks product inventory and provides updates to Shopify. Valid values: true and false. * name: The name of the fulfillment service as seen by merchants. * permits_sku_sharing: Whether the fulfillment service can stock inventory alongside other locations. * requires_shipping_method: Whether the fulfillment service requires products to be physically shipped. Valid values: true and false. * tracking_support: Whether the fulfillment service provides tracking numbers for packages. Valid values: true and false. ### Responses #### 200 Modify an existing FulfillmentService Examples: ##### Update a fulfillment service Request: ``` PUT /admin/api/unstable/fulfillment_services/755357713.json {"fulfillment_service":{"id":755357713,"name":"New Fulfillment Service Name"}} ``` Response: ``` HTTP/1.1 200 OK {"fulfillment_service":{"id":755357713,"name":"New Fulfillment Service Name","email":null,"service_name":"New Fulfillment Service Name","handle":"mars-fulfillment","fulfillment_orders_opt_in":true,"include_pending_stock":false,"provider_id":null,"location_id":24826418,"callback_url":"http://google.com/","tracking_support":true,"inventory_management":true,"admin_graphql_api_id":"gid://shopify/ApiFulfillmentService/755357713","permits_sku_sharing":true,"requires_shipping_method":true}} ``` ## Remove an existing FulfillmentService ### Endpoint /admin/api/#{api_version}/fulfillment_services/{fulfillment_service_id}.json (DELETE) ### Parameters * api_version (required): * fulfillment_service_id (required): ### Responses #### 200 Remove an existing FulfillmentService Examples: ##### Destroy a fulfillment service Request: ``` DELETE /admin/api/unstable/fulfillment_services/755357713.json ``` Response: ``` HTTP/1.1 200 OK {} ```