Purchases
Purchase orders to suppliers, vendor bills (accounts payable) and their payments: lifecycle, conversion and validations.
The purchases module covers the supplier workflow: the purchase order (what you order), the vendor bill (what you are billed and must pay) and vendor payments.
Scopes: purchases:read / purchases:write. Suppliers are managed with contacts:* (see Contacts and products).
Vendor bill or expense?
Vendor bills drive the purchasing workflow (order → bill → payment). To record a received invoice with its VAT breakdown so that it is booked and included in the VAT books, use expenses.
Purchase orders
/api/v1/purchase-orders/purchases:write{
"supplier": 45,
"issue_date": "2026-11-01",
"due_date": "2026-11-15",
"vendor_reference": "PRV-88231",
"notes": "Deliver to the Málaga warehouse",
"lines": [
{ "description": "HP 59A black toner", "quantity": "4", "unit_price": "62.50", "tax_template": 1 },
{ "product": 210, "description": "A4 paper 80 g (box)", "quantity": "10", "unit_price": "21.90", "discount_percent": "5", "tax_template": 1 }
]
}| Field | Description |
|---|---|
supplier | Supplier (required). |
lines | Lines (required): description, quantity, unit_price (before taxes), discount_percent and, optionally, product, tax_template, withholding_template and surcharge_template. |
issue_date, due_date | Order date and expected date. |
vendor_reference | The supplier's reference or number. |
series | Numbering series of type PURCHASE_ORDER (see Settings). |
currency, exchange_rate | Currency and exchange rate when not in euros. |
status | draft, sent, received, cancelled. Change it with the actions. |
Amounts and quantities are decimal strings. The detail (GET /purchase-orders/{id}/) includes lines; the list does not. Until they are numbered, number is null.
| Operation | Endpoint |
|---|---|
| List / read | GET /purchase-orders/ · GET /purchase-orders/{id}/ |
| Update / delete | PATCH /purchase-orders/{id}/ · DELETE /purchase-orders/{id}/ |
| Mark as sent | POST /purchase-orders/{id}/send/ |
| Mark as received | POST /purchase-orders/{id}/receive/ |
| Convert into a vendor bill | POST /purchase-orders/{id}/to-vendor-bill/ → 201 with the draft bill |
Vendor bills
/api/v1/vendor-bills/purchases:writeSame body as an order (supplier, lines, dates, vendor_reference…). Statuses: draft → approved → partially_paid / paid (or overdue), and cancelled.
| Operation | Endpoint |
|---|---|
| Approve (assigns a number) | POST /vendor-bills/{id}/approve/ with optional {"issue_date": "2026-11-03"} |
| Cancel | POST /vendor-bills/{id}/cancel/ |
| Generate the PDF (async) | POST /vendor-bills/{id}/pdf/ |
POST /vendor-bills/{id}/email/ with {"to": ["purchasing@supplier.com"]} |
Vendor payments
/api/v1/vendor-payments/purchases:write{
"bill": 77,
"amount": "250.00",
"date": "2026-11-20",
"method": "transfer",
"reference": "TRF-20261120-01"
}method: transfer, cash, card, direct_debit. The bill must be approved and the amount must be greater than 0 and not exceed the outstanding balance; otherwise the API returns 400 validation_error. Once the total is covered, the bill becomes paid.
Events
purchase_order.created, .updated, .sent, .received, .cancelled, .deleted and vendor_bill.created, .updated, .approved, .paid, .cancelled, .deleted. See webhooks.
