Documents
Invoices, quotes, credit notes and other tax or sales/purchase documents. All routes require authentication.
Main routes
| Method | Path | Description |
|---|---|---|
| GET | /documents | List documents (paginated) |
| GET | /documents/:id | Get a document by ID |
| POST | /documents | Create a document |
| PUT | /documents/:id | Update a document |
| POST | /documents/:id/confirm | Confirm a document |
| POST | /documents/:id/cancel | Cancel a document |
List parameters (GET /documents)
| Parameter | Type | Description |
|---|---|---|
page | number | Page number (e.g. 1) |
limit | number | Records per page (e.g. 20) |
type | string | Document type code |
status | string | Document status |
| Date filters | - | As per implementation |
Example: list documents
bash
curl -X GET "https://api.abaco.hn/documents?page=1&limit=10" \
-H "Authorization: Bearer YOUR_KEY_ID:YOUR_SECRET"Example response (list)
json
{
"documents": [
{
"id": 1,
"number": "001-001-0000001",
"type": "01",
"businessPartnerId": 10,
"total": 1500.00,
"status": "confirmed",
"createdAt": "2024-01-15T10:00:00.000Z"
}
],
"total": 1,
"page": 1,
"limit": 10
}Confirm document
POST /documents/:id/confirmConfirms a purchase document (103, 105, 106). Applies inventory and creates journal entry.
Auto-confirmation
Purchase documents 103, 105, and 106 created without automatic invoice capture are auto-confirmed on save. Those created with that flow require manual confirmation.
Unconfirm document
POST /documents/:id/unconfirmOnly for type 103. Reverses inventory and allows re-editing. Requires no confirmed payments.
Cancel document
POST /documents/:id/cancelCancels credit notes (06, 105), debit notes (07, 106) and imports (104).
Physical delete of drafts
Permanently deleting an unconfirmed purchase document type 103 (inventory and related entries) is only available from the web app, not with an API key.
Print document
POST /documents/:id/printSend document by email
POST /send-documentDocument types
| Code | Type | Module |
|---|---|---|
| 01 | Sales invoice | Sales |
| 06 | Sales credit note | Sales |
| 07 | Sales debit note | Sales |
| 100 | Quote | Sales |
| 101 | Sales order | Sales |
| 112 | Delivery | Sales |
| 113 | Reservation invoice | Sales |
| 103 | Purchase invoice | Purchases |
| 104 | Import | Purchases |
| 105 | Purchase credit note | Purchases |
| 106 | Purchase debit note | Purchases |
| 102 | Purchase order | Purchases |
| 11 | Expense | Purchases |
| 05 | Withholding certificate | Both |
Common errors
- 401: Check that the
Authorization: Bearer <keyId:secret>header is correct. - 403: The API key's company does not have access to the resource.
- 404: No document exists with that
id. - 400: Validation failed (amounts, accounts, closed period, etc.)