Skip to main content

Send OTP API

Overview

Send a One-Time Password (OTP) to the user's phone number or email for various verification purposes.

API Details

Constants

  • OTP Types:
    • 1 = REGISTRATION
    • 2 = FORGOT LOGIN PIN
    • 3 = FORGOT TRANSACTION PIN
    • 4 = FORGOT PASSWORD
    • 5 = COMMON
    • 6 = EMAIL
    • 7 = LOGIN
    • 8 = OLD PHONE
    • 9 = NEW PHONE
    • 10 = PAYMENT LINK VERIFICATION
    • 11 = ADD CASH MANUALLY
    • 12 = 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 = ADMIN
    • 2 = USER
    • 3 = MERCHANT
    • 4 = STAFF
    • 5 = AGENT

Response

{
"success": 1,
"error": [],
"data": {
"message": "AUTH_OTP_SENT_SUCCESS_MESSAGE"
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = 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
}'