Smile Network Payment API

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

  • Get Variation Codes: this returns variation codes for various Smile 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 Smile Data VTU payment plans can be accessed with the endpoint below:

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

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

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

 

EXPECTED RESPONSE

{
    "response_description": "000",
    "content": {
        "ServiceName": "Smile Payment",
        "serviceID": "smile-direct",
        "convinience_fee": "N0.00",
        "varations": [
            {
                "variation_code": "518",
                "name": "SmileVoice ONLY 430 for 30days - 3,070 Naira",
                "variation_amount": "3070.00",
                "fixedPrice": "Yes"
            },
            {
                "variation_code": "airtime",
                "name": "Buy Airtime",
                "variation_amount": "0.00",
                "fixedPrice": "Yes"
            },
            {
                "variation_code": "583",
                "name": "UnlimitedPlatinum for 30days - 24,000 Naira",
                "variation_amount": "24000.00",
                "fixedPrice": "Yes"
            },
            ........
        ]
    }
}

 

VERIFY SMILE EMAIL

This endpoint allows you to verify the Email before attempting to make payment.

Using a POST method, you can verify a smile email with the endpoint below:

Live: https://api-service.vtpass.com/api/merchant-verify/smile/email

Sandbox: https://sandbox.vtpass.com/api/merchant-verify/smile/email

Smile email (billerscode) on sandbox: tester@sandbox.com

 

To simulate a failed smile email validation on sandbox, please use any email apart from the one provided above as the smile email.

 

FIELDS Mandatory/Optional TYPE DESCRIPTION
billersCode M Number The smile email you wish to make the Subscription payment on.

On Sandbox
Use: tester@sandbox.com

serviceID M String Service ID as specified by VTpass. In this case, it is smile-direct

 

EXPECTED RESPONSE

{
    "code": "000",
    "content": {
        "Customer_Name": "Test Smile",
        "AccountList": {
            "Account": {
                "AccountId": 1234567890,
                "FriendlyName": ""
            },
            "NumberOfAccounts": 1
        }
    }
}

 

PURCHASE PRODUCT

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

 

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

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

ServiceID: smile-direct

 

On sandbox, use test billerCode: 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.

Click here to understand how to generate a valid request ID

serviceID M String Service ID as specified by VTpass. In this case, it is smile-direct
billersCode M String The account ID you wish to make the Subscription payment on. (The AccountID gotten from the verify smile email endpoint)
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": "initiated",
             "channel": "api",
             "transactionId": "1563893222275", "method": "api",
             "platform": "api",
             "is_api": 1,
             "discount": null,
             "customer_id": 100649,
             "email": "sandbox@vtpass.com", "phone": "0801111111",
             "type": "Data Services", "convinience_fee": 0,
             "commission": 4,
             "amount": "100.00",
             "total_amount": 96,
             "quantity": 1,
             "unit_price": "100.00", 
             "updated_at": "2019-07-23 15:47:02", 
             "created_at": "2019-07-23 15:47:02", 
             "id": 7349912
          } 
     },
     "response_description": "TRANSACTION SUCCESSFUL",
     "requestId": "SANDVAIN01112A9320WA123JED",
     "payload":
     "{\"request_id\":\"SANDVAIN01112A9320WA123JED\",\"serviceID\":\"smile-
      direct\",\"amount\":\"100.00\",\"phone\":\"08011111111\",\"billersCode\":\"08011111
      111\",\"variation_code\":\"356\",\"var_idx\":308,\"identifier\":\"356\",\"email\":\
      "sandbox@vtpass.com\"}",
     "amount": "100.00",
     "transaction_date": {
        "date": "2019-07-23 15:47: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://api-service.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": "001",
      "response_code": "000", "response_description": "TRANSACTION QUERY", "content": {
      "requestId": "SANDVAIN01112A9320WA123JED",
      "response_code": "000",
      "response_description": "TRANSACTION SUCCESSFUL",
      "amount": "50.00",
      "created_date": {
          "date": "2019-07-23 05:48:52.000000", 
          "timezone_type": 3,
          "timezone": "Africa/Lagos"
       },
      "purchased_code": ""
    }
}

You can check out the complete list of RESPONSE CODES HERE.