Verify OTP API
Overview
Verify a One-Time Password (OTP) sent to the user's phone number or email.
API Details
- Method: POST
- URL: https://api.gafapay.com:8443/gafapay/v3/auth/verify_otp
- Content-Type: application/json
- companyId: 59388167894b4d10a04fe5da3b8a2104
- ip_address: 127.0.0.1
- 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/verify_otp
Headers
Content-Type: application/json
companyId: 59388167894b4d10a04fe5da3b8a2104
ip_address: 127.0.0.1
request_id: b35d332f-131e-44c1-892f-8322e022da74
Request Body
{
"dial_code": "+221",
"phone_number": "968784549",
"user_type": 2,
"otp_type": 7,
"otp": 1234
}
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 verify (see Constants section)
- user_type (integer, required): Type of user
1= ADMIN2= USER3= MERCHANT4= STAFF5= AGENT
- otp (integer, required): The OTP code to verify
Response
{
"success": 1,
"error": [],
"data": {
"message": "AUTH_OTP_VERIFY_SUCCESSFULLY",
"user_id": "2c6267e21e164b34b63fa6213bc2aa6f",
"token": {
"type": "Token",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyYzYyNjdlMjFlMTY0YjM0YjYzZmE2MjEzYmMyYWE2ZiIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3MDk4MTQ3fQ.v1N4tm8m0kJK8E-bGRVz3D7KCu19z7-WDkbZE8qshDQ"
}
}
}
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 verified successfully
- user_id (string): Unique identifier of the authenticated user
- token (object): Authentication token information
- type (string): Token type identifier
- token (string): JWT token for subsequent API calls
Example Usage
curl --location 'https://api.gafapay.com:8443/gafapay/v3/auth/verify_otp' \
--header 'Content-Type: application/json' \
--header 'companyId: 59388167894b4d10a04fe5da3b8a2104' \
--header 'ip_address: 127.0.0.1' \
--header 'request_id: b35d332f-131e-44c1-892f-8322e022da74' \
--data '{
"dial_code": "+221",
"phone_number": "968784549",
"user_type": 2,
"otp_type": 7,
"otp": 1234
}'