This guide covers the complete lifecycle of a one-time payment: creating a customer record, creating a payment object, routing the customer through a hosted checkout session, and confirming the charge succeeded on return. By the end you will have a working end-to-end flow that you can adapt for any e-commerce or service billing scenario.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.
Borga amounts are expressed in whole Icelandic króna (ISK). ISK has no subunit — pass
5990 to charge 5,990 kr, not 59.90 kr.Create a customer (optional)
Creating a customer record before charging lets you attach payment history, save payment methods, and link subscriptions or invoices to a single identity. If you do not yet have a customer in Borga, create one now.Save the returned
id (e.g. cus_01HXYZ…). You will pass it as the customer field in subsequent requests to link activity to this person.Create a payment
A payment object represents a single charge attempt. Create one with the amount to collect, the currency, and an optional description that will appear on the invoice.A successful response returns the payment object with a Save the
pending status:id. You will attach it to a payment session in the next step and poll it after checkout to confirm success.Create a payment session
A payment session hosts the checkout UI and handles 3D Secure redirects for you. Pass the payment The response includes a
id you just created so the session is linked to it, and provide a return_url where Borga will send the customer after checkout.url property pointing to the hosted checkout page on checkout.borga.is.Redirect the customer
Redirect the customer’s browser to When the customer completes or abandons checkout, Borga redirects them back to the
session.url. Borga’s hosted checkout page handles all payment method presentation — cards, Apple Pay, Google Pay, and krafa — without any additional code on your side.Node.js (Express)
return_url or cancel_url you specified.Issue a refund
If you need to refund a succeeded payment, usePOST /v1/refunds. Omit amount to refund the full charge.
curl
Next steps
- Hosted checkout — configure the checkout page appearance, locale, and payment methods
- Webhooks — receive asynchronous
payment.succeededandpayment.failedevents - Subscriptions — set up recurring billing for the same customer