priceListFixedPricesAdd
Requires access scope. Also: The user must have permission to create and edit catalogs.
Creates or updates fixed prices on a price list. You can use the mutation to set a fixed price for specific product variants. This lets you change product variant pricing on a per country basis. Any existing fixed price list prices for these variants will be overwritten.
Arguments
- Anchor to priceListIdprice•
List Id ID!required The ID of the price list to which the fixed prices will be added or updated.
- Anchor to pricesprices•[Price
List requiredPrice Input!]! The list of fixed prices to add or update in the price list.
Anchor to PriceListFixedPricesAddPayload returnsPriceListFixedPricesAddPayload returns
- Anchor to pricesprices•
The list of fixed prices that were added to or updated in the price list.
- Anchor to userErrorsuser•
Errors [PriceList non-nullPrice User Error!]! The list of errors that occurred from executing the mutation.
- Add multiple fixed prices to a price list
- Adding a fixed price using a currency that isn't supported by the price list returns a currency mismatch error
- priceListFixedPricesAdd reference
Examples
mutation priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) {
priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) {
prices {
compareAtPrice {
amount
currencyCode
}
price {
amount
currencyCode
}
}
userErrors {
field
code
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) { priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) { prices { compareAtPrice { amount currencyCode } price { amount currencyCode } } userErrors { field code message } } }",
"variables": {
"priceListId": "gid://shopify/PriceList/115567603",
"prices": [
{
"compareAtPrice": {
"amount": "125.50",
"currencyCode": "CAD"
},
"price": {
"amount": "100",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/43729076"
},
{
"compareAtPrice": {
"amount": "6.99",
"currencyCode": "CAD"
},
"price": {
"amount": "4",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/138327650"
}
]
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) {
priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) {
prices {
compareAtPrice {
amount
currencyCode
}
price {
amount
currencyCode
}
}
userErrors {
field
code
message
}
}
}`,
{
variables: {
"priceListId": "gid://shopify/PriceList/115567603",
"prices": [
{
"compareAtPrice": {
"amount": "125.50",
"currencyCode": "CAD"
},
"price": {
"amount": "100",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/43729076"
},
{
"compareAtPrice": {
"amount": "6.99",
"currencyCode": "CAD"
},
"price": {
"amount": "4",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/138327650"
}
]
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) {
priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) {
prices {
compareAtPrice {
amount
currencyCode
}
price {
amount
currencyCode
}
}
userErrors {
field
code
message
}
}
}`,
"variables": {
"priceListId": "gid://shopify/PriceList/115567603",
"prices": [
{
"compareAtPrice": {
"amount": "125.50",
"currencyCode": "CAD"
},
"price": {
"amount": "100",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/43729076"
},
{
"compareAtPrice": {
"amount": "6.99",
"currencyCode": "CAD"
},
"price": {
"amount": "4",
"currencyCode": "CAD"
},
"variantId": "gid://shopify/ProductVariant/138327650"
}
]
},
},
});
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 priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) {
priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) {
prices {
compareAtPrice {
amount
currencyCode
}
price {
amount
currencyCode
}
}
userErrors {
field
code
message
}
}
}
QUERY
variables = {
"priceListId": "gid://shopify/PriceList/115567603",
"prices": [{"compareAtPrice"=>{"amount"=>"125.50", "currencyCode"=>"CAD"}, "price"=>{"amount"=>"100", "currencyCode"=>"CAD"}, "variantId"=>"gid://shopify/ProductVariant/43729076"}, {"compareAtPrice"=>{"amount"=>"6.99", "currencyCode"=>"CAD"}, "price"=>{"amount"=>"4", "currencyCode"=>"CAD"}, "variantId"=>"gid://shopify/ProductVariant/138327650"}]
}
response = client.query(query: query, variables: variables)