Skip to main content

Getting User's Information

Learn how to access user information and wallet data using OAuth 2.0 authentication.

What You Can Access​

The Wallet API allows you to get information about:

  1. User Information

    • Basic user details (email, phone)
    • Identity information (name, surname, ID code)
    • Address and demographic data
    • User services and settings
  2. Wallet & Account Data

    • Wallet balances across currencies
    • Transaction history and statements
    • Pending payments
    • Account information

Authentication & Permissions​

To access user information, you need to authenticate using one of these methods:

Static Permissions (Special Cases)

In special cases, permissions can be granted statically for a client to access all or part of any user's information in the Paysera system. User ID or identifier must be provided in the request.

OAuth 2.0 ✅ Recommended

In most cases, permissions must be granted by a specific user using OAuth 2.0 protocol. This allows users to authorize your application to access their information.

OAuth is Recommended

OAuth 2.0 provides secure, user-authorized access and is the recommended method for accessing user information.

Quick Start Guide​

StepWhat to DoLearn More
1. Choose MethodDecide authentication approach:
• OAuth 2.0 (recommended)
• Static Permissions (special cases)
Authentication
2. Configure ScopesSelect required permissions:
• email, phone - Contact info
• balance, statements - Financial data
Available Scopes
3. Implement OAuthSet up authorization flow:
• Redirect to authorization
• Exchange code for token
• Handle callbacks
OAuth Guide
4. Access ResourcesMake API calls with token:
• Get user information
• Check wallet balance
• View transactions
User Resource
Wallet Resource

Common Use Cases​

Get User Balance

GET /rest/v1/wallet/me/balance
Authorization: MAC id="SlAV32hkKG", ...

→ Learn more: Wallet Resource - Check Balance

Get User Information

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

→ Learn more: User Resource - Get User Info

Get Transaction History

GET /rest/v1/wallet/me/statements?limit=50
Authorization: MAC id="SlAV32hkKG", ...

→ Learn more: Wallet Resource - View Statements


Resource Relationships​

The following diagram shows the relationship between user information resources:

User
├── Basic Info (email, phone, address)
├── Identity (name, surname, ID code)
├── Wallets (one or more)
│ ├── Balance
│ ├── Statements
│ ├── Pending Payments
│ └── Account Number
└── Services & Preferences
Optional Fields

Some fields are optional and only available with specific permissions. Always check the API response for field availability.


Important Notes​

Privacy & Security
  • Never store user access tokens permanently without user consent
  • Always use HTTPS for all API requests
  • Respect scope limitations
  • Handle user data according to privacy regulations
Token Expiration

Access tokens expire after a certain period. Implement token refresh logic to maintain continuous access.

Offline Scopes

Use offline scopes (*_offline) to access user information without requiring the access token, after initial authorization.


Error Handling​

The Wallet API uses standard HTTP status codes and returns error responses in JSON format. Understanding these errors will help you build robust applications.

Common Error Codes​

Status CodeError TypeDescriptionHow to Handle
400invalid_parametersInvalid request parameters or malformed dataValidate input before sending requests
401unauthorizedMissing or invalid authenticationCheck your credentials and authentication method
403forbiddenInsufficient permissions or access deniedVerify required scopes and user authorization
404not_foundResource not foundCheck if the resource ID is correct
429rate_limit_exceededToo many requestsImplement rate limiting and retry logic
500internal_errorServer errorRetry the request after some time

Error Response Format​

All errors follow this structure:

{
"error": "error_code",
"error_description": "Human-readable error message"
}

Example Error Responses​

Invalid Parameters (400)

{
"error": "invalid_parameters",
"error_description": "Invalid email address format"
}

Forbidden (403)

{
"error": "forbidden",
"error_description": "You do not have permission to access this resource"
}

Not Found (404)

{
"error": "not_found",
"error_description": "User not found"
}

Unauthorized (401)

{
"error": "unauthorized",
"error_description": "Invalid access token"
}

Best Practices​

Error Handling Tips
  • Always check the HTTP status code before parsing the response
  • Log error details for debugging purposes
  • Provide user-friendly error messages in your application
  • Implement retry logic for temporary errors (500, 503)
  • Handle rate limiting (429) with exponential backoff
Security Note

Never expose raw API error messages directly to end users, as they may contain sensitive information.


What's Next?​

Deep Dive into Features:

  1. Using OAuth - Implement OAuth 2.0 authorization

    • Authorization code grant flow
    • Token management and refresh
    • User redirection handling
  2. Available Scopes - Understand permission system

    • Offline scopes for persistent access
    • Optional and extended scopes
    • Scope combinations
  3. User Resource - Manage user information

    • Get user details
    • User registration and identification
    • Password and document management
  4. Wallet Resource - Work with wallets

    • Check balances and statements
    • View transaction history
    • Manage pending payments and favorites

Need Help?​