Skip to main content
POST
Create a transaction
For a Sapiom Pay transaction, send requestFacts with source: "ucp-checkout", version: "v1" and the merchant’s origin in request.merchantOrigin, plus funding.source: "external_card". Omit funding.paymentCardId to use the buyer’s default card. Then open the merchant checkout with Open the checkout.

Authorizations

x-api-key
string
header
required

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

Headers

x-idempotency-key
string
required

Body

application/json
requestFacts
object

For a transaction: source is ucp-checkout, version is v1, and request.merchantOrigin is the merchant's origin. request.estimate is your optional expected total.

Example:
funding
object

How a UCP checkout is paid. Each final merchant total is paid with this card, authorized together with governance; the authorized transaction's payment carries the placeholder card to submit. Only for ucp-checkout request facts, and never with paymentData.

shipping
object

For one UCP checkout: the shipping address and contact the checkout driver fills into the merchant checkout wherever the agent's create or update leaves them out: the contact and the address's name as buyer, and the address as the destination of a shipping method that has none (or of a new shipping method, when the request has no fulfillment). Anything the agent sends wins. Only for ucp-checkout request facts.

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

Current approval or payment action; its navigation link is derived at read time

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