Anchor to fulfillmentServiceDeletefulfillment
fulfillmentServiceDelete
mutation
Requires access scope. Also: The user must have fulfill_and_ship_orders permission.
Deletes a fulfillment service.
Anchor to Arguments
Arguments
- Anchor to destinationLocationIddestination•
Location Id - •ID!required
The ID of the fulfillment service to delete.
- Anchor to inventoryActioninventory•
Action FulfillmentService Default:TRANSFERDelete Inventory Action The action to take with the location after the fulfillment service is deleted.
Was this section helpful?
Anchor to FulfillmentServiceDeletePayload returnsFulfillmentServiceDeletePayload returns
- Anchor to deletedIddeleted•
Id The ID of the deleted fulfillment service.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Remove an existing FulfillmentService
- fulfillmentServiceDelete reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {
fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {
deletedId
userErrors {
field
message
}
}
}`,
{
variables: {
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
},
},
);
const data = await response.json();
mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {
fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {
deletedId
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) { fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) { deletedId userErrors { field message } } }",
"variables": {
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {
fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {
deletedId
userErrors {
field
message
}
}
}`,
{
variables: {
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {
fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {
deletedId
userErrors {
field
message
}
}
}`,
"variables": {
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
},
},
});
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 fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {
fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {
deletedId
userErrors {
field
message
}
}
}
QUERY
variables = {
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"destinationLocationId": "gid://shopify/Location/124656943",
"id": "gid://shopify/FulfillmentService/198258461"
}
Response
JSON{
"fulfillmentServiceDelete": {
"deletedId": "gid://shopify/FulfillmentService/198258461",
"userErrors": []
}
}