fulfillmentService
Returns a FulfillmentService resource by ID.
Arguments
- •ID!required
The ID of the FulfillmentService to return.
Anchor to Possible returnsPossible returns
- Anchor to FulfillmentServiceFulfillment•
Service 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
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.Mutations
You can work with the
object with the fulfillmentServiceCreate, fulfillmentServiceUpdate, and fulfillmentServiceDelete mutations.
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
parameter in the fulfillmentServiceCreate mutation.
- Shopify sends POST requests to the
endpoint to notify the fulfillment service about fulfillment requests and fulfillment cancellation requests.
For more information, refer to Receive fulfillment requests and cancellations.
- Shopify sends GET requests to the
endpoint to retrieve tracking numbers for orders if
is set to
true
.
For more information, refer to Enable tracking support.
Fulfillment services can also update tracking information using the fulfillmentTrackingInfoUpdate mutation, rather than waiting for Shopify to ask for tracking numbers.
- Shopify sends GET requests to the
endpoint to retrieve on hand inventory levels for the fulfillment service location if
is set to
true
.
For more information, refer to Sharing inventory levels with Shopify.
To make sure you have everything set up correctly, you can test the
-prefixed endpoints in your development store.
Resources and webhooks
There are a variety of objects and webhooks that enable a fulfillment service to work. To exchange fulfillment information with Shopify, fulfillment services use the FulfillmentOrder, Fulfillment and Order objects and related mutations. To act on fulfillment process events that happen on the Shopify side, besides awaiting calls to
-prefixed endpoints, fulfillment services can subscribe to the fulfillment order and order webhooks.
- callback
Url •URL The callback URL that the fulfillment service has registered for requests. The following considerations apply:
- Shopify queries the
endpoint to retrieve tracking numbers for orders, if
is set to
true
. - Shopify queries the
endpoint to retrieve inventory levels, if
is set to
true
. - Shopify uses the
endpoint to send fulfillment and cancellation requests.
- Shopify queries the
- handle•String!non-null
Human-readable unique identifier for this fulfillment service.
- id•ID!non-null
The ID of the fulfillment service.
- inventory
Management •Boolean!non-null Whether the fulfillment service tracks product inventory and provides updates to Shopify.
- location•Location
Location associated with the fulfillment service.
- permits
Sku •Sharing Boolean!non-null Whether the fulfillment service can stock inventory alongside other locations.
- service
Name •String!non-null The name of the fulfillment service as seen by merchants.
- tracking
Support •Boolean!non-null Whether the fulfillment service implemented the /fetch_tracking_numbers endpoint.
- type•Fulfillmentnon-null
Service Type! Type associated with the fulfillment service.
- fulfillment
Orders •Opt In Boolean!non-nullDeprecated Whether the fulfillment service uses the fulfillment order based workflow for managing fulfillments.
As the migration is now finished, the
property is deprecated and is always set to
true
on correctly functioning fulfillment services. Migration period ended. All correctly functioning fulfillment services haveset to
true
.
- Shopify sends POST requests to the
Receive a single FulfillmentService
query FulfillmentServiceShow($id: ID!) {
fulfillmentService(id: $id) {
id
callbackUrl
fulfillmentOrdersOptIn
permitsSkuSharing
handle
inventoryManagement
serviceName
location {
legacyResourceId
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query FulfillmentServiceShow($id: ID!) { fulfillmentService(id: $id) { id callbackUrl fulfillmentOrdersOptIn permitsSkuSharing handle inventoryManagement serviceName location { legacyResourceId } } }",
"variables": {
"id": "gid://shopify/FulfillmentService/18961920"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query FulfillmentServiceShow($id: ID!) {
fulfillmentService(id: $id) {
id
callbackUrl
fulfillmentOrdersOptIn
permitsSkuSharing
handle
inventoryManagement
serviceName
location {
legacyResourceId
}
}
}`,
{
variables: {
"id": "gid://shopify/FulfillmentService/18961920"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `query FulfillmentServiceShow($id: ID!) {
fulfillmentService(id: $id) {
id
callbackUrl
fulfillmentOrdersOptIn
permitsSkuSharing
handle
inventoryManagement
serviceName
location {
legacyResourceId
}
}
}`,
"variables": {
"id": "gid://shopify/FulfillmentService/18961920"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query FulfillmentServiceShow($id: ID!) {
fulfillmentService(id: $id) {
id
callbackUrl
fulfillmentOrdersOptIn
permitsSkuSharing
handle
inventoryManagement
serviceName
location {
legacyResourceId
}
}
}
QUERY
variables = {
"id": "gid://shopify/FulfillmentService/18961920"
}
response = client.query(query: query, variables: variables)