Expenses and suppliers

Record received invoices with their VAT breakdown, confirm them to book them, attach the original and manage suppliers and categories.

An expense is an invoice or receipt from a supplier. It is created as pending, confirmed once its data is right (Billora then books the journal entry and includes it in the VAT books) and becomes paid / partially_paid according to its payments.

Scopes: expenses:read / expenses:write (and contacts:write to create suppliers).

Creating an expense

POST/api/v1/expenses/expenses:write
{
  "supplier": 45,
  "date": "2026-10-28",
  "numero_factura": "A-2026-7781",
  "amount": "100.00",
  "spanish_taxes": [1],
  "category": 6,
  "notes": "Office supplies, October"
}
JSON
FieldDescription
supplierSupplier (/suppliers/). Search it by tax id before creating it.
dateDate of the received invoice.
numero_facturaThe supplier's invoice number.
amountTax base, before tax.
spanish_taxesTaxes (input VAT, surcharge, withholding) from the catalog.
tax_linesBreakdown when the invoice has several VAT rates (see below).
categoryExpense category (/expense-categories/).
document_typeDocument type (see below). Defaults to invoice.
rectifiesSupplier credit notes only (supplier_credit_note): the expense (received invoice from the same supplier) it corrects.
operation_typeOperation type for VAT purposes (see below). Inferred from the supplier's country if omitted.
currency, exchange_rate, amount_eurInvoice currency and euro counter-value if not EUR (see foreign currency).
deduction_dateDate the VAT is deducted when later than the invoice date (art. 99 LIVA). Never change date to move VAT to another period.
service_period_start, service_period_endService period covered by the invoice (yearly insurance, subscription…). Both or none; if it crosses the year end, accounting accrues the expense (480).
other_taxesOther taxes that are a cost and add to the total (insurance premium tax, hydrocarbons, customs duties, fees): list of { "kind": "ips" | "ieh" | "duty" | "fee" | "tax_other", "label", "base", "rate", "amount" }.
is_investment_goodtrue for capital goods.
payment_methodPayment method (/expense-payment-methods/). With card, direct debit or a payment gateway the expense is marked paid when confirmed.
notesConcept or remarks.

The response includes the computed amounts (tax_breakdown, total_amount, paid_amount, remaining_amount) and the tax warnings in fiscal_warnings (e.g. foreign_supplier_domestic, deduction_date_before_date, missing_invoice_number): show them to the user, they don't block the creation.

Duplicates

If an expense from the same supplier with the same invoice number (or the same date and total) already exists, the API answers with a duplicate warning and doesn't create it. If it really isn't a duplicate, repeat the request with "force": true: the expense is saved with duplicate_of pointing to the similar one.

Document type

Only invoices and supplier credit notes enter the VAT books, form 303, 347 and 349; everything else is booked as a full cost and takes no VAT.

document_typeWhat it is
invoiceFull received invoice (VAT deductible).
simplified_invoiceSimplified invoice or receipt/ticket (VAT deductible only if itemised).
supplier_credit_noteSupplier credit note / corrective invoice: positive amounts that subtract (see below).
receiptReceipt or proof of payment without an invoice.
settlementSettlement: mileage, per diems, expense reports.
insurance_receiptInsurance receipt (the premium tax goes in other_taxes, it is not VAT).
bank_feeBank or payment-gateway fee.
tax_or_feeTax or public fee (631).
penaltyPenalty or surcharge: exceptional expense (678).
financial_interestLate-payment or financial interest (669).
pass_throughDisbursement paid on behalf of the customer: neither expense nor VAT (555).
otherAny other non-invoice document.

Customs duties (other_taxes with kind: "duty") go to the cost of the goods (2xx or 600); fees and other taxes stay in 631. For an investment good the creditor is the 5230xxxx sub-account (fixed-asset suppliers).

Supplier credit notes

A credit note (document_type: "supplier_credit_note") is recorded with positive amounts (amount, total_amount, remaining_amount); is_credit_note: true means they subtract. With rectifies pointing to the corrected invoice, form 303 reports it in boxes 40/41 when that invoice belongs to an earlier period (otherwise it nets in 28/29) and the purchases book lists it as R1 with the rectifica column.

  • Refund received: a payment of the credit note (POST /expense-payments/ or POST /expenses/{id}/create-payment/) is the money the supplier returns (debit 572 / credit 4x).
  • Offsetting against an invoice: POST /expenses/{original_expense_id}/apply-credit-note/ with { "credit_note": <credit note id>, "amount"?, "date"? } leaves both documents paid for the amount (by default, the smaller outstanding one) with two kind: "credit_note_application" payments and a netting entry. Answers 201 with {expense, credit_note, amount, expense_status, credit_note_status}; 400 if the credit note belongs to another supplier, is not confirmed or the URL is the credit note's.

Several VAT rates on one invoice

A received invoice is a single expense, even if it has bases at different rates. Use tax_lines, one entry per base:

{
  "supplier": 51,
  "date": "2026-10-30",
  "numero_factura": "T-99812",
  "tax_lines": [
    { "description": "Food", "base": "40.00", "taxes": [3] },
    { "description": "Drinks", "base": "20.00", "taxes": [1] }
  ]
}
JSON

