fulfillmentOrderClose
Requires access scope. Also: The user must have fulfill_and_ship_orders permission.
Marks an in-progress fulfillment order as incomplete, indicating the fulfillment service is unable to ship any remaining items, and closes the fulfillment request.
This mutation can only be called for fulfillment orders that meet the following criteria:
- Assigned to a fulfillment service location,
- The fulfillment request has been accepted,
- The fulfillment order status is
.
This mutation can only be called by the fulfillment service app that accepted the fulfillment request. Calling this mutation returns the control of the fulfillment order to the merchant, allowing them to move the fulfillment order line items to another location and fulfill from there, remove and refund the line items, or to request fulfillment from the same fulfillment service again.
Closing a fulfillment order is explained in the fulfillment service guide.
Arguments
- •ID!required
The ID of the fulfillment order to mark as incomplete.
- Anchor to messagemessage•
An optional reason for marking the fulfillment order as incomplete.
Anchor to FulfillmentOrderClosePayload returnsFulfillmentOrderClosePayload returns
- Anchor to fulfillmentOrderfulfillment•
Order The fulfillment order that was marked as incomplete.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
- Marks a fulfillment order as incomplete
- fulfillmentOrderClose reference
Examples
mutation fulfillmentOrderClose($id: ID!, $message: String) {
fulfillmentOrderClose(id: $id, message: $message) {
fulfillmentOrder {
id
status
requestStatus
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation fulfillmentOrderClose($id: ID!, $message: String) { fulfillmentOrderClose(id: $id, message: $message) { fulfillmentOrder { id status requestStatus } userErrors { field message } } }",
"variables": {
"id": "gid://shopify/FulfillmentOrder/1046000779",
"message": "Out of Stock"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation fulfillmentOrderClose($id: ID!, $message: String) {
fulfillmentOrderClose(id: $id, message: $message) {
fulfillmentOrder {
id
status
requestStatus
}
userErrors {
field
message
}
}
}`,
{
variables: {
"id": "gid://shopify/FulfillmentOrder/1046000779",
"message": "Out of Stock"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation fulfillmentOrderClose($id: ID!, $message: String) {
fulfillmentOrderClose(id: $id, message: $message) {
fulfillmentOrder {
id
status
requestStatus
}
userErrors {
field
message
}
}
}`,
"variables": {
"id": "gid://shopify/FulfillmentOrder/1046000779",
"message": "Out of Stock"
},
},
});
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
mutation fulfillmentOrderClose($id: ID!, $message: String) {
fulfillmentOrderClose(id: $id, message: $message) {
fulfillmentOrder {
id
status
requestStatus
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"id": "gid://shopify/FulfillmentOrder/1046000779",
"message": "Out of Stock"
}
response = client.query(query: query, variables: variables)