Business partners
Customers (C) and suppliers (P). Requires authentication.
See Resource template.
Main routes
| Method | Path | Description |
|---|---|---|
| GET | /business-partners | List |
| GET | /business-partners/clients | Customers |
| GET | /business-partners/suppliers | Suppliers |
| GET | /business-partners/:id | Get |
| POST | /business-partners | Create |
| PUT | /business-partners/:id | Update |
Create business partner
POST /business-partners
Content-Type: application/jsonMain fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name |
partner_type | string | yes | "C" or "P" |
rtn | string | recommended | Tax ID / RTN |
email / phone / address | string | no | Contact |
is_active | boolean | no | Default true |
paymentConditionId | number | no | Default payment terms |
withholds_iva | boolean | no | IVA withholding (SV customers only) |
Field names
Use partner_type and rtn — not type / taxId.
Example JSON — customer
json
{
"name": "API Demo Customer",
"partner_type": "C",
"rtn": "08011990123456",
"email": "client@example.com",
"phone": "2234-5678",
"address": "Tegucigalpa",
"is_active": true,
"credit_limit": 50000,
"credit_days_limit": 30
}Example cURL
bash
curl -X POST "https://api.abaco.hn/business-partners" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"name": "API Demo Customer",
"partner_type": "C",
"rtn": "08011990123456",
"email": "client@example.com",
"is_active": true
}'Use the returned id as businessPartnerId when creating documents.
Get by ID
GET /business-partners/:idbash
curl -X GET "https://api.abaco.hn/business-partners/10" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET"json
{
"id": 10,
"name": "API Demo Customer",
"partner_type": "C",
"rtn": "08011990123456",
"credit_limit": 50000,
"is_active": true
}Open AR: Credits.
Common errors
json
{
"error": "Ya existe un socio activo con ese RTN y tipo"
}| Code | When |
|---|---|
| 400 | Validation / duplicate active RTN for same role C/P |
| 401 | Invalid credentials |
| 404 | Partner not found |