kepa
Server-side payments/chargePaymentMethod

Charge a saved payment method

Preview

Charge a saved card server-side, without the cardholder present.

POST/v1/cnp/payment-methods/{id}/charge
Charge a stored payment method server-side — recurring billing, top-ups, any merchant-initiated payment off a card the customer set up earlier. For a cardholder-present online payment use a checkout session instead.
Path parameters
idstringRequired

The payment method (`pm_...`).

Request body

application/json

amountMinorintegerRequired
Example 1999
currencyCodestringRequired
Example "USD"
merchantInitiatedboolean

True for a payment the customer is not present for (rebill, top-up).

Example true
reasonenum
recurringunscheduledincremental
Example "recurring"
descriptionstring
Example "Pro plan — March"

Response

application/json

idstringRequired
Example "0195d46e-7088-7cc4-a9b2-5f9273cd63b8"
merchantIdstringRequired
Example "mch_123"
customerIdstring
Example "cus_123"
terminalIdstring
Example "TID-00012345"
amountMinorintegerRequired
Example 1999
currencyCodestringRequired
Example "USD"
statusenumRequired
REQUIRES_PAYMENT_METHODREQUIRES_CONFIRMATIONPROCESSINGSUCCEEDEDDECLINEDREQUIRES_ACTIONCANCELED
clientSecretstring

Returned on create responses; pass only to the browser client for this payment.

Example "pi_0195d46e_secret_example"
paymentIdstring

Payment ID, present after the charge has been sent for authorization.

Example "0195d46e-7088-7cc4-a9b2-5f9273cd63b8"
paymentstring

Payment details, present after authorization.

setupFutureUsageenum
OFF_SESSIONON_SESSION
descriptionstring
metadataobject
createdAtstring · ISO 8601Required
Example "2026-04-09T09:14:22Z"

chargePaymentMethod

POSTGo API
https://api.kepapay.co/v1/cnp/payment-methods/{id}/charge
Request
curl https://api.kepapay.co/v1/cnp/payment-methods/{id}/charge \
  -H "X-Api-Key: $KEPA_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "amountMinor": 1999,
  "currencyCode": "USD",
  "merchantInitiated": true,
  "reason": "recurring",
  "description": "Pro plan — March"
}'
Response
{
  "id": "0195d46e-7088-7cc4-a9b2-5f9273cd63b8",
  "merchantId": "mch_123",
  "customerId": "cus_123",
  "terminalId": "TID-00012345",
  "amountMinor": 1999,
  "currencyCode": "USD",
  "status": "REQUIRES_PAYMENT_METHOD",
  "clientSecret": "pi_0195d46e_secret_example",
  "paymentId": "0195d46e-7088-7cc4-a9b2-5f9273cd63b8",
  "payment": {
    "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"
  },
  "setupFutureUsage": "OFF_SESSION",
  "description": "string",
  "metadata": {},
  "createdAt": "2026-04-09T09:14:22Z"
}