Book an expense
Needs a token with the write:expenses scope. Authentication
Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.
Books a complete draft: status booked, booked_at and booked_by are set, amounts freeze (GeBüV / OR 958f) and its receipts are locked against deletion (retention). Requires supplier, category, document date (not in the future), a total above 0, a receipt or a receipt_missing_reason, and for a foreign currency an exchange rate with date and source; otherwise 422 cannot_book with details.reasons (a list of sentences). 409 invalid_state if it is not a draft, 409 period_closed if the document date lies in a closed month. Writes an expense.booked audit event. Irreversible except by void_expense; a retry answers 409 invalid_state.
bearerAuthAuthorizationBearer <token>A personal API token, hvt_…, with scopes such as read:* or write:invoices
id*stringThe expense's id.
OK
application/json- response
data*curl -X POST 'https://app.helvetly.com/api/v1/expenses/string/book'{ "data": { "id": "string", "number": 0, "status": "draft", "source": "string", "supplier_name": "string", "supplier_vat_number": "string", "supplier_country": "string", "reference": "string", "duplicate_of": { "id": "string", "number": 0, "date": "2019-08-24" }, "description": "string", "category": { "id": "string", "name": "string", "account_code": "string" }, "document_date": "2019-08-24", "due_date": "2019-08-24", "currency": "string", "amount_mode": "string", "lines": [ { "id": "string", "position": 0, "description": "string", "amount": "1234.50", "vat_rate": "string" } ], "net_total": "1234.50", "vat_total": "1234.50", "total": "1234.50", "vat_breakdown": [ { "rate": "string", "taxable_amount": "1234.50", "vat_amount": "1234.50", "deductible_amount": "1234.50" } ], "input_tax": "string", "reverse_charge": true, "input_tax_box": "string", "deductible_percent": "string", "deductible_vat": "1234.50", "exchange_rate": "string", "exchange_rate_date": "2019-08-24", "exchange_rate_source": "string", "base": { "currency": "string", "net_total": "1234.50", "vat_total": "1234.50", "total": "1234.50", "deductible_vat": "1234.50" }, "payment_status": "string", "paid_on": "2019-08-24", "payment_method": "string", "paid_by_member": { "id": "string", "name": "string" }, "reimbursed_on": "2019-08-24", "is_overdue": true, "note": "string", "receipt_missing_reason": "string", "receipts_count": 0, "is_complete": true, "missing_fields": [ "string" ], "created_by": { "id": "string", "name": "string" }, "booked_at": "2019-08-24T14:15:22Z", "booked_by": { "id": "string", "name": "string" }, "voided_at": "2019-08-24T14:15:22Z", "voided_by": { "id": "string", "name": "string" }, "void_reason": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }}