--- title: fulfillment - GraphQL Admin description: Returns a Fulfillment resource by ID. api_version: 2024-10 api_name: admin type: query api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/2024-10/queries/fulfillment' md: 'https://shopify.dev/docs/api/admin-graphql/2024-10/queries/fulfillment.txt' --- # fulfillment query Requires `read_orders` access scope, `read_marketplace_orders` access scope, `read_assigned_fulfillment_orders` access scope, `read_merchant_managed_fulfillment_orders` access scope, `read_third_party_fulfillment_orders` access scope or `read_marketplace_fulfillment_orders` access scope. Returns a Fulfillment resource by ID. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/2024-10/scalars/ID) required The ID of the Fulfillment to return. *** ## Possible returns * Fulfillment [Fulfillment](https://shopify.dev/docs/api/admin-graphql/2024-10/objects/Fulfillment) Represents a fulfillment. In Shopify, a fulfillment represents a shipment of one or more items in an order. When an order has been completely fulfilled, it means that all the items that are included in the order have been sent to the customer. There can be more than one fulfillment for an order. *** ## Examples * ### Receive a single Fulfillment #### Query ```graphql query FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } } ``` #### Variables ```json { "id": "gid://shopify/Fulfillment/237894043" } ``` #### cURL ```bash 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 FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } }", "variables": { "id": "gid://shopify/Fulfillment/237894043" } }' ``` #### Remix ```javascript const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } }`, { variables: { "id": "gid://shopify/Fulfillment/237894043" }, }, ); const data = await response.json(); ``` #### Ruby ```ruby 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 FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } } QUERY variables = { "id": "gid://shopify/Fulfillment/237894043" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } }`, "variables": { "id": "gid://shopify/Fulfillment/237894043" }, }, }); ``` #### Response ```json { "fulfillment": { "fulfillmentLineItems": { "edges": [ { "node": { "id": "gid://shopify/FulfillmentLineItem/761422146", "lineItem": { "title": "Draft", "variant": { "id": "gid://shopify/ProductVariant/43729076" } }, "quantity": 2, "originalTotalSet": { "shopMoney": { "amount": "20.0", "currencyCode": "USD" } } } } ] }, "status": "SUCCESS", "estimatedDeliveryAt": null, "location": { "id": "gid://shopify/Location/124656943", "legacyResourceId": "124656943" }, "service": { "handle": "manual" }, "trackingInfo": [ { "company": "UPS", "number": "1Z1234512345123456", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456" } ], "originAddress": { "address1": "150 Elgin St", "address2": null, "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K2P 1L4" } } } ``` * ### Retrieves a list of fulfillment events for a specific fulfillment #### Query ```graphql query FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } } ``` #### Variables ```json { "id": "gid://shopify/Fulfillment/237894043" } ``` #### cURL ```bash 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 FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } }", "variables": { "id": "gid://shopify/Fulfillment/237894043" } }' ``` #### Remix ```javascript const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } }`, { variables: { "id": "gid://shopify/Fulfillment/237894043" }, }, ); const data = await response.json(); ``` #### Ruby ```ruby 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 FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } } QUERY variables = { "id": "gid://shopify/Fulfillment/237894043" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } }`, "variables": { "id": "gid://shopify/Fulfillment/237894043" }, }, }); ``` #### Response ```json { "fulfillment": { "events": { "edges": [ { "node": { "happenedAt": "2016-05-02T11:00:00Z", "status": "LABEL_PURCHASED" } }, { "node": { "happenedAt": "2016-05-03T11:00:00Z", "status": "OUT_FOR_DELIVERY" } } ] } } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20FulfillmentShow\(%24id%3A%20ID!\)%20%7B%0A%20%20fulfillment\(id%3A%20%24id\)%20%7B%0A%20%20%20%20fulfillmentLineItems\(first%3A%2010\)%20%7B%0A%20%20%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20lineItem%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20%20%20variant%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20quantity%0A%20%20%20%20%20%20%20%20%20%20originalTotalSet%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20shopMoney%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20amount%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20currencyCode%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20status%0A%20%20%20%20estimatedDeliveryAt%0A%20%20%20%20location%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20legacyResourceId%0A%20%20%20%20%7D%0A%20%20%20%20service%20%7B%0A%20%20%20%20%20%20handle%0A%20%20%20%20%7D%0A%20%20%20%20trackingInfo\(first%3A%2010\)%20%7B%0A%20%20%20%20%20%20company%0A%20%20%20%20%20%20number%0A%20%20%20%20%20%20url%0A%20%20%20%20%7D%0A%20%20%20%20originAddress%20%7B%0A%20%20%20%20%20%20address1%0A%20%20%20%20%20%20address2%0A%20%20%20%20%20%20city%0A%20%20%20%20%20%20countryCode%0A%20%20%20%20%20%20provinceCode%0A%20%20%20%20%20%20zip%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22id%22%3A%20%22gid%3A%2F%2Fshopify%2FFulfillment%2F237894043%22%0A%7D) ```javascript const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query FulfillmentShow($id: ID!) { fulfillment(id: $id) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } }`, { variables: { "id": "gid://shopify/Fulfillment/237894043" }, }, ); const data = await response.json(); ``` ## Input variables JSON ```json { "id": "gid://shopify/Fulfillment/237894043" } ``` ## Response JSON ```json { "fulfillment": { "fulfillmentLineItems": { "edges": [ { "node": { "id": "gid://shopify/FulfillmentLineItem/761422146", "lineItem": { "title": "Draft", "variant": { "id": "gid://shopify/ProductVariant/43729076" } }, "quantity": 2, "originalTotalSet": { "shopMoney": { "amount": "20.0", "currencyCode": "USD" } } } } ] }, "status": "SUCCESS", "estimatedDeliveryAt": null, "location": { "id": "gid://shopify/Location/124656943", "legacyResourceId": "124656943" }, "service": { "handle": "manual" }, "trackingInfo": [ { "company": "UPS", "number": "1Z1234512345123456", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456" } ], "originAddress": { "address1": "150 Elgin St", "address2": null, "city": "Ottawa", "countryCode": "CA", "provinceCode": "ON", "zip": "K2P 1L4" } } } ```