Authorization header of each request. Requests without a valid key are rejected before they reach any endpoint. There are two key types — one for server-side calls and one for browser-side flows — and you should never mix them up.
Key types
Borga issues two distinct key types, each with a different scope and environment variant.
Secret keys have full API access and must only ever appear in server-side code — environment variables, secrets managers, or backend configuration files. Publishable keys have a restricted scope limited to initiating embedded checkout sessions, making them safe to include in browser-side JavaScript.
Passing your secret key
Include your secret key as a Bearer token in theAuthorization header of every request:
curl
Merchant ID header
Most Borga endpoints require anX-Merchant-Id header identifying which merchant account the request is for. Your Merchant ID has the format mer_… and is visible in the dashboard under Settings → API Keys.
You can also retrieve it programmatically:
curl
The
GET /v1/merchants/current endpoint does not require the X-Merchant-Id header — it infers the merchant from the API key itself. Use it to look up your Merchant ID during initial setup.Idempotency
Network failures can leave you uncertain whether a request was processed. To safely retry aPOST request without risking duplicate charges, include an Idempotency-Key header with a unique string (a UUID works well). Borga stores the result of the first request and returns the same response for any subsequent requests with the same key, without executing the operation again.
curl
Test vs. live mode
The key prefix determines the mode of every request:sk_test_…— test mode. No real charges are made. Card numbers, payments, and invoices are all simulated. Use this during development and staging.sk_live_…— live mode. Requests process real ISK charges immediately.
Authentication errors
A
401 response body looks like this:
error.message field for a human-readable explanation before contacting support.