Customer Accounts
Purpose
Customer accounts represent the financial products and services linked to each user. These accounts are essential for processing financial transactions and managing customer funds.
When to use
Create an account after successfully onboarding a user and completing KYC verification. Update or close accounts as needed throughout the customer lifecycle.
Only Latin characters are supported for account creation. Ensure all user data uses Latin alphabet characters to avoid creation failures.
Testing Endpoints
You can test these endpoints directly in our API Sandbox.
Account Lifecycle
The typical lifecycle of a customer account follows these stages:
- List Products: Retrieve available product types to determine which accounts to create
- Create Account: Open an account of a specific product type
- Manage Account: View account details, retrieve balances, etc.
- Close Account: When the customer no longer needs the account
Available Product Types
Before creating a customer account, you need to determine which product types are available for your integration.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/productsaccount_view- cURL
- Python
- JavaScript
curl -X GET "https://sandbox.revsto.com/api/distributor/v1/products" \
-H "Authorization: Bearer your_api_token"
import requests
url = "https://sandbox.revsto.com/api/distributor/v1/products"
headers = {"Authorization": "Bearer your_api_token"}
response = requests.get(url, headers=headers)
print(response.json())
fetch("https://sandbox.revsto.com/api/distributor/v1/products", {
headers: {"Authorization": "Bearer your_api_token"}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Sample Response
{
"items": [
{
"id": "235",
"type": "CURRENT",
"currency": "EUR",
"name": "REVSTO_TESTING EUR",
"profiles": [
306,
309
]
},
{
"id": "242",
"type": "CURRENT",
"currency": "EUR",
"name": "REVSTO TEST C2B",
"profiles": [
306,
309
]
},
{
"id": "251",
"type": "CURRENT",
"currency": "EUR",
"name": "REVSTO TEST C2B 1.7_0.25",
"profiles": [
306,
309
]
}
],
"count": 3,
"limit": 20,
"offset": 0,
"sort": "+id"
}
Create an Account
Create financial accounts for users who have completed the KYC process.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/users/{userId}/accountsaccount_creationCode Examples
- cURL
- Python
- JavaScript
curl -X POST "https://sandbox.revsto.com/api/distributor/v1/users/{userId}/accounts" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_token" \
-d '{"productId": 235}'
import requests
userId = "user123" # Replace with your actual user ID
url = f"https://sandbox.revsto.com/api/distributor/v1/users/{userId}/accounts"
payload = {"productId": 235}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer your_api_token"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const userId = "user123"; // Replace with your actual user ID
fetch(`https://sandbox.revsto.com/api/distributor/v1/users/${userId}/accounts`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer your_api_token"
},
body: JSON.stringify({
productId: 235
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Request Body
{
"productId": 235
}
Sample Response
{
"id": "10000097583",
"externalId": null,
"userId": 3633,
"productId": 235,
"status": "OPENED",
"label": "REVSTO_TESTING EUR #10000097583",
"balance": {
"value": 0,
"currency": "EUR"
},
"availableBalance": {
"value": 0,
"currency": "EUR"
},
"createdAt": "2025-05-08T14:45:37+03:00",
"lastUsedAt": "2025-05-08T14:45:37+03:00"
}
Account Creation Parameters
| Parameter | Required | Description |
|---|---|---|
productId | Yes | The ID of the product to create (from the List Products endpoint) |
Get Account Details
Retrieve detailed information about a specific account.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}account_view- cURL
- Python
- JavaScript
curl -X GET "https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}" \
-H "Authorization: Bearer your_api_token"
import requests
accountId = "acc123" # Replace with your actual account ID
url = f"https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}"
headers = {"Authorization": "Bearer your_api_token"}
response = requests.get(url, headers=headers)
print(response.json())
const accountId = "acc123"; // Replace with your actual account ID
fetch(`https://sandbox.revsto.com/api/distributor/v1/accounts/${accountId}`, {
headers: {"Authorization": "Bearer your_api_token"}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Sample Response
{
"id": "10000096916",
"externalId": null,
"userId": 3630,
"productId": 235,
"status": "OPENED",
"label": "REVSTO_TESTING EUR #10000096916",
"balance": {
"value": 997480,
"currency": "EUR"
},
"availableBalance": {
"value": 997480,
"currency": "EUR"
},
"createdAt": "2025-05-05T16:39:51+03:00",
"lastUsedAt": "2025-05-08T14:37:51+03:00",
"iban": "DK6189000021685625",
"bic": "SXPYDKKKXXX"
}
Account Status Values
| Status | Description |
|---|---|
PENDING | Account created but not yet active |
OPENED | Account is active and can be used for transactions |
SUSPENDED | Account temporarily suspended |
CLOSED | Account permanently closed |
List All Accounts
Retrieve all accounts managed by the distributor.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/accountsaccount_view- cURL
- Python
- JavaScript
curl -X GET "https://sandbox.revsto.com/api/distributor/v1/accounts" \
-H "Authorization: Bearer your_api_token"
import requests
url = "https://sandbox.revsto.com/api/distributor/v1/accounts"
headers = {"Authorization": "Bearer your_api_token"}
response = requests.get(url, headers=headers)
print(response.json())
fetch("https://sandbox.revsto.com/api/distributor/v1/accounts", {
headers: {"Authorization": "Bearer your_api_token"}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Sample Response
{
"items": [
{
"id": "10000008325",
"externalId": null,
"userId": 1016,
"productId": 8,
"status": "OPENED",
"label": "Distributor Current account Revsto (EUR) #10000008325",
"balance": {
"value": 0,
"currency": "EUR"
},
"availableBalance": {
"value": 0,
"currency": "EUR"
},
"createdAt": "2024-06-21T15:20:46+03:00",
"lastUsedAt": "2024-06-21T15:20:46+03:00",
"iban": "DK7289000020669352",
"bic": "SXPYDKKKXXX"
},
{
"id": "10000096916",
"externalId": null,
"userId": 3630,
"productId": 235,
"status": "OPENED",
"label": "REVSTO_TESTING EUR #10000096916",
"balance": {
"value": 997480,
"currency": "EUR"
},
"availableBalance": {
"value": 997480,
"currency": "EUR"
},
"createdAt": "2025-05-05T16:39:51+03:00",
"lastUsedAt": "2025-05-08T14:37:51+03:00",
"iban": "DK6189000021685625",
"bic": "SXPYDKKKXXX"
}
],
"count": 2,
"limit": 20,
"offset": 0,
"sort": "+ids"
}
Close an Account
Close an account when it's no longer needed. This operation is irreversible.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}Before closing an account, ensure that:
- The account has a zero balance or has been emptied
- There are no pending transactions
- Any recurring payments or direct debits have been canceled
account_close- cURL
- Python
- JavaScript
curl -X DELETE "https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}" \
-H "Authorization: Bearer your_api_token"
import requests
accountId = "acc123" # Replace with your actual account ID
url = f"https://sandbox.revsto.com/api/distributor/v1/accounts/{accountId}"
headers = {"Authorization": "Bearer your_api_token"}
response = requests.delete(url, headers=headers)
print(f"Status: {response.status_code}")
const accountId = "acc123"; // Replace with your actual account ID
fetch(`https://sandbox.revsto.com/api/distributor/v1/accounts/${accountId}`, {
method: "DELETE",
headers: {"Authorization": "Bearer your_api_token"}
})
.then(response => {
console.log(`Status: ${response.status}`);
return response.text();
})
.then(data => console.log(data))
.catch(err => console.error(err));
Sample Response
Returns 200 OK on successful account closure.
Close User Account
Close a user account, which automatically closes all associated product accounts. The balance of all accounts should be 0 before closure.
Endpoint
https://sandbox.revsto.com/api/distributor/v1/users/{userId}This operation will close the user account and all associated product accounts. Ensure all account balances are zero before proceeding.
user_deactivate- cURL
- Python
- JavaScript
curl -X DELETE "https://sandbox.revsto.com/api/distributor/v1/users/{userId}" \
-H "Authorization: Bearer your_api_token"
import requests
userId = "user123" # Replace with your actual user ID
url = f"https://sandbox.revsto.com/api/distributor/v1/users/{userId}"
headers = {"Authorization": "Bearer your_api_token"}
response = requests.delete(url, headers=headers)
print(f"Status: {response.status_code}")
const userId = "user123"; // Replace with your actual user ID
fetch(`https://sandbox.revsto.com/api/distributor/v1/users/${userId}`, {
method: "DELETE",
headers: {"Authorization": "Bearer your_api_token"}
})
.then(response => {
console.log(`Status: ${response.status}`);
return response.text();
})
.then(data => console.log(data))
.catch(err => console.error(err));
Response
Returns 200 OK on successful user closure.
Account Balances
When retrieving account details, you may notice two different balance fields:
| Field | Description |
|---|---|
balance | The total amount of money in the account, including any pending transactions |
availableBalance | The amount available for immediate use, excluding holds, pending transactions, etc. |
Best Practices
-
Create Multiple Accounts: Consider creating multiple accounts for different purposes (e.g., one for savings, one for daily transactions).
-
Handle Currency Correctly: Be aware of currency-specific restrictions for each product type.
-
Monitor Account Status: Subscribe to account status change events via webhooks to stay informed about account changes.
-
Implement Proper Error Handling: Be prepared to handle rejection scenarios, such as when an account cannot be created due to KYC issues.
-
Store Reference IDs: Always store both the
userIdandaccountIdfor future reference and transaction processing.
Next Steps
After creating accounts, you can proceed to:
- Fund the accounts (see Money Payment Flows)
- Set up recurring transactions
- Process financial transactions
See the Money Payment Flows section for details on processing transactions.