DOCS Live

Merchants

Card payment

Take a card through the acquirer's own fields, handle the customer's verification step, and capture or release an authorisation.

Card details never pass through your systems or KulPay's API: the customer types them into the acquirer's hosted fields, on KulPay's checkout page or embedded in yours, which give back a token. You charge the token. A card number sent to the API is refused.

Some cards ask the customer to verify the payment with their bank (3-D Secure): the charge then answers requires_action with a page to send them to. And some arrangements authorise first and capture later: the money is held on the card until you capture or release it.

Before you start

Your application, a key with payments:write and payments:read, a card acquirer connected (Setting up) or KulPay's, and a webhook endpoint for payment.*. The simplest way is the hosted checkout, which does all of this page for you.

The flow at a glance

#WhoWhat happens
1CustomerTypes the card into the acquirer's hosted fields; your page gets a token.
2Your systemCharges the token.
3CustomerVerifies with their bank when asked (3-D Secure), then returns to your page.
4Your systemTells KulPay the step is done, and reads the result.
5Your systemCaptures or releases an authorised payment.

1. Charge the card token

Your system.

POST /charges · API reference

source.type is card with the acquirer's token. The answer is succeeded, failed, authorized (held, to capture later) or requires_action with next_action.type redirect_to_url: send the customer to redirect_url for their bank's verification.

Request

{
  "payment_id": "ord-2026-10-22-000983",
  "money": {
    "amount": "1500.00",
    "currency": "MZN"
  },
  "source": {
    "type": "card",
    "card": {
      "token": "tok_…"
    }
  },
  "customer": {
    "email": "ana@example.co.mz"
  },
  "country": "MZ",
  "return_url": "https://shop.example.co.mz/orders/983/return"
}

2. Complete the customer's step

Your system, when the customer comes back to your `return_url`.

POST /charges/{id}/complete-action · API reference

Tells KulPay the customer finished the bank's step; the answer carries the result. For a one-time code your page collected, send it as otp.

3. Capture an authorisation

Your system, when you ship or confirm the order.

POST /charges/{id}/capture · API reference

Takes the money held by an authorized payment: all of it, or less (partial capture).

Request

{
  "amount": {
    "amount": "1200.00",
    "currency": "MZN"
  }
}

4. Or release it

Your system, when the order is cancelled before capture.

POST /charges/{id}/void · API reference

Releases the held money. Only for payments still authorized.

States

StateWhat it means
requires_action

The customer must verify with their bank.

authorized

Held on the card. Capture or void it.

succeeded

Paid (captured).

voided

The authorisation was released.

failed

Declined.

When the money moves

A succeeded payment is paid. An authorized one is only held on the customer's card until you capture it; if you never capture, it is eventually released by the card scheme.

Events

EventWhat it tells you
payment.requires_action

The customer has a step to complete.

payment.authorized

Held; capture or void it.

payment.succeeded

Paid.

payment.failed

Declined.

Errors that matter here

Every error is application/problem+json with a stable code; branch on the code, not the message. The full list is in the error catalogue.

ErrorWhenWhat to do
400 raw_card_data_not_accepted

A card number or CVC was sent.

Use the acquirer's hosted fields and send only the token.

409 invalid_state

Capture or void on a payment that is not authorized.

Read the payment first.

Testing it

Test cards and their tokens are listed in the integration guide: one succeeds, others decline or ask for verification. In test mode a card number is accepted and turned into its test token.


All flows · API reference · Error catalogue