Invoices

Invoices booked in your accounting provider for payments and subscription periods. Read-only.

Invoices are created by Borga when a payment succeeds, a bank invoice is issued or a subscription period ends, and mirrored to PayDay or DK+. See Invoicing. You cannot create or edit them through the API; add one-off charges to a subscription with invoice items.

The invoice object

idstring
Prefixed inv_.
customerstring | null
paymentstring | null
The payment that paid it, for one-off sales and card-collected subscription invoices.
statusenum
draft, open, paid, void or sync_failed.
subtotalinteger
taxinteger
totalinteger
amount_paidinteger
currencystring
accounting_providerenum | null
payday or dk.
external_invoice_idstring | null
The provider's id.
external_invoice_numberstring | null
The legal invoice number issued by the provider.
pdf_urlstring | null
Provider-hosted PDF, when available.
sync_error_messagestring | null
Set when status is sync_failed.
external_referencestring | null
Copied from the payment.
billingobject
name, email, kennitala, vat_number, address used on the invoice.
linesarray
Present when retrieving: id, description, quantity, unit_amount, tax_rate, tax_amount, accounting_code.
finalized_attimestamp | null
paid_attimestamp | null
created_attimestamp

Retrieve an invoice

GET/v1/invoices/:idSecret key
curl https://api.borga.is/v1/invoices/inv_3Ef5Gh7Ij9Kl1Mn3Op5Qr7St \
  -H "Authorization: Bearer sk_test_…"

List invoices

GET/v1/invoicesSecret key

Query parameters

statusenum
limitintegerdefault: 25
starting_afterstring
Node.jsts
const { data, has_more } = await borga.invoices.list({ status: "paid", limit: 50 });

for (const invoice of data) {
  console.log(invoice.external_invoice_number, invoice.total, invoice.pdf_url);
}

if (has_more) {
  const next = await borga.invoices.list({
    status: "paid",
    starting_after: data[data.length - 1].id,
  });
  console.log(next.data.length);
}