Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.borga.is/llms.txt

Use this file to discover all available pages before exploring further.

Every successful payment made through Borga produces a legally compliant Icelandic invoice in PayDay.is automatically. You do not need to generate invoices manually, integrate with a separate invoicing system, or handle Icelandic accounting regulations yourself — Borga takes care of it. Invoices are immediately available via the API and downloadable as PDFs.

Invoice generation

Borga creates an invoice the moment a payment succeeds. The invoice is associated with the payment and, if provided, the customer record. You can retrieve all invoices with GET /v1/invoices, or fetch a specific invoice with GET /v1/invoices/{id}. Invoices generated from subscriptions are created at the start of each billing cycle and finalized once payment is collected.
Invoice generation happens asynchronously after payment succeeds. If you query GET /v1/invoices immediately after a payment, allow a brief moment for the invoice to appear. Use webhooks to receive a notification when an invoice is finalized.

Invoice statuses

An invoice moves through the following statuses during its lifecycle:
StatusMeaning
draftThe invoice is being assembled. Line items can still be added. Not yet sent to the customer.
openThe invoice has been finalized and sent. Payment is outstanding.
paidPayment has been collected.
voidThe invoice has been canceled. A voided invoice is replaced by a new one if rebilling is needed.
uncollectiblePayment attempts have been exhausted and the invoice is marked as a bad debt.

Invoice items

For subscription invoices in draft status, you can add ad-hoc line items before the invoice is finalized using POST /v1/invoice_items. This is useful for one-off charges — setup fees, overages, or adjustments — that should appear on the customer’s next invoice.
curl
curl --request POST \
  --url https://api.borga.is/v1/invoice_items \
  --header "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  --header "X-Merchant-Id: mer_YOUR_MERCHANT_ID" \
  --header "Content-Type: application/json" \
  --data '{
    "customer": "cus_01HXYZ",
    "subscription": "sub_01HXYZ",
    "amount": 5000,
    "currency": "ISK",
    "description": "Setup fee",
    "quantity": 1
  }'

Invoice item fields

FieldRequiredDescription
customerYesThe customer the item is billed to.
amountYesAmount in ISK (integer).
descriptionYesLine item description that appears on the invoice.
subscriptionNoAttach this item to a specific subscription’s upcoming invoice.
currencyNoDefaults to ISK.
quantityNoMultiplied by amount to produce the line total. Defaults to 1.
metadataNoKey-value pairs for your own data.
Invoice items can only be added to invoices in draft status. Once an invoice is finalized (open, paid, or void), its line items are locked.

Credit notes

When you issue a refund against a paid invoice, Borga automatically generates a credit note. A credit note is the legally required document that offsets the original invoice amount — it does not modify or void the invoice itself. Retrieve credit notes with GET /v1/credit_notes. To filter by invoice, pass the invoice ID as a query parameter:
curl
curl --request GET \
  --url "https://api.borga.is/v1/credit_notes?invoice=inv_01HXYZ" \
  --header "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  --header "X-Merchant-Id: mer_YOUR_MERCHANT_ID"
Fetch a specific credit note with GET /v1/credit_notes/{id}.
Credit notes are generated automatically when a refund is processed. You do not need to create them manually.

PDF access

Every finalized invoice has a PDF available for download. Invoice PDFs are accessible directly from the Borga dashboard under Invoices. From the API, the invoice object includes a pdf_url field you can use to open or serve the PDF directly to your customers.

Accounting sync

To sync invoices and credit notes to external accounting software such as Uniconta or DK, see the accounting link guide.
If you use PayDay.is directly, your Borga invoices are already present in your PayDay.is account under the same merchant registration. No additional sync is required.