Hosted checkout lets you accept payments without handling any card data yourself. You create a payment session from your server, redirect the customer to the resulting URL onDocumentation Index
Fetch the complete documentation index at: https://docs.borga.is/llms.txt
Use this file to discover all available pages before exploring further.
checkout.borga.is, and Borga handles the entire checkout experience — including card entry, 3D Secure authentication, Apple Pay, Google Pay, and krafa. When the customer finishes, Borga sends them back to a URL you specify. Your integration never sees raw card numbers, which significantly reduces your PCI scope.
Create a hosted payment session
From your server, create a payment session with The response includes a
mode: "hosted". The return_url is required — it is where Borga redirects the customer after checkout completes (successfully or not). The cancel_url is where the customer lands if they click the back button in the checkout UI.url field and a session id:Hosted checkout sessions expire after one hour. If the customer does not complete checkout within that window, create a new session. The
expires_at field tells you when the session will become invalid.Redirect the customer
Once you have the session, redirect the customer’s browser to The customer is now on
session.url. Do this server-side with an HTTP redirect or client-side by setting window.location.href.Node.js (Express)
Browser
checkout.borga.is. They see a Borga-branded checkout form with the payment methods you enabled. You do not need to do anything further until they return.Handle the return
When checkout completes — whether the payment succeeded, failed, or was declined — Borga redirects the customer to your
return_url. Always verify the payment status server-side before taking any action; never trust the redirect alone.Node.js (Express)
Handle cancellation
If the customer clicks Back or closes the checkout before completing payment, Borga redirects them to your No payment is created when a customer cancels — there is nothing to clean up on the Borga side.
cancel_url. Use this URL to return the customer to your cart or product page so they can try again.Node.js (Express)
Session options reference
| Field | Required | Description |
|---|---|---|
mode | Yes | Set to "hosted" for redirect-based checkout. |
return_url | Yes | Where to redirect after checkout completes or fails. |
cancel_url | No | Where to redirect if the customer cancels. |
amount | No | Required if not attaching an existing payment id. |
currency | No | Defaults to ISK. |
payment | No | Attach to an existing payment object instead of creating a new one. |
customer | No | Customer ID to associate with the session and any saved payment method. |
customer_email | No | Pre-fill the email field in the checkout form. |
external_reference | No | Your own reference ID, carried through to the resulting payment. |
enabled_methods | No | Restrict which methods appear, e.g. ["card", "krafa"]. Omit to show all. |
save_payment_method | No | If true, the card used is saved to the customer for future charges. |
locale | No | Checkout UI language. Use "is" for Icelandic or "en" for English. |
Locale support
Pass alocale value to present the checkout UI in the customer’s language. Borga currently supports "is" (Icelandic, default) and "en" (English). The locale affects all text in the checkout form, including error messages and payment method labels.
Hosted mode and embedded mode are distinct. In hosted mode you redirect the customer away from your site to
checkout.borga.is. In embedded mode, Borga renders a checkout component directly inside your page using borga.js — your site’s origin must be added to Settings → Embed Origins in the dashboard. See the Payments concept guide for an overview of both modes.Next steps
- Accept a payment — create the payment object before the session
- Webhooks — receive
payment.succeededevents asynchronously instead of relying on the return redirect - Subscriptions — set up recurring billing using saved payment methods