Send OTP API
Overview
Send a One-Time Password (OTP) to the user's phone number or email for various verification purposes.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/auth/send_otp
- Content-Type: application/json
- companyId: 59388167894b4d10a04fe5da3b8a2104
- request_id: b35d332f-131e-44c1-892f-8322e022da74
Constants
- OTP Types:
1= REGISTRATION2= FORGOT LOGIN PIN3= FORGOT TRANSACTION PIN4= FORGOT PASSWORD5= COMMON6= EMAIL7= LOGIN8= OLD PHONE9= NEW PHONE10= PAYMENT LINK VERIFICATION11= ADD CASH MANUALLY12= MERCHANT SCAN CUSTOMER QR OR CARD
Endpoint
POST https://api.gafapay.com:8443/gafapay/v3/auth/send_otp
Headers
Content-Type: application/json
companyId: 59388167894b4d10a04fe5da3b8a2104
request_id: b35d332f-131e-44c1-892f-8322e022da74
Request Body
{
"dial_code": "+221",
"phone_number": "968784549",
"otp_type": 1,
"user_type": 2
}
Request Body Fields
- dial_code (string, required): Country dial code (e.g., "+221")
- phone_number (string, required): User's phone number
- otp_type (integer, required): Type of OTP to send (see Constants section)
- user_type (integer, required): Type of user
1= ADMIN2= USER3= MERCHANT4= STAFF5= AGENT
Response
{
"success": 1,
"error": [],
"data": {
"message": "AUTH_OTP_SENT_SUCCESS_MESSAGE"
}
}
Response Fields
- success (integer): Response status indicator
1= Success0= Failure
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message indicating OTP was sent successfully
Example Usage
curl --location 'https://api.gafapay.com:8443/gafapay/v3/auth/send_otp' \
--header 'Content-Type: application/json' \
--header 'companyId: 59388167894b4d10a04fe5da3b8a2104' \
--header 'request_id: b35d332f-131e-44c1-892f-8322e022da74' \
--data '{
"dial_code": "+221",
"phone_number": "968784549",
"user_type": 2,
"otp_type": 7
}'