Create Price
Create a price for your product
Query
mutation CreatePrice($productId: ID!, $input: PriceInput!) {
tenant {
createPrice(productId: $productId, input: $input) {
id
amount
currency
type
product {
id
name
description
}
}
}
}
Variables
{
"productId": 1,
"input": {
"amount": 1000,
"currency": "USD"
}
}
Response
{
"data": {
"tenant": {
"createPrice": {
"amount": "1000",
"currency": "USD",
"id": "1",
"product": {
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"id": "1",
"name": "iPhone"
},
"type": null
}
}
}
}
Create a price for your variant
Query
mutation CreatePrice($productId: ID!, $variantId: ID!, $input: PriceInput!) {
tenant {
createPrice(productId: $productId, variantId: $variantId, input: $input) {
id
amount
currency
type
product {
id
name
description
}
variant {
id
attributes {
name
value
}
}
}
}
}
Variables
{
"productId": 1,
"variantId": 1,
"input": {
"amount": 1050,
"currency": "USD"
}
}
Response
{
"data": {
"tenant": {
"createPrice": {
"amount": "1050",
"currency": "USD",
"id": "5",
"product": {
"description": "Expensive but reliable phone that's mostly used for puppy filters.",
"id": "1",
"name": "iPhone"
},
"type": null,
"variant": {
"attributes": [
{
"name": "capacity",
"value": "512GB"
},
{
"name": "color",
"value": "Gold"
},
{
"name": "display",
"value": "6.7-inch"
}
],
"id": "1"
}
}
}
}
}
Last updated
Was this helpful?