Requires write_products access scope. Also: The user must have a permission to delete a price list.

Deletes a price list. For example, you can delete a price list so that it no longer applies for products in the associated market.


Anchor to id
id
required

The ID of the price list to be deleted.


Was this section helpful?

The ID of the deleted price list.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
DescriptionCopy
mutation priceListDelete($id: ID!) {
  priceListDelete(id: $id) {
    deletedId
    userErrors {
      field
      code
      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 priceListDelete($id: ID!) { priceListDelete(id: $id) { deletedId userErrors { field code message } } }",
 "variables": {
    "id": "gid://shopify/PriceList/294167858"
  }
}'
const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
  `#graphql
  mutation priceListDelete($id: ID!) {
    priceListDelete(id: $id) {
      deletedId
      userErrors {
        field
        code
        message
      }
    }
  }`,
  {
    variables: {
      "id": "gid://shopify/PriceList/294167858"
    },
  },
);

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 priceListDelete($id: ID!) {
    priceListDelete(id: $id) {
      deletedId
      userErrors {
        field
        code
        message
      }
    }
  }
QUERY

variables = {
  "id": "gid://shopify/PriceList/294167858"
}

response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `mutation priceListDelete($id: ID!) {
      priceListDelete(id: $id) {
        deletedId
        userErrors {
          field
          code
          message
        }
      }
    }`,
    "variables": {
      "id": "gid://shopify/PriceList/294167858"
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
  mutation priceListDelete($id: ID!) {
    priceListDelete(id: $id) {
      deletedId
      userErrors {
        field
        code
        message
      }
    }
  }
QUERY;

$variables = [
  "id" => "gid://shopify/PriceList/294167858",
];

$response = $client->query(["query" => $query, "variables" => $variables]);
Hide code
Input variables
Copy
{
  "id": "gid://shopify/PriceList/294167858"
}
Hide code
Response
JSON
{
  "priceListDelete": {
    "deletedId": "gid://shopify/PriceList/294167858",
    "userErrors": []
  }
}