Skip to content
Developer guide

Buyer consent before payment

Explicit API version opt-in; required for hosted checkout and merchant links.

Context and key considerations
Compatibility: without a version header, or with Key2Pay-Version: 2026-05-01, direct API payments retain HTTP 200, a real transactionId and payment instructions. For this guide send Key2Pay-Version: 2026-10-12 and implement the buyer redirect first. Do not enable the new version in clients that only support the old contract. Hosted checkout and merchant links require acceptance under either version.
1 / 3

Create → accept → pay

POST /payments returns 201 awaiting_consent and a sessionId; no transaction exists and the provider has not been called. Redirect the buyer to the Key2Pay checkoutUrl. The buyer reviews the amount, currency, method and terms and explicitly accepts before payment is initiated.

json
{
  "sessionId": "cs_example",
  "transactionId": null,
  "status": "awaiting_consent",
  "consentRequired": true,
  "checkoutUrl": "https://sandbox.key2pay.ai/checkout/cs_example",
  "amount": 600,
  "currency": "USD"
}

The same rule applies to every method, including Boleto, PIX, SPEI, cards and redirect payments. hostedCheckout: false, an API key or a consent field cannot bypass this step. Optional document policies do not disable buyer acknowledgement.

Key2Pay Developer documentationAPI v1
Documentation
Dashboard