Skip to main content

User Resource

Access and manage user information including registration, identification, profile data, and services.

Overview

The User Resource provides comprehensive methods for managing user data.

Quick Reference

FeatureEndpointsRequired ScopeDescription
Get User InfoGET /user/:idemail, phone, etc.Retrieve user details
Register UserPOST /userSpecial permissionCreate new user
Phone/EmailPOST/PUT /user/:id/phone-Assign and confirm
PasswordPOST/PUT /user/password-Reset and change
ServicesGET/PUT /user/:id/servicesservicesManage services
PositionPUT/GET /user/:id/positionuser_positionGeo location
AvatarPUT/DELETE /user/:id/avataravatarManage avatar
DocumentsPOST /user/:id/documentSpecial permissionUpload docs
Contact BookPOST /user/:id/contact-book-Manage contacts

→ Full scope list: Available Scopes


Get User Information

Retrieve user information by ID or other identifiers.

By User ID

GET /rest/v1/user/:id

Parameters:

  • id - User ID (integer) or me (with access token)

By Other Information

GET /rest/v1/user?person_code[:nationality]=:code&email=:email&phone=:phone

Query Parameters:

  • person_code - Person's identification code (with nationality)
  • nationality - ISO 3166-1 alpha-2 country code
  • email - Confirmed email address
  • phone - Confirmed phone (country code, no 00 or +)
Special Permission

Searching by person code requires special API client permissions.

📋 Response Structure & Example

Response Fields

FieldTypeWhen AvailableDescription
idintegerAlwaysUser ID
emailstringWith email scopeVerified email
phonestringWith phone scopeVerified phone
addressobjectWith address scopeUser address
dobstringWith dob scopeDate of birth (yyyy-mm-dd)
genderstringWith gender scopemale or female
identityobjectWith identity/full_name scopeVerified identity
identification_levelstringWith identification_level scopeIdentification level
calculated_levelstringWith identification_level scopeCalculated identification level of the user
typestringNot returned by default; enabled only for some clientsType of client: legal or natural
walletsarrayWith wallet_list scopeWallet IDs
optionsobjectIf availableUser options
peparrayWith pep scopePolitically exposed persons

Example Response

{
"id": 221,
"email": "something@example.com",
"phone": "37066612345",
"address": {
"country": "lt",
"city": "Vilnius",
"street": "Lauko g. 1",
"post_index": "LT-11111"
},
"dob": "1910-01-23",
"gender": "male",
"identity": {
"name": "John",
"surname": "Smith",
"nationality": "lt",
"code": "31001230000"
},
"identification_level": "fully_identified",
"wallets": [14471],
"options": {
"default_currency": "EUR"
}
}

Identification Levels

LevelDescription
unidentifiedLevel 1 - Starter
semi_identifiedLevel 2 - Basic
basic_identifiedLevel 2.5 - Intermediate
identifiedLevel 3 - Standard
fully_identifiedLevel 4 - Unlimited

Getting Specific User Information

Request specific fields individually:

GET /rest/v1/user/:id/email - Get email only

GET /rest/v1/user/:id/phone - Get phone only

GET /rest/v1/user/:id/address - Get address only

GET /rest/v1/user/:id/identity - Get identity only

GET /rest/v1/user/:id/wallets - Get wallets array

Returns 403 if no permissions, 404 if information not available.


Register New User

Special Feature

User registration requires special client permissions.

➕ Register New User - Full Documentation

Register User

POST /rest/v1/user

Request Body

{
"email": "email@example.com",
"phone": "37066612345",
"locale": "lt",
"identity": {
"name": "John",
"surname": "Smith",
"nationality": "lt",
"code": "31001010000"
},
"credentials": {
"type": "main-password",
"password": "secretPassword22"
},
"parameters": {
"phone_link": "myapp://phone_confirmation/{code}"
}
}

Request Fields

FieldRequiredDescription
emailConditionalEmail address
phoneConditionalPhone number (country code, no 00/+)
localeOptionalUser locale (en, lt, ru)
identityOptionalName, surname, nationality, code
credentialsConditionalLogin credentials
cardOptionalCard information
parametersOptionalAdditional parameters

Credential Types

main-password - Permanent password (for new registrations)

{
"type": "main-password",
"password": "plainTextPassword"
}

pre-salt-sha1-base64 - Custom credentials (for migrations)

{
"type": "pre-salt-sha1-base64",
"password": "hashedPassword",
"password_salt": "base64Salt",
"username": "johnsm"
}

Response

Returns user object with created user information.

Errors

  • card_already_assigned
  • person_code_already_assigned
  • email_already_assigned
  • phone_already_assigned

Advanced Features

