Anchor to priceListFixedPricesDeleteprice
priceListFixedPricesDelete
mutation
Requires access scope. Also: The user must have permission to delete catalogs.
Deletes specific fixed prices from a price list using a product variant ID. You can use the mutation to delete a set of fixed prices from a price list. After deleting the set of fixed prices from the price list, the price of each product variant reverts to the original price that was determined by the price list adjustment.
Anchor to Arguments
Arguments
- Anchor to priceListIdprice•
List Id ID!required The ID of the price list from which the fixed prices will be removed.
- Anchor to variantIdsvariant•
Ids [ID!]!required A list of product variant IDs whose fixed prices will be removed from the price list.
Was this section helpful?
Anchor to PriceListFixedPricesDeletePayload returnsPriceListFixedPricesDeletePayload returns
- Anchor to deletedFixedPriceVariantIdsdeleted•
Fixed Price Variant Ids A list of product variant IDs whose fixed prices were removed from the price list.
- Anchor to userErrorsuser•
Errors [PriceList non-nullPrice User Error!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
- Delete multiple fixed prices from a price list
- priceListFixedPricesDelete reference
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) {6 priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) {7 deletedFixedPriceVariantIds8 userErrors {9 field10 code11 message12 }13 }14 }`,15 {16 variables: {17 "priceListId": "gid://shopify/PriceList/294167858",18 "variantIds": [19 "gid://shopify/ProductVariant/498744621",20 "gid://shopify/ProductVariant/113711323"21 ]22 },23 },24);2526const data = await response.json();27
mutation priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) {
priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) {
deletedFixedPriceVariantIds
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 priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) { priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) { deletedFixedPriceVariantIds userErrors { field code message } } }",
"variables": {
"priceListId": "gid://shopify/PriceList/294167858",
"variantIds": [
"gid://shopify/ProductVariant/498744621",
"gid://shopify/ProductVariant/113711323"
]
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) {
priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) {
deletedFixedPriceVariantIds
userErrors {
field
code
message
}
}
}`,
{
variables: {
"priceListId": "gid://shopify/PriceList/294167858",
"variantIds": [
"gid://shopify/ProductVariant/498744621",
"gid://shopify/ProductVariant/113711323"
]
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) {
priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) {
deletedFixedPriceVariantIds
userErrors {
field
code
message
}
}
}`,
"variables": {
"priceListId": "gid://shopify/PriceList/294167858",
"variantIds": [
"gid://shopify/ProductVariant/498744621",
"gid://shopify/ProductVariant/113711323"
]
},
},
});
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 priceListFixedPricesDelete($priceListId: ID!, $variantIds: [ID!]!) {
priceListFixedPricesDelete(priceListId: $priceListId, variantIds: $variantIds) {
deletedFixedPriceVariantIds
userErrors {
field
code
message
}
}
}
QUERY
variables = {
"priceListId": "gid://shopify/PriceList/294167858",
"variantIds": ["gid://shopify/ProductVariant/498744621", "gid://shopify/ProductVariant/113711323"]
}
response = client.query(query: query, variables: variables)
Input variables
JSON1{2 "priceListId": "gid://shopify/PriceList/294167858",3 "variantIds": [4 "gid://shopify/ProductVariant/498744621",5 "gid://shopify/ProductVariant/113711323"6 ]7}
Response
JSON1{2 "priceListFixedPricesDelete": {3 "deletedFixedPriceVariantIds": [4 "gid://shopify/ProductVariant/113711323",5 "gid://shopify/ProductVariant/498744621"6 ],7 "userErrors": []8 }9}