{
"OwnerAddress": {
"AddressLine1": "Rue des plantes",
"AddressLine2": "The Oasis",
"City": "Paris",
"Region": "Ile de France",
"PostalCode": "75001",
"Country": "FR"
},
"IBAN": "FR7630004000031234567890143",
"BIC": "BNPAFRPP",
"OwnerName": "John Doe",
"Tag": "Created using the 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 {
$userId = '146476890';
$bankAccount = new \MangoPay\BankAccount();
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Address line 1';
$address->AddressLine2 = 'Address line 2';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'Region';
$details = new \MangoPay\BankAccountDetailsIBAN();
$details->IBAN = 'FR7630004000031234567890143';
$details->BIC = 'BNPAFRPP';
$bankAccount->OwnerAddress = $address;
$bankAccount->OwnerName = 'Alex Smith';
$bankAccount->Tag = 'Created using Mangopay PHP SDK';
$bankAccount->Type = 'IBAN';
$bankAccount->Details = $details;
$response = $api->Users->CreateBankAccount($userId, $bankAccount);
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 user = {
Id: '165863393',
Address: {
AddressLine1: 'Edgewood Road',
AddressLine2: null,
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR',
},
FirstName: 'John',
LastName: 'Doe',
}
let bankAccount = {
Type: 'IBAN',
OwnerName: user.FirstName + '' + user.LastName,
OwnerAddress: user.Address,
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay NodeJS SDK',
}
const createBankAccount = async (userId, bankAccount) => {
return await mangopay.Users.createBankAccount(userId, bankAccount)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createBankAccount(user.Id, bankAccount)
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 createIbanBankAccount(userId, ibanBankAccountObject)
begin
response = MangoPay::BankAccount.create(userId, ibanBankAccountObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create bank account: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '165863393'
}
myIbanBankAccount = {
Type: 'IBAN',
OwnerName: 'Alex Smith',
OwnerAddress: {
AddressLine1: 'Edgewood Road',
AddressLine2: 'Address line 2',
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR'
},
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay Ruby SDK'
}
createIbanBankAccount(myUser[:Id], myIbanBankAccount)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.BankAccountType;
import com.mangopay.entities.BankAccount;
import com.mangopay.entities.UserNatural;
import com.mangopay.entities.subentities.BankAccountDetailsIBAN;
public class createIBANankaccount {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT");
BankAccount account = new BankAccount();
account.setType(BankAccountType.IBAN);
account.setOwnerName(user.getFirstName() + " " + user.getLastName());
account.setOwnerAddress(user.getAddress());
account.setUserId(user.getId());
BankAccountDetailsIBAN bankAccountDetails = new BankAccountDetailsIBAN();
bankAccountDetails.setIban("FR7630004000031234567890143");
bankAccountDetails.setBic("BNPAFRPP");
account.setDetails(bankAccountDetails);
account.setTag("Created using the Mangopay Java SDK");
BankAccount createAccount = mangopay.getUserApi().createBankAccount(user.getId(), account);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createAccount);
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 NaturalUser, BankAccount
from mangopay.utils import Address
natural_user = NaturalUser.get('213753890')
iban_bank_account = BankAccount(
user_id = natural_user.id,
owner_name = f'{natural_user.first_name} {natural_user.last_name}',
owner_address = Address(
address_line_1 = natural_user.address.address_line_1,
address_line_2 = natural_user.address.address_line_2,
city = natural_user.address.city,
region = natural_user.address.region,
postal_code = natural_user.address.postal_code,
country = natural_user.address.country,
),
iban = 'FR7630004000031234567890143',
bic = 'BNPAFRPP',
type = 'IBAN',
tag = 'Created using the Mangopay Python SDK'
)
create_iban_bank_account = iban_bank_account.save()
pprint(create_iban_bank_account)
using MangoPay.SDK;
using MangoPay.SDK.Entities.GET;
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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN");
var iban = "FR7630004000031234567890143";
var IbanBankAccount = new BankAccountIbanPostDTO(
user.FirstName + " " + user.LastName,
user.Address,
iban
) {
BIC = "BNPAFRPP",
Tag = "Created using the Mangopay .NET SDK"
};
BankAccountDTO createIbanBankAccount = await api.Users.CreateBankAccountIbanAsync(user.Id, IbanBankAccount);
string prettyPrint = JsonConvert.SerializeObject(createIbanBankAccount, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"OwnerAddress":{
"AddressLine1":"Rue des plantes",
"AddressLine2":"The Oasis",
"City":"Paris",
"Region":"Ile de France",
"PostalCode":"75001",
"Country":"FR"
},
"IBAN":"FR7630004000031234567890143",
"BIC":"BNPAFRPP",
"UserId":"142036728",
"OwnerName":"John Doe",
"Type":"IBAN",
"Id":"150287803",
"Tag":"custom meta",
"CreationDate":1661859994,
"Active":true
}
Bank accounts
Create an IBAN Bank Account
POST
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
bankaccounts
/
iban
{
"OwnerAddress": {
"AddressLine1": "Rue des plantes",
"AddressLine2": "The Oasis",
"City": "Paris",
"Region": "Ile de France",
"PostalCode": "75001",
"Country": "FR"
},
"IBAN": "FR7630004000031234567890143",
"BIC": "BNPAFRPP",
"OwnerName": "John Doe",
"Tag": "Created using the 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 {
$userId = '146476890';
$bankAccount = new \MangoPay\BankAccount();
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Address line 1';
$address->AddressLine2 = 'Address line 2';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'Region';
$details = new \MangoPay\BankAccountDetailsIBAN();
$details->IBAN = 'FR7630004000031234567890143';
$details->BIC = 'BNPAFRPP';
$bankAccount->OwnerAddress = $address;
$bankAccount->OwnerName = 'Alex Smith';
$bankAccount->Tag = 'Created using Mangopay PHP SDK';
$bankAccount->Type = 'IBAN';
$bankAccount->Details = $details;
$response = $api->Users->CreateBankAccount($userId, $bankAccount);
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 user = {
Id: '165863393',
Address: {
AddressLine1: 'Edgewood Road',
AddressLine2: null,
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR',
},
FirstName: 'John',
LastName: 'Doe',
}
let bankAccount = {
Type: 'IBAN',
OwnerName: user.FirstName + '' + user.LastName,
OwnerAddress: user.Address,
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay NodeJS SDK',
}
const createBankAccount = async (userId, bankAccount) => {
return await mangopay.Users.createBankAccount(userId, bankAccount)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createBankAccount(user.Id, bankAccount)
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 createIbanBankAccount(userId, ibanBankAccountObject)
begin
response = MangoPay::BankAccount.create(userId, ibanBankAccountObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create bank account: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '165863393'
}
myIbanBankAccount = {
Type: 'IBAN',
OwnerName: 'Alex Smith',
OwnerAddress: {
AddressLine1: 'Edgewood Road',
AddressLine2: 'Address line 2',
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR'
},
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay Ruby SDK'
}
createIbanBankAccount(myUser[:Id], myIbanBankAccount)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.BankAccountType;
import com.mangopay.entities.BankAccount;
import com.mangopay.entities.UserNatural;
import com.mangopay.entities.subentities.BankAccountDetailsIBAN;
public class createIBANankaccount {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT");
BankAccount account = new BankAccount();
account.setType(BankAccountType.IBAN);
account.setOwnerName(user.getFirstName() + " " + user.getLastName());
account.setOwnerAddress(user.getAddress());
account.setUserId(user.getId());
BankAccountDetailsIBAN bankAccountDetails = new BankAccountDetailsIBAN();
bankAccountDetails.setIban("FR7630004000031234567890143");
bankAccountDetails.setBic("BNPAFRPP");
account.setDetails(bankAccountDetails);
account.setTag("Created using the Mangopay Java SDK");
BankAccount createAccount = mangopay.getUserApi().createBankAccount(user.getId(), account);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createAccount);
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 NaturalUser, BankAccount
from mangopay.utils import Address
natural_user = NaturalUser.get('213753890')
iban_bank_account = BankAccount(
user_id = natural_user.id,
owner_name = f'{natural_user.first_name} {natural_user.last_name}',
owner_address = Address(
address_line_1 = natural_user.address.address_line_1,
address_line_2 = natural_user.address.address_line_2,
city = natural_user.address.city,
region = natural_user.address.region,
postal_code = natural_user.address.postal_code,
country = natural_user.address.country,
),
iban = 'FR7630004000031234567890143',
bic = 'BNPAFRPP',
type = 'IBAN',
tag = 'Created using the Mangopay Python SDK'
)
create_iban_bank_account = iban_bank_account.save()
pprint(create_iban_bank_account)
using MangoPay.SDK;
using MangoPay.SDK.Entities.GET;
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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN");
var iban = "FR7630004000031234567890143";
var IbanBankAccount = new BankAccountIbanPostDTO(
user.FirstName + " " + user.LastName,
user.Address,
iban
) {
BIC = "BNPAFRPP",
Tag = "Created using the Mangopay .NET SDK"
};
BankAccountDTO createIbanBankAccount = await api.Users.CreateBankAccountIbanAsync(user.Id, IbanBankAccount);
string prettyPrint = JsonConvert.SerializeObject(createIbanBankAccount, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"OwnerAddress":{
"AddressLine1":"Rue des plantes",
"AddressLine2":"The Oasis",
"City":"Paris",
"Region":"Ile de France",
"PostalCode":"75001",
"Country":"FR"
},
"IBAN":"FR7630004000031234567890143",
"BIC":"BNPAFRPP",
"UserId":"142036728",
"OwnerName":"John Doe",
"Type":"IBAN",
"Id":"150287803",
"Tag":"custom meta",
"CreationDate":1661859994,
"Active":true
}
Caution - Payouts refused to Bank Accounts created after April 30, 2026Bank Account objects created after April 30, 2026, will not be usable for payouts. External accounts must be registered using the Recipient endpoints and authenticated using SCA.Payouts to Bank Accounts created after May 1, 2026, will fail with the
ResultCode 121018. To resolve this, register the external account using POST Create a Recipient and retry the payout.Note – Replaced by Recipients featureThe Bank Account object and endpoints have been replaced by the Recipients feature, which all platforms should integrate instead.Legacy active Bank Accounts (
Active is true) have been migrated to the new feature and their data is retrievable via the GET View a Recipient endpoint using the same BankAccountId. Read more about legacy bank account migration.Path parameters
string
required
The unique identifier of the User (natural or legal) who owns the bank account.
Body parameters
object
required
Information about the address of residence of the bank account owner.
Show properties
Show properties
string
required
Max. length: 255 charactersThe first line of the address.
string
Max. length: 255 charactersThe second line of the address.
string
required
Max. length: 255 charactersThe city of the address.
string
Max. length: 255 charactersThe region of the address. This field is optional except if the
Country is US, CA, or MX.string
Max. length: 255 charactersThe postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
string
required
The country of the address.
string
required
Max. length: 34 charactersThe IBAN (international bank account number) of the bank account.
It follows the CCDDBBAN format in which:
- CC represents the country code (ISO 3166-1 alpha 2)
- DD represents two check digits used by banking systems to avoid simple errors
- BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.
Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed.
string
The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.The BIC can have one of the two following formats:
- BIC8 – 8-character BIC (AAAABBCC)
- BIC11 – 11-character BIC (AAAABBCCDDD)
- AAAA represents the bank code: 4 characters defining the bank
- BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format)
- CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country
- DDD represents the branch code: 3 characters used to define the branch of the bank (sometimes replaced with XXX)
string
required
Max. length: 255 charactersThe full name of the owner of the bank account. (Format: FirstName LastName)
string
Max. length: 255 charactersCustom data that you can add to this object.
For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
Responses
200
200
object
Information about the address of residence of the bank account owner.
Show properties
Show properties
string
Max. length: 255 charactersThe first line of the address.
string
Max. length: 255 charactersThe second line of the address.
string
Max. length: 255 charactersThe city of the address.
string
Max. length: 255 charactersThe region of the address. This field is optional except if the
Country is US, CA, or MX.string
Max. length: 255 charactersThe postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country of the address.
string
Max. length: 34 charactersThe IBAN (international bank account number) of the bank account.
It follows the CCDDBBAN format in which:
- CC represents the country code (ISO 3166-1 alpha 2)
- DD represents two check digits used by banking systems to avoid simple errors
- BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.
Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed.
string
The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.The BIC can have one of the two following formats:
- BIC8 – 8-character BIC (AAAABBCC)
- BIC11 – 11-character BIC (AAAABBCCDDD)
- AAAA represents the bank code: 4 characters defining the bank
- BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format)
- CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country
- DDD represents the branch code: 3 characters used to define the branch of the bank (sometimes replaced with XXX)
string
The unique identifier of the user.
string
Max. length: 255 charactersThe full name of the owner of the bank account. (Format: FirstName LastName)
string
Returned values:
The values are:
IBAN, US, CA, GB, OTHERThe type of the bank account, indicating the country where the real-life account is registeredThe values are:
IBAN– For accounts registered in countries that use IBANUS– For accounts registered in the United StatesCA– For accounts registered in CanadaGB– For accounts registered in the United KingdomOTHER– For accounts registered in countries that do not use IBAN (and are not US, CA, GB)
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 bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance).
Unix timestamp
The date and time at which the object was created.
boolean
Whether or not the Bank Account is active.
Mangopay automatically sets this parameter to
false if the bank account is closed or does not exist anymore.400 - BIC blocked by fraud policy
400 - BIC blocked by fraud policy
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "7b4a6886-2402-4400-9501-18bcc70fbfc7#1764080288",
"Date": 1764080289,
"errors": {
"BIC": "The BIC used is blocked by Fraud Policy"
}
}
400 - BIC format not valid
400 - BIC format not valid
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "c35b1e0b-1a21-42e4-a80f-440ad9de3c57#1662449222",
"Date": 1662449223.0,
"errors": {
"BIC": "The field BIC must match the regular expression '^[a-zA-Z]{6}\\w{2}(\\w{3})?$'."
}
}
400 - BIC value not valid
400 - BIC value not valid
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "709e198c-c72a-4589-8055-b210c3360893#1745589614",
"Date": 1745589615,
"errors": {
"BIC": "The value is not a valid BIC"
}
}
400 - IBAN not valid
400 - IBAN not valid
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "692b34b2-86a5-4859-a515-f8838292a56e#1662449297",
"Date": 1662449298.0,
"errors": {
"IBAN": "The value is not a valid IBAN"
}
}
{
"OwnerAddress":{
"AddressLine1":"Rue des plantes",
"AddressLine2":"The Oasis",
"City":"Paris",
"Region":"Ile de France",
"PostalCode":"75001",
"Country":"FR"
},
"IBAN":"FR7630004000031234567890143",
"BIC":"BNPAFRPP",
"UserId":"142036728",
"OwnerName":"John Doe",
"Type":"IBAN",
"Id":"150287803",
"Tag":"custom meta",
"CreationDate":1661859994,
"Active":true
}
{
"OwnerAddress": {
"AddressLine1": "Rue des plantes",
"AddressLine2": "The Oasis",
"City": "Paris",
"Region": "Ile de France",
"PostalCode": "75001",
"Country": "FR"
},
"IBAN": "FR7630004000031234567890143",
"BIC": "BNPAFRPP",
"OwnerName": "John Doe",
"Tag": "Created using the 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 {
$userId = '146476890';
$bankAccount = new \MangoPay\BankAccount();
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Address line 1';
$address->AddressLine2 = 'Address line 2';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'Region';
$details = new \MangoPay\BankAccountDetailsIBAN();
$details->IBAN = 'FR7630004000031234567890143';
$details->BIC = 'BNPAFRPP';
$bankAccount->OwnerAddress = $address;
$bankAccount->OwnerName = 'Alex Smith';
$bankAccount->Tag = 'Created using Mangopay PHP SDK';
$bankAccount->Type = 'IBAN';
$bankAccount->Details = $details;
$response = $api->Users->CreateBankAccount($userId, $bankAccount);
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 user = {
Id: '165863393',
Address: {
AddressLine1: 'Edgewood Road',
AddressLine2: null,
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR',
},
FirstName: 'John',
LastName: 'Doe',
}
let bankAccount = {
Type: 'IBAN',
OwnerName: user.FirstName + '' + user.LastName,
OwnerAddress: user.Address,
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay NodeJS SDK',
}
const createBankAccount = async (userId, bankAccount) => {
return await mangopay.Users.createBankAccount(userId, bankAccount)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createBankAccount(user.Id, bankAccount)
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 createIbanBankAccount(userId, ibanBankAccountObject)
begin
response = MangoPay::BankAccount.create(userId, ibanBankAccountObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create bank account: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '165863393'
}
myIbanBankAccount = {
Type: 'IBAN',
OwnerName: 'Alex Smith',
OwnerAddress: {
AddressLine1: 'Edgewood Road',
AddressLine2: 'Address line 2',
City: 'Little Rock',
Region: 'IDF',
PostalCode: '75000',
Country: 'FR'
},
IBAN: 'FR7630004000031234567890143',
BIC: 'BNPAFRPP',
Tag: 'Created using Mangopay Ruby SDK'
}
createIbanBankAccount(myUser[:Id], myIbanBankAccount)
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.enumerations.BankAccountType;
import com.mangopay.entities.BankAccount;
import com.mangopay.entities.UserNatural;
import com.mangopay.entities.subentities.BankAccountDetailsIBAN;
public class createIBANankaccount {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT");
BankAccount account = new BankAccount();
account.setType(BankAccountType.IBAN);
account.setOwnerName(user.getFirstName() + " " + user.getLastName());
account.setOwnerAddress(user.getAddress());
account.setUserId(user.getId());
BankAccountDetailsIBAN bankAccountDetails = new BankAccountDetailsIBAN();
bankAccountDetails.setIban("FR7630004000031234567890143");
bankAccountDetails.setBic("BNPAFRPP");
account.setDetails(bankAccountDetails);
account.setTag("Created using the Mangopay Java SDK");
BankAccount createAccount = mangopay.getUserApi().createBankAccount(user.getId(), account);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(createAccount);
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 NaturalUser, BankAccount
from mangopay.utils import Address
natural_user = NaturalUser.get('213753890')
iban_bank_account = BankAccount(
user_id = natural_user.id,
owner_name = f'{natural_user.first_name} {natural_user.last_name}',
owner_address = Address(
address_line_1 = natural_user.address.address_line_1,
address_line_2 = natural_user.address.address_line_2,
city = natural_user.address.city,
region = natural_user.address.region,
postal_code = natural_user.address.postal_code,
country = natural_user.address.country,
),
iban = 'FR7630004000031234567890143',
bic = 'BNPAFRPP',
type = 'IBAN',
tag = 'Created using the Mangopay Python SDK'
)
create_iban_bank_account = iban_bank_account.save()
pprint(create_iban_bank_account)
using MangoPay.SDK;
using MangoPay.SDK.Entities.GET;
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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN");
var iban = "FR7630004000031234567890143";
var IbanBankAccount = new BankAccountIbanPostDTO(
user.FirstName + " " + user.LastName,
user.Address,
iban
) {
BIC = "BNPAFRPP",
Tag = "Created using the Mangopay .NET SDK"
};
BankAccountDTO createIbanBankAccount = await api.Users.CreateBankAccountIbanAsync(user.Id, IbanBankAccount);
string prettyPrint = JsonConvert.SerializeObject(createIbanBankAccount, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?