{
"UserCategory": "PAYER",
"TermsAndConditionsAccepted": false,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Tag": "Created using Mangopay API Postman collection"
}
{
"UserCategory": "OWNER",
"TermsAndConditionsAccepted": true,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"CompanyNumber": "123456789",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"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 {
$user = new \MangoPay\UserLegal();
$user->Name = 'Smith corp';
$user->Email = 'smith@example.com';
$user->LegalPersonType = \MangoPay\LegalPersonType::Business;
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Rue des plantes';
$address->AddressLine2 = '2nd floor';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'IDF';
$user->HeadquartersAddress = $address;
$user->LegalRepresentativeAddress = $address;
$user->LegalRepresentativeFirstName = 'Alex';
$user->LegalRepresentativeLastName = 'Smith';
$user->LegalRepresentativeEmail = 'asmith@example.com';
$user->LegalRepresentativeBirthday = mktime(0, 0, 0, 12, 21, 1975);
$user->LegalRepresentativeNationality = 'FR';
$user->LegalRepresentativeCountryOfResidence = 'FR';
$user->CompanyNumber = 'LU123456';
$user->Tag = 'Created using Mangopay PHP SDK';
$user->TermsAndConditionsAccepted = true;
$user->UserCategory = 'Owner';
$response = $api->Users->Create($user);
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-mangopay-client-id',
clientApiKey: 'your-mangopay-api-key',
})
let myLegalUser = {
HeadquartersAddress: {
AddressLine1: '45 Main Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Created using the Mangopay NodeJS SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL',
LegalSca: false,
}
const createLegalUser = async (legalUser) => {
return await mangopay.Users.create(legalUser)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createLegalUser(myLegalUser)
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 createLegalUser(legalUserObject)
begin
response = MangoPay::LegalUser.create(legalUserObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create User: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
HeadquartersAddress: {
AddressLine1: '59 Main Road',
AddressLine2: 'PB 456',
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Updated using the Mangopay Ruby SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL'
}
createLegalUser(myLegalUser)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.entities.User;
import com.mangopay.entities.UserLegal;
import com.mangopay.core.enumerations.UserCategory;
import com.mangopay.core.enumerations.CountryIso;
import com.mangopay.core.enumerations.LegalPersonType;
import java.lang.reflect.Field;
public class CreateLegalUser {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserLegal user = new UserLegal();
Address headquartersAddress = new Address();
Address legalRepAddress = new Address();
headquartersAddress.setAddressLine1("34 rue des Entreprises");
headquartersAddress.setAddressLine2("Batiment B");
headquartersAddress.setCity("Paris");
headquartersAddress.setRegion("Île-de-France");
headquartersAddress.setPostalCode("75001");
headquartersAddress.setCountry(CountryIso.FR);
legalRepAddress.setAddressLine1("12032 Wiza Way");
legalRepAddress.setAddressLine2("Mitchell Drive");
legalRepAddress.setCity("Paris");
legalRepAddress.setRegion("Île-de-France");
legalRepAddress.setPostalCode("75001");
legalRepAddress.setCountry(CountryIso.FR);
user.setName("Best Business");
user.setLegalPersonType(LegalPersonType.BUSINESS);
user.setLegalRepresentativeFirstName("Cedrik");
user.setLegalRepresentativeLastName("Dickinson");
user.setLegalRepresentativeEmail("cedrik.dickinson@example.com");
user.setLegalRepresentativeBirthday((long) 652117514);
user.setLegalRepresentativeNationality(CountryIso.FR);
user.setLegalRepresentativeCountryOfResidence(CountryIso.FR);
user.setHeadquartersAddress(headquartersAddress);
user.setLegalRepresentativeAddress(legalRepAddress);
user.setCompanyNumber("652398741");
user.setEmail("best.business@best.com");
user.setTermsAndConditionsAccepted(true);
user.setTag("Created with the Mangopay Java SDK");
user.setUserCategory(UserCategory.OWNER);
User createUser = mangopay.getUserApi().create(user);
System.out.println(String.format("id: %s", createUser.getId()));
printObjectFields(createUser);
}
private static void printObjectFields(Object obj) {
Class<?> objClass = obj.getClass();
Field[] fields = objClass.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
try {
Object value = field.get(obj);
if (value instanceof Address) {
System.out.println(field.getName() + ": ");
printObjectFields(value);
} else {
System.out.println(field.getName() + ": " + value);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
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 LegalUser
from mangopay.utils import Address
legal_user = LegalUser(
headquarters_address = Address(
address_line_1 = '45 Main Road',
city = 'London',
postal_code = 'NW1 4RG',
country = 'GB'
),
legal_representative_address = Address(
address_line_1 = '35 London Road',
city = 'London',
postal_code = 'NW1 0AA',
country = 'GB'
),
name = 'Executive Consulting',
legal_person_type = 'BUSINESS',
legal_representative_first_name = 'Juliana',
legal_representative_last_name = 'Dunn',
legal_representative_email = 'juliana.dunn@example.com',
legal_representative_birthday = 188301600,
legal_representative_nationality = 'GB',
legal_representative_country_of_residence = 'GB',
company_number = '12345678',
tag = 'Created with Mangopay Python SDK',
email = 'executive.consulting@example.com',
terms_and_conditions_accepted = True,
user_category = 'OWNER'
)
create_legal_user=legal_user.save()
pprint(create_legal_user)
using MangoPay.SDK;
using MangoPay.SDK.Entities;
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 myUser = new UserLegalOwnerPostDTO {
HeadquartersAddress = new Address {
AddressLine1 = "17 Rue de la République",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
LegalRepresentativeAddress = new Address {
AddressLine1 = "12032 Wiza Way",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
Name = "Dedicated Notion",
LegalPersonType = LegalPersonType.BUSINESS,
LegalRepresentativeFirstName = "Derek",
LegalRepresentativeLastName = "Nelson",
LegalRepresentativeEmail = "derek.nelson@dedicatednotion.com",
LegalRepresentativeBirthday = new DateTime(1980, 3, 15),
LegalRepresentativeNationality = CountryIso.FR,
LegalRepresentativeCountryOfResidence = CountryIso.FR,
CompanyNumber = "325698745",
Email = "dedicatednotion@dedicatednotion.com",
Tag = "Created using the Mangopay .NET SDK"
};
var createLegalUser = await api.Users.CreateOwnerAsync(myUser);
string prettyPrint = JsonConvert.SerializeObject(createLegalUser, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"HeadquartersAddress": {
"AddressLine1": null,
"AddressLine2": null,
"City": null,
"Region": null,
"PostalCode": null,
"Country": null
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": null,
"LegalRepresentativeBirthday": null,
"LegalRepresentativeNationality": null,
"LegalRepresentativeCountryOfResidence": null,
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": null,
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3QCQ38ZC0S52Y1TNGHGAN",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217520,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": false,
"TermsAndConditionsAcceptedDate": null,
"UserCategory": "PAYER",
"UserStatus": "ACTIVE"
}
{
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": "123456789",
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3FQ7K0WB275T1BZ1SPZMF",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217268,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": true,
"TermsAndConditionsAcceptedDate": 1737217268,
"UserCategory": "OWNER",
"UserStatus": "ACTIVE"
}
Non-SCA endpoints
Create a Legal User
POST
/
v2.01
/
{ClientId}
/
users
/
legal
{
"UserCategory": "PAYER",
"TermsAndConditionsAccepted": false,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Tag": "Created using Mangopay API Postman collection"
}
{
"UserCategory": "OWNER",
"TermsAndConditionsAccepted": true,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"CompanyNumber": "123456789",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"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 {
$user = new \MangoPay\UserLegal();
$user->Name = 'Smith corp';
$user->Email = 'smith@example.com';
$user->LegalPersonType = \MangoPay\LegalPersonType::Business;
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Rue des plantes';
$address->AddressLine2 = '2nd floor';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'IDF';
$user->HeadquartersAddress = $address;
$user->LegalRepresentativeAddress = $address;
$user->LegalRepresentativeFirstName = 'Alex';
$user->LegalRepresentativeLastName = 'Smith';
$user->LegalRepresentativeEmail = 'asmith@example.com';
$user->LegalRepresentativeBirthday = mktime(0, 0, 0, 12, 21, 1975);
$user->LegalRepresentativeNationality = 'FR';
$user->LegalRepresentativeCountryOfResidence = 'FR';
$user->CompanyNumber = 'LU123456';
$user->Tag = 'Created using Mangopay PHP SDK';
$user->TermsAndConditionsAccepted = true;
$user->UserCategory = 'Owner';
$response = $api->Users->Create($user);
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-mangopay-client-id',
clientApiKey: 'your-mangopay-api-key',
})
let myLegalUser = {
HeadquartersAddress: {
AddressLine1: '45 Main Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Created using the Mangopay NodeJS SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL',
LegalSca: false,
}
const createLegalUser = async (legalUser) => {
return await mangopay.Users.create(legalUser)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createLegalUser(myLegalUser)
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 createLegalUser(legalUserObject)
begin
response = MangoPay::LegalUser.create(legalUserObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create User: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
HeadquartersAddress: {
AddressLine1: '59 Main Road',
AddressLine2: 'PB 456',
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Updated using the Mangopay Ruby SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL'
}
createLegalUser(myLegalUser)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.entities.User;
import com.mangopay.entities.UserLegal;
import com.mangopay.core.enumerations.UserCategory;
import com.mangopay.core.enumerations.CountryIso;
import com.mangopay.core.enumerations.LegalPersonType;
import java.lang.reflect.Field;
public class CreateLegalUser {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserLegal user = new UserLegal();
Address headquartersAddress = new Address();
Address legalRepAddress = new Address();
headquartersAddress.setAddressLine1("34 rue des Entreprises");
headquartersAddress.setAddressLine2("Batiment B");
headquartersAddress.setCity("Paris");
headquartersAddress.setRegion("Île-de-France");
headquartersAddress.setPostalCode("75001");
headquartersAddress.setCountry(CountryIso.FR);
legalRepAddress.setAddressLine1("12032 Wiza Way");
legalRepAddress.setAddressLine2("Mitchell Drive");
legalRepAddress.setCity("Paris");
legalRepAddress.setRegion("Île-de-France");
legalRepAddress.setPostalCode("75001");
legalRepAddress.setCountry(CountryIso.FR);
user.setName("Best Business");
user.setLegalPersonType(LegalPersonType.BUSINESS);
user.setLegalRepresentativeFirstName("Cedrik");
user.setLegalRepresentativeLastName("Dickinson");
user.setLegalRepresentativeEmail("cedrik.dickinson@example.com");
user.setLegalRepresentativeBirthday((long) 652117514);
user.setLegalRepresentativeNationality(CountryIso.FR);
user.setLegalRepresentativeCountryOfResidence(CountryIso.FR);
user.setHeadquartersAddress(headquartersAddress);
user.setLegalRepresentativeAddress(legalRepAddress);
user.setCompanyNumber("652398741");
user.setEmail("best.business@best.com");
user.setTermsAndConditionsAccepted(true);
user.setTag("Created with the Mangopay Java SDK");
user.setUserCategory(UserCategory.OWNER);
User createUser = mangopay.getUserApi().create(user);
System.out.println(String.format("id: %s", createUser.getId()));
printObjectFields(createUser);
}
private static void printObjectFields(Object obj) {
Class<?> objClass = obj.getClass();
Field[] fields = objClass.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
try {
Object value = field.get(obj);
if (value instanceof Address) {
System.out.println(field.getName() + ": ");
printObjectFields(value);
} else {
System.out.println(field.getName() + ": " + value);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
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 LegalUser
from mangopay.utils import Address
legal_user = LegalUser(
headquarters_address = Address(
address_line_1 = '45 Main Road',
city = 'London',
postal_code = 'NW1 4RG',
country = 'GB'
),
legal_representative_address = Address(
address_line_1 = '35 London Road',
city = 'London',
postal_code = 'NW1 0AA',
country = 'GB'
),
name = 'Executive Consulting',
legal_person_type = 'BUSINESS',
legal_representative_first_name = 'Juliana',
legal_representative_last_name = 'Dunn',
legal_representative_email = 'juliana.dunn@example.com',
legal_representative_birthday = 188301600,
legal_representative_nationality = 'GB',
legal_representative_country_of_residence = 'GB',
company_number = '12345678',
tag = 'Created with Mangopay Python SDK',
email = 'executive.consulting@example.com',
terms_and_conditions_accepted = True,
user_category = 'OWNER'
)
create_legal_user=legal_user.save()
pprint(create_legal_user)
using MangoPay.SDK;
using MangoPay.SDK.Entities;
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 myUser = new UserLegalOwnerPostDTO {
HeadquartersAddress = new Address {
AddressLine1 = "17 Rue de la République",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
LegalRepresentativeAddress = new Address {
AddressLine1 = "12032 Wiza Way",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
Name = "Dedicated Notion",
LegalPersonType = LegalPersonType.BUSINESS,
LegalRepresentativeFirstName = "Derek",
LegalRepresentativeLastName = "Nelson",
LegalRepresentativeEmail = "derek.nelson@dedicatednotion.com",
LegalRepresentativeBirthday = new DateTime(1980, 3, 15),
LegalRepresentativeNationality = CountryIso.FR,
LegalRepresentativeCountryOfResidence = CountryIso.FR,
CompanyNumber = "325698745",
Email = "dedicatednotion@dedicatednotion.com",
Tag = "Created using the Mangopay .NET SDK"
};
var createLegalUser = await api.Users.CreateOwnerAsync(myUser);
string prettyPrint = JsonConvert.SerializeObject(createLegalUser, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"HeadquartersAddress": {
"AddressLine1": null,
"AddressLine2": null,
"City": null,
"Region": null,
"PostalCode": null,
"Country": null
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": null,
"LegalRepresentativeBirthday": null,
"LegalRepresentativeNationality": null,
"LegalRepresentativeCountryOfResidence": null,
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": null,
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3QCQ38ZC0S52Y1TNGHGAN",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217520,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": false,
"TermsAndConditionsAcceptedDate": null,
"UserCategory": "PAYER",
"UserStatus": "ACTIVE"
}
{
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": "123456789",
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3FQ7K0WB275T1BZ1SPZMF",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217268,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": true,
"TermsAndConditionsAcceptedDate": 1737217268,
"UserCategory": "OWNER",
"UserStatus": "ACTIVE"
}
Caution - Deprecated endpointThe legacy User endpoints are deprecated. This endpoint will stop working and return an error after Dec 15, 2025.These endpoints were made redundant by the equivalent SCA-enabled endpoints during the introduction of SCA.Instead of calling this endpoint for user creation, your platform must call POST Create a Legal User (SCA).
Note – Country-based restrictions apply to usersDue to Mangopay’s country restrictions, it is not possible to use blocked countries as the following:
HeadquartersAddress.CountryLegalRepresentativeNationalityLegalRepresentativeCountryOfResidenceLegalRepresentativeAddress.Country
Body parameters
string
required
Allowed values:
PAYER, OWNERThe category of the user:PAYER– User who can only make pay-ins to their wallets and transfers to other wallets (as well as refunds for pay-ins and transfers).OWNER– User who can also receive transfers to their wallets. Owners are able to request KYC verification, which if successful gives them theKYCLevelofREGULARand the ability to request payouts.
boolean
required
Whether the user has accepted Mangopay’s terms and conditions (as defined by your contract, see the T&Cs guide for details).Must be
true if UserCategory is OWNER.string
required
Allowed values: BUSINESS, PARTNERSHIP, ORGANIZATION, SOLETRADERThe type of legal user. For information on which
LegalPersonType to use for a particular local legal structure, see the verification requirements.Caution: Modification of the LegalPersonType may result in a verification downgrade.string
required
Max. length: 255 charactersThe registered legal name of the entity. The
Name value should be the one registered with the relevant national authority.string
required
Format: A valid email addressThe email address for the entity.
object
Required if
UserCategory is OWNER. Child parameters returned null if UserCategory is PAYER.The legally registered address of the entity’s administrative center.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 charactersRequired if
Country is US, CA, or MX.The region of the address.string
required
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 if
UserCategory is OWNER and LegalPersonType is BUSINESS. Returned null if UserCategory is PAYER.The registration number of the entity, assigned by the relevant national authority. For information on the expected format for a specific country, see the Company number guide. To validate the format of a number before submitting documents for verification, use POST Validate the format of User data.string
required
Min length: 1; max. length: 100The first name of the entity’s legal representative.
string
required
Min length: 1; max. length: 100The last name of the entity’s legal representative.
string
Format: A valid email addressThe email address of the entity’s legal representative.Returned
null if UserCategory is PAYER.Unix timestamp
Required if
UserCategory is OWNER. Returned null if UserCategory is PAYER.The date of birth of the entity’s legal representative.Note: This is a Unix timestamp in UTC. Ensure you convert your timezone to UTC to avoid midnight being interpreted as the day before.string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)Required if
UserCategory is OWNER. Returned null if UserCategory is PAYER.The nationality of the entity’s legal representative.string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)Required if
UserCategory is OWNER. Returned null if UserCategory is PAYER.The country of residence of the entity’s legal representative.object
The address of the entity’s legal representative.
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 charactersRequired if
Country is US, CA, or MX.The region of the address.string
required
Max. length: 255 charactersThe postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
string
required
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country of the address.
string
Max. length: 255 charactersCustom data that you can add to this object.
Responses
200
200
object
The legally registered address of the entity’s administrative center.
This object’s sub-parameters are
This object’s sub-parameters are
null if the UserCategory is PAYER.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.
object
The address of the entity’s legal representative.
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: 255 charactersThe registered legal name of the entity. The
Name value should be the one registered with the relevant national authority.string
Returned values: BUSINESS, PARTNERSHIP, ORGANIZATION, SOLETRADERThe type of legal user. For information on which
LegalPersonType to use for a particular local legal structure, see the verification requirements.Caution: Modification of the LegalPersonType may result in a verification downgrade.string
Min. length: 1; max. length: 100The first name of the entity’s legal representative.
string
Min. length: 1; max. length: 100The last name of the entity’s legal representative.
string
Format: A valid email addressThe email address of the entity’s legal representative.Returned
null if UserCategory is PAYER.Unix timestamp
The date of birth of the entity’s legal representative.Returned
null if UserCategory is PAYER.Note: This is a Unix timestamp in UTC. Ensure you convert your timezone to UTC to avoid midnight being interpreted as the day before.string
Returned
null if UserCategory is PAYER.The nationality of the entity’s legal representative.string
Returned
null if UserCategory is PAYER.The country of residence of the entity’s legal representative.string
The
Id of the KYC Document whose Type is REGISTRATION_PROOF if validated for the user. If no registration proof is validated, then this value is null.string
The
Id of the KYC Document whose Type is SHAREHOLDERS_DECLARATION if validated for the user. If no Shareholder Declaration is validated, then this value is null.string
The
Id of the KYC Document whose Type is ARTICLES_OF_ASSOCIATION if validated for the user. If no articles of association document is validated, then this value is null.string
The
Id of the KYC Document whose Type is IDENTITY_PROOF if validated for the user. If no identity proof is validated, then this value is null.string
Required if
UserCategory is OWNER and LegalPersonType is BUSINESS. Returned null if UserCategory is PAYER.The registration number of the entity, assigned by the relevant national authority. For information on the expected format for a specific country, see the Company number guide. To validate the format of a number before submitting documents for verification, use POST Validate the format of User data.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.
Unix timestamp
The date and time at which the object was created.
string
Returned values: NATURAL, LEGALThe type of the user:
NATURAL– Natural users are individuals (natural persons).LEGAL– Legal users are legal entities (legal persons) like companies, non-profits, and sole proprietors.
PersonType is defined by the endpoint used to create the user and can’t be modified.string
Format: A valid email addressThe email address for the entity.
string
Default value:
LIGHTReturned values: LIGHT, REGULARThe verification status of the user set by Mangopay:LIGHT– Unverified, assigned by default to all users.REGULAR– Verified, meaning the user has successfully completed the verification process and had the necessary documents validated by Mangopay. Only users whoseUserCategoryisOWNERcan submit verification documents for validation. Only users whoseKYCLevelisREGULARcan request payouts.
boolean
Whether the user has accepted Mangopay’s terms and conditions (as defined by your contract, see the T&Cs guide for details).Must be
true if UserCategory is OWNER.Unix timestamp
The date and time at which the
TermsAndConditionsAccepted value was set to true.Returned null if UserCategory is PAYER.string
Possible values:
PAYER, OWNER, PLATFORMThe category of the user:PAYER– User who can only make pay-ins to their wallets and transfers to other wallets (as well as refunds for pay-ins and transfers).OWNER– User who can also receive transfers to their wallets. Owners are able to request KYC verification, which if successful gives them theKYCLevelofREGULARand the ability to request payouts.PLATFORM– Single specific user that represents the platform. ThePLATFORMvalue is only assigned by Mangopay and may be used as part of the validated workflow implemented by the platform.
string
Returned values: ACTIVE, CLOSEDInternal use only. This field can only be used and updated by Mangopay teams.
400 - Invalid email
400 - Invalid email
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "864a164a-cbb9-4e9d-b140-2b83c720e729",
"Date": 1690291065.0,
"errors": {
"Email": "The field Email must match the regular expression '([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?'."
}
}
403 - TermsAndConditionsAccepted must be true if OWNER
403 - TermsAndConditionsAccepted must be true if OWNER
{
"Message": "User must accept the terms and conditions before account creation or modification.",
"Type": "user_hasnt_accepted_terms_and_conditions",
"Id": "dbbc752b-6f9f-4248-a4bb-04ee0ba7b4b7",
"Date": 1730810728,
"errors": null
}
{
"HeadquartersAddress": {
"AddressLine1": null,
"AddressLine2": null,
"City": null,
"Region": null,
"PostalCode": null,
"Country": null
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": null,
"LegalRepresentativeBirthday": null,
"LegalRepresentativeNationality": null,
"LegalRepresentativeCountryOfResidence": null,
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": null,
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3QCQ38ZC0S52Y1TNGHGAN",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217520,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": false,
"TermsAndConditionsAcceptedDate": null,
"UserCategory": "PAYER",
"UserStatus": "ACTIVE"
}
{
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Name": "Best Business",
"LegalPersonType": "BUSINESS",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"ProofOfRegistration": null,
"ShareholderDeclaration": null,
"Statute": null,
"LegalRepresentativeProofOfIdentity": null,
"CompanyNumber": "123456789",
"PhoneNumber": null,
"PhoneNumberCountry": null,
"Id": "user_m_01JHX3FQ7K0WB275T1BZ1SPZMF",
"Tag": "Created using Mangopay API Postman collection",
"CreationDate": 1737217268,
"PersonType": "LEGAL",
"Email": "best.business@example.com",
"KYCLevel": "LIGHT",
"TermsAndConditionsAccepted": true,
"TermsAndConditionsAcceptedDate": 1737217268,
"UserCategory": "OWNER",
"UserStatus": "ACTIVE"
}
{
"UserCategory": "PAYER",
"TermsAndConditionsAccepted": false,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"Tag": "Created using Mangopay API Postman collection"
}
{
"UserCategory": "OWNER",
"TermsAndConditionsAccepted": true,
"LegalPersonType": "BUSINESS",
"Name": "Best Business",
"Email": "best.business@example.com",
"HeadquartersAddress": {
"AddressLine1": "34 rue des Entreprises",
"AddressLine2": "Batiment B",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75001",
"Country": "FR"
},
"CompanyNumber": "123456789",
"LegalRepresentativeFirstName": "Alex",
"LegalRepresentativeLastName": "Smith",
"LegalRepresentativeEmail": "alex.smith@example.com",
"LegalRepresentativeBirthday": 652117514,
"LegalRepresentativeNationality": "FR",
"LegalRepresentativeCountryOfResidence": "FR",
"LegalRepresentativeAddress": {
"AddressLine1": "3 rue de la Cité",
"AddressLine2": "Appartement 7",
"City": "Paris",
"Region": "Île-de-France",
"PostalCode": "75004",
"Country": "FR"
},
"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 {
$user = new \MangoPay\UserLegal();
$user->Name = 'Smith corp';
$user->Email = 'smith@example.com';
$user->LegalPersonType = \MangoPay\LegalPersonType::Business;
$address = new \MangoPay\Address();
$address->AddressLine1 = 'Rue des plantes';
$address->AddressLine2 = '2nd floor';
$address->City = 'Paris';
$address->Country = 'FR';
$address->PostalCode = '75000';
$address->Region = 'IDF';
$user->HeadquartersAddress = $address;
$user->LegalRepresentativeAddress = $address;
$user->LegalRepresentativeFirstName = 'Alex';
$user->LegalRepresentativeLastName = 'Smith';
$user->LegalRepresentativeEmail = 'asmith@example.com';
$user->LegalRepresentativeBirthday = mktime(0, 0, 0, 12, 21, 1975);
$user->LegalRepresentativeNationality = 'FR';
$user->LegalRepresentativeCountryOfResidence = 'FR';
$user->CompanyNumber = 'LU123456';
$user->Tag = 'Created using Mangopay PHP SDK';
$user->TermsAndConditionsAccepted = true;
$user->UserCategory = 'Owner';
$response = $api->Users->Create($user);
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-mangopay-client-id',
clientApiKey: 'your-mangopay-api-key',
})
let myLegalUser = {
HeadquartersAddress: {
AddressLine1: '45 Main Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
AddressLine2: null,
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Created using the Mangopay NodeJS SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL',
LegalSca: false,
}
const createLegalUser = async (legalUser) => {
return await mangopay.Users.create(legalUser)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createLegalUser(myLegalUser)
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 createLegalUser(legalUserObject)
begin
response = MangoPay::LegalUser.create(legalUserObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create User: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
HeadquartersAddress: {
AddressLine1: '59 Main Road',
AddressLine2: 'PB 456',
City: 'London',
PostalCode: 'NW1 4RG',
Country: 'GB',
},
LegalRepresentativeAddress: {
AddressLine1: '35 London Road',
City: 'London',
PostalCode: 'NW1 0AA',
Country: 'GB',
},
Name: 'Executive Consulting',
LegalPersonType: 'BUSINESS',
LegalRepresentativeFirstName: 'Juliana',
LegalRepresentativeLastName: 'Dunn',
LegalRepresentativeEmail: 'juliana.dunn@example.com',
LegalRepresentativeBirthday: 188301600,
LegalRepresentativeNationality: 'GB',
LegalRepresentativeCountryOfResidence: 'GB',
CompanyNumber: '12345678',
Tag: 'Updated using the Mangopay Ruby SDK',
Email: 'executive.consulting@example.com',
TermsAndConditionsAccepted: true,
UserCategory: 'OWNER',
PersonType: 'LEGAL'
}
createLegalUser(myLegalUser)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.entities.User;
import com.mangopay.entities.UserLegal;
import com.mangopay.core.enumerations.UserCategory;
import com.mangopay.core.enumerations.CountryIso;
import com.mangopay.core.enumerations.LegalPersonType;
import java.lang.reflect.Field;
public class CreateLegalUser {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
UserLegal user = new UserLegal();
Address headquartersAddress = new Address();
Address legalRepAddress = new Address();
headquartersAddress.setAddressLine1("34 rue des Entreprises");
headquartersAddress.setAddressLine2("Batiment B");
headquartersAddress.setCity("Paris");
headquartersAddress.setRegion("Île-de-France");
headquartersAddress.setPostalCode("75001");
headquartersAddress.setCountry(CountryIso.FR);
legalRepAddress.setAddressLine1("12032 Wiza Way");
legalRepAddress.setAddressLine2("Mitchell Drive");
legalRepAddress.setCity("Paris");
legalRepAddress.setRegion("Île-de-France");
legalRepAddress.setPostalCode("75001");
legalRepAddress.setCountry(CountryIso.FR);
user.setName("Best Business");
user.setLegalPersonType(LegalPersonType.BUSINESS);
user.setLegalRepresentativeFirstName("Cedrik");
user.setLegalRepresentativeLastName("Dickinson");
user.setLegalRepresentativeEmail("cedrik.dickinson@example.com");
user.setLegalRepresentativeBirthday((long) 652117514);
user.setLegalRepresentativeNationality(CountryIso.FR);
user.setLegalRepresentativeCountryOfResidence(CountryIso.FR);
user.setHeadquartersAddress(headquartersAddress);
user.setLegalRepresentativeAddress(legalRepAddress);
user.setCompanyNumber("652398741");
user.setEmail("best.business@best.com");
user.setTermsAndConditionsAccepted(true);
user.setTag("Created with the Mangopay Java SDK");
user.setUserCategory(UserCategory.OWNER);
User createUser = mangopay.getUserApi().create(user);
System.out.println(String.format("id: %s", createUser.getId()));
printObjectFields(createUser);
}
private static void printObjectFields(Object obj) {
Class<?> objClass = obj.getClass();
Field[] fields = objClass.getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
try {
Object value = field.get(obj);
if (value instanceof Address) {
System.out.println(field.getName() + ": ");
printObjectFields(value);
} else {
System.out.println(field.getName() + ": " + value);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
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 LegalUser
from mangopay.utils import Address
legal_user = LegalUser(
headquarters_address = Address(
address_line_1 = '45 Main Road',
city = 'London',
postal_code = 'NW1 4RG',
country = 'GB'
),
legal_representative_address = Address(
address_line_1 = '35 London Road',
city = 'London',
postal_code = 'NW1 0AA',
country = 'GB'
),
name = 'Executive Consulting',
legal_person_type = 'BUSINESS',
legal_representative_first_name = 'Juliana',
legal_representative_last_name = 'Dunn',
legal_representative_email = 'juliana.dunn@example.com',
legal_representative_birthday = 188301600,
legal_representative_nationality = 'GB',
legal_representative_country_of_residence = 'GB',
company_number = '12345678',
tag = 'Created with Mangopay Python SDK',
email = 'executive.consulting@example.com',
terms_and_conditions_accepted = True,
user_category = 'OWNER'
)
create_legal_user=legal_user.save()
pprint(create_legal_user)
using MangoPay.SDK;
using MangoPay.SDK.Entities;
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 myUser = new UserLegalOwnerPostDTO {
HeadquartersAddress = new Address {
AddressLine1 = "17 Rue de la République",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
LegalRepresentativeAddress = new Address {
AddressLine1 = "12032 Wiza Way",
City = "Paris",
Region = "Île-de-France",
PostalCode = "75001",
Country = CountryIso.FR
},
Name = "Dedicated Notion",
LegalPersonType = LegalPersonType.BUSINESS,
LegalRepresentativeFirstName = "Derek",
LegalRepresentativeLastName = "Nelson",
LegalRepresentativeEmail = "derek.nelson@dedicatednotion.com",
LegalRepresentativeBirthday = new DateTime(1980, 3, 15),
LegalRepresentativeNationality = CountryIso.FR,
LegalRepresentativeCountryOfResidence = CountryIso.FR,
CompanyNumber = "325698745",
Email = "dedicatednotion@dedicatednotion.com",
Tag = "Created using the Mangopay .NET SDK"
};
var createLegalUser = await api.Users.CreateOwnerAsync(myUser);
string prettyPrint = JsonConvert.SerializeObject(createLegalUser, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I