Personal Accident Insurance API
This section contains the recommended flow for integrating Personal Accident insurance services on the VTpass RESTful API.
Authentication
Learn about authentication from here.
AVAILABLE ENDPOINTS
To integrate the VTpass personal accident insurance RESTful API, the endpoints below applies:
- Get Variation Codes: this returns variation codes for various personal accident insurance 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 Personal Accident insurance plans can be accessed with the endpoint below:
Live: https://vtpass.com/api/service-variations?serviceID=personal-accident-insurance
Sandbox: https://sandbox.vtpass.com/api/service-variations?serviceID=personal-accident-insurance
FIELDS | Mandatory/Optional | TYPE | DESCRIPTION |
N/A | N/A | N/A | N/A |
EXPECTED RESPONSE
{ "response_description":"000", "content":{ "ServiceName":"Personal Accident Insurance", "serviceID":"personal-accident-insurance", "convinience_fee":"0 %", "varations":[ { "variation_code":"option-a", "name":"Option A - 2,500 Naira yearly", "variation_amount":"2500.00", "fixedPrice":"Yes" }, { "variation_code":"option-b", "name":"Option B - 4,000 Naira yearly", "variation_amount":"4000.00", "fixedPrice":"Yes" }, ... ] } }
PURCHASE PRODUCT
Using a POST method, personal accident insurance can be purchased with the endpoint below:
Live: https://vtpass.com/api/pay
Sandbox: https://sandbox.vtpass.com/api/pay
ServiceID: personal-accident-insurance
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 personal-accident-insurance |
billersCode | M | String | The Full name of the person you wish to make the insurance payment on. In this case: Testimetri Adams |
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 |
full_name | M | String | The Full name of the person you wish to make the insurance payment on. |
address | M | String | The Address of the person you wish to make the insurance payment on. |
dob | M | String | The date of birth of the person insured in for of YYYY-mm-dd. |
next_kin_name | M | String | Customer’s next of kin name. |
next_kin_phone | M | String | Customer’s next of kin phone number. |
business_occupation | M | String | Customer’s business occupation. |
EXPECTED RESPONSE
{ "code": "000", "content": { "transactions": { "status": "delivered", "product_name": "Personal Accident Insurance", "unique_element": "Testimetri Adams", "unit_price": 2500, "quantity": 1, "service_verification": null, "channel": "api", "commission": 500, "total_amount": 2100, "discount": null, "type": "Insurance", "email": "sandbox@vtpass.com", "phone": "07061933309", "name": null, "convinience_fee": 100, "amount": 2500, "platform": "api", "method": "api", "transactionId": "1601022658876" } }, "response_description": "TRANSACTION SUCCESSFUL", "requestId": "34uiejpj7ui9i0sd0h9jhj4j9imddrt0yu", "amount": "2500.00", "transaction_date": { "date": "2020-09-25 09:30:58.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": "Personal Accident Insurance", "unique_element": "Testimetri Adams", "unit_price": 2500, "quantity": 1, "service_verification": null, "channel": "api", "commission": 30000, "total_amount": 2100, "discount": null, "type": "Insurance", "email": "sandbox@vtpass.com", "phone": "07061933309", "name": null, "convinience_fee": 100, "amount": "2500.00", "platform": "api", "method": "wallet", "transactionId": "1582531685722" } }, "response_description": "TRANSACTION SUCCESSFUL", "requestId": "34uiejpj7ui9i0sd0h9jhj4j9imddrt0yu", "amount": "2500.00", "transaction_date": { "date": "2020-02-24 09:08:05.000000", "timezone_type": 3, "timezone": "Africa/Lagos" }, "purchased_code": "" }