URL: /api/insureapi
Methods: POST
, GET
This API endpoint allows users to purchase third party insurance.
To access this endpoint, users must include their API key and secret key in the request headers.
See usage example in the code snippets below:
POST request to purchase insurance:
Content-Type: application/json api-key: your-api-key secret-key: your-secret-key { "firstLevel": "3rd party insurance", "secondLevel": "Private", "phone": "08032566178", "number": "ABC123", "Insured_Name": "John Doe", "Engine_Number": "1234567890", "Chasis_Number": "ABCDEFGHIJKL12345", "Vehicle_Make": "Toyota", "Vehicle_Color": "Blue", "Vehicle_Model": "Camry", "Year_of_Make": "2020", "Contact_Address": "123 Main St, City", }
Response:
- Status Code: 200 { "message": "Transaction successful", "insureHistory": { "transactionId": "1234567890", "email": "user@example.com", "activity": "3rd party insurance", "message": "Order Submitted Successfully", "recipient": "08032566178", "amount": 15000, "initialBalance": 20000, "finalBalance": 5000, "number": "ABC123", "Insured_Name": "John Doe", "Engine_Number": "1234567890", "Chasis_Number": "ABCDEFGHIJKL12345", "Vehicle_Make": "Toyota", "Vehicle_Color": "Blue", "Vehicle_Model": "Camry", "Year_of_Make": "2020", "Contact_Address": "123 Main St, City", "Method": API, } }
{ "error": "Transaction failed", "insureHistory": { "transactionId": "1234567890", "email": "user@example.com", "activity": "3rd party insurance", "message": "Order Failed", "recipient": "08032566178", "amount": 15000, "initialBalance": 20000, "finalBalance": 20000, "number": "ABC123", "Insured_Name": "John Doe", "Engine_Number": "1234567890", "Chasis_Number": "ABCDEFGHIJKL12345", "Vehicle_Make": "Toyota", "Vehicle_Color": "Blue", "Vehicle_Model": "Camry", "Year_of_Make": "2020", "Contact_Address": "123 Main St, City", "Method": API, } }
See usage example in the code snippets below:
GET request for available firstLevel and secondLevel:
Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
Response:
- Status Code: 200 { "3rd party insurance": { "available": true, "secondLevel": [ "Private", "Commercial", "Tricycles", "Motorcycle" ], "amount": [ 15000, 20000, 5000, 3000 ] } }