Data

Processing Data bundles.

Fetching All Bundles

The Bundles API allows you to retrieve information about mobile bundles. You can filter bundles based on currency and network.

Retrieves a list of mobile bundles based on specified filters such as currency and network.

GET https://domain.xash.co.zw/api/v1/bundles

Query Parameters

Name
Type
Description

currency

String

Filter bundles based on the currency (e.g., USD).

network

String

Filter bundles based on the network (e.g., NetOne).

Headers

Name
Type
Description

Authorization*

String

This endpoint requires a Firebase Bearer token for authorization. The token should be included in the Authorization header in the format Bearer {token}.

{
  "bundles": [
    {
      "name": "USD Airtime $0.50",
      "value": 0.5,
      "description": "USD Airtime $0.50",
      "network": "NetOne",
      "valid_for": 30,
      "currency": "USD"
    },
    ...
  ]
}
// JS example
fetch('/bundles?network=NetOne&currency=USD')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Buy Bundle

This API allows users to purchase bundle

Purchase bundle

POST https://domain.xash.co.zw/api/v1/bundles/buy

This endpoint enables users to buy bundles based on the provided network, currency, quantity, and value. The operation performs a series of checks, including validating the input parameters, checking the user's balance, and processing the bundle purchase.

Headers

Name
Type
Description

Authorization*

String

This endpoint requires a Firebase Bearer token for authorization. The token should be included in the Authorization header in the format Bearer {token}.

Request Body

Name
Type
Description

name*

String

Bundle name as fetched from previous request

value*

Float

Bundle value as fetched from previous request

network*

String

Bundle network as fetched from previous request

currency*

String

Bundle currency as fetched from previous request

quantity*

Integer

Quantity of bundles to be purchased (must be greater than or equal to 1).

mobile_phone

String

Valid receiver's phone number to buy bundle for.

 {
    "message": "Bundle purchased successfully",
    "vouchers": [
      {
        "value": 10,
        "currency": "USD",
        "network": "Econet",
        "name": "Bundle Name" 
      },
      // Additional voucher objects if quantity is more than 1
    ]
  }

Last updated