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

# Buy Airtime

> Send airtime to any mobile number across all major networks in a single Dojah API call.

<div className="dj-endpoint">
  <span className={`dj-method dj-method-post`}>POST</span>
  <code>/api/v1/purchase/airtime</code>
</div>

Send airtime to any mobile number across all major networks in a single API call. The cost is charged to your Dojah wallet.

## Headers

| Header          | Required | Description                                         |
| --------------- | -------- | --------------------------------------------------- |
| `Authorization` | Yes      | Your app's secret key, sent as-is — *not* `Bearer`. |
| `AppId`         | Yes      | The App ID from your dashboard.                     |
| `Content-Type`  | Yes      | `application/json`                                  |

## Body parameters

| Parameter     | Type   | Required | Description                                                                                                  |
| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `amount`      | number | Yes      | The amount of airtime to send.                                                                               |
| `destination` | array  | Yes      | The number(s) to receive the airtime, e.g. `2348012345678`. Pass an array to top up several numbers at once. |

## Response

Returns an `entity` describing the airtime purchase — its `status`, the `mobile` number topped up, and the `amount` sent (with currency).

## Errors

| Code  | Meaning                                                                                       |
| ----- | --------------------------------------------------------------------------------------------- |
| `400` | Bad request — a required field is missing or malformed.                                       |
| `401` | Unauthorized — check your key and `AppId` (no `Bearer` prefix).                               |
| `402` | Insufficient wallet balance. [Fund your wallet](/api-reference/core-concepts/wallet-billing). |
| `429` | Too many requests — back off and retry.                                                       |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.dojah.io/api/v1/purchase/airtime" \
    -H "Authorization: {{secret_key}}" \
    -H "AppId: {{app_id}}" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 200,
      "destination": ["2348012345678"]
    }'
  ```

  ```js Node.js theme={null}
  const res = await fetch("https://api.dojah.io/api/v1/purchase/airtime", {
    method: "POST",
    headers: {
      Authorization: process.env.DOJAH_SECRET_KEY,
      AppId: process.env.DOJAH_APP_ID,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      amount: 200,
      destination: ["2348012345678"],
    }),
  });
  const data = await res.json();
  ```

  ```python Python theme={null}
  import os, requests

  res = requests.post(
      "https://api.dojah.io/api/v1/purchase/airtime",
      headers={
          "Authorization": os.environ["DOJAH_SECRET_KEY"],
          "AppId": os.environ["DOJAH_APP_ID"],
      },
      json={
          "amount": 200,
          "destination": ["2348012345678"],
      },
  )
  data = res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json POST /api/v1/purchase/airtime theme={null}
  {
    "entity": {
      "status": "Sent",
      "mobile": "+2348102152847",
      "amount": "NGN 200.0000"
    }
  }
  ```
</ResponseExample>
