Documents
Sales/purchase tax documents. All routes require authentication.
See also: Concepts · Resource template.
Main routes
| Method | Path | Description |
|---|---|---|
| GET | /documents | List (paginated) |
| GET | /documents/:id | Get by ID |
| POST | /documents | Create |
| PUT | /documents/:id | Update |
| POST | /documents/:id/confirm | Confirm |
| POST | /documents/:id/unconfirm | Unconfirm (e.g. purchase 103) |
| POST | /documents/:id/cancel | Cancel |
| POST | /documents/:id/print | PDF (Jasper) |
Create document
POST /documents
Content-Type: application/jsonMain body fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Type code (see table below) |
businessPartnerId | number | yes* | Customer/supplier ID |
date | string | recommended | YYYY-MM-DD |
dueDate | string | no | Due date |
currency | string | no | Allowed company currency (HNL / USD, …) |
exchangeRate | number | no | Default 1 |
subtotal, discountAmount, taxAmount, total | number | yes if lines | Must match line totals |
lines | array | yes to issue | Document lines |
isConfirmed | boolean | no | For 103: false = draft |
Line fields (lines[])
| Field | Type | Description |
|---|---|---|
productId | number | Product |
code / description | string | Display |
quantity / price / discount | number | Amounts |
taxRate | string/number | e.g. "15" |
subtotal / total | number | Line totals |
warehouseId | number | Warehouse |
Example JSON — sales invoice (01, Honduras)
json
{
"type": "01",
"businessPartnerId": 10,
"date": "2026-11-03",
"dueDate": "2026-11-18",
"currency": "HNL",
"exchangeRate": 1,
"observations": "Invoice via API",
"subtotal": 1000.00,
"discountAmount": 0,
"taxAmount": 150.00,
"total": 1150.00,
"lines": [
{
"productId": 5,
"code": "PROD-001",
"description": "Sample product",
"quantity": 2,
"price": 500.00,
"discount": 0,
"taxRate": "15",
"subtotal": 1000.00,
"total": 1150.00,
"warehouseId": 1
}
]
}Example cURL
bash
curl -X POST "https://api.abaco.hn/documents" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"type": "01",
"businessPartnerId": 10,
"date": "2026-11-03",
"currency": "HNL",
"subtotal": 1000.00,
"discountAmount": 0,
"taxAmount": 150.00,
"total": 1150.00,
"lines": [{
"productId": 5,
"code": "PROD-001",
"description": "Sample product",
"quantity": 2,
"price": 500.00,
"discount": 0,
"taxRate": "15",
"subtotal": 1000.00,
"total": 1150.00,
"warehouseId": 1
}]
}'Totals
The server checks that header totals match the lines (small cent tolerance). Mismatch → 400.
El Salvador
Use "currency": "USD" only (no extra foreign currency).
Typical response (simplified)
json
{
"id": 12345,
"type": "01",
"businessPartnerId": 10,
"status": "draft",
"currency": "HNL",
"total": 1150.00,
"date": "2026-11-03"
}Get document by ID
GET /documents/:idbash
curl -X GET "https://api.abaco.hn/documents/12345" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET"json
{
"id": 12345,
"type": "01",
"Number": "00001234",
"businessPartnerId": 10,
"isConfirmed": true,
"currency": "HNL",
"total": 1150.00,
"date": "2026-11-03",
"lines": [
{
"productId": 5,
"quantity": 2,
"price": 500.00,
"warehouseId": 1
}
]
}Confirm / unconfirm / cancel
POST /documents/:id/confirm
POST /documents/:id/unconfirm
POST /documents/:id/cancelConfirm often uses an empty body. Unconfirm only if the company allows editing confirmed purchases, for types 103 / 105 / 106 / 11 (not 104). Cancel only for 06/07/105/106/104/05/116.
Document types
| Code | Type | Module |
|---|---|---|
| 01 | Sales invoice | Sales |
| 06 / 07 | Sales credit / debit note | Sales |
| 100 / 101 / 112 / 113 | Quote / order / delivery / reservation | Sales |
| 103 / 104 / 105 / 106 / 102 / 116 | Purchase / import / NC / ND / PO / goods receipt | Purchases |
| 11 | Expense | Purchases |
| 05 | Withholding | Both |
Type × actions matrix
| Type | Create | Confirm | Unconfirm | Cancel | Pay | Stock | Doc journal |
|---|---|---|---|---|---|---|---|
| 01 | Yes | Cond. | — | — | Yes | reduce | Yes |
| 06 | Yes | Cond. | — | Yes | Refund | add | Yes |
| 07 | Yes | Cond. | — | Yes | Yes | reduce | Yes |
| 100 / 101 / 102 | Yes | — | — | — | Advance* | — | — |
| 112 | Yes | Cond. | — | — | Yes | reduce | — (by design) |
| 113 | Yes | Cond. | — | — | Yes | — | Yes |
| 103 | Yes | Yes | Cond.** | — (draft: web) | Yes | add | Yes |
| 104 | Yes | Cond. | — | Yes | Yes | add | Yes |
| 105 / 106 | Yes | Yes | Cond.** | Yes | Yes | reduce / add | Yes |
| 11 | Yes | Cond. | Cond.** | — | Yes | — | Yes |
| 116 | Yes | born confirmed | — | Yes*** | — | add | Yes |
| 05 | Yes | Cond. | Cond.** | Yes | — | — | Yes |
*Advances on quote/order/PO flows. **Company must allow editing confirmed purchases. ***Blocked if already invoiced on a 103.
Full Spanish matrix (same rules): Documentos → matriz.
Common errors
json
{
"error": "Ya existe un documento con el mismo RTN, número de documento y total. No se puede confirmar porque sería un duplicado."
}json
{
"message": "No se puede desconfirmar este documento."
}| Code | When |
|---|---|
| 400 | Totals mismatch, currency, closed period, non-cancellable type, duplicate on confirm |
| 401 | Invalid API key / session |
| 403 | Not allowed / unconfirm denied |
| 404 | Unknown document id |
Next: Register payment · API index