Appearance
Your profile
Returns the account the token belongs to.
GET /api/v1/auth/profile
GET /api/v1/profile is the same endpoint under a second path.
Example
bash
curl https://app.xash.co.zw/api/v1/auth/profile \
-H "Authorization: Bearer YOUR_SERVER_TOKEN"Response 200
json
{
"success": true,
"message": "Profile fetched successfully.",
"data": {
"phone": "263770000001",
"first_name": "Tariro",
"last_name": "Example",
"id_number": "00-000000A00",
"dob": "1990-01-31",
"email": null,
"user_number": 1234567890,
"services": [
{ "name": "Airtime Voucher", "slug": "airtime_voucher", "order_by": 1 },
{ "name": "Direct Airtime", "slug": "direct_airtime", "order_by": 2 },
{ "name": "Electricity", "slug": "electricity", "order_by": 4 }
],
"business": null,
"is_sub_account": false
}
}| Field | Description |
|---|---|
phone | The account's phone number, digits only with the country code. |
user_number | The number you sign in with. Other Xash users send you money with it. |
services | The services the account is set up for. Same list as GET /api/v1/services. |
business | null until business details are added. Otherwise an object with id, profile_phone, business_name, business_category, bp_number, business_address and home_address. |
is_sub_account | true when the token belongs to a branch of a business. Then phone and user_number are the branch's, the name fields are the owner's, and business.business_name has the branch label added. |
A use for this endpoint in an integration is a start-up check: call it once to confirm the token works and belongs to the account you expect.