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

# Transaction status

> Check the status of an airtime transfer by transaction ID.

Use `POST /v1/transaction-status` to check the status of a previously submitted airtime transfer.

**Endpoint:** `https://apiairtime.beem.africa/v1/transaction-status`

***

## Request parameters

### Headers

| Header          | Required | Description                                                                       |
| --------------- | -------- | --------------------------------------------------------------------------------- |
| `Authorization` | Yes      | Basic Auth or access token — see [Authentication](/guides/airtime/authentication) |
| `Content-Type`  | Yes      | `application/json`                                                                |

### Body

| Parameter        | Type   | Required | Description                                                     |
| ---------------- | ------ | -------- | --------------------------------------------------------------- |
| `transaction_id` | String | Yes      | Transaction ID returned when the airtime transfer was submitted |

***

## Sample implementations

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={null}
    const axios = require("axios");
    const https = require("https");
    const btoa = require("btoa");

    const api_key = "<api_key>";
    const secret_key = "<secret_key>";
    const url = "https://apiairtime.beem.africa/v1/transaction-status";

    const payload = { transaction_id: "<transaction_id>" };

    axios
      .post(url, payload, {
        headers: {
          "content-type": "application/json",
          Authorization: "Basic " + btoa(api_key + ":" + secret_key),
        },
        httpsAgent: new https.Agent({ rejectUnauthorized: false }),
      })
      .then((resp) => console.log(resp.data))
      .catch((err) => console.log(err.message));
    ```
  </Tab>

  <Tab title="PHP">
    ```php theme={null}
    <?php
    $url = "https://apiairtime.beem.africa/v1/transaction-status";
    $api_key = '<api_key>';
    $secret_key = '<secret_key>';

    $body = ['transaction_id' => '<transaction_id>'];

    $ch = curl_init($url);
    curl_setopt_array($ch, [
      CURLOPT_POST => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
        'Authorization: Basic ' . base64_encode("$api_key:$secret_key"),
        'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode($body),
      CURLOPT_SSL_VERIFYHOST => 0,
      CURLOPT_SSL_VERIFYPEER => 0,
    ]);

    $response = curl_exec($ch);
    if ($response === false) {
      die(curl_error($ch));
    }
    var_dump($response);
    ?>
    ```
  </Tab>

  <Tab title="GitHub">
    [beem-airtime-api-sample — transactionStatus](https://github.com/beemafrica/beem-airtime-api-sample/tree/master/transactionStatus)
  </Tab>
</Tabs>

***

## Success response

**HTTP 200 OK**

```json theme={null}
{
  "code": 100,
  "message": "SUCCESSFUL",
  "args": {
    "timestamp": "2021-06-09T09:21:39.000Z",
    "transaction_id": "1623230499585",
    "reference_id": "12345678",
    "amount": "12345678",
    "dest_addr": "255701000000"
  }
}
```

***

## Error responses

<Tabs>
  <Tab title="Invalid transaction ID">
    **HTTP 400 Bad Request**

    ```json theme={null}
    {
      "code": 400,
      "message": "Invalid Transaction Id"
    }
    ```
  </Tab>

  <Tab title="Invalid authentication">
    **HTTP 401 Unauthorized**

    ```json theme={null}
    {
      "code": 120,
      "message": "Invalid Authentication Parameters"
    }
    ```
  </Tab>

  <Tab title="Missing authorization">
    **HTTP 400 Bad Request**

    ```json theme={null}
    {
      "error": "No authorization headers"
    }
    ```
  </Tab>
</Tabs>
