Skip to main content
POST
Create a spend intent

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

Supply allowed_hosts to request exact card-reveal destinations without seller pre-registration. The business approves these hosts; they are immutable and included in create idempotency. allowed_hosts is required; omitted, null and empty lists are invalid. There is no seller-registry fallback. Caller-selected hosts require CVC at approval and remain test-only. Hosts do not certify merchant legitimacy or enforce merchant account, amount or single use. Redirects never authorize another reveal host. save_card and replace_card remain action_not_enabled. Caller never supplies account, Agent, mode, proxy credentials or approval.

action
enum<string>
required
Available options:
payment
amount
integer
required
Required range: 1 <= x <= 9007199254740991
card_id
string
required
Pattern: ^spcard_[A-Za-z0-9]{14}$
purpose
string
required
Required string length: 1 - 1000
Pattern: .*\S.*
seller
object
required
currency
string
required
Pattern: ^[a-z]{3}$
billing_details
object
required
allowed_hosts
string[]
required

Exact plaintext reveal destinations. Supply 1-20 distinct lowercase public DNS hosts on create to avoid seller pre-registration. Null, empty, wildcard, URL, port, path, IP and local/internal names are rejected. The actual hosts are customer-approved and immutable; redirects do not expand them. Not a whole-browser network allowlist, merchant-legitimacy check, or merchant-account/amount constraint.

Required array length: 1 - 20 elements
Maximum string length: 253
Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$
reference
string
Required string length: 1 - 200
Pattern: .*\S.*
claim_within_seconds
integer
default:300

Seconds after approved_at within which the first claim must complete. Resolved and frozen at creation, shown during approval, and returned on the intent. Does not extend credential TTL. The supported range is 1-300 seconds; a larger valid duration returns HTTP 422 claim_window_unsupported before intent creation. Null and out-of-range values are invalid.

Required range: 1 <= x <= 86400
return_url
string

Optional. Where the Ionic approval page returns the owner after they decide, with spend_intent={id} added. Only a platform's delegated Agent can send it; the origin must be one of the platform's approved origins in this mode (HTTPS; test mode also allows HTTP localhost with a port). No userinfo or fragment. The redirect is not proof of the decision: read the intent or use spend_intent.updated.

Required string length: 10 - 2048

Response

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

Credential/approval state, never merchant payment status. Unknown issuance preserves credential_exposure=possible even after cancellation. Null credential_expires_at means no verified expiry is known, not that exposure ended.

id
string
required
Pattern: ^spi_[A-Za-z0-9]{14}$
object
enum<string>
required
Available options:
spend_intent
account_id
string
required
Pattern: ^mer_[A-Za-z0-9]{14}$
agent_id
string
required
Pattern: ^agt_[A-Za-z0-9]{14}$
livemode
boolean
required
version
integer
required
Required range: x >= 1
action
enum<string>
required
Available options:
payment,
save_card,
replace_card
card_id
string
required
Pattern: ^spcard_[A-Za-z0-9]{14}$
purpose
string
required
Required string length: 1 - 1000
Pattern: .*\S.*
seller
object
required
amount
integer
required
Required range: 0 <= x <= 9007199254740991
currency
string
required
Pattern: ^[a-z]{3}$
billing_details
object
required
reference
string | null
required
Required string length: 1 - 200
Pattern: .*\S.*
status
enum<string>
required
Available options:
pending_approval,
approved,
declined,
claimed,
expired,
canceled,
issuance_unknown,
blocked
allowed_hosts
string[]
required

Exact plaintext reveal destinations. Supply 1-20 distinct lowercase public DNS hosts on create to avoid seller pre-registration. Null, empty, wildcard, URL, port, path, IP and local/internal names are rejected. The actual hosts are customer-approved and immutable; redirects do not expand them. Not a whole-browser network allowlist, merchant-legitimacy check, or merchant-account/amount constraint.

Required array length: 1 - 20 elements
Maximum string length: 253
Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$
approval_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?#]*)?$
return_url
string | null
required

Where a platform's Agent asked the owner be returned after deciding: an absolute URL on one of the platform's approved origins, or null. The Ionic approval page sends the owner there with spend_intent={id}; the redirect is not proof of the decision, so read the intent. Only a platform's delegated Agent can set it.

Required string length: 10 - 2048
created
integer<int64>
required

Unix epoch seconds. Equality with a deadline is expired.

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

Server-selected deadline for the owner to approve a pending intent, in Unix seconds. This deadline does not shorten a claim window that starts after approval.

Required range: x >= 0
approved_at
integer<int64> | null
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0
claimed_at
integer<int64> | null
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0
canceled_at
integer<int64> | null
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0
claim_expires_at
integer<int64> | null
required

approved_at + claim_within_seconds, in Unix seconds; null before approval. Preserve the original deadline in later states. It is independent of the pending-approval deadline; same-key recovery after this deadline remains subject to original credential expiry and current authority.

Required range: x >= 0
credential_expires_at
integer<int64> | null
required

Unix epoch seconds. Equality with a deadline is expired.

Required range: x >= 0
claim_replay_available
boolean
required
credential_exposure
enum<string>
required
Available options:
none,
possible,
issued
claim_within_seconds
integer
default:300
required

Seconds after approved_at within which the first claim must complete. Resolved and frozen at creation, shown during approval, and returned on the intent. Does not extend credential TTL. The supported range is 1-300 seconds; a larger valid duration returns HTTP 422 claim_window_unsupported before intent creation. Null and out-of-range values are invalid.

Required range: 1 <= x <= 86400
approvals
object[]
required

Every required human approval, in decision order. The card owner's approval (business, or owner for a direct Agent) is always present and decides last, except on a blocked request (decision 0110), which no one can decide: there the list is empty.

Maximum array length: 3
limit_breaches
object[]
required

Limits exceeded when evaluated; empty when within every limit. Budgets cap approvals, not merchant charges.

Maximum array length: 30
blocked_at
integer<int64> | null
required

When a blocking limit rule ended the request, in Unix seconds: at creation or at the final approval (decision 0110). Null on every other status.

Required range: x >= 0