Create User
POST{baseUrl}/as/api/v1/users
Payload
| Attribute | Type | Required | Description |
|---|---|---|---|
| parentId | Integer | No (Server-set) | Set by the system as the ID of the merchant/agent creating the customer. Ignored if sent. |
| firstName | String | Yes | Customer’s first name. |
| lastName | String | Yes | Customer’s last name. |
| String | Conditional | Valid email. Optional; either email or (countryCode + phone) must be provided. | |
| countryCode | String | Conditional | Required only when creating by phone. E.g., “92”. |
| phone | String | Conditional | Valid phone number. Optional; either email or (countryCode + phone) must be provided. |
| status | Enum | Yes | One of: ACTIVE, PENDING, BLOCK. |
Request Example
{
"firstName": "khalid",
"lastName": "raza",
"email": "khalidraza@gmail.com",
"countryCode": "92",
"phone": "3329465636",
"status": "ACTIVE"
}Either
countryCode+phonemust be provided.
Response
| Field | Type | Description |
|---|---|---|
| id | Integer | ID of the created user. |
| parentId | Integer | Parent (merchant/agent) ID. |
| sessionId | String | Session ID (if available). |
| parent | Object | Parent details (id, firstName, lastName, userType, email, username, countryCode, phone, status, fullName, phoneNumber). |
| userType | String | Type of created user. Will be USER. |
| firstName | String | First name of the created user. |
| lastName | String | Last name of the created user. |
| String | Email, if provided. | |
| username | String | System-generated unique username. |
| countryCode | String | Country code, if phone was provided. |
| phone | String | Phone number, if provided. |
| status | String | Status of the created user. |
| fullName | String | Combination of first and last name. |
| phoneNumber | String | Normalized E.164-like concatenation of countryCode + phone (if available). |
200 — SUCCESS
{
"data": {
"id": 604,
"parentId": 4,
"firstName": "test",
"lastName": "user",
"parent": {
"id": 4,
"firstName": "Default",
"lastName": "Agent",
"userType": "AGENT",
"email": "default.agent@vaultspay.ae",
"username": "default.agent",
"countryCode": "92",
"phone": "3332222222",
"status": "ACTIVE",
"fullName": "Default Agent",
"phoneNumber": "923332222222"
},
"userType": "USER",
"email": "test@vp.com.pk",
"username": "c4437be81dfe4d93ba58e7566c61f868",
"countryCode": "92",
"phone": "3319234231",
"status": "ACTIVE",
"fullName": "test user",
"phoneNumber": "923319234231"
}
}Error Responses
| HTTP | Code | Type | Meaning / Notes |
|---|---|---|---|
| 400 | 1000 | INVALID_PAYLOAD | Missing/invalid fields (e.g., neither email nor phone provided). |
| 401 | 1001 | UNAUTHORISED | Not permitted to access the resource. |
| 401 | 1003 | TOKEN_EXPIRED | accessToken has expired; refresh required. |
| 401 | 1004 | SESSION_EXPIRED | Session has expired; login required. |