amount is then the sum of the bases (you can omit it). Don't split the invoice into several expenses: it would be duplicated in the VAT books.

Operation type

operation_typeWhen
domesticSpanish supplier charging VAT.
intra_euSupplier from another EU country without VAT (reverse charge).
foreign_servicesServices from a non-EU company (reverse charge).
domestic_reverse_chargeDomestic reverse charge (construction, scrap, gold…).
importImport with a customs declaration (DUA).
not_subject / non_deductibleNot subject / non-deductible VAT.

For intra_eu and foreign_services, set the VAT you self-assess (for example 21%): Billora generates the matching output and input VAT.

Invoices in another currency

With a currency other than EUR, amount and the tax_lines bases are in the original currency. Billora stores the euro counter-value (amount in the response) and keeps the original amount in original_amount: Their payments can be recorded in the expense's currency together with the euros actually charged (amount_eur).

  • exchange_rate is euros per 1 unit of the currency (amount_eur = original × exchange_rate). If omitted, Billora uses the ECB rate of the invoice date (exchange_rate_source: "ecb").
  • If you know the actual euro charge (card statement), send amount_eur instead of the rate: Billora derives the rate (exchange_rate_source: "bank_charge").

Confirming the expense

POST/api/v1/expenses/{id}/change-status/expenses:write
{ "status": "confirmed" }
JSON

Confirming books it. Check first that total_amount matches the supplier invoice total. A late invoice dated in an already locked period can be created and confirmed if it carries a deduction_date in an open period: the entry is dated on the first open day (metadata.document_date keeps the real date); without deduction_date it still returns 409 period_locked.

Attaching the original

Send the invoice PDF or image in the attachment field with multipart/form-data, when creating or with PATCH:

curl -X PATCH https://api.billora.app/api/v1/expenses/880/ \
  -H "Authorization: Bearer $BILLORA_API_KEY" \
  -F "attachment=@factura-proveedor.pdf"
bash

The expense detail returns attachment_url (temporary signed link) and attachment_filename; the list only says whether it has one (attachment: true).

Missing invoices

GET/api/v1/expenses/gaps/expenses:read

Flags numbering gaps in the invoices of a supplier and months without an invoice from suppliers with an expected_frequency (monthly, quarterly, yearly) on their record. Accepts ?supplier=45, date_from and date_to.

Paying overdue expenses in bulk

POST/api/v1/expenses/backfill-payments/expenses:write

When loading history you often end up with hundreds of confirmed expenses that are in fact already paid (charged to the card or direct-debited at the time). This action records, in one go, a payment for the outstanding amount of each of them, instead of creating the payments one by one.

{ "dry_run": true, "until": "2025-12-31", "infer": true }
JSON

By default (dry_run: true) it only lists what would be paid; review rows and repeat with "dry_run": false.

FieldDescription
dry_runtrue by default: records nothing.
untilOnly expenses dated on or before (YYYY-MM-DD).
supplierRestrict to one supplier (id).
methodName or id of a payment method (/expense-payment-methods/) assigned to expenses without a method. An unknown method returns 400.
inferInfer the method of expenses without one from the supplier (their latest payment or usual payment method).
include_pendingAlso confirm pending expenses before paying them.
forceAlso pay expenses whose method is not settled on the spot (bank transfer, cash). Use it only when you know they are already paid.

Without force only confirmed or partially paid expenses whose payment method is settled on the spot (card, direct debit, PayPal, Bizum…) are paid; the rest, and those already paid, are counted in skipped. The payment date is the invoice date or the due date, depending on the method (direct debit: due date).

{
  "dry_run": true,
  "paid": 2,
  "skipped": 14,
  "rows": [
    { "id": 880, "date": "2025-10-28", "supplier": "Papelería Central, S.L.", "invoice_number": "A-2025-7781", "remaining": "121.00", "method": "Tarjeta", "result": "would_pay" },
    { "id": 893, "date": "2025-11-03", "supplier": "Iberdrola Clientes, S.A.U.", "invoice_number": "FE25-118822", "remaining": "86.40", "method": "Domiciliación (SEPA)", "result": "would_pay" }
  ]
}
JSON

result is would_pay (simulation), paid or error (with the reason in reason). Each expense is paid in its own transaction: one failure does not block the others.

The payments are recorded without a bank account. When you later import the statement or sync the bank, reconciliation recognizes them as payments already recorded and links them to their transaction, moving them to the real bank date, instead of creating a second payment.

Suppliers and categories

  • Suppliers: /suppliers/, same format as customers. The tax id is stored normalised (no spaces, dashes or ES prefix) and its check digit is validated; the organisation's own tax id can never be a supplier. Optionally, default_document_type, default_accounting_account, default_category and expected_frequency set the defaults for its expenses.
  • Categories: /expense-categories/ (read and write with expenses:*).
  • Payment methods: /expense-payment-methods/.

Useful filters

GET /expenses/?status=pending, ?supplier=45, ?search=A-2026-7781 (invoice number, notes…), plus the shared created_after / updated_after filters.

Events

expense.created, expense.updated, expense.confirmed, expense.paid, expense.deleted, supplier.*. See webhooks.