📱 Phone & Email Management

Assign Phone

POST /rest/v1/user/:userId/phone

{
"phone": "37066612345",
"parameters": {
"phone_link": "myapp://confirm/{code}"
}
}

User receives SMS with confirmation code.

Confirm Phone

PUT /rest/v1/user/:userId/phone/confirm

{
"code": "ABCDEF"
}

Errors: phone_already_assigned, invalid_code, rate_limit_exceeded


Assign Email

POST /rest/v1/user/:userId/email

{
"email": "test@example.com",
"parameters": {
"email_link": "myapp://confirm/{code}"
}
}

Confirm Email

PUT /rest/v1/user/:userId/email/confirm

{
"code": "ABCDEF"
}
🔒 Password Management

Request Password Reset

POST /rest/v1/user/password/reset

{
"email": "email@example.com",
"identity": {
"code": "31001010000"
}
}

User receives confirmation code via email/SMS.

Change Password

PUT /rest/v1/user/:userId/password

With reset code:

{
"code": "ABCDEF",
"password": "newPassword123"
}

With old password:

{
"old_password": "oldPassword",
"password": "newPassword123"
}

Errors: identity_required, invalid_identity, invalid_code, invalid_password, rate_limit_exceeded

⚙️ User Services

Manage user-enabled services (requires services scope).

Get User Services

GET /rest/v1/user/:userId/services

Enable Service

PUT /rest/v1/user/:userId/service/:service

Available Services

ServiceDescription
affiliateAffiliate program participant
macroMacro payments collection
microMicro payments collection
offlineOffline service
payment_instrumentsPayment instruments usage
paysera_appPaysera app usage
sms_bankSMS bank service
📍 Position Management

Manage user's geographic position (requires user_position scope).

Provide Position

PUT /rest/v1/user/:userId/position

{
"lat": 54.698686,
"lng": 25.216615,
"type": "merchant"
}

Types: Default (public), hidden (not in search), merchant (mobile retailers)

Get Position: GET /rest/v1/user/:userId/position

Remove Position: DELETE /rest/v1/user/:userId/position

Get Users' Positions: GET /rest/v1/positions?lat=:lat&lng=:lng&distance=:distance

🖼️ Avatar Management

Manage user avatars (requires avatar scope).

Display Avatar

GET https://www.paysera.com/avatar/:userId.jpg?size=:size

No authentication required for viewing.

Upload Avatar

PUT /rest/v1/user/:userId/avatar

Body: Binary image content (not JSON)

Delete Avatar

DELETE /rest/v1/user/:userId/avatar

📄 Document Management

Upload identification documents (requires special permissions).

Upload Document

POST /rest/v1/user/:userId/document

Body: Binary file content

Provide Document Metadata

PUT /rest/v1/user/document/:documentId/metadata

{
"title": "Passport scan",
"extension": "pdf",
"type": "passport",
"number": "AB1234567",
"date": "2020-01-15"
}

Document Types: card, passport, driver_licence

🆔 Identification Process

Provide user identity information (requires special permissions).

Provide Identity

PUT /rest/v1/user/:userId

{
"email": "user@example.com",
"identity": {
"name": "John",
"surname": "Smith",
"nationality": "lt",
"code": "31001010000"
}
}

For offline or gateway clients. Receipt must be printed after this operation.

Get Identification Receipt

GET /rest/v1/user/:userId/receipt/identification?locale=:locale&width=:width

Get Registration Receipt

GET /rest/v1/user/:userId/receipt/registration?locale=:locale&width=:width

📖 Contact Book

Manage contact book for wallet search and notifications.

Create Contact Book

POST /rest/v1/user/:userId/contact-book

{
"emails": ["a@example.com", "b@example.com"],
"phones": ["37012345678"],
"email_hashes": ["hash1", "hash2"],
"phone_hashes": ["hash3"]
}

Delete Contact Book: DELETE /rest/v1/contact-book/:contactBookId

Remove Contacts: DELETE /rest/v1/contact-book/:id/contacts?email=:emails&phone=:phones

Append Contacts: PUT /rest/v1/contact-book/:id/append


Common Use Cases

Get Current User Profile

GET /rest/v1/user/me
Authorization: MAC id="access_token", ...

Register User with Email

POST /rest/v1/user
Content-Type: application/json

{
"email": "user@example.com",
"credentials": {
"type": "main-password",
"password": "SecurePass123"
}
}

Update User Avatar

PUT /rest/v1/user/me/avatar
Content-Type: image/jpeg

[binary image data]

What's Next?

  1. Wallet Resource - Work with wallets and balances
  2. Available Scopes - Review required scopes
  3. API Reference - Full endpoint documentation

Need Help?