API reference · Credit Limit
Set or Update Credit Limit for Customer
- Method
- POST
- Route
-
/creditLimit/save - Base URL
https://ws.autorei.net- Token
- Requires Bearer token
Test in Postman
Opens this request in the public API documentation, the official source of the reference.
Description
Creates or updates the credit limit of a customer already registered on the platform, for one of the types created in Create Credit Limit Type. Resending for the same customer and type updates the existing limit.
Request body (JSON)
All six fields are required. 0 and false are valid values — only null and empty string count as missing.
| Field | Type | Required | Description |
|---|---|---|---|
document |
string | Yes | Customer CPF or CNPJ. |
credit_code |
string | Yes | Limit type code — the code you defined when creating the type. |
value |
number | Yes | Total limit amount. |
balance |
number | Yes | Available limit balance. |
active |
boolean | Yes | true keeps the limit active. |
without_credit_limit |
boolean | Yes | true allows the customer to buy even without a balance. |
Response · 200
| Field | Type | Description |
|---|---|---|
message |
string | Operation confirmation: Conta criada/atualizada com sucesso. |
document |
string | Customer document, as sent. |
credit_code |
string | Limit type code, same as sent. |
credit_type |
string | Limit type name. |
value |
number | Total amount saved. |
balance |
number | Balance saved. |
active |
boolean | Whether the limit is active. |
without_credit_limit |
boolean | Whether the customer buys without a balance. |
Errors
| Code | When |
|---|---|
| 404 | Body missing or empty: {"status":"NOT_FOUND","message":"JSON com formato inválido e/ou não informado"}. |
| 400 | One of the six required fields is missing or empty, or the credit service did not confirm the save. The message echoes the received payload — compare it with the table above to find the missing field. |
| 401 | Token missing, malformed or expired. |
Example request
curl --request POST 'https://ws.autorei.net/creditLimit/save' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"document": "29.893.264/0001-01",
"credit_code": "CREDITO-PADRAO",
"value": 5000.0,
"balance": 5000.0,
"active": true,
"without_credit_limit": false
}' Example responses
200Success — limit set
{
"without_credit_limit": false,
"balance": 5000,
"document": "29.893.264/0001-01",
"credit_code": "CREDITO-PADRAO",
"active": true,
"message": "Conta criada/atualizada com sucesso",
"credit_type": "Crédito Padrão",
"value": 5000
} Used in
- Use casesEcommerce ERP integration: the typical path through the API
- Use casesB2B customer portal: the typical path through the API
- Use casesB2B marketplace: the typical path through the API
- Use casesComplex retail and B2B2C: the typical path through the API
- Use casesB2B procurement and supplies: the typical path through the API
- Use casesGuided selling and counter sales: the typical path through the API
Related endpoints
Generated from the public API collection, published on 2026-09-04: api-docs.cws.digital.