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:
-
User Information
- Basic user details (email, phone)
- Identity information (name, surname, ID code)
- Address and demographic data
- User services and settings
-
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 2.0 provides secure, user-authorized access and is the recommended method for accessing user information.
Quick Start Guide​
| Step | What to Do | Learn More |
|---|---|---|
| 1. Choose Method | Decide authentication approach: • OAuth 2.0 (recommended) • Static Permissions (special cases) | Authentication |
| 2. Configure Scopes | Select required permissions: • email, phone - Contact info• balance, statements - Financial data | Available Scopes |
| 3. Implement OAuth | Set up authorization flow: • Redirect to authorization • Exchange code for token • Handle callbacks | OAuth Guide |
| 4. Access Resources | Make 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
Some fields are optional and only available with specific permissions. Always check the API response for field availability.
Important Notes​
- 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
Access tokens expire after a certain period. Implement token refresh logic to maintain continuous access.
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 Code | Error Type | Description | How to Handle |
|---|---|---|---|
| 400 | invalid_parameters | Invalid request parameters or malformed data | Validate input before sending requests |
| 401 | unauthorized | Missing or invalid authentication | Check your credentials and authentication method |
| 403 | forbidden | Insufficient permissions or access denied | Verify required scopes and user authorization |
| 404 | not_found | Resource not found | Check if the resource ID is correct |
| 429 | rate_limit_exceeded | Too many requests | Implement rate limiting and retry logic |
| 500 | internal_error | Server error | Retry 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​
- 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
Never expose raw API error messages directly to end users, as they may contain sensitive information.
What's Next?​
Deep Dive into Features:
-
Using OAuth - Implement OAuth 2.0 authorization
- Authorization code grant flow
- Token management and refresh
- User redirection handling
-
Available Scopes - Understand permission system
- Offline scopes for persistent access
- Optional and extended scopes
- Scope combinations
-
User Resource - Manage user information
- Get user details
- User registration and identification
- Password and document management
-
Wallet Resource - Work with wallets
- Check balances and statements
- View transaction history
- Manage pending payments and favorites
Need Help?​
- API Support: tech_support@paysera.com
- OAuth Issues: Review the OAuth guide
- Scope Questions: Check available scopes