Skip to main content

Fetch a product with pricing

Retrieve a product together with its base price and calculated price for a specific quantity and tax zone.

Query

query GetProductWithPricing($productId: Int!, $quantity: Int!, $taxZone: String!) {
product(productId: $productId) {
productId
sku
names { language value }
priceData {
id
list
cost
suggested
store
per
defaultTaxCode
costPrices {
quantityFrom
value
}
}
price(input: { quantity: $quantity, taxZone: $taxZone }) {
net
gross
list
cost
taxCode
type
quantity
}
}
}

Variables

{
"productId": 1895,
"quantity": 1,
"taxZone": "NL"
}

Response

{
"data": {
"product": {
"productId": 1895,
"sku": "HP-450G10-I5",
"names": [
{ "language": "NL", "value": "HP ProBook 450 G10 i5" }
],
"priceData": {
"id": "01948326-33e3-7a1b-9d2f-abc123def456",
"list": 15,
"cost": null,
"suggested": null,
"store": null,
"per": 1,
"defaultTaxCode": "H",
"costPrices": []
},
"price": {
"net": 18.15,
"gross": 15,
"list": 15,
"cost": null,
"taxCode": "H",
"type": "DEFAULT",
"quantity": 1
}
}
}
}

How it works

priceData returns the raw price record. price(input) returns the calculated price after tax and pricesheets are applied. The naming convention is counterintuitive: gross is the base price (before tax) and net is the final price (after tax). Tax code H in zone NL applies 21% VAT, so net = gross × 1.21.

See also