---
title: Points Balance & Transactions
slug: devdocs/points-balance-and-transactions
docTags: 
createdAt: 2026-10-16T12:03:52.032Z
---

## Current balance

Read the current balance with `loyalty.points.balance` of the customer. See **Customer Details**.

:::BlockQuote
⚠️ **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**

```graphql
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**

```json
{
  "customer": "<customer key>",
  "from": "2026-01-01T00:00:00",
  "to": "2026-01-31T23:59:59",
  "first": 30,
  "after": null
}
```

**cURL**

```bash
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**

```json
{
  "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.   |

:::BlockQuote
⚠️ **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

1. Query one period of at most 1 year.
2. Page through the results until `hasNextPage` is `false`.
3. Repeat for the next period.

Don't assume that the first page is the full history. Orders are sorted by creation date, newest first.

:::BlockQuote
💡 **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`.
:::
