Skip to content

Select Payment Method

Select a payment method for a checkout session. Returns the payment details the customer needs to complete the transfer.

POST /v1/checkout/session/:sessionId/payment-method

Required permission: checkout

Authentication

Requires an API key. Origin/domain validation is enforced for public keys.

Path parameters

ParameterTypeDescription
sessionIdstringThe checkout session ID

Request body

ParameterTypeRequiredDescription
payment_methodstringYes"bank_transfer" or "payid"

Example request

bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/payment-method \
  -H "Content-Type: application/json" \
  -H "x-api-key: pk_test_your_public_key" \
  -d '{"payment_method": "bank_transfer"}'

Response — Bank Transfer

When payment_method is "bank_transfer", a temporary virtual account is created:

json
{
  "success": true,
  "data": {
    "payment_method": "bank_transfer",
    "account_number": "5000973258",
    "bank_name": "VFD Microfinance Bank",
    "account_name": "Your Business Name",
    "amount": 500000,
    "expires_at": "2026-03-07T19:37:00.000Z"
  }
}
FieldTypeDescription
payment_methodstringAlways "bank_transfer"
account_numberstringVirtual account number for the transfer
bank_namestringAlways "VFD Microfinance Bank"
account_namestringMerchant's business name (or "ZevPay Checkout" if not configured)
amountintegerAmount in kobo the customer should transfer
expires_atstringISO 8601 timestamp — when the virtual account expires

Response — PayID

When payment_method is "payid", a dynamic PayID is created:

json
{
  "success": true,
  "data": {
    "payment_method": "payid",
    "pay_id": "5de2.dypid",
    "qr_data": "https://zevpay.me/5de2.dypid",
    "amount": 500000,
    "expires_at": "2026-03-07T19:37:00.000Z"
  }
}
FieldTypeDescription
payment_methodstringAlways "payid"
pay_idstringDynamic PayID for the payment
qr_datastringURL for QR code generation (https://zevpay.me/{payId})
amountintegerAmount in kobo
expires_atstringISO 8601 timestamp — when the dynamic PayID expires

Behavior

  • Calling this endpoint multiple times for the same method reuses the existing virtual account or PayID (as long as it's still active/pending)
  • Switching methods (e.g., from bank_transfer to payid) logs a method_switched event and increments the attempt counter
  • The session must be active — expired, completed, or failed sessions return an error

Errors

StatusMessageCause
400Session is {status}.Session is not active (e.g., "Session is completed.")
400Session has expired.Session's expiry time has passed
400Unsupported payment method:Invalid payment_method value
400Session does not belong to this API key.API key mismatch
401Invalid API keyKey not found or inactive
404Session not found.Invalid session ID

Try it

API Playground
POSThttps://api.zevpaycheckout.com/v1/checkout/session/:sessionId/payment-method

ZevPay Checkout Developer Documentation