- Print
- DarkLight
How can I get prices and availabilites via the productsearch?
Retrieve prices via productOrderDetails.orderUnits.
The priceCalculation property is an optional parameter. When you use it, you will get prices coming directly from a connected ERP system or calculated prices from our pricing engine. When you do not use it, you will get the static prices from our database, which are usually gross list prices. Using the priceCalculation parameter only makes sense, when you know, that a 3rd party ERP is connected or when you know, that price rules are defined for you. The properties deliveryType and project are optional and depend on the connected ERP or your price rules. So "priceCalculation: {}" is also a valid parameter.
query q2 {
productsearch (
<Filter criteria>,
priceCalculation: {deliveryType: ""<Delivery type>"",
project: ""<Project or construction site>""}) {
content {
id
productOrderDetails {
orderUnits {
name
code
quantityMin
price {
amount
currency
}
contentUnit {
name
code
contentUnitPerOrderUnit
}
availabilities {
location {
name
address {
street
city
zip
}
}
amount
}
}
}
}
}
As you can see, the availabilities are per orderUnit and the amount is (if available) per store.