OTP Endpoints

API reference for OTP initiation and verification endpoints.

Initiate OTP
Initiates OTP verification with a Fayda Card Number (FCN). This endpoint sends an OTP to the mobile number associated with the provided FCN.
POST/api/fayda/otp/initiate

Request Headers

HeaderRequiredDescription
Authorization / X-API-KeyYesYour API key. See Authentication.
Content-TypeYesMust be application/json.

Request Body

{
  "fcn": "1234567890123456"
}
ParameterTypeRequiredDescription
fcnStringYesThe 16-digit Fayda Card Number of the user.

Successful Response (200 OK)

json
{
  "success": true,
  "transactionId": "cd8e1472-57f4-49a2-ace9-6ec24ad3ac52",
  "maskedMobile": "09xxxxxx24",
  "status": "SUCCESS",
  "message": "OTP sent",
  "statusCode": 200
}
FieldTypeDescription
successBooleanIndicates if the OTP was successfully sent.
transactionIdStringA unique ID for this transaction. Required for the verify step.
maskedMobileStringThe masked mobile number to which the OTP was sent.

Error Responses

Common errors for this endpoint include:

  • INVALID_FCN - The FCN format is incorrect.
  • FCN_NOT_FOUND - The FCN does not exist in the Fayda system.
  • SMS_DELIVERY_FAILED - Could not send OTP to the user's phone.

See the full Error Reference for more details.

Verify OTP
Verifies the OTP entered by the user. If successful, it returns the user's verified identity data.
POST/api/fayda/otp/verify

Request Body

json
{
  "transactionId": "cd8e1472-57f4-49a2-ace9-6ec24ad3ac52",
  "otp": "123456",
  "fcn": "1234567890123456"
}
ParameterTypeRequiredDescription
transactionIdStringYesThe ID from the initiate OTP response.
otpStringYesThe 6-digit OTP entered by the user.
fcnStringYesThe user's 16-digit FCN.

Successful Response (200 OK)

json
{
  "success": true,
  "transactionId": "cd8e1472-57f4-49a2-ace9-6ec24ad3ac52",
  "user": {
    "uin": "8957253029940",
    "fullName": [
      { "language": "eng", "value": "John Doe" },
      { "language": "amh", "value": "ጆን ዶ" }
    ],
    "dateOfBirth": "1990/01/01",
    "gender": [
      { "language": "eng", "value": "Male" },
      { "language": "amh", "value": "ወንድ" }
    ],
    "phone": "0912345678",
    "region": "Addis Ababa",
    // ... other fields
  },
  "photo": "base64-encoded-image-data",
  "qrCode": "base64-encoded-qr-data"
}

Error Responses

Common errors for this endpoint include:

  • INVALID_OTP - The OTP is incorrect.
  • OTP_EXPIRED - The OTP has expired.
  • MAX_ATTEMPTS_REACHED - Too many incorrect OTP attempts.
  • TRANSACTION_NOT_FOUND - The transaction ID is invalid or has expired.