# Data

## Sample request for vending data

```json
{
  "plan_code": "1001",
  "phonenumber": "08169643167",
  "transaction_id": "80kld-E-82269942-209322"
}

```

## Vending Data Operation

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/service/api/single_data_direct_vending`

#### Path Parameters

| Name                                        | Type   | Description                                                                                                         |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | The API key is a unique key that must be passed to the header before any request and can be found in the dashboard. |
| client-id<mark style="color:red;">\*</mark> | String | This is a unique id for customers which can also be found in the dashboard when login                               |

#### Request Body

| Name                                              | Type   | Description                                                                              |
| ------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| plan\_code<mark style="color:red;">\*</mark>      | String | Each network has its plan code. The code of the network you are vending is required here |
| phonenumber<mark style="color:red;">\*</mark>     | String | This is the phone number of the customer                                                 |
| transaction\_id<mark style="color:red;">\*</mark> | String | This is the Unique Id you provided for the transaction.                                  |

{% tabs %}
{% tab title="200: OK Successful" %}
{% code title="Sample response" %}

```json
{
    "status_code": "200",
    "transaction_id": null,
    "reference": "80kjd-D-82269942-218322",
    "phonenumber": "08069633127",
    "network": "MTN",
    "message": "Successful"
}
```

{% endcode %}
{% endtab %}

{% tab title="300: Multiple Choices Duplicate" %}
{% code title="Sample response" %}

```javascript
{
    "status_code": "300",
    "transaction_id": null,
    "reference": "80kjd-D-82269942-218322",
    "phonenumber": "08069633127",
    "network": "MTN",
    "message": "Duplicate customer reference"
}
```

{% endcode %}
{% endtab %}

{% tab title="100: Continue others" %}
{% code title="Sample response" %}

```json
{
    "status_code": "100",
    "message": Any other error
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found notFound" %}
{% code title="Sample response" %}

```json
{
    "status_code": "3",
    "message": "not found"
}
```

{% endcode %}
{% endtab %}

{% tab title="500: Internal Server Error failedStatus" %}
{% code title="Sample response" %}

```javascript
{
    "status_code": "500",
    "transaction_id": "166272313399778110",
    "reference": "80kjd-612269142-test-n21",
    "phonenumber": "08169653167",
    "network": "MTN",
    "message": "unsuccessful"
}
```

{% endcode %}
{% endtab %}

{% tab title="501: Pending Transaction" %}

```json
Sample Response
{
    "status_code": "501",
    "message": "Pending"
}
```

{% endtab %}
{% endtabs %}

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

```json
{
  "id": 1,
  "name": "John",
  "age": 30
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

## Get all the data packages for different network

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/service/api/get-packages`

The endpoint is used to get all  data packages available for a network send as request. It return a json format response. If no network is not provided, a response with status code 1 will be returned.

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String |             |
| client-id<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                      | Type   | Description                 |
| ----------------------------------------- | ------ | --------------------------- |
| network<mark style="color:red;">\*</mark> | String | The network you want to get |

## Sample request for getting packages&#x20;

```json
{
    "network": "MTN"
}
```

{% tabs %}
{% tab title="200: OK Successful" %}
{% code title="Sample response" %}

```json
{
    "status_code": "0",
    "message": "Successful",
    "result": [
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "100MB ",
            "bundle_validity": " Daily Plan",
            "bundle_description": " Daily Plan",
            "bundle_price": "100",
            "plan_code": "1001"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "200MB",
            "bundle_validity": " 2-day Plan",
            "bundle_description": " 2-day Plan",
            "bundle_price": "200",
            "plan_code": "1002"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "350MB",
            "bundle_validity": " Weekly Plan",
            "bundle_description": " Weekly Plan",
            "bundle_price": "300",
            "plan_code": "1003"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "750MB",
            "bundle_validity": " 2-Week plan",
            "bundle_description": " 2-Week plan",
            "bundle_price": "500",
            "plan_code": "1004"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2GB",
            "bundle_validity": " Monthly Plan",
            "bundle_description": " Monthly Plan",
            "bundle_price": "1200",
            "plan_code": "1005"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1.5GB",
            "bundle_validity": " 1-Month Mobile Plan",
            "bundle_description": " 1-Month Mobile Plan",
            "bundle_price": "1000",
            "plan_code": "1006"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "750MB",
            "bundle_validity": " Weekly Plan ",
            "bundle_description": " Weekly Plan ",
            "bundle_price": "500",
            "plan_code": "1007"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "3GB",
            "bundle_validity": " 3GB Monthly Plan",
            "bundle_description": " 3GB Monthly Plan",
            "bundle_price": "1500",
            "plan_code": "1011"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "325GB",
            "bundle_validity": " 6_Months Plan",
            "bundle_description": " 6_Months Plan",
            "bundle_price": "100000",
            "plan_code": "1012"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1000GB",
            "bundle_validity": " 1_Year Plan ",
            "bundle_description": " 1_Year Plan ",
            "bundle_price": "300000",
            "plan_code": "1013"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1500GB",
            "bundle_validity": " 1_Year Plan ",
            "bundle_description": " 1_Year Plan ",
            "bundle_price": "450000",
            "plan_code": "1014"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2.5GB ",
            "bundle_validity": " 2_Day Plan",
            "bundle_description": " 2_Day Plan",
            "bundle_price": "500",
            "plan_code": "1015"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "400GB",
            "bundle_validity": " Yearly Plan",
            "bundle_description": " Yearly Plan",
            "bundle_price": "120000",
            "plan_code": "1016"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "75GB ",
            "bundle_validity": " 2_Month Plan",
            "bundle_description": " 2_Month Plan",
            "bundle_price": "20000",
            "plan_code": "1017"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "120GB",
            "bundle_validity": " 2_Month Plan",
            "bundle_description": " 2_Month Plan",
            "bundle_price": "30000",
            "plan_code": "1018"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "150GB",
            "bundle_validity": " 3_Month Plan",
            "bundle_description": " 3_Month Plan",
            "bundle_price": "50000",
            "plan_code": "1019"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "250GB",
            "bundle_validity": " 3_Month Plan",
            "bundle_description": " 3_Month Plan",
            "bundle_price": "75000",
            "plan_code": "1020"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "25GB",
            "bundle_validity": " Monthly Plan",
            "bundle_description": " Monthly Plan",
            "bundle_price": "6000",
            "plan_code": "1021"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1GB ",
            "bundle_validity": " Weekly Plan",
            "bundle_description": " Weekly Plan",
            "bundle_price": "500",
            "plan_code": "1022"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "6GB",
            "bundle_validity": " Weekly Plan",
            "bundle_description": " Weekly Plan",
            "bundle_price": "1500",
            "plan_code": "1023"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "6GB",
            "bundle_validity": " Monthly Plan",
            "bundle_description": " Monthly Plan",
            "bundle_price": "2500",
            "plan_code": "1024"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "10GB",
            "bundle_validity": " Monthly Plan",
            "bundle_description": " Monthly Plan",
            "bundle_price": "3000",
            "plan_code": "1025"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "110GB",
            "bundle_validity": " Monthly Plan",
            "bundle_description": " Monthly Plan",
            "bundle_price": "20000",
            "plan_code": "1026"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "30GB",
            "bundle_validity": " SME Share Bundle",
            "bundle_description": " SME Share Bundle",
            "bundle_price": "13500",
            "plan_code": "1027"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "90GB",
            "bundle_validity": " SME Share Bundle",
            "bundle_description": " SME Share Bundle",
            "bundle_price": "40000",
            "plan_code": "1028"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "4.5GB",
            "bundle_validity": " 1 Month all day plan",
            "bundle_description": " 1 Month all day plan",
            "bundle_price": "2000",
            "plan_code": "1029"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "12GB",
            "bundle_validity": " Month Plan",
            "bundle_description": " Month Plan",
            "bundle_price": "3500",
            "plan_code": "1030"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "20GB",
            "bundle_validity": " Month Plan",
            "bundle_description": " Month Plan",
            "bundle_price": "5000",
            "plan_code": "1031"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "40GB",
            "bundle_validity": " Month Plan",
            "bundle_description": " Month Plan",
            "bundle_price": "10000",
            "plan_code": "1032"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "75GB",
            "bundle_validity": " Month Plan",
            "bundle_description": " Month Plan",
            "bundle_price": "15000",
            "plan_code": "1033"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "75MB",
            "bundle_validity": " Daily Plan",
            "bundle_description": " Daily Plan",
            "bundle_price": "100",
            "plan_code": "1060"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "200MB",
            "bundle_validity": "2 days",
            "bundle_description": "2 days",
            "bundle_price": "200",
            "plan_code": "1061"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT300",
            "bundle_validity": "XT 300Weekly",
            "bundle_description": "XT 300Weekly",
            "bundle_price": "300",
            "plan_code": "1062"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD300",
            "bundle_validity": "XT 300Weekly",
            "bundle_description": "XT 300Weekly",
            "bundle_price": "300",
            "plan_code": "1063"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "350MB",
            "bundle_validity": "7 Days",
            "bundle_description": "7 Days",
            "bundle_price": "300",
            "plan_code": "1064"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2.5GB",
            "bundle_validity": "2 Days",
            "bundle_description": "2 Days",
            "bundle_price": "500",
            "plan_code": "1065"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "750MB",
            "bundle_validity": "14 Days",
            "bundle_description": "14 Days",
            "bundle_price": "500",
            "plan_code": "1066"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT500",
            "bundle_validity": "XT 500Weekly",
            "bundle_description": "XT 500Weekly",
            "bundle_price": "500",
            "plan_code": "1067"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "750MB",
            "bundle_validity": "7 Days",
            "bundle_description": "7 Days",
            "bundle_price": "500",
            "plan_code": "1068"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2GB",
            "bundle_validity": "2 Days",
            "bundle_description": "2 Days",
            "bundle_price": "500",
            "plan_code": "1069"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD500",
            "bundle_validity": "XD 500Weekly",
            "bundle_description": "XD 500Weekly",
            "bundle_price": "500",
            "plan_code": "1070"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2GB",
            "bundle_validity": "2 Days",
            "bundle_description": "2 Days",
            "bundle_price": "500",
            "plan_code": "1071"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD1000",
            "bundle_validity": "2 Days",
            "bundle_description": "2 Days",
            "bundle_price": "1000",
            "plan_code": "1072"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1.5GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "1000",
            "plan_code": "1073"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT1000Mthly",
            "bundle_validity": "XT 1000Monthly",
            "bundle_description": "XT 1000Monthly",
            "bundle_price": "1000",
            "plan_code": "1074"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "1200",
            "plan_code": "1075"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "6GB",
            "bundle_validity": "7 Days",
            "bundle_description": "7 Days",
            "bundle_price": "1200",
            "plan_code": "1076"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "3GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "1200",
            "plan_code": "1077"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT2000",
            "bundle_validity": "XT 2000Monthly",
            "bundle_description": "XT 2000Monthly",
            "bundle_price": "2000",
            "plan_code": "1078"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "4.5GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "2000",
            "plan_code": "1079"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD2000",
            "bundle_validity": "XD 2000Monthly",
            "bundle_description": "XD 2000Monthly",
            "bundle_price": "2000",
            "plan_code": "1080"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "6GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "2500",
            "plan_code": "1081"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "10GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "3000",
            "plan_code": "1082"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD5000",
            "bundle_validity": "XD 5000Monthly",
            "bundle_description": "XD 5000Monthly",
            "bundle_price": "5000",
            "plan_code": "1083"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT5000",
            "bundle_validity": "XT 5000Monthly",
            "bundle_description": "XT 5000Monthly",
            "bundle_price": "5000",
            "plan_code": "1084"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "20GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "5000",
            "plan_code": "1085"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "25GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "5000",
            "plan_code": "1086"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "30GB",
            "bundle_validity": "60 Days",
            "bundle_description": "60 Days",
            "bundle_price": "8000",
            "plan_code": "1087"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD10000",
            "bundle_validity": "XD10000 Monthly",
            "bundle_description": "XD10000 Monthly",
            "bundle_price": "10000",
            "plan_code": "1089"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "40GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "10000",
            "plan_code": "1090"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT10000",
            "bundle_validity": "XT 10000Monthly",
            "bundle_description": "XT 10000Monthly",
            "bundle_price": "10000",
            "plan_code": "1091"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "35GB",
            "bundle_validity": "SME",
            "bundle_description": "SME",
            "bundle_price": "13500",
            "plan_code": "1092"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT15000",
            "bundle_validity": "XT 10000Monthly",
            "bundle_description": "XT 10000Monthly",
            "bundle_price": "15000",
            "plan_code": "1093"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD15000",
            "bundle_validity": "XD 15000Monthly",
            "bundle_description": "XD 15000Monthly",
            "bundle_price": "15000",
            "plan_code": "1094"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "75GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "15000",
            "plan_code": "1095"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD15000",
            "bundle_validity": "XD 15000Monthly",
            "bundle_description": "XD 15000Monthly",
            "bundle_price": "15000",
            "plan_code": "1096"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XT20000",
            "bundle_validity": "XT 20000Monthly",
            "bundle_description": "XT 20000Monthly",
            "bundle_price": "20000",
            "plan_code": "1097"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "75GB",
            "bundle_validity": "60 Days",
            "bundle_description": "60 Days",
            "bundle_price": "20000",
            "plan_code": "1098"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "110GB",
            "bundle_validity": "30 Days",
            "bundle_description": "30 Days",
            "bundle_price": "20000",
            "plan_code": "1099"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "XD20000",
            "bundle_validity": "XD 20000Monthly",
            "bundle_description": "XD 20000Monthly",
            "bundle_price": "20000",
            "plan_code": "1100"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "120GB",
            "bundle_validity": "60 Days",
            "bundle_description": "60 Days",
            "bundle_price": "30000",
            "plan_code": "1101"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "90GB",
            "bundle_validity": "SME",
            "bundle_description": "SME",
            "bundle_price": "40000",
            "plan_code": "1102"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "150GB",
            "bundle_validity": "SME 90days",
            "bundle_description": "SME 90days",
            "bundle_price": "50000",
            "plan_code": "1103"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "150GB",
            "bundle_validity": "90 days",
            "bundle_description": "90 days",
            "bundle_price": "50000",
            "plan_code": "1104"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "250GB",
            "bundle_validity": "90 days",
            "bundle_description": "90 days",
            "bundle_price": "75000",
            "plan_code": "1105"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1TB",
            "bundle_validity": "365 days",
            "bundle_description": "365 days",
            "bundle_price": "100000",
            "plan_code": "1106"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "325GB",
            "bundle_validity": "180 days",
            "bundle_description": "180 days",
            "bundle_price": "100000",
            "plan_code": "1107"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "400GB",
            "bundle_validity": "365 days",
            "bundle_description": "365 days",
            "bundle_price": "120000",
            "plan_code": "1108"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1000GB",
            "bundle_validity": "365 days",
            "bundle_description": "365 days",
            "bundle_price": "300000",
            "plan_code": "1109"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "2000GB",
            "bundle_validity": "365 days",
            "bundle_description": "365 days",
            "bundle_price": "450000",
            "plan_code": "1110"
        },
        {
            "plan_name": "MTN data_plan",
            "bundle_value": "1500GB",
            "bundle_validity": "365 days",
            "bundle_description": "365 days",
            "bundle_price": "450000",
            "plan_code": "1111"
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found Network not found with status code 1" %}

```json
{
    "status_code": "1",
    "message": "Network no valid",
    "result": null
}
```

{% 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://payvantage.gitbook.io/payvantage.gitbook.io/vending/data.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.
