🚀 VaultsPay API v1 is live. See what's new →
UsersCreate User

Create User

POST{baseUrl}/as/api/v1/users

Payload

AttributeTypeRequiredDescription
parentIdIntegerNo (Server-set)Set by the system as the ID of the merchant/agent creating the customer. Ignored if sent.
firstNameStringYesCustomer’s first name.
lastNameStringYesCustomer’s last name.
emailStringConditionalValid email. Optional; either email or (countryCode + phone) must be provided.
countryCodeStringConditionalRequired only when creating by phone. E.g., “92”.
phoneStringConditionalValid phone number. Optional; either email or (countryCode + phone) must be provided.
statusEnumYesOne of: ACTIVE, PENDING, BLOCK.
Request Example
{
  "firstName": "khalid",
  "lastName": "raza",
  "email": "khalidraza@gmail.com",
  "countryCode": "92",
  "phone": "3329465636",
  "status": "ACTIVE"
}

Either email or countryCode + phone must be provided.

Response

FieldTypeDescription
idIntegerID of the created user.
parentIdIntegerParent (merchant/agent) ID.
sessionIdStringSession ID (if available).
parentObjectParent details (id, firstName, lastName, userType, email, username, countryCode, phone, status, fullName, phoneNumber).
userTypeStringType of created user. Will be USER.
firstNameStringFirst name of the created user.
lastNameStringLast name of the created user.
emailStringEmail, if provided.
usernameStringSystem-generated unique username.
countryCodeStringCountry code, if phone was provided.
phoneStringPhone number, if provided.
statusStringStatus of the created user.
fullNameStringCombination of first and last name.
phoneNumberStringNormalized 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

HTTPCodeTypeMeaning / Notes
4001000INVALID_PAYLOADMissing/invalid fields (e.g., neither email nor phone provided).
4011001UNAUTHORISEDNot permitted to access the resource.
4011003TOKEN_EXPIREDaccessToken has expired; refresh required.
4011004SESSION_EXPIREDSession has expired; login required.