How to get customer prices
Guide to fetching the customer prices for an product using GraphQL mutations. Includes example queries, and responses for each step.
There is no direct way to fetch product customer prices but it can be achieve as follows:
- create an order
- add lines with the desired products
- read the
priceInCurrency
- delete the order (and lines)
This can be achieved with a single request that also avoids the last step, by using temporary rows (defined with the temporary : true
).
Query
mutation get_customer_price($cid : Int!, $customer : Int, $prod : String)
{
useCompany(no : $cid)
{
order_create(
values:[
{
customerNo : $customer,
orderLines : [
{ productNo : $prod, quantity : 1 },
]
}
],
temporary : true
)
{
affectedRows
items
{
customerNo
orderLines: joindown_OrderLine_via_Order
{
items
{
productNo
quantity
priceInCurrency
}
}
}
}
}
}
Result
{
"data": {
"useCompany": {
"order_create": {
"affectedRows": 1,
"items": [
{
"customerNo": 10001,
"orderLines": {
"items": [
{
"productNo": "1001",
"quantity": 1,
"priceInCurrency": 995
}
]
}
}
]
}
}
}
}
Last modified September 18, 2025