Credits
Accounts receivable / payable queries. GET only — limits live on the business partner; balances come from open documents and journal items.
Requires authentication.
Routes
| Method | Path | Description |
|---|---|---|
| GET | /credits/summary | Aging — clients |
| GET | /credits/summary/export | Export clients |
| GET | /credits/providers/summary | Aging — providers |
| GET | /credits/providers/summary/export | Export providers |
| GET | /credits/client/:clientId | One client detail |
| GET | /credits/client/:clientId/statement | Statement |
| GET | /credits/client/:clientId/movements | Movements |
| GET | /credits/provider/:providerId | One provider detail |
| GET | /credits/provider/:providerId/statement | Statement |
| GET | /credits/provider/:providerId/movements | Movements |
Paths
Use /credits/provider/... (singular), not supplier. Global client aging is /credits/summary, not per-id.
Optional: summary=1 on aging endpoints omits documents[] (lighter payload).
Client summary
GET /credits/summaryCXC document types: 01, 07, 113 (+ open journal items as JE).
json
{
"clientId": 10,
"clientName": "API Demo Customer",
"clientRtn": "08011990123456",
"totalCredit": 1150.00,
"current": 1150.00,
"days1_15": 0,
"days16_30": 0,
"days31_60": 0,
"days61_90": 0,
"days90_plus": 0,
"documents": [
{
"id": 12345,
"Number": "00001234",
"type": "01",
"remainingAmount": 1150.00,
"daysOverdue": 0
}
]
}Provider aging: same buckets with providerId / providerName; types 103, 104, 106.
Client detail
GET /credits/client/:clientIdjson
{
"clientId": 10,
"clientName": "API Demo Customer",
"documents": [
{
"documentId": 12345,
"documentNumber": "00001234",
"documentType": "01",
"totalPaid": 0,
"remainingAmount": 1150.00,
"daysOverdue": 0,
"status": "pendiente"
}
]
}Credit limits
Configured on the partner (credit_limit, payment condition). Check /credits/client/:clientId before creating a sales document via API.
Common errors
json
{
"error": "Usuario no tiene una compañía asignada"
}| HTTP | When |
|---|---|
| 400 | User without company |
| 401 | Invalid auth |
| 500 | Internal aging failure |