Anchor to priceListDeleteprice
priceListDelete
mutation
Requires access scope. Also: The user must have permission to delete catalogs.
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 Arguments
Arguments
- •ID!required
The ID of the price list to be deleted.
Was this section helpful?
Anchor to PriceListDeletePayload returnsPriceListDeletePayload returns
- Anchor to deletedIddeleted•
Id The ID of the deleted price list.
- Anchor to userErrorsuser•
Errors [PriceList non-nullUser Error!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
- Delete a price list
- priceListDelete reference
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation priceListDelete($id: ID!) {6 priceListDelete(id: $id) {7 deletedId8 userErrors {9 field10 code11 message12 }13 }14 }`,15 {16 variables: {17 "id": "gid://shopify/PriceList/294167858"18 },19 },20);2122const data = await response.json();23
mutation priceListDelete($id: ID!) {
priceListDelete(id: $id) {
deletedId
userErrors {
field
code
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-10/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();
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"
},
},
});
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)
Input variables
JSON1{2 "id": "gid://shopify/PriceList/294167858"3}
Response
JSON1{2 "priceListDelete": {3 "deletedId": "gid://shopify/PriceList/294167858",4 "userErrors": []5 }6}