User Resource
Get user information
This method returns information about the user.Requesting user by ID
GET https://wallet.paysera.com/rest/v1/user/:id
Parameters
id
- id of the user. Can be integer or me
(if access token is used)
Requesting user by other information
GET https://wallet.paysera.com/rest/v1/user?person_code[:nationality]=:person_code&email=:email&phone=:phone
Parameters
person_code - person's identification code
nationality - person's nationality (country to which person code belongs) in ISO 3166-1 alpha-2 format
email - person's confirmed email address
phone
- person's confirmed phone number; must start with country code and without 00
or +
sign
person_code
always comes with
nationality
86
is country code for China
Response data structure
id
email
email
or scope email_offline
was confirmed;only if currently available for this user
phone
phone
or scope phone_offline
was confirmed;only if currently available for this user
address
address
or scope address_offline
was confirmed;only if currently available for this user
dob
dob
or scope dob_offline
was confirmed;only if currently available for this user
yyyy-mm-dd
gender
gender
or scope gender_offline
was confirmed;only if currently available for this user
male
, female
identity
identity
or
full_name
, or scope
identity_offline
or
full_name_offline
or
confirmed;only if currently available for this user
identification_level
identification_level
or
identification_level_offline
confirmed;type
legal
, natural
calculated_level
identification_level
or
identification_level_offline
confirmed;wallets
wallet_list
or scope wallet_list_offline
was confirmed
options
pep
politically_exposed_persons
Address data structure
country
city
street
post_index
Identity data structure
name
surname
nationality
identity
is active
code
identity
is active
Options data structure
default_currency
Identification levels
unidentified
semi_identified
identified
fully_identified
Pep data structure
name
relation
positions
Example request
GET /rest/v1/user/221 HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="9JanJHwnBfPdahjqd0I+kzbdEM/TRVY/h3xtAhzjos0="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "id": 221, "email": "something@example.com", "phone": "37066612345", "address": { "country": "lt", "city": "Vilnius", "street": "Lauko g. 1" }, "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" }, "pep": [ { "name": "Bill", "relation": "Parents", "positions": [ "head_of_state" ] } ] }
Getting specific information about the user
You can also request some specific user information. When getting all information, specific element can be missing
if it is not available or if you don't have permissions to access it. When requesting specific information,
error with status code 403
is returned if you have no permissions to access it and error with
status code 404
- if information is not currently available.
When requesting user's available wallets, response format is different than in user request - array of wallet objects is returned, not only their IDs (see wallet object response structure).
Requesting specific user information by ID
me
(if access token is used)Getting the specific user email
GET https://wallet.paysera.com/rest/v1/user/:id/email
Example request for the specific user email
GET /rest/v1/user/221/email HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="YJoiU+AkAlYkdGXIzHR8EfC70Dd6vALDB4cN17urtZ4="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
"example@paysera.com"
Getting the specific user phone
GET https://wallet.paysera.com/rest/v1/user/:id/phone
Example request for the specific user phone
GET /rest/v1/user/221/phone HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="NrSooeVbipBrt4m02hAexuapxJRXucphzUduHc6GNj4="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
"370612312345"
Getting the specific user confirmed phones
GET https://wallet.paysera.com/rest/v1/user/:id/confirmed-phones
Example request for the specific user phone
GET /rest/v1/user/221/confirmed-phones HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="F8drQOyK2oEi/eTROdbQrLgvycvM14SFAjjnfLB8LBQ="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
[ "370612312345" ]
Getting the specific user address
GET https://wallet.paysera.com/rest/v1/user/:id/address
Example request for the specific user address
GET /rest/v1/user/221/address HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="3kfDyk9vaRCu47XFvKQ3PBfQX3BR0fIeXrqZC4PVvRc="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "country": "lt", "city": "Vilnius", "street": "Street example 16", "post_index": "LT-11111" }
Getting the specific user identity
GET https://wallet.paysera.com/rest/v1/user/:id/identity
Example request for the specific user identity
GET /rest/v1/user/221/identity HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="a/a7ZtHbFEuSWowd+7+A3t5tlWnQk7SNLrQlETn5i5w="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "name": "John", "surname": "Smith", "nationality": "lt", "code": "31001010000" }
Getting the specific user wallets
GET https://wallet.paysera.com/rest/v1/user/:id/wallets
Example request for the specific user wallets
Parameters
id
- id of the user. Can be integer or me
(if access token is used)
inactive_included
- By default endpoint returns only active wallets, use ?inactive_included=true
to get inactive also
GET /rest/v1/user/221/wallets HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="4ZaEVJ1lryXXR9+PJgjROWAjGZE1/VVuFzCik3uJqGw="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
[ { "id": 14471, "owner": 221, "account": { "number": "EVP0010001000101", "owner_title": "John Smith", "description": "My personal account" }, "status": "active" }, { "id": 14472, "owner": 221, "account": { "number": "EVP3210001000102", "owner_title": "Company Inc." }, "status": "active" } ]
Getting user's services
These methods allow to get or enable user services. To use these methods services
scope is required.
Services list
Services list with their description are provided below.
affiliate
macro
micro
offline
payment_instruments
paysera_app
sms_bank
Service data structure
service
status
enabled
, disabled
title
actions
enable
, disable
added
url
url_plain
Requesting enabled user services
GET https://wallet.paysera.com/rest/v1/user/:id/services
Parameters
id
- id of the user. Can be integer or me
(if access token is used)
Response data structure
user_id
services
Example request
GET /rest/v1/user/221/services HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="N1HGqFcc6hxuabSWzYNYSPfSEQ48Ne8zPu7Mhx2Bm2s="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "user_id": "221", "services": [ { "service": "micro", "status": "enabled", "title": "Micro", "actions": [ "enable", "disable" ], "added": 1402406430, "url": "http://test.url", "url_plain": "http://testplain.url" }, { "service": "offline", "status": "enabled", "title": "Offline", "actions": [ "enable" ], "added": 1403864605, "url": "http://test.url", "url_plain": "http://testplain.url" }, { "service": "macro", "status": "enabled", "title": "Macro", "actions": [ "disable" ], "added": 1404201388, "url": "http://test.url", "url_plain": "http://testplain.url" } ] }
Enabling service for user
PUT https://wallet.paysera.com/rest/v1/user/:id/service/:service
Parameters
id
- id of the user. Can be integer or me
(if access token is used)
service - Service key
Example request
PUT /rest/v1/user/221/service/macro HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="mI95WuvEkvM12/inG8Ol9bFvyXqJAn/YDzTDPdEyGgA="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "service": "macro", "status": "enabled", "title": "Macro", "actions": [ "disable" ], "added": 1404376087, "url": "http://test.url", "url_plain": "http://testplain.url" }
Register new user
Request
POST https://wallet.paysera.com/rest/v1/user
Request body structure
email
phone
and credentials
are not specified
phone
email
and credentials
are not specified
00
or +
sign
locale
en
, lt
, ru
identity
credentials
email
and phone
are not specified
card
parameters
Identity data structure
name
surname
is provided
surname
name
is provided
nationality
code
is provided
code
nationality
is provided
Credentials data structure
type
main-password
, pre-salt-sha1-base64
. Types are detailed below
password
type
parameter
password_salt
type
values
username
type
values
Depending on the type
parameter, other values may be required or unavailable to use:
main-password
- Permanent password to Paysera system is provided. This is used when new user registers with Paysera system,
client must not save the password. With this type, password
parameter is user's provided
password in plain text, password_salt
and username
parameters are unavailable.
email
or phone
must also be provided when using this type of credentials
pre-salt-sha1-base64
- This type is used for providing custom credentials, already available in client's system - this is
for migrating users to Paysera system. With this type, password
parameter is the hash of the
password, password_salt
and username
parameters are also required.
email
and phone
parameters are unavailable if this type is used - if email address
or phone number is known, client doesn't need to provide credentials, as the user will get instructions
how to provide a new one in Paysera system.
password_salt
is provided in base64 format. Plain password is prefixed with
password_salt
in binary format, password
is SHA-1 hash result in base64
encoding.
Password hashing algorithm:
password = base64_encode(sha1(base64_decode(password_salt) + plain_password))
If custom credentials are provided (not type main-password
), first time that user logs to
Paysera system, she will be provided with registration form, where permanent
password will be provided (possible the same as provided by API). Also contact details are required - phone or
email address.
If no credentials are passed, user will get notification SMS to phone or letter to email with registration instructions. However, user is able to fill funds and make transfers from her account before filling the registration form in Paysera system.
Card data structure
issuer
vilniecio
, paysera
number
Parameters structure
phone_link
{code}
, which will
be replaced with the confirmation code. This is intended to provide easier phone confirmation in mobile
applications, where links could open and prefill the code to the program or would make instant API call
email_link
{code}
, which will
be replaced with the confirmation code. This is intended to provide easier email confirmation in mobile
applications, where links could open and prefill the code to the program or would make instant API call
scopes
generator_phone_code
-
lets the same code to be used for initiating generator, so that no additional SMS message is needed;
convert_currency_phone_code
- lets the same code to be used with token refresh to extend
current access token scope with convert_currency
app_client
Response data structure
On success API returns user object that was created. See get user information for more info. Response will contain all provided fields, not only those, which are accessible by getting user directly - to get all fields special permissions granted by the user are needed.
Errors
card_already_assigned
, person_code_already_assigned
,
email_already_assigned
, phone_already_assigned
Example request for registering user with main password
POST /rest/v1/user HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="eBXVCLxUKdb5kHFEG2P62Rjmv3cPMjbmQu6W3Hs7GUY=", ext="body_hash=aqslU%2B2JiI%2FtXkuAxcZfJT3W6J6wLavgfCt%2FR80R1CE%3D"
{ "email": "email@example.com", "phone": "37066612345", "locale": "lt", "identity": { "name": "John", "surname": "Smith" }, "credentials": { "type": "main-password", "password": "secretPassword22" }, "parameters": { "phone_link": "myapp://phone_confirmation/{code}", "email_link": "myapp://email_confirmation/{code}" } }
Example request for registering user with full identity
POST /rest/v1/user HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="0g1ATPbLN4r1/4qMbL+3PuA4gP3CxVSRZdK/LHuTbjo=", ext="body_hash=dw6npD8qCjzeCskm3%2B5HKXePepCH1%2Bgv9%2FrjzVNvrw4%3D"
{ "phone": "37066612345", "identity": { "name": "John", "surname": "Smith", "nationality": "lt", "code": "31001010000" } }
Example request for registering user with custom credentials
POST /rest/v1/user HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="g92wlN+ouFXcFmTaD24mCx2XzIYvKLhJ1MOTL+FaYyM=", ext="body_hash=W3RkJuVGVP%2FhFOWE27YK5D6N1IoNvbRmM9KxSUgl4ZQ%3D"
{ "credentials": { "type": "pre-salt-sha1-base64", "password": "ZCsTcGHtfkkcjovbYy+tJzgr2SM=", "password_salt": "GA40QjJ+6oT+qu7eDjsJcBzVwZw=", "username": "johnsm" } }
secretPassword22
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "id": 221, "phone": "37066612345", "identity": { "name": "John", "surname": "Smith", "nationality": "lt", "code": "31001010000" }, "wallets": [ 14471 ] }
Getting receipt for registered user
In case user is registered at some location (for offline
or gateway
clients),
user receipt can (and must) be printed and given to the user. It is not allowed for the client to save
receipt's text or display it for anyone else except the user herself.
Registration receipt request
GET https://wallet.paysera.com/rest/v1/user/:userId/receipt/registration?locale=:locale&width=:width
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
locale
- optional parameter; locale for the text translation. Currently available locales: en
, lt
, ru
width - optional parameter; maximum symbol count in one line. Longer lines will be broken into separate ones
Response data structure
text
\r\n
characters (CR + LF)
Example request
GET /rest/v1/user/221/receipt/registration?locale=en&width=35 HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="5A68z9rhEL2JamyBDZ3SzQh4rjWXolMnyBxH7mGh5Xg="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "text": "You have registered in PayserarnsystemrnYour confirmation code is ABCDEF" }
Assigning phone to user
Request
POST https://wallet.paysera.com/rest/v1/user/:userId/phone
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
phone
email
and credentials
are not specified
00
or +
sign
parameters
Parameters structure
phone_link
{code}
, which will
be replaced with the confirmation code. This is intended to provide easier phone confirmation in mobile
applications, where links could open and prefill the code to the program or would make instant API call
scopes
generator_phone_code
-
lets the same code to be used for initiating generator, so that no additional SMS message is needed;
convert_currency_phone_code
- lets the same code to be used with token refresh to extend
current access token scope with convert_currency
Response data structure
On success API returns user object. See get user information for more info.
Errors
phone_already_assigned
, not found
, rate_limit_exceeded
(if current client made too many requests in some period of time)
Example request
POST /rest/v1/user/221/phone HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="Mp+ItikyWphKoUBKW96GQPwJS7pXB5+YuNYEVSStMKU=", ext="body_hash=FtpRvrnoUbS8ZJZO5KK5xJGvHku%2FqUmJMhdeBE3blso%3D"
{ "phone": "37066612345", "parameters": { "phone_link": "myapp://phone_confirmation/{code}" } }
Confirming user's phone number
Request
PUT https://wallet.paysera.com/rest/v1/user/:userId/phone/confirm
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
code
Response data structure
On success API returns user object. See get user information for more info.
Errors
invalid_code
(if code is incorrect), rate_limit_exceeded
(if current client made too
many invalid code attempts in some period of time)
Example request
PUT /rest/v1/user/221/phone/confirm HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="Q1FKNpCN+oh8A7T0s8MZUIevpGb2OigS28PMzg9Xw4E=", ext="body_hash=sc%2BZyvNgEganUAKIuipczDh2Bd7WT3KE78M3tnuFdoU%3D"
{ "code": "ABCDEF" }
Assigning email to user
Request
POST https://wallet.paysera.com/rest/v1/user/:userId/email
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
email
parameters
Parameters structure
email_link
{code}
, which will be replaced with the confirmation code.
Response data structure
On success API returns user object. See get user information for more info.
Errors
email_already_assigned
, not found
, rate_limit_exceeded
(if current client made too many requests in some period of time)
Example request
POST /rest/v1/user/221/email HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="pRH5X3W30ktJ97vhmOBDJ82O+Jasg1RQ+SlNeYdwD0g=", ext="body_hash=XdfKkp5CnXHijeYwWiGq53BkFzRK98VwDQXi1et8%2BpY%3D"
{ "email": "test@test.com" }
Confirming user's email address
Request
PUT https://wallet.paysera.com/rest/v1/user/:userId/email/confirm
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
code
Response data structure
On success API returns user object. See get user information for more info.
Errors
invalid_code
(if code is incorrect), rate_limit_exceeded
(if current client made too
many invalid code attempts in some period of time)
Example request
PUT /rest/v1/user/221/email/confirm HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="h99hxFpjRKH7m3PK0CKSbKD+4W0d8QhzHZKaF75KvO4=", ext="body_hash=sc%2BZyvNgEganUAKIuipczDh2Bd7WT3KE78M3tnuFdoU%3D"
{ "code": "ABCDEF" }
Resetting user's password
- Client makes request to API providing user's phone or email address.
-
If user is identified in Paysera system, error response is returned with code
identity_required
. In this case client asks user for nationality and person code. Client makes request again, providing user's phone or email address, together with identity information. - Paysera system sends user SMS or email with confirmation code and card information.
- User inputs the code and new password into the client.
- Client makes password change request, providing confirmation code and new password.
Request
POST https://wallet.paysera.com/rest/v1/user/password/reset
Request body structure
email
phone
is not specified, unavailable otherwise
phone
email
is not specified, unavailable otherwise
00
or +
sign
identity
parameters
Identity data structure
code
Parameters structure
phone_link
{code}
, which will
be replaced with the confirmation code. This is intended to provide easier phone confirmation in mobile
applications, where links could open and prefill the code to the program or would make instant API call
email_link
{code}
, which will
be replaced with the confirmation code. This is intended to provide easier email confirmation in mobile
applications, where links could open and prefill the code to the program or would make instant API call
app_client
Response data structure
On success API returns user object. See get user information for more information.
Errors
identity_required
(if identity is not provided, but required for resetting the password),
invalid_identity
(if user identity does not match confirmed one),
rate_limit_exceeded
(if too many requests or invalid requests are made
from this client in specified time period)
Example request
POST /rest/v1/user HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="CaA+7p90dpxasbRdcXQljrPSO4Jfa7NGhLBB2aoEhq0=", ext="body_hash=IwZ%2FnwduvQV8u0dfbkt97V9Cc6GpFq1CTy0v2bcpTdg%3D"
{ "email": "email@example.com", "parameters": { "email_link": "myapp://reset_password/{code}" } }
Example request if identity is needed
POST /rest/v1/user HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="hfhgmDsQVFhS8cqY9bPr1B7xm+rWk5/r5/sNCZptFM8=", ext="body_hash=6D98%2BlNEct%2BDRiE48vINf56FiIL%2BKGEklMp%2FAYo3EKg%3D"
{ "email": "37066612345", "identity": { "code": "31001010000" }, "parameters": { "phone_link": "myapp://reset_password/{code}" } }
Request for resetting the password
PUT https://wallet.paysera.com/rest/v1/user/:userId/password
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request data structure
code
old_password
is not specified, unavailable otherwise
old_password
code
is not specified, unavailable otherwise
password
Response data structure
On success API returns user object. See get user information for more information.
Errors
invalid_parameters
(if password does not match required constraints),
invalid_code
(if wrong code was provided),
rate_limit_exceeded
(if too many requests or invalid requests are made
from this client in specified time period)
invalid_password
(wrong old password was specified)
Example request - reset code specified
PUT /rest/v1/user/221/password HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="pt/524MeyaiUpF9EDN/N7HZG/tP4EgMBhiYX4Fq1sxw=", ext="body_hash=Kvtu30NDTm2TmQwqvn7GVhBIUM1ZsysaQiNCpAWNtBM%3D"
{ "code": "ABCDEF", "password": "newSecurePassword33" }
Example request - old password specified
PUT /rest/v1/user/221/password HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="1DYxLJwbdRZUqllOdAo3iCXG3ertrPABlOreZl0h1eg=", ext="body_hash=bqHO7kRJIqbt14UYtHiqn%2FKLlmM3Ck2%2FyI35WciaaEE%3D"
{ "old_password": "myOldPassword", "password": "newSecurePassword33" }
Providing user's identity
offline
or gateway
clients.
Receipt must be printed and given to the user after this request. User will get information to the provided
phone or email and on receipt, how she can confirm the information online.
Request
PUT https://wallet.paysera.com/rest/v1/user/:id
Parameters
id
- id of the user. Can be integer or me
(if access token is used)
Request body structure
email
phone
is not specified
phone
email
is not specified
00
or +
sign
identity
Response data structure
On success API returns user object. See get user information for more info.
Errors
person_code_already_assigned
, email_already_assigned
, phone_already_assigned
,
person_code_mismatch
, not_found
Example request
PUT /rest/v1/user/221 HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="c/xYJqipUXpIvRHe9I4bxMyjPdLdrDhI6QnvIYipXy8=", ext="body_hash=dw6npD8qCjzeCskm3%2B5HKXePepCH1%2Bgv9%2FrjzVNvrw4%3D"
{ "phone": "37066612345", "identity": { "name": "John", "surname": "Smith", "nationality": "lt", "code": "31001010000" } }
Getting receipt for identified user
In case user is identified at some location (for offline
or gateway
clients),
user receipt can (and must) be printed and given to the user. It is not allowed for the client to save
receipt's text or display it for anyone else except the user herself.
Identification receipt request
GET https://wallet.paysera.com/rest/v1/user/:userId/receipt/identification?locale=:locale&width=:width
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
locale
- optional parameter; locale for the text translation. Currently available locales: en
, lt
, ru
width - optional parameter; maximum symbol count in one line. Longer lines will be broken into separate ones
Response data structure
text
\r\n
characters (CR + LF)
Example request
GET /rest/v1/user/221/receipt/identification?locale=en HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="OKROveAfjh3RLp0YrBov/OtaYjVXD6aJTiLCCNMe+Cw="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "text": "You have started identification process in Paysera systemrnYour confirmation code is ABCDEF" }
Sending user's document
Document upload request
POST https://wallet.paysera.com/rest/v1/user/:userId/document
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body
Request body is binary content of the file being uploaded - no other formatting takes place.
Response data structure
Response is an object with single key - id
. This is document's ID, which is provided when
giving document's metadata.
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "id": 1232 }
Document metadata request
PUT https://wallet.paysera.com/rest/v1/user/document/:documentId/metadata
Parameters
documentId - id of the document, given in the response when document was uploaded
Request body structure
title
extension
pdf
, jpg
type
card
, passport
,
driver_licence
number
date
yyyy-mm-dd
, for example
1983-01-29
Response data structure
Response has same keys as was provided in request, with additional id
parameter - ID of the document.
Errors
not_found
, invalid_state
(if document metadata was already provided)
Example request
PUT /rest/v1/user/document/1232 HTTP/1.1 Host: wallet.paysera.com Content-Type: application/json;charset=utf-8 User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="2yVI5P5MbpJwk0rz8Lm09aU2hhDNQV022/JxEdRByP0=", ext="body_hash=RJBemF0EHy9gZzn7Ctf1%2FeDi3ptSrdPSz%2FS3hWtdTU4%3D"
{ "title": "Scanned driver's licence for John Smith", "extension": "pdf", "type": "driver_licence", "number": "BV1221312413", "date": "2010-04-30" }
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "id": 1232, "title": "Scanned driver's licence for John Smith", "extension": "pdf", "type": "driver_licence", "number": "BV1221312413", "date": "2010-04-30" }
Get users' positions
This method returns information about current positions of Paysera users. This method requires special client privileges.Requesting positions in some specific place
GET https://wallet.paysera.com/rest/v1/positions?lat=lat&lng=lng&distance=distance&limit=:limit&offset=:offset
Locations are filtered by place, providing lat
, lng
and distance
parameters.
Parameters
lat - required; latitude of coordinates in decimal format
lng - required; longitude of coordinates in decimal format
distance
- optional; distance in meters from given coordinates for filtering, defaults to 500
limit
- optional; maximum number of positions to be returned in one response. Defaults to 20
, maximum available is 200
.
offset
- optional; number of statements to skip. Defaults to 0
Response data structure
positions
_metadata
Position data structure
distance
user_info
User info data structure
wallet_id
account_number
user_id
display_name
phone
email
phone
or email
is only provided when display_name
is unavailable.
Metadata information structure
total
limit
and offset
parameters
offset
limit
Example request
GET /rest/v1/positions?lat=54.698686&lng=25.216615&distance=2000&limit=50 HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="9Y/yxkeNyfjO9pZEsV1xGUTJOJgrIooCEYYLZIpBqO8="
Example response
HTTP/1.1 200 OK Content-type: application/json;charset=utf-8
{ "locations": [ { "distance": 15, "user_info": { "display_name": "John S.", "user_id": 54, "wallet_id": 4558, "account_number": "EVP7010001000101" } }, { "distance": 298, "user_info": { "display_name": "Peter J.", "user_id": 4457, "wallet_id": 25487, "account_number": "EVP6310001000103" } } ], "_metadata": { "total": 2, "offset": 0, "limit": 50 } }
Manage user's position
These methods allow to provide, get or remove user's position for others to find by API.
To use these methods user_position
scope is required.
Providing user's position
PUT https://wallet.paysera.com/rest/v1/user/:userId/position
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
Request body contains user's position data structure.
lat
lng
type
hidden
(not displayed in public search), merchant
(not displayed in public search,
used for mobile retailers)
Response data structure
On success API returns user's position object - it has the same structure like one passed in request.
Getting current user's position
GET https://wallet.paysera.com/rest/v1/user/:userId/position
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Response data structure
On success API returns user's position object.
Removing current user's position
DELETE https://wallet.paysera.com/rest/v1/user/:userId/position
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Response data structure
On success API returns user's position object.
User's avatar
Displaying user's avatar
To display user's avatar, no API method is required - simple GET request to provided URL is enough without any authentication.
GET https://www.paysera.com/avatar/:userId.jpg?size=:size&default=:default
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
size
- optional; size of the avatar in pixels, defaults to 200
default
- optional; mm
to display default image, 404
to return status code 404
; defaults to 404
Providing and removing user's avatar
These methods allows to provide and remove user's avatar. To use these methods avatar
scope is required.
Providing user's avatar
PUT https://wallet.paysera.com/rest/v1/user/:userId/avatar
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
Request body is binary content of the image.
Response data structure
id
Removing user's avatar
DELETE https://wallet.paysera.com/rest/v1/user/:userId/avatar
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Response data structure
id
Contact book
Contact book is resource for helping to search for contacts. It can be used both to search for wallets by contacts and to subscribe to push notifications when user registers with such contact. If only one-time search is needed, the same can be achieved with simple wallet batch search.
Creating contact book
POST https://wallet.paysera.com/rest/v1/user/:userId/contact-book
Parameters
userId
- id of the user. Can be integer or me
(if access token is used)
Request body structure
emails
phones
email_hashes
phone_hashes
Response data structure
id
Deleting contact book
DELETE https://wallet.paysera.com/rest/v1/contact-book/:contactBookId
Parameters
contactBookId - Contact book identifier
Example response
HTTP/1.1 204 No Content Content-type: text/html;charset=utf-8
{ "time": 1383116734 }
Deleting contacts from contact book
DELETE https://wallet.paysera.com/rest/v1/contact-book/:contactBookId/contacts?email=:email&phone=:phone&email_hash=:email_hash&phone_hash=:phone_hash
Parameters
Parameters are passed in the query string.
Example request
DELETE /rest/v1/contact-book/1/contacts?email=a@evp.lt,b@evp.lt&phone=37012312345 HTTP/1.1 Host: wallet.paysera.com User-Agent: Paysera WalletApi PHP library Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="v8d2hRotPUCDdGP6hoXqYQZyolfpARS45PPBzNi4PPg="
contactBookId
email
phone
email_hash
phone_hash
Example response
HTTP/1.1 204 No Content Content-type: text/html;charset=utf-8
{ "time": 1383116734 }
Appending contacts to contact book
PUT https://wallet.paysera.com/rest/v1/contact-book/:id/append
Parameters
id - ID of the contact book to append contacts to
Request body structure
Request structure is the same as when creating new contact book.
Response data structure
Response structure is the same as when creating new contact book. Only wallets for appended contacts are returned.
User services
Resource allows to get User services and enable specific ones.
You must have scope services
to access this resource.
Get User services
GET https://wallet.paysera.com/rest/v1/user/:userId/services
Enable User service
PUT https://wallet.paysera.com/rest/v1/user/:userId/service/:service
Parameters
userId - id of the user.
service - service identifier. String
Response data structure
user_id
services
Service
objects
Service structure
service
status
enabled
or disabled
title
actions
enable
and disable
dependencies
url
url_plain
added