> For the complete documentation index, see [llms.txt](https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/bills-payment/airtime-purchase.md).

# Airtime Purchase

### Initiate the data bill payment:

| Verb   | URL                             |
| ------ | ------------------------------- |
| `POST` | `{{baseUlr}}/api/bills/airtime` |

| Attribute     | Description                                                                                    |
| ------------- | ---------------------------------------------------------------------------------------------- |
| `phoneNumber` | This is the phone number that will receive the data bundle.                                    |
| `amount`      | This is the fixed amount of the data bundle (specified in the currencies lowest denomination). |
| `provider`    | The network provider of the phone number bing purchased for (MTN, AIRTEL, GLO, 9MOBILE)        |
| `reference`   | The unique identifier of the transaction on your system.                                       |

{% tabs %}
{% tab title="Initiate Data Purchase" %}

<pre class="language-javascript"><code class="lang-javascript">curl --location 'https://api.smarthivesms.com/api/bills/data/get_data' \
--header 'Content-Type: application/json' \
<strong>--header 'x-api-key: &#x3C;API KEY>' \
</strong>--data '{
    "phoneNumber": "23490XXXXXXX",
    "amount": 10000,
    "provider": "MTN",
    "reference": 3456789
}'
</code></pre>

{% endtab %}

{% tab title="200 OK Response" %}

```python
{
    "status": "ok",
    "description": "The request has succeeded",
    "data": {
        "transaction_id": "68ccde58db49dcbe7473bf85",
        "statusCode": "OK",
        "statusCodeValue": 200
    }
}
```

{% endtab %}
{% endtabs %}
