Skip to main content
POST
Pick purchase.type by merchant. Call Check a merchant first: when status is supported, send ucp_checkout. For any other merchant, send browser_checkout. Both need a browser session with Browser Pay attached to enter the card.

Authorizations

x-api-key
string
header
required

Your platform key for buyer management, or a buyer key for everything else.

Headers

Idempotency-Key
string

Your unique ID for this transaction. A retry with the same key returns the same transaction instead of buying twice. Required for a ucp_checkout. The older spelling x-idempotency-key still works; sending both with different keys returns 400 invalid_request.

Body

application/json
purchase
UCP checkout · object
required

What the transaction buys. Each type takes only its own fields.

Example:
funding
object
required

The buyer's card that pays. Omit paymentCardId to use the buyer's default card.

shipping
object

Only with ucp_checkout: the address and contact Sapiom fills into the merchant checkout wherever checkout leaves them out. Anything in checkout wins. Refused with browser_checkout; enter the address on the checkout page.

returnUrl
string

Return destination after hosted approval and card confirmation. Must use an origin or app scheme registered by the organization.

Maximum string length: 2048
metadata
object

Additional metadata for the transaction

Response

Transaction created successfully

id
string
required

Transaction ID

Example:

"123e4567-e89b-12d3-a456-426614174000"

tenantId
string
required

Organization ID

Example:

"123e4567-e89b-12d3-a456-426614174000"

serviceName
string
required

Service identifier

Example:

"openai"

actionName
string
required

Action being performed

Example:

"completion"

resourceName
string
required

Resource being accessed

Example:

"gpt-4"

status
enum<string>
required

Transaction status

Available options:
pending,
preparing,
waiting_approval,
authorized,
completed,
denied,
cancelled,
needs_revision
Example:

"authorized"

requiresPayment
boolean
required

Whether the transaction requires payment

Example:

true

createdAt
string<date-time>
required

Creation timestamp

Example:

"2024-01-01T00:00:00.000Z"

updatedAt
string<date-time>
required

Last update timestamp

Example:

"2024-01-01T00:00:00.000Z"

returnUrl
string | null

Integrator-provided return destination for hosted transaction steps

nextAction
object

The next step in one vocabulary (type + actor: wait, buyer_security_code, approval, payment_ready, closed, …), always present for a purchase. For a transaction that buys nothing, only an approval or security-code step, absent when nobody needs to act. Links are derived at read time.

purchase
object

For a purchase: what is bought, from whom, for how much, and who said so (assertedBy: merchant for the merchant's own checkout answer, agent for the agent's unchecked statement). Read from durable records; absent for a transaction that buys nothing.

Example:
order
object | null

For a purchase: the merchant-confirmed order outcome (confirmed, not_confirmed, unknown). With confirmed, the merchant's confirmation from its completed answer, for the platform to show the cardholder: id, label (the order number the buyer sees), permalinkUrl (the order on the merchant's site) and links (its refund, shipping, terms, privacy and contact pages, { type, url, title? }), each null or empty when the merchant sent none. Null for a browser purchase, which has no order confirmation.

Example:
version
string

For a purchase: changes whenever anything the caller acts on changes. Pass it back as since to wait for the next change.

approvals
object

Approval obligations and linked successor attempts; inspect an approval for current authority

serviceId
string | null

Service entity ID (foreign key reference)

Example:

"123e4567-e89b-12d3-a456-426614174000"

qualifiers
object

Additional qualifiers for the transaction

Example:
metadata
object

Additional metadata for the transaction

authorizedAt
string<date-time>

Authorization timestamp

Example:

"2024-01-01T00:00:00.000Z"

completedAt
string<date-time>

Completion timestamp

Example:

"2024-01-01T00:00:00.000Z"

outcome
enum<string>

Transaction outcome (set when completed)

Available options:
success,
error
Example:

"success"

currentPaymentTransactionId
string | null

Current payment transaction ID if transaction requires payment

Example:

"123e4567-e89b-12d3-a456-426614174000"

payment
object

Payment transaction details when transaction requires payment

trace
object

Trace information for workflow grouping

agentId
string | null

Agent ID if transaction is associated with an agent

Example:

"123e4567-e89b-12d3-a456-426614174000"

agent
object

Agent information if transaction is associated with an agent