API reference · Credit Limit
Set or Update Credit Limit for Customer
https://api.sandbox.cws.digital/creditLimit/saveDescription
Creates or updates a customer's credit limit for one of your store's types, created in Create Credit Limit Type. Resending for the same customer and type updates the existing limit.
All six fields are required. 0 and false are valid values; only null and empty text count as missing.
To send several customers at once, use Set or Update Credit Limits in Batch.
The examples use the CREDITO-PADRAO type, the same one as in the example of Create Credit Limit Type: create it first in your store.
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| document | string | Yes | Customer's CPF or CNPJ, with or without mask. Up to 18 characters. | |
| credit_code | string | Yes | Code of the limit type — the | |
| value | number | Yes | Total value of the limit. | |
| balance | number | Yes | Available balance. It replaces the stored balance; see The balance sent replaces the current balance. | |
| active | boolean | Yes |
| |
| without_credit_limit | boolean | Yes |
|
Business rules
The balance sent replaces the current balance
value is the limit and balance is the available balance. Both replace what is stored.
Purchases with the limit deduct from the balance. Resending an old balance undoes these deductions: always send the current balance from your system.
Without changes, nothing is stored
Resending the same values responds 200 with the limit as it is, without storing anything.
Document with or without mask
document accepts CPF or CNPJ, with or without mask, including the CNPJ with letters. The response brings the document with letters and digits only.
Responses
- 401
Missing, malformed or expired token.