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 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.
Creating a US user
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 can order a USD card for this user.
Users who log in to Yordex will be prompted to accept this anyway. However, if you don't anticipate your user to access the Yordex UI, you can accept on their behalf by including the below additional array in your user request:
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",
"termsOfService": {
"accepted": "true/false"
}
}'
Getting user details
Getting a list of all users is done as follows:
curl {baseURL}/users
-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.
Updated 3 days ago