OTP
Send OTP
POST /otp/api/v2/send
For exisitng LipaLater customers this endpoint will verify their information (the mobile number and ID number tied to their account), additionally an OTP will be sent to the customer's mobile device to confirm phone number ownership. For new customers this endpoint will verify their personal details i.e their ID information.
Existing customer curl request
curl -i -X POST 'https://core-v2-multi-country.herokuapp.com/api/v2/otp/send' \
-H 'Authorization: Bearer <access_token>' \
-H "Content-type: application/json" \
-d '{"id_number":"31394166", "phone_number":"254726325094"}'
Exisiting customer JSON request
{
"id_number": "31394166",
"phone_number": "+254726325094"
}
New customer curl request
curl -i -X POST 'https://core-v2-multi-country.herokuapp.com/api/v2/otp/send' \
-H 'Authorization: Bearer <access_token>' \
-H "Content-type: application/json" \
-d '{"phone_number":"+254797087287", "id_number":"27934146", "first_name":"Derrick", "last_name":"Orare", "country_code":"KE","date_of_birth":"11/08/1990"}'
New customer JSON request
{
"phone_number": "+254797087287",
"id_number": "27934146",
"first_name": "Derrick",
"last_name": "Orare",
"country_code": "KE",
"date_of_birth": "11/08/1990"
}
JSON response
The otp
is sent to the phone_number
sent in the request above for verification. The response below is how the data is sent back from our API on production.
{
"request_id": "3f1e7b01-67c4-445c-9491-1503f674a4f3",
"apiVersion": "2.0",
"status": 200,
"data": "OTP has been sent successfully"
}
The test response will look like the one below. The otp
has been added to the body for easy verification when developing.
{
"request_id": "ab6a78ec-e1ed-4761-9aae-c71d79015833",
"apiVersion": "2.0",
"status": 200,
"data": {
"message": "OTP has been sent successfully",
"otp": "247335"
}
}
Verify OTP
POST /otp/api/v2/verify
curl request
curl -X POST 'https://core-v2-multi-country.herokuapp.com/api/v2/otp/verify' \
-H 'Authorization: Bearer <access_token>' \
-H "Content-type: application/json" \
-d '{"id_number":"31394165", "item_value":"15799", "otp":"373240", "phone_number":"+254726325093"}'
JSON request
{
"id_number": "31394165",
"item_value": "15799",
"otp": "373240",
"phone_number": "+254726325093"
}
JSON response
{
"request_id": "447cfa5b-6662-40be-9b25-1be14af634e6",
"apiVersion": "2.0",
"status": 200,
"data": {
"id": "8bf616dd-4cdc-4c55-80bc-58678102f3d3",
"credit_limit": 116000.0,
"available_limit": 40000.0,
"credit_limit_status": "limit_active",
"payment_terms": {
"principal_amount": "15799.00",
"upfront_fees": "1500.00",
"first_installment": "2816.58",
"minimum_payment": "1316.58"
}
}
}