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

# Errors

> Common error response shapes returned by the Reeple Checkout API

Every error response follows the same envelope:

```json theme={null}
{
  "status": "failed",
  "statusCode": "401",
  "message": "api-key was not passed in the header"
}
```

`status` is `failed`, `statusCode` is a **string**, and `message` is safe to log but not to show
to a customer verbatim.

## Common errors

<AccordionGroup>
  <Accordion title="401 — api-key was not passed in the header">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "401",
      "message": "api-key was not passed in the header"
    }
    ```

    The header is missing entirely. It is `api-key` — not `apikey`, `API-Key`, or
    `Authorization`.
  </Accordion>

  <Accordion title="401 — Invalid public key passed">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "401",
      "message": "Invalid public key passed. Please check and try again"
    }
    ```

    The key is unrecognised, belongs to the other environment, or you sent a secret key to an
    endpoint that expects the public one. See
    [Authentication](/api-reference/authentication#which-key-for-which-endpoint).
  </Accordion>

  <Accordion title="401 — Invalid SECRET key">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "401",
      "message": "Invalid SECRET key. Please check and try again"
    }
    ```

    Returned by the secret-key endpoints — verify, refunds, chargebacks, tokenized charge — when
    the key is unrecognised or is a public key.
  </Accordion>

  <Accordion title="400 — Payload could not be decrypted">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "400",
      "message": "Something went wrong while trying to decrypt your payload, please try again or contact support"
    }
    ```

    The `data` field could not be decrypted. Most often the wrong padding (it must be PKCS#1
    v1.5, not OAEP), or an encryption key from the other environment. See
    [Encryption](/encryption#troubleshooting).
  </Accordion>

  <Accordion title="13 — Order not found at the moment">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "13",
      "message": "Order not found at the moment"
    }
    ```

    The `reference` doesn't match an order. Check you're reusing the reference from the
    create-order call rather than generating a new one.
  </Accordion>

  <Accordion title="13 — Order payment is currently pending">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "13",
      "message": "Order payment is currently pending"
    }
    ```

    A payment for this order is already in flight. Poll
    [Get order status](/api-reference/orders/get-order-status) rather than retrying the pay call.
  </Accordion>

  <Accordion title="604 — Payment link not found">
    ```json theme={null}
    {
      "status": "failed",
      "statusCode": "604",
      "message": "Sorry! Cannot find this payment link, check the reference and try again"
    }
    ```

    The payment-link reference is unknown or expired. Payment-link references are issued by
    Reeple and are distinct from your order reference.
  </Accordion>
</AccordionGroup>

<Warning>
  A network failure or gateway error on a pay-order request **does not** mean the payment
  failed — the response may simply have been lost after Reeple processed it. Check the order's
  status before retrying, or you risk double-charging the customer. Retrying a pay call for an
  order that already has one in flight returns `13 — Order payment is currently pending`.
</Warning>
