Points Balance & Transactions
6 min
Current balance
Read the current balance with loyalty.points.balance of the customer. See Customer Details.
⚠️ WARNING
Don't add up the receipts to get the balance. A value you calculate from a part of the transactions won't match the real state. Read loyalty.points.balance.
Points of each receipt
Each receipt of an order carries the points of that receipt. Read them with order.orders.
Query
query GetReceiptPoints($customer: Guid, $from: DateTime, $to: DateTime, $first: Int, $after: String) {
order {
orders(customer: $customer, perionBegin: $from, perionEnd: $to, first: $first, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
publicKey
createdOn
receipts {
publicKey
createdOn
number
loyalty {
points {
credit
debit
}
}
}
}
}
}
}Variables
{
"customer": "<customer key>",
"from": "2026-01-01T00:00:00",
"to": "2026-01-31T23:59:59",
"first": 30,
"after": null
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetReceiptPoints($customer: Guid, $from: DateTime, $to: DateTime, $first: Int, $after: String) { order { orders(customer: $customer, perionBegin: $from, perionEnd: $to, first: $first, after: $after) { totalCount pageInfo { hasNextPage endCursor } items { publicKey createdOn receipts { publicKey createdOn number loyalty { points { credit debit } } } } } } }", "variables": {"customer": "<customer key>", "from": "2026-01-01T00:00:00", "to": "2026-01-31T23:59:59", "first": 30, "after": null}}'Response
{
"data": {
"order": {
"orders": {
"totalCount": 1,
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ=="
},
"items": [
{
"publicKey": "00000000-0000-0000-0000-000000000121",
"createdOn": "2026-01-15T10:30:00",
"receipts": [
{
"publicKey": "00000000-0000-0000-0000-000000000131",
"createdOn": "2026-01-15T10:45:00",
"number": 1024,
"loyalty": {
"points": {
"credit": 5.61,
"debit": 0.0
}
}
}
]
}
]
}
}
}
}Field | Meaning |
|---|---|
loyalty.points.credit | The points the customer earned on the receipt. |
loyalty.points.debit | The points the customer used on the receipt. |
⚠️ WARNING
orders needs at least one of these: order keys, or a period (perionBegin and perionEnd) of at most 1 year. The arguments are spelled perionBegin and perionEnd in the schema. Use them as written.
Read the full history
- Query one period of at most 1 year.
- Page through the results until hasNextPage is false.
- Repeat for the next period.
Don't assume that the first page is the full history. Orders are sorted by creation date, newest first.
💡 TIP
To get the lifetime total of points earned or used, add up credit or debit over all the periods. For the current balance use loyalty.points.balance.