Anchor to section titled 'undefined'

fulfillmentServiceDelete
mutation

Requires write_fulfillments access scope. Also: The user must have fulfill_and_ship_orders permission.

Deletes a fulfillment service.


The ID of the location where inventory and commitments will be relocated after the fulfillment service is deleted.

Anchor to id
id
required

The ID of the fulfillment service to delete.


Was this section helpful?

The ID of the deleted fulfillment service.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
DescriptionCopy
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-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();
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)
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"
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$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]);
Hide code
Input variables
Copy
{
  "destinationLocationId": "gid://shopify/Location/124656943",
  "id": "gid://shopify/FulfillmentService/198258461"
}
Hide code
Response
JSON
{
  "fulfillmentServiceDelete": {
    "deletedId": "gid://shopify/FulfillmentService/198258461",
    "userErrors": []
  }
}