Appearance
Registration
Xash appCreates an account and sends its user number and a 5-digit code to the phone by SMS. The account cannot be used until a password is set with that code.
POST /api/v1/auth/register
No token is needed.
Body
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | Yes | Up to 255 characters. |
last_name | string | Yes | Up to 255 characters. |
phone | string | Yes | A Zimbabwean mobile number that can receive SMS. It must not already belong to a finished account. |
dob | string | Yes | Date of birth as YYYY-MM-DD. The person must be at least 11 years old. |
id_number | string | Yes | National ID number. It must not already belong to a finished account. |
email | string | No | An email address. |
Example
bash
curl -X POST https://app.xash.co.zw/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"first_name": "Tariro",
"last_name": "Example",
"phone": "0770000001",
"dob": "1990-01-31",
"id_number": "00-000000A00"
}'Response 201
json
{
"success": true,
"message": "Registration successful. Check your SMS for a user number to finish registration.",
"data": {
"first_name": "Tariro",
"last_name": "Example",
"dob": "1990-01-31",
"phone": "263770000001",
"id_number": "00-000000A00"
}
}The user number is not in the response. It arrives by SMS together with the code, which is valid for 10 minutes. Next, call Set password.
If the code expires before you use it, ask for a new one with POST /api/v1/auth/request-pin-otp.
Registering the same phone again
A registration that was never finished (no password and no PIN set) does not block the phone. Registering again replaces it and sends a new user number and code.
Errors
| Status | When | Body |
|---|---|---|
422 | A field is missing or invalid, or the phone or ID number already belongs to a finished account. | Validation error |
500 | The SMS could not be sent. The registration is discarded. | {"success": false, "message": "Error sending user number via SMS. Verify your phone number and try again."} |