<?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 = '199463368';
$response = $api->UboDeclarations->Create($userId);
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 myUser = {
Id: 'user_m_01KMD8QZHCVY2VPYV020RDBZGA'
}
const createUboDeclaration = async (userId) => {
return await mangopay.UboDeclarations.create(userId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createUboDeclaration(myUser.Id)
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 createUboDeclaration(legalUserId)
begin
response = MangoPay::UboDeclaration.create(legalUserId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create UBO Declaration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
Id: '194338122'
}
createUboDeclaration(myLegalUser[:Id])
import com.mangopay.MangoPayApi;
import com.mangopay.entities.UboDeclaration;
import com.mangopay.entities.UserLegal;
import java.lang.reflect.Field;
public class CreateUBODeclaraction {
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 myUser = mangopay.getUserApi().getLegal("user_m_01HQK53VP687RBSH2Q5TJZRR3S");
UboDeclaration createUboDeclaration = mangopay.getUboDeclarationApi().create(myUser.getId());
System.out.println(String.format("id: %s", createUboDeclaration.getId()));
printObjectFields(createUboDeclaration);
}
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);
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 UboDeclaration, LegalUser
legal_user = LegalUser(
id = '210760575'
)
ubo_declaration = UboDeclaration(user=legal_user)
create_ubo_declaration = ubo_declaration.save()
pprint(create_ubo_declaration)
using MangoPay.SDK;
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_01J2V0P9B1WCX46GEBDWCTXNQ0";
var createUboDeclaration = await api.UboDeclarations.CreateUboDeclarationAsync(userId);
string prettyPrint = JsonConvert.SerializeObject(createUboDeclaration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "ubo_m_01JH7TS09VMCDVV7B39F4A2JAF",
"UserId": "user_m_01JH2Z508798F23M9FB9T9Z2Y7",
"CreationDate": 1736503492,
"ProcessedDate": null,
"Status": "CREATED",
"Reason": null,
"Message": null,
"Ubos": []
}
UBO declarations
Create a UBO Declaration
POST
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
kyc
/
ubodeclarations
<?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 = '199463368';
$response = $api->UboDeclarations->Create($userId);
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 myUser = {
Id: 'user_m_01KMD8QZHCVY2VPYV020RDBZGA'
}
const createUboDeclaration = async (userId) => {
return await mangopay.UboDeclarations.create(userId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createUboDeclaration(myUser.Id)
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 createUboDeclaration(legalUserId)
begin
response = MangoPay::UboDeclaration.create(legalUserId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create UBO Declaration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
Id: '194338122'
}
createUboDeclaration(myLegalUser[:Id])
import com.mangopay.MangoPayApi;
import com.mangopay.entities.UboDeclaration;
import com.mangopay.entities.UserLegal;
import java.lang.reflect.Field;
public class CreateUBODeclaraction {
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 myUser = mangopay.getUserApi().getLegal("user_m_01HQK53VP687RBSH2Q5TJZRR3S");
UboDeclaration createUboDeclaration = mangopay.getUboDeclarationApi().create(myUser.getId());
System.out.println(String.format("id: %s", createUboDeclaration.getId()));
printObjectFields(createUboDeclaration);
}
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);
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 UboDeclaration, LegalUser
legal_user = LegalUser(
id = '210760575'
)
ubo_declaration = UboDeclaration(user=legal_user)
create_ubo_declaration = ubo_declaration.save()
pprint(create_ubo_declaration)
using MangoPay.SDK;
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_01J2V0P9B1WCX46GEBDWCTXNQ0";
var createUboDeclaration = await api.UboDeclarations.CreateUboDeclarationAsync(userId);
string prettyPrint = JsonConvert.SerializeObject(createUboDeclaration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Id": "ubo_m_01JH7TS09VMCDVV7B39F4A2JAF",
"UserId": "user_m_01JH2Z508798F23M9FB9T9Z2Y7",
"CreationDate": 1736503492,
"ProcessedDate": null,
"Status": "CREATED",
"Reason": null,
"Message": null,
"Ubos": []
}
Caution – Legacy endpoints being superseded by the hosted KYC/KYB solutionMangopay’s hosted KYC/KYB solution is becoming mandatory for all platforms, and allows Legal Users to declare and verify all beneficial owners in the same IDV Session object.The criteria defining beneficial owners remain the same.
Path parameters
string
required
The unique identifier of the user.
Responses
200
200
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
string
The unique identifier of the user.
Unix timestamp
The date and time at which the object was created.
Unix timestamp
The date and time at which the UBO Declaration was processed by Mangopay’s team.
string
Returned values:
CREATED, VALIDATION_ASKED, INCOMPLETE, VALIDATED, REFUSEDThe status of the declaration:CREATED– The UBO Declaration is created, but not submitted yet.VALIDATION_ASKED– The UBO Declaration is submitted for validation.INCOMPLETE– The UBO Declaration is deemed incomplete by Mangopay teams.VALIDATED– The UBO Declaration is validated by Mangopay’s team.REFUSED– The UBO Declaration is rejected by Mangopay’s team. You can learn more about the reasons for refusal in theReasonandMessagefields.
string
The reason for which the UBO Declaration was
REFUSED or considered as INCOMPLETE.string
Additional information about why the UBO Declaration was refused or marked as incomplete, provided by Mangopay’s team.
array
The list of UBOs attached to the UBO Declaration.
Hide properties
Hide properties
object
The UBO object created by the platform.
Hide properties
Hide properties
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
Unix timestamp
The date and time at which the object was created.
string
Max. length: 100 charactersThe last name of the beneficial owner.
string
The nationality of the beneficial owner.
object
The postal address of the beneficial 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.
object
Information about the beneficial owner’s place of birth.
Show properties
Show properties
string
The city in which the beneficial owner was born.
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country in which the beneficial owner was born.
boolean
Whether or not the UBO is considered in the declaration. To disregard a UBO, this parameter must be set to
false. This action is irreversible.400 - Failed due to lack of UBO
400 - Failed due to lack of UBO
{
"Message": "You can not request validation for a declaration which has no ubo",
"Type": "invalid_action",
"Id": "96ee403c-1a23-46c9-8b2e-1e56c7e80325#1672326575",
"Date": 1672326576.0,
"errors": null
}
400 - Declaration already in progress
400 - Declaration already in progress
{
"Message": "You can not create a declaration because you already have a declaration in progress",
"Type": "invalid_action",
"Id": "5b9c158f-2a55-44c0-b14b-e3cf62a5f2c4#1672326207",
"Date": 1672326208.0,
"errors": null
}
400 - Wrong LegalUserType
400 - Wrong LegalUserType
{
"Message": "Cannot create an UBO for a LegalUser of type SOLETRADER",
"Type": "invalid_action",
"Id": "f2da32db-43cd-405b-b7c2-d50ab14f41d8#1672326440",
"Date": 1672326441.0,
"errors": null
}
400 - Not allowed for Payer users
400 - Not allowed for Payer users
{
"Message": "User belonging to category PAYER can't create UBO declarations",
"Type": "invalid_action",
"Id": "96ee403c-1a23-46c9-8b2e-1e56c7e80325#1672326575",
"Date": 1672326576.0,
"errors": null
}
{
"Id": "ubo_m_01JH7TS09VMCDVV7B39F4A2JAF",
"UserId": "user_m_01JH2Z508798F23M9FB9T9Z2Y7",
"CreationDate": 1736503492,
"ProcessedDate": null,
"Status": "CREATED",
"Reason": null,
"Message": null,
"Ubos": []
}
<?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 = '199463368';
$response = $api->UboDeclarations->Create($userId);
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 myUser = {
Id: 'user_m_01KMD8QZHCVY2VPYV020RDBZGA'
}
const createUboDeclaration = async (userId) => {
return await mangopay.UboDeclarations.create(userId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
createUboDeclaration(myUser.Id)
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 createUboDeclaration(legalUserId)
begin
response = MangoPay::UboDeclaration.create(legalUserId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create UBO Declaration: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myLegalUser = {
Id: '194338122'
}
createUboDeclaration(myLegalUser[:Id])
import com.mangopay.MangoPayApi;
import com.mangopay.entities.UboDeclaration;
import com.mangopay.entities.UserLegal;
import java.lang.reflect.Field;
public class CreateUBODeclaraction {
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 myUser = mangopay.getUserApi().getLegal("user_m_01HQK53VP687RBSH2Q5TJZRR3S");
UboDeclaration createUboDeclaration = mangopay.getUboDeclarationApi().create(myUser.getId());
System.out.println(String.format("id: %s", createUboDeclaration.getId()));
printObjectFields(createUboDeclaration);
}
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);
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 UboDeclaration, LegalUser
legal_user = LegalUser(
id = '210760575'
)
ubo_declaration = UboDeclaration(user=legal_user)
create_ubo_declaration = ubo_declaration.save()
pprint(create_ubo_declaration)
using MangoPay.SDK;
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_01J2V0P9B1WCX46GEBDWCTXNQ0";
var createUboDeclaration = await api.UboDeclarations.CreateUboDeclarationAsync(userId);
string prettyPrint = JsonConvert.SerializeObject(createUboDeclaration, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I