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

# Requery Transaction

> Check the current status of a previously initiated transaction. Use this when a webhook is missed or a purchase returned 'pending'.

## Request

**Authorization** `string` *required*

Bearer token: `Bearer <api-key>`

**Content-Type** `string` *required*

`application/json`

**reference** `string` *required*

The `reference` value submitted in the original `POST /purchase` request. E.g. `RTU-DATA-20261003-AB12CD`

```bash cURL theme={null}
curl --request POST \
  --url https://api.rapidtopup.com.ng/api/v2/b2b/requery \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "reference": "YOUR_UNIQUE_REF_001"
  }'
```

```javascript JavaScript (Fetch) theme={null}
const response = await fetch('https://api.rapidtopup.com.ng/api/v2/b2b/requery', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Authorization': 'Bearer <api-key>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    reference: 'YOUR_UNIQUE_REF_001',
  }),
});

const data = await response.json();

if (data.status === 'success') {
  console.log(data.data.status); // "success" or "failed"
} else if (data.status === 'pending') {
  console.log(`Retry after ${data.retry_after} seconds`);
}
```

```php PHP (Guzzle) theme={null}
<?php

use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('POST', 'https://api.rapidtopup.com.ng/api/v2/b2b/requery', [
    'headers' => [
        'Accept'        => 'application/json',
        'Authorization' => 'Bearer <api-key>',
        'Content-Type'  => 'application/json',
    ],
    'json' => [
        'reference' => 'YOUR_UNIQUE_REF_001',
    ],
]);

$data = json_decode($response->getBody(), true);

if ($data['status'] === 'success') {
    echo $data['data']['status']; // "success" or "failed"
} elseif ($data['status'] === 'pending') {
    echo "Retry after " . $data['retry_after'] . " seconds";
}
```

***

## Response

**status** `string`

`success`, `pending`, or `error`

**message** `string`

Human-readable status message.

**data** `object`

Present on `success` status. Contains the full transaction object.

**data fields**

**reference** `string`

The transaction reference.

**status** `string`

`success`, `pending`, or `failed`

**amount** `string`

Amount deducted in NGN.

**token** `string | null`

Electricity token or education PIN if applicable.

**units** `string | null`

Energy units in kWh for electricity purchases if applicable.

**receipt\_number** `string | null`

Official transaction receipt number if applicable.

**created\_at** `string`

ISO 8601 timestamp of transaction creation.

**updated\_at** `string`

ISO 8601 timestamp of the last status update.

**retry\_after** `number`

Present on `pending` responses. Seconds to wait before calling `/requery` again.

**✅ Transaction Confirmed `200`:**

```json theme={null}
{
  "message": "Synchronization completed.",
  "status": "success",
  "data": {
    "reference": "RTU-DATA-20261003-AB12CD",
    "type": "electricity",
    "phone_number": "04012345678",
    "amount": "5000.00",
    "status": "success",
    "token": "47133458396693522090",
    "units": "13.3",
    "receipt_number": "RCT17910630...",
    "created_at": "2026-10-03T08:00:00.000000Z",
    "updated_at": "2026-10-03T08:01:15.000000Z"
  }
}
```

**⏳ Still Processing `202`:**

```json theme={null}
{
  "message": "Transaction is still being processed by the provider. Please wait a moment before syncing.",
  "status": "pending",
  "retry_after": 45
}
```

> [!NOTE]
>
> The `retry_after` field tells you how many seconds to wait before calling `/requery` again. Respect this value — polling too aggressively may consume your rate limit.

> [!WARNING]
>
> If status returns `failed`, the transaction did not go through and your wallet has been **automatically refunded**. It is now safe to retry the purchase with a new `reference`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.