Skip to main content
POST
Update a purchase

Authorizations

x-api-key
string
header
required

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

Headers

Idempotency-Key
string
required

Your unique ID for this change. Use a new key for each change. Reuse a key only to resend the same body.

Path Parameters

transactionId
string
required

Body

application/json
version
string
required

The latest purchase version returned by a transaction read.

checkout
object

Full replacement UCP checkout without payment data. Send this or purchase, never both.

purchase
object

Full replacement browser purchase, in the create purchase shape. Merchant and currency are fixed. No funding argument is accepted.

Response

The current transaction after acceptance; follow nextAction.

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

Your 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

The purchase details and their source (assertedBy). UCP uses merchant throughout the purchase, including while checkout details are pending. Browser purchases use agent for the caller's statement. For a UCP purchase, a merchant.nameSource of caller identifies an optional display name supplied at create. The purchase is 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 user: id, label (the order number the user 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, or as version when updating this purchase. A browser version includes its accepted revision and payment attempt.

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