One Time Password Service

The One Time Password service provides endpoints which allows the generation and sending of One-Time Passwords (OTPs) which can be used as an alternative to username and password authentication.

Endpoints

Generate and Send SMS OTP Code

POST onetimepassword/generateAndSendSMSOTP.json

If configured for the program, generates an OTP code, and, if the provided phone number matches a user in the system, sends the code to the user via SMS. For security, returns a success even if there are no matching users with the phone number.

The following authentication methods are allowed for this endpoint:

Query Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID to perform the operation in.
  • mobilePhone (String) – (required) The mobile phone number associated with the user.
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required) The error code of the failure.
  • errorMessage (String) – (required) The (human readable) error message of the failure.

Error Codes

The following are the possible codes and messages that can be returned by the One Time Password Service.

There are other system-level errors which may be returned which are not documented here.

The caller of the endpoint can use the returned message to display to the end user or, if different wording is desired, can provide their own mapping of code to message.

Code Message
one_time_password.system_error System error
one_time_password.feature_disabled SMS OTP feature not enabled for this merchant
one_time_password.duplicate_phone_numbers Multiple users were found with this phone number