# Data Purchase

You can make a data bill payment purchase in one easy step:

### Initiate the data bill payment:

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

| 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' \
--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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/bills-payment/data-purchase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
