kepa
Checkout/createCnpCheckoutSession

Create Checkout Session

Create an HPP, Elements, or Drop-in checkout session.

POST/v1/cnp/checkout-sessions
Create a checkout session tied to a payment intent. For HPP, redirect the browser to /checkout/{id}?client_secret=... For Elements or Drop-in, return the id and clientSecret to your frontend and call kepa.js.

Request body

application/json

merchantIdstringRequired

Merchant identifier.

paymentIntentIdstringRequired

Payment intent ID.

successUrlstringRequired

HTTPS redirect after success.

cancelUrlstringRequired

HTTPS redirect after cancel.

ttlSecondsinteger

Session lifetime, 300–86400 seconds.

Response

application/json

idstring

Checkout session ID.

paymentIntentIdstring

Linked payment intent.

statusenum

Session status.

OPENCOMPLETEDEXPIREDCANCELED
clientSecretstring

Browser client secret for this checkout session.

expiresAtstring · ISO 8601

Expiry timestamp.

Good to know
  • HPP URL shape: /checkout/{checkoutSessionId}?client_secret={clientSecret}
  • Elements and Drop-in use the same session id and client secret with kepa.js.

createCnpCheckoutSession

POSTGo API
https://api.kepapay.co/v1/cnp/checkout-sessions
Request
curl https://api.kepapay.co/v1/cnp/checkout-sessions \
  -H "X-Api-Key: $KEPA_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"merchantId": "mch_123","paymentIntentId": "00000000-0000-0000-0000-000000000001","successUrl": "https://merchant.example/success","cancelUrl": "https://merchant.example/cancel"}'
Response
{
  "id": "11111111-1111-1111-1111-111111111111",
  "paymentIntentId": "00000000-0000-0000-0000-000000000001",
  "status": "OPEN",
  "clientSecret": "hpp_..._secret_...",
  "successUrl": "https://merchant.example/success",
  "cancelUrl": "https://merchant.example/cancel"
}