# fulfillment - admin-graphql - QUERY Version: 2024-10 ## Description Returns a Fulfillment resource by ID. ### Access Scopes `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. ## Arguments * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! - The ID of the Fulfillment to return. ## Returns * [createdAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! The date and time when the fulfillment was created. * [deliveredAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime The date that this fulfillment was delivered. * [displayStatus](/docs/api/admin-graphql/2024-10/enums/FulfillmentDisplayStatus): FulfillmentDisplayStatus Human readable display status for this fulfillment. * [estimatedDeliveryAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime The estimated date that this fulfillment will arrive. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! A globally-unique ID. * [inTransitAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime The date and time when the fulfillment went into transit. * [legacyResourceId](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! The ID of the corresponding resource in the REST Admin API. * [location](/docs/api/admin-graphql/2024-10/objects/Location): Location The location that the fulfillment was processed at. * [name](/docs/api/admin-graphql/2024-10/scalars/String): String! Human readable reference identifier for this fulfillment. * [order](/docs/api/admin-graphql/2024-10/objects/Order): Order! The order for which the fulfillment was created. * [originAddress](/docs/api/admin-graphql/2024-10/objects/FulfillmentOriginAddress): FulfillmentOriginAddress The address at which the fulfillment occurred. This field is intended for tax purposes, as a full address is required for tax providers to accurately calculate taxes. Typically this is the address of the warehouse or fulfillment center. To retrieve a fulfillment location's address, use the `assignedLocation` field on the [`FulfillmentOrder`](/docs/api/admin-graphql/latest/objects/FulfillmentOrder) object instead. * [requiresShipping](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! Whether any of the line items in the fulfillment require shipping. * [service](/docs/api/admin-graphql/2024-10/objects/FulfillmentService): FulfillmentService Fulfillment service associated with the fulfillment. * [status](/docs/api/admin-graphql/2024-10/enums/FulfillmentStatus): FulfillmentStatus! The status of the fulfillment. * [totalQuantity](/docs/api/admin-graphql/2024-10/scalars/Int): Int! Sum of all line item quantities for the fulfillment. * [trackingInfo](/docs/api/admin-graphql/2024-10/objects/FulfillmentTrackingInfo): FulfillmentTrackingInfo! Tracking information associated with the fulfillment, such as the tracking company, tracking number, and tracking URL. * [updatedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! The date and time when the fulfillment was last modified. ## Examples ### Receive a single Fulfillment Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"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 } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentShow($id: ID!) {\n fulfillment(id: $id) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query FulfillmentShow($id: ID!) {\n fulfillment(id: $id) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentShow($id: ID!) {\n fulfillment(id: $id) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentShow($id: ID!) {\n fulfillment(id: $id) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Fulfillment/237894043" } #### Graphql Response { "data": { "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 Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query FulfillmentEventList($id: ID!) { fulfillment(id: $id) { events(first: 10) { edges { node { happenedAt status } } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentEventList($id: ID!) {\n fulfillment(id: $id) {\n events(first: 10) {\n edges {\n node {\n happenedAt\n status\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query FulfillmentEventList($id: ID!) {\n fulfillment(id: $id) {\n events(first: 10) {\n edges {\n node {\n happenedAt\n status\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentEventList($id: ID!) {\n fulfillment(id: $id) {\n events(first: 10) {\n edges {\n node {\n happenedAt\n status\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Fulfillment/237894043\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentEventList($id: ID!) {\n fulfillment(id: $id) {\n events(first: 10) {\n edges {\n node {\n happenedAt\n status\n }\n }\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Fulfillment/237894043" } #### Graphql Response { "data": { "fulfillment": { "events": { "edges": [ { "node": { "happenedAt": "2016-05-02T11:00:00Z", "status": "LABEL_PURCHASED" } }, { "node": { "happenedAt": "2016-05-03T11:00:00Z", "status": "OUT_FOR_DELIVERY" } } ] } } } }