Creating a user

This page will show you how to create a user

This page will explain how to create a user by API and has the following sections:

Users can also be managed manually from the user management section of our web app.

Creating a user

A user can be created as follows:

curl {baseURL}/users  
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X POST  
-d '{
  "firstName": "John",
  "lastName": "Smith",
  "gender": "M",
  "email":"[email protected]",
  "roles":["ROLE_TRADER_STANDARD"],
  "mobileNumberCountryCode": "44",
  "mobileNumber": "7777123456",
  "customerUserId": "ID2345" 
}'

Only the email and roles fields are mandatory. The other fields are optional. Possible values for roles are ROLE_TRADER_STANDARD and ROLE_TRADER_ADMIN. Possible values for gender are M and F.

The mobileNumber and mobileNumberCountryCode are not mandatory but they are required for two-factor authentication for card payments ("3D Secure"). You will not be able to create cards for this user if the user doesn't have a mobile number. The following fields are mandatory to be able to create cards for the user:

  • mobileNumber
  • mobileNumberCountryCode
  • firstName
  • lastName
  • gender

The customerUserId is an optional field allowing you to add the id under which this user is known in your own system.

After creating a user, the response to the API will look as follows:

{
  "id":"user-id",
  "firstName": "John",
  "lastName": "Smith",
  "gender": "M",
  "email":"[email protected]",
  "roles":["ROLE_TRADER_STANDARD"],
  "traderId": "your-trader-id",
  "mobileNumberCountryCode": "44",
  "mobileNumber": "7777123456",
  "customerUserId": "ID2345", 
  "enabled": true,
  "emailConfirmed": false
}

After creating a user in Yordex, the user will receive an email to set their password. Once they set that, emailConfirmed will be true.

🚧

US cardholder term of service

US cardholder terms of service should be accepted by all users for whom cards issued by US issuers were created after 15 June 2023

If you are creating a user who will be issued a USD card, you must confirm they have acknowledged and accept the US cardholder terms of service before you create a USD card for this user.

Users who log in to Yordex will be prompted to accept these terms. If your users don't login to Yordex, you need to have them accept these term and confirm they have done so using the following API call:

curl {baseURL}/users  
-H "Authorization:your-api-key"  
-H "Content-type: application/json"  
-X POST  
-d '{
  ... all other fields required to create a user
  "termsOfService": {
        "accepted": "true/false"
    }
}'

Getting user details

Getting a list of all users is done as follows:

curl {baseURL}/users?size=10&page=0 
-H "Authorization:your-api-key"  
-X GET

The response will look as follows:

{
  "users": [
    {
      "id":"user-id-1",
      "firstName": "John",
      "lastName": "Smith",
      "gender": "M",
      "email":"[email protected]",
      "roles":["ROLE_TRADER_STANDARD"],
      "traderId": "your-trader-id",
      "mobileNumberCountryCode": "44",
      "mobileNumber": "7777123456",
      "customerUserId": "ID2345", 
      "enabled": true,
      "emailConfirmed": true
    }, 
    {
      "id":"user-id-2",
      "firstName": "Delia",
      "lastName": "Smith",
      "gender": "F",
      "email":"[email protected]",
      "roles":["ROLE_TRADER_ADMIN"],
      "traderId": "your-trader-id",
      "mobileNumberCountryCode": "44",
      "mobileNumber": "7777123457",
      "customerUserId": "ID3456", 
      "enabled": true,
      "emailConfirmed": true
    }
  ]
}

Getting an individual user is done as follows:

curl {baseURL}/users/user-id
-H "Authorization:your-api-key"  
-X GET

The response will be similar as when getting a list of users.