This endpoint is used to make insurance payment.
{{base_url}}
/vas/insurance/purchase
Parameter | Type | Details |
---|---|---|
bill_type | string | id_ of the Provider selected |
package | string | variation_code gotten from get-insurance-packages endpoint |
insured_name | string | Customer full name |
string | Customer email | |
phone | string | Phone Number of the customer |
state | string | StateCode from Insurance Data array |
lga | string | LgaCode from lga endpoint |
engine_capacity | string | CapacityCode gotten from insurance Data array |
chasis_number | string | Vehicle Chasis Number |
plate_number | string | Vehicle Plate Number |
vehicle_make | string | VehicleMakeCode from insurance Data array |
vehicle_model | string | VehicleModelCode from vehicle-model endpoint |
vehicle_color | string | Vehicle ColorCode from insurance Data array |
yearOfMake | string | Vehicle Year Of Make |
amount | decimal | Variation_amount from the packages endpoint. |
Request Example (guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', '{{base_url}}/vas/mobile-data/purchase', [
'json' => [
'amount' => '100.00',
'bill_type' => 'ui-xxx',
'phone' => '081xxxxxxxx',
'package' => '1',
'insured_name' => 'Mr Ajanlekoko',
'engine_capacity' => '1',
'chasis_number' => 'S12332323FRHJJ433434J',
'plate_number' => 'ATU480ER',
'vehicle_make' => '335',
'vehicle_color' => '20',
'vehicle_model' => '745',
'yearOfMake' => '2009',
'state' => '1',
'lga' => '745',
'email' => 'test@email.com',
],
'headers' => [
'Authorization' => 'Bearer {{access_token}}',
'client-id' => 'sdaH23sE5Th4*******dDF4df',
'accept' => 'application/json',
'content-type' => 'application/json',
],
]);
echo $response->getBody();
**Response: SUCCESS (200 OK)**
{
"message": success,
"data": {
"clientId": "673f225ce994ba0024cced6e",
"serviceCategoryId": "61e989f20e69308aa37a7a9f",
"reference": "4edfab8fab3f47e7819764a140b95ba5",
"status": "successful",
"amount": "1500",
"id": "67d3f91132ebf265b484a585",
"reciever": {
"number": null,
"customerNumber": null,
"distribution": "GOTV",
"vendType": "",
}
}
}
**Response: ERROR (403 FAILED)**
{
"message": {
"code": 403,
"error": [
"Requested with invalid token!"
]
},
"data": [],
"type": "error"
}