Airtel Data Subscription API

This section contains the recommended flow for integrating Airtel Data Subscription services on the VTpass RESTful API.

 

Authentication

The VTpass API uses Basic Authentication.

It should be passed as a concatenated string like this

username:password

Please use the following details for authentication

Username: YourVtpassEmail

Password: YourPassword

Please create your authentication details by following the instructions here.

 

 

Available Endpoints

To integrate the VTpass Airtel Data Subscription Payment RESTful API, the endpoints below applies:

  • Get Variation Codes: this returns variation codes for various Airtel Data (subscription plans)
  • Purchase Product (Using the variation code gotten in the first step)
  • Query transaction status

 

GET VARIATION CODES

Using a GET method, the VTpass variation codes for Airtel Data subscription plans can be accessed with the endpoint below:

Live:   https://vtpass.com/api/service-variations?serviceID=airtel-data

Sandbox: https://sandbox.vtpass.com/api/service-variations?serviceID=airtel-data

FIELDS Mandatory/Optional TYPE DESCRIPTION
N/A N/A N/A N/A

 

EXPECTED RESPONSE

{  
   "response_description":"000",
   "content":{  
      "ServiceName":"Airtel Data",
      "serviceID":"airtel-data",
      "convinience_fee":"0%",
      "varations":[  
          {
                "variation_code": "airt-50",
                "name": "Airtel Data Bundle - 50 Naira - 20MB - 1Day",
                "variation_amount": "49.99",
                "fixedPrice": "Yes"
          },
          {
                "variation_code": "airt-100",
                "name": "Airtel Data Bundle - 100 Naira - 1Day",
                "variation_amount": "99.00",
                "fixedPrice": "Yes"
          },
          ...
      ]
   }
}

PURCHASE PRODUCT

Using a POST method, Airtel Data bundle can with the endpoint below:

 

Live: https://vtpass.com/api/pay

Sandbox: https://sandbox.vtpass.com/api/pay

ServiceID: airtel-data

 

On sandbox, use test phone number: 08011111111

To simulate a failed transaction on sandbox, please use any number apart from the one provided above as the phone number.

 

 

FIELDS Mandatory/Optional TYPE DESCRIPTION
request_id M String This is a unique reference with which you can use to identify and query the status of a given transaction after the transaction has been executed.
serviceID M String Service ID as specified by VTpass. In this case, it is airtel-data
billersCode M String The phone number you wish to make the Subscription payment on
variation_code M String The code of the variation (as specified in the GET VARIATIONS method as variation_code).
amount O Number The amount of the variation (as specified in the GET VARIATIONS endpoint as variation_amount)

This amount will be ignored as the variation code determine the price of the data bundle.

phone M Number The phone number of the customer or recipient of this service

 

EXPECTED RESPONSE

{
  "code": "000",
  "content": {
      "transactions": {
      "status": "delivered",
      "product_name": "Airtel Data",
      "unique_element": "08011111111",
      "unit_price": 100,
      "quantity": 1,
      "service_verification": null,
      "channel": "api",
      "commission": 4,
      "total_amount": 96,
      "discount": null,
      "type": "Data Services",
      "email": "sandbox@vtpass.com",
      "phone": "07061933309",
      "name": null,
      "convinience_fee": 0,
      "amount": 100,
      "platform": "api",
      "method": "api",
      "transactionId": "1582290782154"
       }
    },
    "response_description": "TRANSACTION SUCCESSFUL",
    "requestId": "3476we129909djd",
    "amount": "100.00",
    "transaction_date": {
        "date": "2020-02-21 14:13:02.000000",
        "timezone_type": 3,
        "timezone": "Africa/Lagos"
     },
     "purchased_code": ""
}

 

QUERY TRANSACTION STATUS

Using a POST method, transaction status can be queried with the endpoint below:

Live: https://vtpass.com/api/requery

Sandbox: https://sandbox.vtpass.com/api/requery

FIELDS Mandatory/Optional TYPE DESCRIPTION
request_id M String

This is the reference with which you sent when purchasing a transaction after the transaction has been executed.

 

EXPECTED RESPONSE

{
  "code": "000",
  "content": {
      "transactions": {
      "status": "delivered",
      "product_name": "Airtel Data",
      "unique_element": "08011111111",
      "unit_price": 100,
      "quantity": 1,
      "service_verification": null,
      "channel": "api",
      "commission": 4,
      "total_amount": 96,
      "discount": null,
      "type": "Data Services",
      "email": "sandbox@vtpass.com",
      "phone": "07061933309",
      "name": null,
      "convinience_fee": 0,
      "amount": 100,
      "platform": "api",
      "method": "api",
      "transactionId": "1582290782154"
       }
    },
    "response_description": "TRANSACTION SUCCESSFUL",
    "requestId": "3476we129909djd",
    "amount": "100.00",
    "transaction_date": {
        "date": "2020-02-21 14:13:02.000000",
        "timezone_type": 3,
        "timezone": "Africa/Lagos"
     },
     "purchased_code": ""
}