> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v2.reeple.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay with a card

> Card payload shapes for 3-D Secure, no-auth and saved-card charges

The card payload for [Pay an order](/api-reference/orders/pay-order). Which authentication path
the customer takes depends on the card and on the optional `authOption` field.

## Endpoint

```
POST https://api-v4.reeple.ai/charge/order/pay
```

Authenticate with your **public key**. See [Authentication](/api-reference/authentication).

## Payload (before encryption)

| Field           | Type   | Description                                    |
| --------------- | ------ | ---------------------------------------------- |
| `reference`     | String | **Required.** The order reference.             |
| `paymentoption` | String | **Required.** `C` for card.                    |
| `country`       | String | Optional. Two-letter country code of the card. |
| `card`          | Object | **Required.** See [Card object](#card-object). |

### Card object

| Field         | Type    | Description                                                                  |
| ------------- | ------- | ---------------------------------------------------------------------------- |
| `cardnumber`  | String  | **Required**, unless charging a saved card. Digits only, no spaces.          |
| `expirymonth` | String  | **Required**, unless charging a saved card. Two digits, e.g. `03`.           |
| `expiryyear`  | String  | **Required**, unless charging a saved card. Two digits, e.g. `28`.           |
| `cvv`         | String  | **Required**, unless charging a saved card.                                  |
| `savedCardId` | Number  | **Required** when charging a saved card. Replaces all four fields above.     |
| `saveCard`    | Boolean | Optional. `true` saves the card for reuse after a successful charge.         |
| `authOption`  | String  | Optional. `NOAUTH` skips the authentication step where the card supports it. |

<Warning>
  Card details go inside the [encrypted](/encryption) payload — they are never sent in plain
  JSON. Encrypt on your **server**, not in the browser, so card data stays off your frontend
  and out of your logs.
</Warning>

## 3-D Secure (the default)

The usual path: the customer is redirected to their bank to authenticate.

```json theme={null}
{
  "reference": "order-2026-0001",
  "paymentoption": "C",
  "country": "NG",
  "card": {
    "cardnumber": "5346712000061350",
    "expirymonth": "03",
    "expiryyear": "28",
    "cvv": "573"
  }
}
```

The response carries a `redirectUrl` — send the customer there.

```json theme={null}
{
  "data": {
    "paymentDetail": {
      "redirectUrl": "https://payment-v2.reeple.ai/redirect?t=aHR0cHM6Ly9jb3JlL...",
      "recipientAccount": null,
      "paymentReference": "CPD5A4DAA8-C363-4179-A52F-0E8604F72494"
    },
    "orderPayment": {
      "statusId": 2,
      "orderPaymentResponseCode": "02",
      "orderPaymentResponseMessage": "pending-authenticaion",
      "totalAmount": 530,
      "fee": 30
    }
  },
  "status": "success",
  "statusCode": "02",
  "message": "pending-authenticaion"
}
```

<Warning>
  `pending-authenticaion` means the customer has **not** paid yet. Poll
  [Get order status](/api-reference/orders/get-order-status) until `isFinalStatus` is `true`.
</Warning>

## Saving a card at charge time

Add `saveCard` to the card object. The card is only saved if the charge succeeds.

```json theme={null}
{
  "reference": "order-2026-0001",
  "paymentoption": "C",
  "country": "NG",
  "card": {
    "cardnumber": "5346713000061350",
    "expirymonth": "06",
    "expiryyear": "26",
    "cvv": "049",
    "saveCard": true
  }
}
```

<Note>
  If the customer only decides to save the card *after* seeing the payment succeed, use
  [Save a card](/api-reference/orders/save-card) instead.
</Note>

## Skipping authentication

Some cards support charging without a step-up. Set `authOption` to `NOAUTH`.

```json theme={null}
{
  "reference": "order-2026-0001",
  "paymentoption": "C",
  "country": "NG",
  "card": {
    "cardnumber": "5346712100061350",
    "expirymonth": "10",
    "expiryyear": "27",
    "cvv": "123",
    "authOption": "NOAUTH"
  }
}
```

<Warning>
  `NOAUTH` is a request, not a guarantee — the issuer can still require authentication, in which
  case you get a `redirectUrl` back as normal. Always handle both outcomes. Skipping
  authentication also shifts chargeback liability towards you.
</Warning>

## Charging a saved card

Send only `savedCardId`. The id comes from the `savedCards` array in the
[create-order](/api-reference/orders/create-order) response.

```json theme={null}
{
  "reference": "order-2026-0002",
  "paymentoption": "C",
  "country": "NG",
  "card": {
    "savedCardId": 1
  }
}
```

<Note>
  For recurring or off-session billing, where there is no customer present to complete a
  step-up, use [Tokenized charge](/api-reference/tokenized/tokenized-charge) with your secret
  key instead.
</Note>

## Common errors

| Code  | Message                                                     | Cause                                         |
| ----- | ----------------------------------------------------------- | --------------------------------------------- |
| `13`  | `Order not found at the moment`                             | The `reference` doesn't match an order        |
| `13`  | `Order payment is currently pending`                        | A payment for this order is already in flight |
| `400` | `Something went wrong while trying to decrypt your payload` | See [Encryption](/encryption#troubleshooting) |

## Testing

Test card numbers for each authentication path are issued with your sandbox credentials. See
[Sandbox testing](/sandbox-testing#test-cards).
