Skip to main content
After checkout submits, read the transaction until nextAction.type is payment_submitted or order.outcome is confirmed. Then show the buyer the merchant’s confirmation.

Read the transaction

maxWaitSeconds (up to 25) holds the call open until something changes. since is the version from your last read. Reading never pays. It asks the merchant only while the merchant is completing the order. An agent on the MCP tools reads with sapiom_get_transaction.

After the card is sent

Once the card reaches the merchant’s payment processor, nextAction.type is payment_submitted. Your agent stops reading and never pays again for this transaction. For a UCP checkout, your backend gets the confirmation.

When you can buy again

If the transaction reads payment_submitted, or its order.outcome is confirmed or unknown, the card can be with the merchant. Never buy again for it. A card payment that reads blocked with reason: payment_ended ended before Sapiom sent the card. The most frequent cause of payment_ended is an expired approval. The placeholder card works for about one hour after the buyer approves. Get the approval when your browser worker is ready to pay.

Order outcome

For a UCP checkout, order.outcome comes from the merchant’s checkout. After payment_submitted, it changes only when your backend refreshes the checkout. A browser checkout has no order outcome: order is null. The merchant’s page is the only confirmation, so tell the buyer what it showed.

Show the order confirmation

For a UCP checkout, the merchant’s completed checkout is the order confirmation. After payment_submitted:
  1. Refresh the checkout every 5 seconds or more until order.outcome is confirmed.
  2. Read the transaction.
  3. Show the buyer what’s in order.
A field the merchant didn’t send is null, and links is empty. Show only what’s there. Sapiom drops any link that isn’t https. Other outcomes carry only outcome.
MCP results carry the same fields. If the order never confirms, tell the buyer the payment went through and to check the merchant’s email. Never buy again.

Refresh the checkout

For a UCP checkout only. Your backend calls refresh with the buyer’s key when nextAction.type is reconcile_checkout, or after payment_submitted to get the confirmation. Then your agent reads the transaction again:

Recover without buying twice

Error formats and codes are in Errors.