Spectranet API

This section contains the recommended flow for integrating Spectranet 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 Spectranet Payment RESTful API, the endpoints below applies:

  • Get Variation Codes: this returns variation codes for various Spectranet (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 Spectranet subscription plans can be accessed with the endpoint below:

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

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

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

 

EXPECTED RESPONSE

{  
   "response_description":"000",
   "content": {
        "ServiceName": "Spectranet",
        "serviceID": "spectranet",
        "convinience_fee": "0 %",
        "variations": [
            {
                "variation_code": "vt-1000",
                "name": "Spectranet N1000",
                "variation_amount": 1000,
                "fixedPrice": "Yes"
            },
            {
                "variation_code": "vt-2000",
                "name": "Spectranet N2000",
                "variation_amount": 2000,
                "fixedPrice": "Yes"
            },
            ....
        ],
        "varations": [
            {
                "variation_code": "vt-1000",
                "name": "Spectranet N1000",
                "variation_amount": 1000,
                "fixedPrice": "Yes"
            },
            {
                "variation_code": "vt-2000",
                "name": "Spectranet N2000",
                "variation_amount": 2000,
                "fixedPrice": "Yes"
            },
            .....
        ]
    }
}

PURCHASE PRODUCT

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

 

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

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

ServiceID: mtn-data

 

On sandbox, use test phone number: 1212121212

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 spectranet
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": "Spectranet",
            "unique_element": "08011111111",
            "unit_price": 1000,
            "quantity": 1,
            "service_verification": null,
            "channel": "api",
            "commission": 40,
            "total_amount": 960,
            "discount": null,
            "type": "Data Services",
            "email": "sandbox@vtpass.com",
            "phone": "07061933309",
            "name": null,
            "convinience_fee": 0,
            "amount": 1000,
            "platform": "api",
            "method": "api",
            "transactionId": "16490633278997623167611852"
        }
    },
    "response_description": "TRANSACTION SUCCESSFUL",
    "requestId": "202204041008ksemeoqykrmtisffmfkd45jkfdjdjjeodlkuwokdckfjf",
    "amount": "1000.00",
    "transaction_date": {
        "date": "2022-04-04 10:08:47.000000",
        "timezone_type": 3,
        "timezone": "Africa/Lagos"
    },
    "purchased_code": "PIN: 08999186, S/N:81560189",
    "cards": [
        {
            "serialNumber": "81560189",
            "pin": "08999186",
            "expiresOn": "2040-10-12",
            "value": 1000
        }
    ]
}

 

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": "Spectranet",
            "unique_element": "08011111111",
            "unit_price": 1000,
            "quantity": 1,
            "service_verification": null,
            "channel": "api",
            "commission": 40,
            "total_amount": 960,
            "discount": null,
            "type": "Data Services",
            "email": "sandbox@vtpass.com",
            "phone": "07061933309",
            "name": null,
            "convinience_fee": 0,
            "amount": 1000,
            "platform": "api",
            "method": "api",
            "transactionId": "16490633278997623167611852"
        }
    },
    "response_description": "TRANSACTION SUCCESSFUL",
    "requestId": "202204041008ksemeoqykrmtisffmfkd45jkfdjdjjeodlkuwokdckfjf",
    "amount": "1000.00",
    "transaction_date": {
        "date": "2022-04-04 10:08:47.000000",
        "timezone_type": 3,
        "timezone": "Africa/Lagos"
    },
    "purchased_code": "PIN: 08999186, S/N:81560189",
    "cards": [
        {
            "serialNumber": "81560189",
            "pin": "08999186",
            "expiresOn": "2040-10-12",
            "value": 1000
        }
    ]
}