kepa
Checkout/retrieveCnpCheckoutSession

Retrieve a checkout session in the browser

Read the current state of a checkout session from the browser.

POST/api/v1/cnp/public/checkout-sessions/{id}/retrieve
Browser-safeCall from the customer’s browser with a publishable key — never your secret key.
kepa.js calls this on load to hydrate the payment form — amount, currency, enabled methods, and whether the session is still open. It takes the session's client secret, not a key with any authority of its own, so it is safe from the browser. Read-only.
Path parameters
idstringRequired

Checkout session identifier.

Request body

application/json

clientSecretstringRequired
Example "cs_7c1b9b86_secret_example"

Response

application/json

sessionobject
intentobject
Good to know
  • Returns the session only while its status is OPEN; a completed or expired session is rejected.
  • The merchant is resolved from the publishable key, so a session belonging to another merchant is never returned.
  • Under heavy load this is shed before money-moving calls — treat a 503 as retryable, not as a failure of the payment.

retrieveCnpCheckoutSession

POSTGo API
https://api.kepapay.co/api/v1/cnp/public/checkout-sessions/{id}/retrieve
Request
curl https://api.kepapay.co/api/v1/cnp/public/checkout-sessions/{id}/retrieve \
  -H "X-Kepa-Publishable-Key: $KEPA_PUBLISHABLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "clientSecret": "cs_7c1b9b86_secret_example"
}'
Response
{
  "session": {
    "id": "7c1b9b86-9764-4e47-b2ac-f3dc4672d4ea",
    "merchantId": "mch_123",
    "paymentIntentId": "0195d46e-7088-7cc4-a9b2-5f9273cd63b8",
    "status": "OPEN",
    "clientSecret": "cs_7c1b9b86_secret_example",
    "successUrl": "https://merchant.example/checkout/success",
    "cancelUrl": "https://merchant.example/checkout/cancel",
    "expiresAt": "2026-04-09T09:14:22Z",
    "createdAt": "2026-04-09T09:14:22Z"
  },
  "intent": {
    "id": "0195d46e-7088-7cc4-a9b2-5f9273cd63b8",
    "merchantId": "mch_123",
    "acceptanceChannel": "CARD_PRESENT",
    "status": "REQUIRES_PAYMENT_METHOD",
    "type": "SALE",
    "captureMethod": "AUTOMATIC",
    "capturedAmountMinor": 0,
    "authExpiresAt": "2026-04-09T09:14:22Z",
    "amountMinor": 2500,
    "baseAmountMinor": 2200,
    "currencyCode": "NZD",
    "tipAmountMinor": 0,
    "tipSource": "preset:1800",
    "cashbackAmountMinor": 0,
    "customerId": "cus_123",
    "referenceId": "POS-INV-20260328-001",
    "authorizationCode": "A12345",
    "responseCode": "00",
    "cardScheme": "VISA",
    "maskedPan": "************1234",
    "rrn": "262803141422",
    "decline": {
      "category": "INSUFFICIENT_FUNDS",
      "retryClass": "NEVER",
      "retryable": true,
      "networkResponseCode": "51",
      "customerMessage": "Your card was declined. Please try another card.",
      "merchantMessage": "Insufficient funds; ask the customer for another payment method."
    },
    "cardPresent": {
      "terminalId": "TID-00012345",
      "entryMode": "CONTACTLESS",
      "acceptanceMode": "KEPA_L2",
      "applicationLabel": "Visa Credit",
      "aid": "A0000000031010",
      "cryptogramType": "TC",
      "tvr": "0000000000",
      "cvmResult": "PIN"
    },
    "cardNotPresent": {
      "paymentIntentId": "pi_123",
      "paymentMethodId": "pm_123",
      "threeDsStatus": "AUTHENTICATED",
      "liabilityShift": true,
      "eci": "05",
      "setupFutureUsage": "OFF_SESSION"
    },
    "settlementId": "stl_01JQDAY00042",
    "metadata": {},
    "createdAt": "2026-04-09T09:14:22Z",
    "updatedAt": "2026-04-09T09:14:22Z"
  }
}