Skip to content

Documents ​

Sales/purchase tax documents. All routes require authentication.

See also: Concepts · Resource template.

Main routes ​

MethodPathDescription
GET/documentsList (paginated)
GET/documents/:idGet by ID
POST/documentsCreate
PUT/documents/:idUpdate
POST/documents/:id/confirmConfirm
POST/documents/:id/unconfirmUnconfirm (e.g. purchase 103)
POST/documents/:id/cancelCancel
POST/documents/:id/printPDF (Jasper)

Create document ​

POST /documents
Content-Type: application/json

Main body fields ​

FieldTypeRequiredDescription
typestringyesType code (see table below)
businessPartnerIdnumberyes*Customer/supplier ID
datestringrecommendedYYYY-MM-DD
dueDatestringnoDue date
currencystringnoAllowed company currency (HNL / USD, …)
exchangeRatenumbernoDefault 1
subtotal, discountAmount, taxAmount, totalnumberyes if linesMust match line totals
linesarrayyes to issueDocument lines
isConfirmedbooleannoFor 103: false = draft

Line fields (lines[]) ​

FieldTypeDescription
productIdnumberProduct
code / descriptionstringDisplay
quantity / price / discountnumberAmounts
taxRatestring/numbere.g. "15"
subtotal / totalnumberLine totals
warehouseIdnumberWarehouse

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/:id
bash
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/cancel

Confirm 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 ​

CodeTypeModule
01Sales invoiceSales
06 / 07Sales credit / debit noteSales
100 / 101 / 112 / 113Quote / order / delivery / reservationSales
103 / 104 / 105 / 106 / 102 / 116Purchase / import / NC / ND / PO / goods receiptPurchases
11ExpensePurchases
05WithholdingBoth

Type × actions matrix ​

TypeCreateConfirmUnconfirmCancelPayStockDoc journal
01YesCond.——YesreduceYes
06YesCond.—YesRefundaddYes
07YesCond.—YesYesreduceYes
100 / 101 / 102Yes———Advance*——
112YesCond.——Yesreduce— (by design)
113YesCond.——Yes—Yes
103YesYesCond.**— (draft: web)YesaddYes
104YesCond.—YesYesaddYes
105 / 106YesYesCond.**YesYesreduce / addYes
11YesCond.Cond.**—Yes—Yes
116Yesborn confirmed—Yes***—addYes
05YesCond.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."
}
CodeWhen
400Totals mismatch, currency, closed period, non-cancellable type, duplicate on confirm
401Invalid API key / session
403Not allowed / unconfirm denied
404Unknown document id

Next: Register payment · API index