# Welcome to Topupbox API

## Get Access Token

All APIs in this documentation require an access token which serves as an authorization key which lasts for a year. Tokens can re refreshed, and re-generated on the Topupbox Dashboard.

### Postman Documentation

Check out and test our postman documentation here

All Endpoints have a base url of <https://api.topupbox.com>

<https://documenter.getpostman.com/view/19486823/2s9YJey1fd>

## Get Transaction Record

Get all records and transactions.

<mark style="color:blue;">`GET`</mark> `https://api.topupbox.com/api/v2/w1/query/page/{page}/{numPerPage}`

#### Path Parameters

| Name                                         | Type   | Description                  |
| -------------------------------------------- | ------ | ---------------------------- |
| page<mark style="color:red;">\*</mark>       | String | Page ID                      |
| numPerPage<mark style="color:red;">\*</mark> | String | Number of parameters by page |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | String | Access Token |

{% tabs %}
{% tab title="Javascript" %}

```
// Some code
```

{% endtab %}

{% tab title="PHP" %}

```
// Some code
```

{% endtab %}

{% tab title="Java" %}

```
// Some code
```

{% endtab %}
{% endtabs %}

## Get Data Packages

<mark style="color:blue;">`GET`</mark> `https://api.topupbox.com/api/v2/w1/data-price-point/{network}`

#### Path Parameters

| Name                                      | Type   | Description                                    |
| ----------------------------------------- | ------ | ---------------------------------------------- |
| Network<mark style="color:red;">\*</mark> | String | Network names eg MTN, AIRTEL,GLO, AIRTEL, etc. |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Access Token |

{% tabs %}
{% tab title="Javascript" %}

```
// Some code
```

{% endtab %}

{% tab title="PHP" %}

```
// Some code
```

{% endtab %}

{% tab title="Java" %}

```
// Some code
```

{% endtab %}
{% endtabs %}

## Get All Data Packages

<mark style="color:blue;">`GET`</mark> `https://api.topupbox.com/api/v2/w1/data-price-point/all`

Get all Data Packages irrespective of network.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Access Token |

{% tabs %}
{% tab title="Javascript" %}

```
// Some code
```

{% endtab %}

{% tab title="PHP" %}

```
// Some code
```

{% endtab %}

{% tab title="Java" %}

```
// Some code
```

{% endtab %}
{% endtabs %}

## Make your First Recharge

<mark style="color:green;">`POST`</mark> `https://api.topupbox.com/api/v2/w1/recharge/{network}/{rechargeType}`

Recharge Number based on Network and rechargeType

#### Path Parameters

| Name                                           | Type   | Description                                         |
| ---------------------------------------------- | ------ | --------------------------------------------------- |
| Network<mark style="color:red;">\*</mark>      | String | Network names eg MTN, AIRTEL,GLO, AIRTEL, et        |
| rechargeType<mark style="color:red;">\*</mark> | String | type of recharge , expected value : AIRTIME or DATA |

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Access Token |

#### Request Body

| Name                                                  | Type   | Description                     |
| ----------------------------------------------------- | ------ | ------------------------------- |
| amount<mark style="color:red;">\*</mark>              | String | Amount to be credited           |
| beneficiary<mark style="color:red;">\*</mark>         | String | Phone Number of beneficiary     |
| customer\_reference<mark style="color:red;">\*</mark> | String | reference number of customer    |
| tariffTypeId<mark style="color:red;">\*</mark>        | String | TarriffTypeID for data packages |


---

# 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://developer.topupbox.com/welcome-to-topupbox-api.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.
