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 The ID of an active merchant managed location where inventory and commitments will be relocated after the fulfillment service is deleted.
- •ID!required
The ID of the fulfillment service to delete.
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
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation fulfillmentServiceDelete($id: ID!, $destinationLocationId: ID) {6 fulfillmentServiceDelete(id: $id, destinationLocationId: $destinationLocationId) {7 deletedId8 userErrors {9 field10 message11 }12 }13 }`,14 {15 variables: {16 "destinationLocationId": "gid://shopify/Location/124656943",17 "id": "gid://shopify/FulfillmentService/198258461"18 },19 },20);2122const data = await response.json();23
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/2024-04/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
JSON1{2 "destinationLocationId": "gid://shopify/Location/124656943",3 "id": "gid://shopify/FulfillmentService/198258461"4}
Response
JSON1{2 "fulfillmentServiceDelete": {3 "deletedId": "gid://shopify/FulfillmentService/198258461",4 "userErrors": []5 }6}