> ## 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.

# Verify an order

> Confirm a payment server-side with your secret key before fulfilling

The authoritative answer to "did this order get paid?". Call it from your backend with your
**secret key** before you release goods, credit an account, or mark an order complete.

## Endpoint

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

## Authentication

Authenticate with your **secret key** in the `api-key` header — not your public key.

```
api-key: YOUR_SECRET_KEY
```

<Warning>
  Your secret key must never reach the browser. This endpoint exists precisely so that
  confirmation happens somewhere the customer cannot influence.
</Warning>

## Request body

Plain JSON — this endpoint is **not** encrypted.

| Field       | Type   | Description                                                                                   |
| ----------- | ------ | --------------------------------------------------------------------------------------------- |
| `reference` | String | **Required.** The order reference from [Create an order](/api-reference/orders/create-order). |

```json theme={null}
{ "reference": "order-2026-0001" }
```

## Request example

```bash theme={null}
curl -X POST https://api-v4.reeple.ai/charge/order/verify \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_SECRET_KEY" \
  -d '{ "reference": "order-2026-0001" }'
```

## Response

Returns the order's settled state, in the same shape as
[Get order status](/api-reference/orders/get-order-status).

```json theme={null}
{
  "status": "Successful",
  "statusCode": "00",
  "message": "Transaction was completed successfully",
  "data": {
    "isFinalStatus": true,
    "requeryNeeded": false,
    "orderSummary": {
      "orderReference": "order-2026-0001",
      "totalChargedAmount": 530,
      "fee": 30,
      "statusId": 5,
      "status": "Successful",
      "paymentType": "C",
      "paymentResponseCode": "00"
    }
  }
}
```

## What to check before fulfilling

<Steps>
  <Step title="The status is final and successful">
    `isFinalStatus` is `true` **and** `orderSummary.status` is `Successful`.
  </Step>

  <Step title="The amount matches">
    `totalChargedAmount` is at least what you expected for this order. This protects you if a
    reference is ever replayed or tampered with.
  </Step>

  <Step title="You haven't already fulfilled it">
    Record fulfilment against the reference and make repeat verifications no-ops — you will see
    the same successful response more than once.
  </Step>
</Steps>

<Warning>
  Verify against the reference **you** stored for the order, not one taken from a callback query
  string. A reference supplied by the browser is attacker-controlled until you've matched it to
  one of your own orders.
</Warning>

## Common errors

| Code  | Message                                          | Cause                                               |
| ----- | ------------------------------------------------ | --------------------------------------------------- |
| `401` | `Invalid SECRET key. Please check and try again` | Wrong key type, or a key from the other environment |
| `13`  | `Order not found at the moment`                  | The reference doesn't match an order                |

## Verify or status?

|                     | [Get order status](/api-reference/orders/get-order-status) | Verify an order    |
| ------------------- | ---------------------------------------------------------- | ------------------ |
| Key                 | Public                                                     | **Secret**         |
| Body                | Encrypted                                                  | Plain JSON         |
| Safe from a browser | Yes                                                        | **No**             |
| Use for             | Updating your checkout UI while the customer waits         | Deciding to fulfil |

<Card title="Callbacks and verification" href="/callbacks-and-verification">
  The full server-side verification flow, with a worked example.
</Card>
