Skip to content
platform

API reference · CashBack

List Aggregated Cashback Balance by Customer

Method
GET
Route
/loyaltyProgram/listCustomersTotal
Base URL
https://ws.autorei.net
Query parameters in the example
limit=20 offset=0
Token
Requires Bearer token
Test in Postman

Opens this request in the public API documentation, the official source of the reference.

Description

Lists your store's cashback balance customer by customer, with the totals per status for each one. Use it when you need the individual balance; for the store's consolidated figure, use GET /loyaltyProgram/total.

Query parameters

Parameter Type Required Description
limit integer No Records per page. Default 20, cap 50 — a value above that is reduced to 50, with no error.
offset integer No Starting record of the page. Default 0.

Business rules

Pagination counts entries, not customers

limit and offset are applied to cashback entries, and the response groups those entries by customer. Since a customer usually has more than one entry, the page returns fewer customers than the limit — limit=20 may return 17 customers. Do not use the number of items in the response to decide whether you reached the end. There is no empty page: when the offset goes past the last entry, the response is 400 with no record found — that 400 is what ends the pagination.

Response · 200

Array with one object per customer.

Field Type Description
customerId integer Customer id at CWS.
name string Customer name or company name.
document string Customer CPF or CNPJ.
credit object Cashback the customer earned, by status. Key = status, value = total.
debit object Cashback the customer spent, by status. Comes as {} when there is no debit.

The possible statuses in the keys of credit and debit are the same as in GET /loyaltyProgram/total: TO_RELEASE, RELEASED, CANCELLED, INVALID_EXPIRED, IN_USE, USED, EXPIRED. The values are strings with two decimal places and a dot as the separator ("11.80").

Errors

Code When
400 {"status":"BAD_REQUEST","message":"no record found"} — the store has no cashback records, or the offset went past the end of the list. It is not an error in your request.
401 Token missing, malformed or expired.

Example request

curl --request GET 'https://ws.autorei.net/loyaltyProgram/listCustomersTotal?limit=20&offset=0' \
  --header 'Authorization: Bearer {{access_token}}'

Example responses

200Success — two customers with balance

[
  {
    "customerId": 700101,
    "name": "Ana Paula Ribeiro",
    "document": "700.413.648-56",
    "credit": {
      "TO_RELEASE": "11.80",
      "RELEASED": "42.35"
    },
    "debit": {
      "USED": "15.00"
    }
  },
  {
    "customerId": 700102,
    "name": "Comercial Aurora Ltda",
    "document": "29.893.264/0001-01",
    "credit": {
      "RELEASED": "318.90"
    },
    "debit": {}
  }
]

Used in

Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.