Create purchase
Record a supplier bill as a purchase, as a draft or approved.
POST https://cotlet.dev/api/v1/holded/contacts/{contact_id}/purchases
Creates one purchase for a supplier with the number printed on the supplier's bill. Each line needs an expense account, because Holded needs one for the ledger. With approve false, the default, the purchase is saved as a draft. Approving makes Holded create the accounting entry. Optionally attach the bill by link. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| contact_id string required | string | Supplier contact ID from list_contacts. |
| document_number string required | string | The supplier's own document number. |
| items array required | array | Lines of the document. Each line has name, description, units, price and tax (the tax as named in Holded). Optional discount in percent per line. Use a product from list_products or a new name. |
| date date | date | Bill date. Default: today. |
| due_date date | date | Due date. |
| deduction_date date | date | Controls the tax period for the deduction. |
| attachment_url string | string | HTTPS link to the bill file to attach. |
| approve boolean | boolean | true approves the purchase, false saves a draft. Default: false. |
Request
curl -X POST https://cotlet.dev/api/v1/holded/contacts/c_a7731e/purchases \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document_number":"88213","date":"2026-10-09","due_date":"2026-11-08","items":[{"name":"Cloud hosting, October","description":"Hosting plan","units":1,"price":49,"tax":"VAT 21%","account":"Software"}],"approve":false}' result = client.call("holded", "create_purchase", {"contact_id":"c_a7731e","document_number":"88213","date":"2026-10-09","due_date":"2026-11-08","items":[{"name":"Cloud hosting, October","description":"Hosting plan","units":1,"price":49,"tax":"VAT 21%","account":"Software"}],"approve":False}) const result = await cotlet.call('holded', 'create_purchase', {"contact_id":"c_a7731e","document_number":"88213","date":"2026-10-09","due_date":"2026-11-08","items":[{"name":"Cloud hosting, October","description":"Hosting plan","units":1,"price":49,"tax":"VAT 21%","account":"Software"}],"approve":false}); cotlet call holded create_purchase --data '{"contact_id":"c_a7731e","document_number":"88213","date":"2026-10-09","due_date":"2026-11-08","items":[{"name":"Cloud hosting, October","description":"Hosting plan","units":1,"price":49,"tax":"VAT 21%","account":"Software"}],"approve":false}' Example response
{
"purchase_id": "pu_5e17",
"supplier": "Fastcloud Hosting",
"document_number": "88213",
"status": "draft",
"subtotal": 49,
"tax_total": 10.29,
"total": 59.29,
"currency": "EUR",
"due_date": "2026-11-08"
}