Anchor to priceListFixedPricesAddprice
priceListFixedPricesAdd
mutation
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.
Anchor to Arguments
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.
Was this section helpful?
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.
Was this section helpful?
- 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
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation priceListFixedPricesAdd($priceListId: ID!, $prices: [PriceListPriceInput!]!) {6 priceListFixedPricesAdd(priceListId: $priceListId, prices: $prices) {7 prices {8 compareAtPrice {9 amount10 currencyCode11 }12 price {13 amount14 currencyCode15 }16 }17 userErrors {18 field19 code20 message21 }22 }23 }`,24 {25 variables: {26 "priceListId": "gid://shopify/PriceList/115567603",27 "prices": [28 {29 "compareAtPrice": {30 "amount": "125.50",31 "currencyCode": "CAD"32 },33 "price": {34 "amount": "100",35 "currencyCode": "CAD"36 },37 "variantId": "gid://shopify/ProductVariant/43729076"38 },39 {40 "compareAtPrice": {41 "amount": "6.99",42 "currencyCode": "CAD"43 },44 "price": {45 "amount": "4",46 "currencyCode": "CAD"47 },48 "variantId": "gid://shopify/ProductVariant/138327650"49 }50 ]51 },52 },53);5455const data = await response.json();56
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)
Input variables
JSON1{2 "priceListId": "gid://shopify/PriceList/115567603",3 "prices": [4 {5 "compareAtPrice": {6 "amount": "125.50",7 "currencyCode": "CAD"8 },9 "price": {10 "amount": "100",11 "currencyCode": "CAD"12 },13 "variantId": "gid://shopify/ProductVariant/43729076"14 },15 {16 "compareAtPrice": {17 "amount": "6.99",18 "currencyCode": "CAD"19 },20 "price": {21 "amount": "4",22 "currencyCode": "CAD"23 },24 "variantId": "gid://shopify/ProductVariant/138327650"25 }26 ]27}
Response
JSON1{2 "priceListFixedPricesAdd": {3 "prices": [4 {5 "compareAtPrice": {6 "amount": "125.5",7 "currencyCode": "CAD"8 },9 "price": {10 "amount": "100.0",11 "currencyCode": "CAD"12 }13 },14 {15 "compareAtPrice": {16 "amount": "6.99",17 "currencyCode": "CAD"18 },19 "price": {20 "amount": "4.0",21 "currencyCode": "CAD"22 }23 }24 ],25 "userErrors": []26 }27}