API reference · CashBack

Get Customer Cashback History

GEThttps://api.sandbox.cws.digital/v1/cashback/customers/{document}/statementIn homologation

Description

Lists the cashback statement of a customer of your store: one item per entry, earned or spent, from the most recent to the oldest.

Accepted values in status: TO_RELEASE, RELEASED, CANCELLED, INVALID_EXPIRED (credit entries) and IN_USE, USED, EXPIRED (debit entries).

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
documentstringYes

Customer's CPF or CNPJ, with numbers only (and letters, in the alphanumeric CNPJ). See Document with numbers only in the route.

Query parameters

FieldTypeRequiredDescriptionValue
statusstringNo

Filters the entries by status. Accepts several separated by commas: status=TO_RELEASE,RELEASED. When omitted, it brings all of them.

limitintegerNo

Entries per page. Default 20, maximum 50. A value above that is reduced to 50, and an invalid value uses the default, with no error.

offsetintegerNo

How many entries to skip before the page. Default 0.

Business rules

Document with numbers only in the route

Send the customer's CPF or CNPJ without ., / and -: 46693537308. The slash of a formatted CNPJ breaks the route.

An unknown status is ignored

A value outside the list does not cause an error: it is dropped from the filter. With no valid value, the statement brings all statuses.

A nonexistent customer and an empty statement respond differently

A document with no customer in your store responds 404 with the message Customer not found in the CWS database.

A customer with no entry in the filter, or an offset past the end, responds 404 with the message No record found.

Responses

  • 401

    Missing, malformed or expired token.

Try it

Sandbox

Language

Credentials

Access token: saved in this tab and used on every endpoint.

Each token only reaches the partner's own data and that of the branches with an authorized link.

Don't have sandbox credentials yet? See how to request them

Request

cURL
curl --request GET \
  --url 'https://api.sandbox.cws.digital/v1/cashback/customers/46693537308/statement' \
  --header 'Authorization: Bearer <access_token>'

Response

Click Try it to see the real response here, or pick a documented example: