Create a new user and send an OTP token to the user's mobile. If the mobile number already exists, do not create a new user. Send an OTP code to the existing user's mobile and disregard any other signup params.

If successful:

  • an OTP code will be sent via SMS to the user's mobile

  • an otp_auth_key will be returned to the client

Hong Kong mobile numbers

  • must begin with +8525, +8526, or +8529

  • must contain a further 7 digits.

Valid examples:

  • +85251234567

  • +85261234567

  • +85291234567

Invalid examples:

  • +11112345678 - must begin with +8525, +8526, or +8529

  • +85212345678 - must begin with +8525, +8526, or +8529

  • +8525234567 - too short

  • +852523456789 - too long

To understand the registration process in detail please refer to the attached Registration flowcharts

Supported Formats

json

Errors

Code Description
422 Validation Error
500 Internal Server Error

Examples

POST /api/v1/auth/signup
{
  "user_auth": {
    "mobile": "+85251224538",
    "first_name": "Jake",
    "last_name": "Deamon",
    "address_attributes": {
      "district_id": "1",
      "address_type": "Profile"
    }
  }
}
200
{
  "otp_auth_key": "/JqONEgEjrZefDV3ZIQsNA=="
}

Params

Param name Description
user_auth
required

Validations:

  • Must be a Hash

user_auth[mobile]
optional

Mobile number e.g. +85212345678

Validations:

  • Must be a String

user_auth[first_name]
optional

Given name (first name)

Validations:

  • Must be a String

user_auth[last_name]
optional

Family name (last name)

Validations:

  • Must be a String

user_auth[address_attributes]
required

Validations:

  • Must be a Hash

user_auth[address_attributes][district_id]
optional

Hong Kong district

Validations:

  • Must be a String

user_auth[address_attributes][address_type]
optional

Type of address e.g. 'Profile' or 'Collection'

Validations:

  • Must be a String