A payment session represents a checkout interaction. UseDocumentation Index
Fetch the complete documentation index at: https://docs.borga.is/llms.txt
Use this file to discover all available pages before exploring further.
mode: "hosted" to redirect your customer to a Borga-hosted checkout page, or mode: "embedded" to render checkout directly in your own page using the client_secret.
Sessions expire after a short window. Retrieve a session to check its status and whether the underlying payment succeeded.
Create a payment session
POST /v1/payment_sessions
Creates a new payment session. The required parameters vary by mode — see the examples below.
Request parameters
Checkout mode. Use
"hosted" to redirect the customer to a Borga-hosted page, or "embedded" to render checkout within your own page. Defaults to "hosted".ID of an existing payment to attach this session to. If omitted, a new payment is created using the
amount and currency fields.Amount for the payment in whole ISK kronur. Required when
payment is not provided.Three-letter ISO 4217 currency code. Defaults to
ISK.ID of an existing customer to associate with the session.
Customer email address. Pre-fills the email field in hosted checkout.
URL the customer is redirected to after completing or attempting checkout. Required for
mode: "hosted". Borga appends a session_id query parameter so you can retrieve the session on load.URL the customer is redirected to if they cancel checkout. Only used in
mode: "hosted".The origin of the page embedding checkout (e.g.
https://example.com). Required for mode: "embedded". Borga uses this for postMessage communication.Array of payment method types to enable (e.g.
["card", "apple_pay"]). When omitted, all methods available to your merchant account are enabled.BCP 47 language tag controlling the checkout UI language (e.g.
"is", "en"). Defaults to the customer’s browser locale.When
true, prompts the customer to save their payment method for future use.Your own reference string for this session — an order ID, invoice number, or similar.
Set of key-value pairs to attach to the session. Values must be strings.
- Hosted
- Embedded
url returned in the response. After checkout, Borga redirects them to your return_url with ?session_id=pses_... appended. Retrieve the session on that page to confirm the outcome.Response fields
Unique identifier for the session.
Checkout mode:
"hosted" or "embedded".The hosted checkout URL to redirect your customer to. Present when
mode is "hosted", null otherwise.Secret used to initialise the embedded checkout element. Present when
mode is "embedded", null otherwise.Session status. One of
open, complete, expired.ID of the payment associated with this session.
ISO 8601 timestamp after which the session can no longer be used to complete checkout.
Retrieve a payment session
GET /v1/payment_sessions/{id}
Retrieves an existing payment session. Call this endpoint from your server after the customer returns to your return_url to confirm the payment outcome before fulfilling the order.
Path parameters
The ID of the payment session to retrieve.
Response fields
Unique session identifier.
Checkout mode:
"hosted" or "embedded".Hosted checkout URL.
null for embedded sessions.Embedded checkout secret.
null for hosted sessions.Session status. One of
open, complete, expired.ID of the associated payment.
ISO 8601 expiry timestamp.