> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/wallets/create-wallet/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Create a Wallet POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/wallets Content-Type: application/json Create a Mangopay wallet for a Mangoapy User. **Caution – Currency not updatable** The `Currency` of a created wallet cannot be changed. Reference: https://docs.mangopay.com/api-reference/wallets/create-wallet ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL. ## Servers - `https://api.sandbox.mangopay.com` (Sandbox, default) - `https://api.mangopay.com` (Production) - `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox) - `https://api-mtls.mangopay.com` (mTLS Production) ## Request ### Path parameters - `ClientId` (string, required) — Platform's API account identifier, associated with the API key. ### Body (application/json) This endpoint expects a CreateAWalletRequest. - `Description` (string, required) — Max. length: 255 characters The 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). - `Owners` (list of string, required) — The unique identifier of the user owning the wallet. **Note:** Only one owner can be defined; this array accepts only one string. - `Currency` (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. - `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`. ## Response ### 200 Success - `Description` (string, optional) — Max. length: 255 characters The 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). - `Owners` (list of string, optional) — The unique identifier of the user owning the wallet. **Note:** Only one owner can be defined; this array accepts only one string. - `Id` (string, optional) — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object. - `Balance` (UserWalletResponseBalance, optional) — The current balance of the wallet. - `Currency` (string, optional) — **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. - `FundsType` (string, optional) — **Returned values:** `DEFAULT`, `FEES`, `CREDIT` The type of funds in the wallet: - `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot 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. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. - `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`. - `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the wallet was created. ## Errors ### 400 Bad Request Error Bad Request - `Message` (string, optional) — Description of the error. - `Type` (string, optional) — The category of the error. - `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support. - `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered. - `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors. ### 403 Forbidden Error Forbidden - `Message` (string, optional) — Description of the error. - `Type` (string, optional) — The category of the error. - `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support. - `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered. - `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors. ## Types ### UserWalletResponseBalance The current balance of the wallet. - `Currency` (string, optional) — **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 amount. - `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ## Examples **Response** ```json { "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 } ``` **SDK Code** ```python 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) ``` ```javascript 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) ``` ```java 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 owner = new ArrayList(); 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); } } ``` ```csharp 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); } } ``` ```php 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); } ``` ```ruby 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) ```