Skip to main content
POST
Create a setup session

Authorizations

Authorization
string
header
required

Backend secret key for hosted setup; Agent secret key for card inventory and every spending-request operation. A delegated request also selects the authorized business through Ionic-Account. Machine keys cannot approve requests.

Headers

Ionic-Account
string

Required for delegated Connect requests; omit for direct business requests. Selector is not authorization.

Pattern: ^mer_[A-Za-z0-9]{14}$
Idempotency-Key
string
required

Stable opaque key. Same body/key retries only. Claim key is bound permanently to the intent issuance; no second key can remint.

Required string length: 16 - 255
Pattern: ^[\x21-\x7e]+$

Body

application/json
label
string
Required string length: 1 - 100
Pattern: .*\S.*
return_url
string

Absolute HTTPS URL; no userinfo, port, query, fragment or whitespace. Return destinations require registration where specified. Seller pre-registration is not required when the caller supplies allowed_hosts.

Required string length: 10 - 2048
Pattern: ^https://[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?:/[^\s?#]*)?$

Response

Returned when you retry with the same Idempotency-Key. The body is the existing object.

id
string
required
Pattern: ^sps_[A-Za-z0-9]{14}$
object
enum<string>
required
Available options:
spend.setup_session
account_id
string
required
Pattern: ^mer_[A-Za-z0-9]{14}$
livemode
boolean
required
status
enum<string>
required
Available options:
pending,
completed,
expired,
canceled
url
string | null
required

Absolute HTTPS URL; no userinfo, port, query, fragment or whitespace. Return destinations require registration where specified. Seller pre-registration is not required when the caller supplies allowed_hosts.

Required string length: 10 - 2048
Pattern: ^https://[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?:/[^\s?#]*)?$
card_id
string | null
required
Pattern: ^spcard_[A-Za-z0-9]{14}$
created
integer<int64>
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0
expires_at
integer<int64>
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0