Appearance
Link codes
Xash productsA link code connects a Xash account to another Xash product, such as the Xash point-of-sale system. The product asks Xash to send a code to the account holder's phone; the holder reads the code to the product; the product redeems it and receives the account's business details.
These endpoints are for Xash's own products. They accept only the product names listed below.
Issue a code
POST /api/v1/auth/link-code
No token is needed.
| Field | Type | Required | Description |
|---|---|---|---|
product | string | Yes | xash-pos or xash-ai. |
identifier | string | Yes | The user number of the account to link. Digits only. |
Response 202
json
{
"success": true,
"message": "A verification code has been sent by SMS. SMS charges may apply.",
"data": {
"delivery_method": "sms",
"expires_in_minutes": 15,
"product": "xash-pos"
}
}The answer is always the same, whether or not a code was sent. This is deliberate: it does not reveal which user numbers exist. A code is sent only when all of these are true:
- the user number belongs to an account;
- the account (or, for a branch, its owner) has business details with a business address;
- the wallet that pays has at least USD 0.025.
Sending the code charges USD 0.025 to the account's wallet. For a branch, the owner's wallet pays. A new code cancels any earlier unused code for the same account and product. The code has 5 digits and is valid for 15 minutes.
Limits
Passing any of these answers 429:
- 3 requests a minute for one user number from one IP;
- 5 codes an hour for one account;
- 10 codes an hour charged to one paying wallet.
Redeem a code
POST /api/v1/auth/link-code/redeem
Requires a server token.
| Field | Type | Required | Description |
|---|---|---|---|
product | string | Yes | The same value used to issue the code. |
identifier | string | Yes | The user number the code was issued for. |
code | string | Yes | The 5-digit code. |
Response 200
json
{
"success": true,
"message": "Link code redeemed.",
"data": {
"profile": {
"phone": "263770000001",
"user_number": "1234567890",
"first_name": "Tariro",
"last_name": "Example",
"email": null
},
"business": {
"id": "7",
"business_name": "Example Trading",
"trading_name": null,
"business_category": "Retail",
"bp_number": null,
"default_currency": "USD",
"business_address": {
"address_line_1": "1 Example Road",
"address_line_2": null,
"city": "Harare",
"country": "Zimbabwe"
}
},
"branch": null,
"branches": [
{
"label": "Avondale",
"user_number": "1098765432",
"phone": "263770000001a",
"city": "Harare"
}
]
}
}| Field | Description |
|---|---|
profile | The account that was linked. |
business | The owner's business. |
branch | When the linked account is a branch: its label, user_number, phone, city and the owner's parent_user_number. Otherwise null. |
branches | When the linked account is the owner: its branches. Empty for a branch. |
A code can be redeemed once.
Errors
| Status | When | message |
|---|---|---|
403 | The request did not use a server token. | Server token required. |
410 | The code has expired or was already used. | Link code has expired or has already been used. |
422 | The code or the user number is wrong. | Invalid link code or identifier. |
422 | The account's business details are incomplete. | Profile business/KYC data is incomplete. |
429 | More than 3 attempts a minute for one user number from one IP. |