API/Create a hosted session
v1.0.0-beta.mdGet API keys
Hosted sessions

Create a hosted session

POST /functions/v1/hosted-session-create

Called by your server with a secret key. The session carries merchant, action, reference and amount, so a browser cannot alter a value it never holds.

A publishable pk_ is rejected: minting a session is a server act.

Body

FieldTypeNotes
actionauthorize|checkin|sign|verify|enrollrequired
external_txn_refstring ≤128Required for authorize; charset [\w.:@/-]
amount_centsintegerRequired for authorize; minor unit
currencyISO-4217Defaults to BRL when an amount is present
brandstring ≤40Display label only, sanitized
ttl_seconds60–900Default 300
metadataobject ≤2 KBDisplay and passthrough only
merchant_idstringOptional; must match the key's merchant
curl -X POST https://api.sidaxis.com/functions/v1/hosted-session-create \
  -H "x-sidaxis-api-key: sk_live_..." \
  -H "content-type: application/json" \
  -d '{
    "action": "authorize",
    "external_txn_ref": "order-88213",
    "amount_cents": 18900,
    "currency": "USD",
    "brand": "Northwind",
    "ttl_seconds": 300
  }'

Response

201
{
  "session_token": "hs_9c1f...",
  "session_id": "hss_71ac33",
  "merchant_id": "mrc_9f2c",
  "action": "authorize",
  "external_txn_ref": "order-88213",
  "amount_cents": 18900,
  "currency": "USD",
  "brand": "Northwind",
  "expires_at": "2026-09-16T12:06:03Z",
  "ttl_seconds": 300,
  "single_use": true
}

What this call does not have

No url, no mode, no return_url, no branding block. There is no redirect URL: you hand the token to the browser and open the hosted screen with it, and branding comes from merchant-theme-get.

The security property, plainly: the session carries merchant, action, reference and amount, and it is the session that decides the values the screen shows. The browser never carries the amount, so it cannot alter it.

Errors

StatusCodes
400INVALID_ACTION, INVALID_EXTERNAL_TXN_REF, INVALID_AMOUNT_CENTS, INVALID_CURRENCY, AMOUNT_AND_REF_REQUIRED, INVALID_TTL, INVALID_BRAND, INVALID_METADATA, METADATA_TOO_LARGE
401API_KEY_REQUIRED, INVALID_API_KEY
403MERCHANT_MISMATCH
500SESSION_WRITE_FAILED
Sidaxis is the human authorisation layer. It never moves money, holds funds or settles. The machine-readable contract is openapi.yaml.
Sidaxis API documentationQuickstartAuthenticationHosted or headlessSandbox and productionIdempotencyRate limitsErrors and refusalsField namesWebhooksAssuranceThe document ruleAlias availabilityMerchant themeMCP serverCompatibilityStatusRoadmapChangelogIdentityEnroll an identityRecognise a personDisclose an attributeMandatesThe eight scopesIssue a mandateCheck an actionConsume a mandateRead a mandateRevoke a mandateReceiptsRead a merchant's receiptsVerify a receiptHosted sessionsCreate a hosted sessionConsume a hosted sessionOne Face for agents