Headless Transaction API
Walk through the full escrow lifecycle using the /api/partner/transactions/* endpoints. These are for partners building their own UI on top of XValuePay — no hosted checkout or embed involved. Requires your API key to have the portal:act_on_behalf_of scope.
Walkthrough state
Values extracted from each step's response and reused in subsequent calls.
sessionToken: —transactionUuid: —paymentUuid: —
1Create checkout session
Partner creates a checkout session server-side. In headless mode this seeds the transaction data but does not yet create the Transaction row.
POST/partner/checkout/sessions
2Initiate transaction (from session)
Use the standard /transactions/initiate endpoint with checkoutSessionToken. This creates the Transaction row and links it to the session. In a full portal flow, the seller would accept first — headless mode lets the partner bypass that.
POST/transactions/initiate
3Buyer: initiate payment (on behalf of)
POST /api/partner/transactions/:uuid/buyer/pay — requires scope portal:act_on_behalf_of. The partner is acting as the buyer to start the payment flow.
POST/partner/transactions/undefined/buyer/pay
4Buyer: confirm payment
POST /api/partner/transactions/:uuid/buyer/confirm — after buyer approval (for sandbox, this happens immediately). Advances transaction.Stage to 'funded'.
POST/partner/transactions/undefined/buyer/confirm
5Seller: mark shipped
POST /api/partner/transactions/:uuid/seller/mark-shipped — advances stage to 'delivery' and fires checkout_session.shipped webhook.
POST/partner/transactions/undefined/seller/mark-shipped
6Buyer: mark received (start inspection)
POST /api/partner/transactions/:uuid/buyer/mark-received — transitions to 'inspection' stage and starts the inspection window.
POST/partner/transactions/undefined/buyer/mark-received
7Buyer: accept & release funds
POST /api/partner/transactions/:uuid/buyer/accept-inspection — releases funds to seller via EscrowService and fires checkout_session.inspection_accepted.
POST/partner/transactions/undefined/buyer/accept-inspection