Basic flow for Internet Data API

Sandbox Base URL: https://sandbox.giftbills.com/api/v1

Production Base URL: https://giftbills.com/api/v1

Gift Bills allows Reseller/Agent to purchase internet data for their customers via API.

a. Call /api/v1/internet to get all the avaliable internet data service providers.

b. Call /api/v1/internet/data_types to fetch available data types.

c. Call /api/v1/internet/plans/{provider} to fetch available data plans for a specified provider.

d. Call /api/v1/internet/data to initialize data purchase transaction.

Note:- We advise that all tests should be done on our Sandbox environment. After tests have been done successfully and integration completed on the sandbox, kindly request to be provisioned on our Production Environment. Click Here to register sandbox account now.


Getting Internet Providers

API Endpoint: /internet

GET method

curl -X GET --header 'Authorization: Bearer API_KEY' --header 'MerchantId:
username' --header 'content-type: application/json'

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "Fetched successfully",
    "data": [
        {
            "id": 1,
            "provider": "AIRTEL",
            "providerLogoUrl": "assets/images/bills/Airtel-Data.jpg"
        },
        {
            "id": 2,
            "provider": "MTN",
            "providerLogoUrl": "assets/images/bills/MTN-Data.jpg"
        },
        {
            "id": 3,
            "provider": "GLO",
            "providerLogoUrl": "assets/images/bills/GLO-Data.jpg"
        },
        {
            "id": 4,
            "provider": "9MOBILE",
            "providerLogoUrl": "assets/images/bills/9mobile-Data.jpg"
        },
        {
            "id": 5,
            "provider": "SMILE4G",
            "providerLogoUrl": "assets/images/bills/Smile-Payment.jpg"
        },
        {
            "id": 6,
            "provider": "SPECTRANET",
            "providerLogoUrl": "assets/images/bills/Spectranet.jpg"
        }
    ]
}
RESPONSE PROPERTY DESCRIPTION
id Internet service provider id
provider Internet service provider
providerLogoUrl Provider logo URL

Getting Internet Data Types

API Endpoint: /internet/data_types

GET method

curl -X GET --header 'Authorization: Bearer API_KEY' --header 'MerchantId:
username' --header 'content-type: application/json'

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "Fetched successfully",
    "data": [
        {
            "id": 1,
            "ip_id": 1,
            "name": "AIRTEL Direct"
        },
        {
            "id": 2,
            "ip_id": 2,
            "name": "MTN Direct"
        },
        {
            "id": 3,
            "ip_id": 3,
            "name": "GLO Direct"
        },
        {
            "id": 4,
            "ip_id": 4,
            "name": "9MOBILE Direct"
        },
        {
            "id": 6,
            "ip_id": 2,
            "name": "MTN SME"
        },
        {
            "id": 7,
            "ip_id": 5,
            "name": "SMILE 4G"
        },
        {
            "id": 8,
            "ip_id": 1,
            "name": "AIRTEL Corporate Gifting"
        },
        {
            "id": 9,
            "ip_id": 6,
            "name": "Spectranet Internet Data"
        }
    ]
}
RESPONSE PROPERTY DESCRIPTION
id Data type id
ip_id Internet service provider id
name Data Type Name

Getting Internet Data Plans

API Endpoint: /internet/plans/{provider}

GET method

curl -X GET --header 'Authorization: Bearer API_KEY' --header 'MerchantId:
username' --header 'content-type: application/json'
QUERY PROPERTY DESCRIPTION
provider please use the provider (name) returned in internet providers

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "Internet Data Plans Fetched successfully",
    "data": [
        {
            "id": 1,
            "data_type_id": 2,
            "name": "MTN N100 100MB - (24 Hours)",
            "amount": "100",
            "api_cent": "2"
        },
        {
            "id": 2,
            "data_type_id": 2,
            "name": "MTN N25 20MB - (24 Hours)",
            "amount": "25",
            "api_cent": "2"
        },
        ...
        {
            "id": 233,
            "data_type_id": 6,
            "name": "5.00GB - [1 month]",
            "amount": "1250.00",
            "api_cent": "2"
        },
        {
            "id": 234,
            "data_type_id": 6,
            "name": "10.00GB - [1 month]",
            "amount": "2500.00",
            "api_cent": "2"
        }
    ]
}
RESPONSE PROPERTY DESCRIPTION
id Data type id
data_type_id Data Type id
name Data Plan Name
amount Data Plan Amount
api_cent Reseller/Agent Percentage dicount on data plan amount

To Initiate a Internet Data Purchase Transaction

API Endpoint: /internet/data

POST method

curl -X POST --header 'Authorization: Bearer API_KEY' --header 'MerchantId:
username' --header 'content-type: application/json'

Sample Request Body

{
    "provider": "1",
    "number": "09011104837",
    "plan_id": "238",
    "reference": "GBR_202206221045239484727"
}
REQUEST PROPERTY DESCRIPTION
MerchantId Reseller/Agent account username
API_KEY Reseller/Agent account api_key
provider please use the id or provider returned in internet providers (e.g. for Airtel, use 1 or AIRTEL)
number beneficiary's mobile number to subscribe on
plan_id id of the data plan you are subscribing to
reference Order number of Reseller/Agent (unique order number from Reseller/Agent platform)

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "SUCCESSFUL",
    "data": {
        "orderNo": "211104130931335009",
        "reference": "GBR_202206221045239484727",
        "status": "delivered",
        "errorMsg": "You have successfully gifted 2349011104837 with 1GB of Data. valid till 7\/28\/2022 12:00:00 PM"
    }
}
RESPONSE PROPERTY DESCRIPTION
orderNo Order number of Gift Bills payment
reference Reseller/Agent reference (unique order number from Reseller/Agent platform)
status delivered
successful
Pending
Failed
errorMsg Will return actual server response of the transaction or null or no message