{ "Description": "Description of the user's wallet", "Owners": [ "user_m_01J18HZSACR1EMYNY1TBS8KTJD" ], "Currency": "EUR", "Tag": "Created using Mangopay API Postman Collection",}
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 pprintimport mangopaymangopay.client_id='your-client-id'mangopay.apikey='your-api-key'from mangopay.api import APIRequesthandler = APIRequest(sandbox=True)from mangopay.resources import NaturalUser, Walletnatural_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",}
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 pprintimport mangopaymangopay.client_id='your-client-id'mangopay.apikey='your-api-key'from mangopay.api import APIRequesthandler = APIRequest(sandbox=True)from mangopay.resources import NaturalUser, Walletnatural_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.
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).
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.
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.
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).
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.
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).
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.
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.
The date and time at which the wallet was created.
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
{ "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
{ "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",}