Anchor to fulfillment
fulfillment
query
Requires access scope,
access scope,
access scope,
access scope,
access scope or
access scope.
Returns a Fulfillment resource by ID.
Anchor to Arguments
Arguments
- •ID!required
The ID of the Fulfillment to return.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to FulfillmentFulfillment•
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.
Was this section helpful?
- Receive a single Fulfillment
- Retrieves a list of fulfillment events for a specific fulfillment
Examples
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
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
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/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"
}
}'
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();
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"
},
},
});
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)
Input variables
JSON{
"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",