Register Endpoint
Validates registration data and emails a six-digit verification code. The user record is created only after Verify Register succeeds.
- Endpoint:
/api/v1/auth/register - Method:
POST - Authentication: Partner token.
Payload Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | String | Yes | Valid email address. |
password | String | Yes | Minimum 6 characters. |
password_confirmation | String | Yes | Must match password. |
first_name | String | Yes | User first name. |
name | String | Optional | Display name. |
last_name | String | Optional | User last name. |
tel_dial | String | Optional | Telephone dial code. |
phone | String | Optional | User phone number. |
country | String | Optional | Country name. |
address | String | Optional | User address. |
gender | String | Optional | User gender. |
date_of_birth | String | Optional | Date of birth. |
Sample Payload
{
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"password": "secret123",
"password_confirmation": "secret123",
"tel_dial": "66",
"phone": "800000000",
"country": "Thailand",
"address": "Bangkok",
"gender": "male",
"date_of_birth": "1995-06-15"
}
Sample Response
{
"result": 1,
"message": "The information has been sent to your email successfully."
}
The OTP is valid for one hour. Submit the same registration payload and the OTP to /api/v1/auth/verify-register.
Sample Failure Response
{
"result": 0,
"message": "user already exist"
}