Skip to main content
POST
Cancel a transaction

Authorizations

x-api-key
string
header
required

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

Headers

Idempotency-Key
string

Optional. Sapiom sends it with the merchant cancel. Reuse it when you retry.

Path Parameters

transactionId
string
required

Response

The cancelled transaction

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). Null for a browser purchase, which has no order confirmation.

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