// GET has no body parameters
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01K894KCN9MKGAJDCCDGQ7RSQX';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new FilterWallets();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Users->GetWallets($userId, $pagination, null, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let user = {
Id: "user_m_01JZ8AVM2Y1RWVY1RT396BYW9V",
};
const listUserWallets = async (userId) => {
return await mangopay.Users.getWallets(userId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listUserWallets(user.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listUserWallets(userId)
begin
response = MangoPay::User.wallets(userId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallets for the user: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: 'user_m_01JXJ256GTH5TKXF6RGVFYQVV7',
}
listUserWallets(myUser[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterWallets;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListUserWallets {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HSAVT2J0REPGV5ZRPNK079K9";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterWallets filter = new FilterWallets();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Wallet> wallets = mangopay.getUserApi().getWallets(userId, pagination, filter, sorting);
for (Wallet wallet : wallets) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(wallet);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
try:
all_wallets = Wallet.get_all_for_user(user.id, **{"ScaContext": 'USER_NOT_PRESENT'}, page=1, per_page=100)
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListUserWalletsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01K8AZGCCWGE9AA7J2M7ZE0SQ5";
var filter = new FilterWallets
{
ScaContext = "USER_PRESENT"
};
var pagination = new Pagination(1, 10);
try
{
await api.Users.GetWalletsAsync(userId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
[
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J18J1SQGG6KXNM3F8GD674TP",
"Balance": {
"Currency": "EUR",
"Amount": 99800
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1719348029
},
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "GBP",
"Amount": 0
},
"Currency": "GBP",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
User wallets
List Wallets for a User
GET
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
wallets
// GET has no body parameters
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01K894KCN9MKGAJDCCDGQ7RSQX';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new FilterWallets();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Users->GetWallets($userId, $pagination, null, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let user = {
Id: "user_m_01JZ8AVM2Y1RWVY1RT396BYW9V",
};
const listUserWallets = async (userId) => {
return await mangopay.Users.getWallets(userId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listUserWallets(user.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listUserWallets(userId)
begin
response = MangoPay::User.wallets(userId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallets for the user: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: 'user_m_01JXJ256GTH5TKXF6RGVFYQVV7',
}
listUserWallets(myUser[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterWallets;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListUserWallets {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HSAVT2J0REPGV5ZRPNK079K9";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterWallets filter = new FilterWallets();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Wallet> wallets = mangopay.getUserApi().getWallets(userId, pagination, filter, sorting);
for (Wallet wallet : wallets) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(wallet);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
try:
all_wallets = Wallet.get_all_for_user(user.id, **{"ScaContext": 'USER_NOT_PRESENT'}, page=1, per_page=100)
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListUserWalletsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01K8AZGCCWGE9AA7J2M7ZE0SQ5";
var filter = new FilterWallets
{
ScaContext = "USER_PRESENT"
};
var pagination = new Pagination(1, 10);
try
{
await api.Users.GetWalletsAsync(userId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
[
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J18J1SQGG6KXNM3F8GD674TP",
"Balance": {
"Currency": "EUR",
"Amount": 99800
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1719348029
},
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "GBP",
"Amount": 0
},
"Currency": "GBP",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
Caution - ScaContext default value changingOn this endpoint, the default value for
ScaContext is changing to USER_PRESENT on Dec 15, 2025 (Dec 1 in Sandbox).From this date, if the PendingUserAction.RedirectUrl value is returned, then you need to redirect the user to perform SCA.With approval from Mangopay, your platform may be able to use the USER_NOT_PRESENT value provided you also have a legal proxy in place with the user and the user’s consent to access wallet balances and transactions on their behalf (read more about proxy management).Note – SCA triggered by this endpointThis endpoint requires the user to perform SCA to authenticate the access to their wallet, unless SCA for wallet access was successfully completed in the last 180 days (or unless your platform is using a proxy and user consent).When SCA is required, this endpoint returns a 401 - Unauthorized response.To let the user complete the SCA session on the Mangopay-hosted webpage, your platform needs to retrieve the
RedirectUrl from the WWW-Authenticate response header, add an encoded returnUrl query parameter, and redirect the user. Read more about how to redirect them in the SCA session guide.In Sandbox, you can bypass SCA by including the word accept in the Email value of the Natural User or the LegalRepresentative.Email value of the Legal User – for example accept@example.com or john.doe+accept@example.com.Path parameters
string
required
The unique identifier of the user.
Query parameters
string
Possible values:
USER_PRESENT, USER_NOT_PRESENTThe SCA context of the request, which is required if the user’s UserCategory is OWNER:USER_PRESENT– The user is taking the SCA-triggering action of accessing their wallet. The platform must redirect the user using thePendingUserAction.RedirectUrlreturned so that the user can complete the SCA session (unless exempted because a successful SCA session for wallet access occurred in the last 180 days, so no redirection link was returned).USER_NOT_PRESENT– The platform is taking the action under proxy from the user and the user has previously given consent to Mangopay (via the SCA hosted experience) to allow the action. If the user has not given (or has revoked) their consent, thenUSER_NOT_PRESENTreturns a 403 error.
OWNER, and the default value will become USER_PRESENT from Dec 15, 2025 (Dec 1 in Sandbox)integer
Min. value:
1; max. value: 100Default value: 10Indicates the number of items returned for each page of the pagination.integer
Start value:
1Default value: 1Indicates the index of the page for the pagination.string
Possible values:
CreationDate:ASC, CreationDate:DESCDefault value: CreationDate:ASCIndicates the direction in which to sort the list.Responses
200
200
array
The list of wallets created by the platform.
Show properties
Show properties
object
The Wallet object created by the platform.
Show properties
Show properties
string
Max. length: 255 charactersThe description of the wallet. It can be a name, the type, or anything else that can help you clearly identify the wallet on the platform (and for your end users).
array
stringThe unique identifier of the user owning the wallet.Note: Only one owner can be defined; this array accepts only one string.
object
The current balance of the wallet.
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the balance.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the wallet.
string
Returned values:
DEFAULT, FEES, CREDITThe type of funds in the wallet:DEFAULT– Regular funds for user-owned wallets. Wallets with thisFundsTypecannot have a negative balance.FEES– Fees Wallet, for fees collected by the platform, specific to the Client Wallet object.CREDIT– Repudiation Wallet, for funds for the platform’s dispute management, specific to the Client Wallet object.
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
string
Max. length: 255 charactersCustom data that you can add to this object.
For wallets, you can use this parameter to identify the corresponding end user in your platform.
For wallets, you can use this parameter to identify the corresponding end user in your platform.
Unix timestamp
The date and time at which the wallet was created.
401 - SCA required
401 - SCA required
When SCA is required for wallet access, this endpoint returns a 401 - Unauthorized response code with the In this case, your platform needs to retrieve the URL value, encode and add a
redirectUrl in the WWW-Authenticate response header:401 response header
WWW-Authenticate: PendingUserAction redirectUrl=https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13
returnUrl query parameter, and redirect the user.Read more about SCA redirection and SCA on wallet access →[
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J18J1SQGG6KXNM3F8GD674TP",
"Balance": {
"Currency": "EUR",
"Amount": 99800
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1719348029
},
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "GBP",
"Amount": 0
},
"Currency": "GBP",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
// GET has no body parameters
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$userId = 'user_m_01K894KCN9MKGAJDCCDGQ7RSQX';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new FilterWallets();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Users->GetWallets($userId, $pagination, null, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let user = {
Id: "user_m_01JZ8AVM2Y1RWVY1RT396BYW9V",
};
const listUserWallets = async (userId) => {
return await mangopay.Users.getWallets(userId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listUserWallets(user.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listUserWallets(userId)
begin
response = MangoPay::User.wallets(userId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallets for the user: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: 'user_m_01JXJ256GTH5TKXF6RGVFYQVV7',
}
listUserWallets(myUser[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterWallets;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListUserWallets {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HSAVT2J0REPGV5ZRPNK079K9";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterWallets filter = new FilterWallets();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Wallet> wallets = mangopay.getUserApi().getWallets(userId, pagination, filter, sorting);
for (Wallet wallet : wallets) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(wallet);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
try:
all_wallets = Wallet.get_all_for_user(user.id, **{"ScaContext": 'USER_NOT_PRESENT'}, page=1, per_page=100)
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListUserWalletsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01K8AZGCCWGE9AA7J2M7ZE0SQ5";
var filter = new FilterWallets
{
ScaContext = "USER_PRESENT"
};
var pagination = new Pagination(1, 10);
try
{
await api.Users.GetWalletsAsync(userId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
Was this page helpful?
⌘I