{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Currency": "EUR",
"Tag": "Created using Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$wallet = new \MangoPay\Wallet();
$wallet->Owners = ['198675238'];
$wallet->Currency = 'EUR';
$wallet->Description = 'EUR Wallet';
$wallet->Tag = 'Created with Mangopay PHP SDK';
$response = $api->Wallets->Create($wallet);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key'
})
let userId = '165863393'
let wallet = {
Owners: [userId],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay NodeJS SDK'
}
const createWallet = async (walletObject) => {
return await mangopay.Wallets.create(wallet)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createWallet(wallet)
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 createWallet(walletObject)
begin
response = MangoPay::Wallet.create(walletObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create wallet: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '146476890',
}
myWallet = {
Owners: [myUser[:Id]],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay Ruby SDK'
}
createWallet(myWallet)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.Wallet;
public class CreateWallet {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
ArrayList<String> owner = new ArrayList<String>();
owner.add("user_m_01HSAVT2J0REPGV5ZRPNK079K9");
Wallet wallet = new Wallet();
wallet.setOwners(owner);
wallet.setCurrency(CurrencyIso.EUR);
wallet.setDescription("EUR Wallet");
wallet.setTag("Created using the Mangopay Java SDK");
Wallet createWallet = mangopay.getWalletApi().create(wallet);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateUbo);
System.out.println(createWallet);
}
}
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 NaturalUser, Wallet
natural_user = NaturalUser.get('213753890')
user_wallet = Wallet(
owners=[natural_user],
description='Wallet of Rhoda Keeling',
currency='EUR',
tag="Created using the Mangopay Python SDK"
)
create_wallet = user_wallet.save()
pprint(create_wallet)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var wallet = new WalletPostDTO(
[userId],
"Wallet in GBP",
CurrencyIso.GBP
);
var createWallet = await api.Wallets.CreateAsync(wallet);
string prettyPrint = JsonConvert.SerializeObject(createWallet, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "EUR",
"Amount": 0
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
User wallets
Create a Wallet
POST
/
v2.01
/
{ClientId}
/
wallets
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Currency": "EUR",
"Tag": "Created using Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$wallet = new \MangoPay\Wallet();
$wallet->Owners = ['198675238'];
$wallet->Currency = 'EUR';
$wallet->Description = 'EUR Wallet';
$wallet->Tag = 'Created with Mangopay PHP SDK';
$response = $api->Wallets->Create($wallet);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key'
})
let userId = '165863393'
let wallet = {
Owners: [userId],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay NodeJS SDK'
}
const createWallet = async (walletObject) => {
return await mangopay.Wallets.create(wallet)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createWallet(wallet)
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 createWallet(walletObject)
begin
response = MangoPay::Wallet.create(walletObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create wallet: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '146476890',
}
myWallet = {
Owners: [myUser[:Id]],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay Ruby SDK'
}
createWallet(myWallet)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.Wallet;
public class CreateWallet {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
ArrayList<String> owner = new ArrayList<String>();
owner.add("user_m_01HSAVT2J0REPGV5ZRPNK079K9");
Wallet wallet = new Wallet();
wallet.setOwners(owner);
wallet.setCurrency(CurrencyIso.EUR);
wallet.setDescription("EUR Wallet");
wallet.setTag("Created using the Mangopay Java SDK");
Wallet createWallet = mangopay.getWalletApi().create(wallet);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateUbo);
System.out.println(createWallet);
}
}
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 NaturalUser, Wallet
natural_user = NaturalUser.get('213753890')
user_wallet = Wallet(
owners=[natural_user],
description='Wallet of Rhoda Keeling',
currency='EUR',
tag="Created using the Mangopay Python SDK"
)
create_wallet = user_wallet.save()
pprint(create_wallet)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var wallet = new WalletPostDTO(
[userId],
"Wallet in GBP",
CurrencyIso.GBP
);
var createWallet = await api.Wallets.CreateAsync(wallet);
string prettyPrint = JsonConvert.SerializeObject(createWallet, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "EUR",
"Amount": 0
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
Best practice – Create one wallet per user and currencyWhile Mangopay authorizes you to create as many wallets as required, we recommend you create one wallet per user and currency.
Caution – Currency not updatableThe
Currency of a created wallet cannot be changed.Body parameters
string
required
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
required
stringThe unique identifier of the user owning the wallet.Note: Only one owner can be defined; this array accepts only one string.
string
required
Allowed 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
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.
Responses
200
200
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.
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
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: 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.
400 - Limited to one owner per wallet
400 - Limited to one owner per wallet
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "c09ebc81-24d6-47ef-8cef-d491209faee8",
"Date": 1702037849.0,
"errors": {
"Owners": "Owners doesn't support multiple values for the moment"
}
}
400 - Currency not supported
400 - Currency not supported
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "d3370a5b-af3c-4b99-9e6e-6c7dea052e19",
"Date": 1690284549.0,
"errors": {
"Currency": "Currency: The currency AZN is not available"
}
}
403 - User's UserStatus is CLOSED
403 - User's UserStatus is CLOSED
{
"Message": "User closed: No action can be performed",
"Type": "user_closed",
"Id": "10cdfa86-e743-4d0e-8172-9de82128e1d2#1779272906",
"Date": 1779272907,
"errors": null
}
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
"Balance": {
"Currency": "EUR",
"Amount": 0
},
"Currency": "EUR",
"FundsType": "DEFAULT",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1724921476
}
{
"Description": "Description of the user's wallet",
"Owners": [
"user_m_01J18HZSACR1EMYNY1TBS8KTJD"
],
"Currency": "EUR",
"Tag": "Created using Mangopay API Postman Collection",
}
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$wallet = new \MangoPay\Wallet();
$wallet->Owners = ['198675238'];
$wallet->Currency = 'EUR';
$wallet->Description = 'EUR Wallet';
$wallet->Tag = 'Created with Mangopay PHP SDK';
$response = $api->Wallets->Create($wallet);
print_r($response);
} catch(MGPResponseException $e) {
print_r($e);
} catch(MGPException $e) {
print_r($e);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key'
})
let userId = '165863393'
let wallet = {
Owners: [userId],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay NodeJS SDK'
}
const createWallet = async (walletObject) => {
return await mangopay.Wallets.create(wallet)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createWallet(wallet)
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 createWallet(walletObject)
begin
response = MangoPay::Wallet.create(walletObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create wallet: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '146476890',
}
myWallet = {
Owners: [myUser[:Id]],
Currency: 'EUR',
Description: 'Wallet in EUR',
Tag: 'Created using Mangopay Ruby SDK'
}
createWallet(myWallet)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.entities.Wallet;
public class CreateWallet {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
ArrayList<String> owner = new ArrayList<String>();
owner.add("user_m_01HSAVT2J0REPGV5ZRPNK079K9");
Wallet wallet = new Wallet();
wallet.setOwners(owner);
wallet.setCurrency(CurrencyIso.EUR);
wallet.setDescription("EUR Wallet");
wallet.setTag("Created using the Mangopay Java SDK");
Wallet createWallet = mangopay.getWalletApi().create(wallet);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(updateUbo);
System.out.println(createWallet);
}
}
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 NaturalUser, Wallet
natural_user = NaturalUser.get('213753890')
user_wallet = Wallet(
owners=[natural_user],
description='Wallet of Rhoda Keeling',
currency='EUR',
tag="Created using the Mangopay Python SDK"
)
create_wallet = user_wallet.save()
pprint(create_wallet)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using MangoPay.SDK.Entities.POST;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var wallet = new WalletPostDTO(
[userId],
"Wallet in GBP",
CurrencyIso.GBP
);
var createWallet = await api.Wallets.CreateAsync(wallet);
string prettyPrint = JsonConvert.SerializeObject(createWallet, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I