For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a Payment Session

New endpoint available

POST /v1/user/payments is now the recommended way to create onramp sessions.

The previous endpoint POST /v1/user/onramp/get_url remains available but for new integrations should use POST /v1/user/payments.

Create a payment session

post

Creates a payment session. ON_RAMP returns a hosted widget link; OFF_RAMP is accepted in the contract but returns 501 in Phase 1. country and currency_id are always mandatory. For ON_RAMP, amount, fiat_currency and redirect_url are also mandatory and are locked into the hosted widget. custom_wallet_address requires the merchant's allow_custom_external_wallet flag.

Body

Request to create a payment session (ON_RAMP today; OFF_RAMP returns 501)

amountstring · decimalOptional

Required for ON_RAMP; locked in the widget.

countrystringRequired

ISO 3166-1 alpha-2 country code. REQUIRED — no default.

currency_idstring · uuidRequired

Target currency id.

custom_wallet_addressstringOptional

Self-custody destination. Only honoured when the merchant flag is on.

fiat_currencystringOptional

ISO 4217 fiat currency (3-letter). Required for ON_RAMP; locked in the widget.

metadataobjectOptional

Free-form merchant metadata.

payment_typestring · enumRequired

ON_RAMP returns a hosted widget link. OFF_RAMP is accepted but returns 501 in Phase 1.

Possible values:
redirect_urlstringOptional

URL the hosted widget redirects the user to on completion. Required for ON_RAMP; must start with http:// or https://.

session_referencestringOptional

Merchant's own id for this session; echoed back in webhooks.

themestring · enumOptional

Widget theme. Optional; defaults to dark.

Default: darkPossible values:
user_reference_idstringOptional

Merchant's stable player id. Required unless custom_wallet_address is supplied.

Responses
200

Created payment session

application/json

A created payment session

correlation_keystringRequired

Server-generated key, also the provider's externalSessionId.

expires_atstring · date-time · nullableOptional

Link expiry. Null until a self-imposed TTL is introduced.

linkstringRequired

Provider-hosted URL the user is sent to.

post/v1/user/payments
POST /v1/user/payments HTTP/1.1
Host: gateway.stage.pay.io
Content-Type: application/json
Accept: */*
Content-Length: 235

{
  "amount": "250",
  "country": "US",
  "currency_id": "c872e749-fd56-533e-b01f-de87ae38e7f1",
  "fiat_currency": "EUR",
  "payment_type": "ON_RAMP",
  "redirect_url": "https://example.com/deposit-complete",
  "theme": "dark",
  "user_reference_id": "hub_player_2"
}
{
  "correlation_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479:order_9981",
  "expires_at": null,
  "link": "https://onramp.example.com/session/abc123..."
}

Last updated