{
"Tag": "accept",
"Type": "IDENTITY_PROOF"
}
<?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 = '198675238';
$kycDocument = new \MangoPay\KycDocument();
$kycDocument->Type = \MangoPay\KycDocumentType::IdentityProof;
$kycDocument->Tag = 'accept';
$response = $api->Users->CreateKycDocument($userId, $kycDocument);
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'
}
let myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: "accept"
}
const createKycDocument = async (userId, kycDocument) => {
return await mangopay.Users.createKycDocument(userId, kycDocument)
.then((response) => {
console.info(response)
return response
}).catch((err) => {
console.log(err);
return false
});
}
createKycDocument(myUser.Id, myKycDocument)
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 createKycDocument(userId, kycDocumentObject)
begin
response = MangoPay::KycDocument.create(userId, kycDocumentObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: 'accept'
}
createKycDocument(myUser[:Id], myKycDocument)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.core.enumerations.KycDocumentType;
import com.mangopay.entities.KycDocument;
import java.lang.reflect.Field;
public class CreateKYCDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
KycDocument createKycDoc = mangopay.getUserApi().createKycDocument(
userId,
KycDocumentType.IDENTITY_PROOF,
"accept"
);
System.out.println(String.format("id: %s", createKycDoc.getId()));
printObjectFields(createKycDoc);
}
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 Document, LegalUser
legal_user = LegalUser(
id = '210760575'
)
kyc_document = Document(type='REGISTRATION_PROOF', user=legal_user)
create_kyc_document = kyc_document.save()
pprint(create_kyc_document)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var tag = "accept";
var createKycDoc = await api.Users.CreateKycDocumentAsync(userId, KycDocumentType.IDENTITY_PROOF, tag);
string prettyPrint = JsonConvert.SerializeObject(createKycDoc, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Type": "IDENTITY_PROOF",
"UserId": "user_m_01J8J0Y9DPNYRA9RB532CCND9Q",
"Flags": [],
"Id": "kyc_01JA5M2N33ENJHWVPQXVJ6Q51P",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1728913167,
"ProcessedDate": null,
"Status": "CREATED",
"RefusedReasonType": null,
"RefusedReasonMessage": null
}
KYC documents
Create a KYC Document
Create a container for files to be submitted
POST
/
v2.01
/
{ClientId}
/
users
/
{UserId}
/
kyc
/
documents
{
"Tag": "accept",
"Type": "IDENTITY_PROOF"
}
<?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 = '198675238';
$kycDocument = new \MangoPay\KycDocument();
$kycDocument->Type = \MangoPay\KycDocumentType::IdentityProof;
$kycDocument->Tag = 'accept';
$response = $api->Users->CreateKycDocument($userId, $kycDocument);
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'
}
let myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: "accept"
}
const createKycDocument = async (userId, kycDocument) => {
return await mangopay.Users.createKycDocument(userId, kycDocument)
.then((response) => {
console.info(response)
return response
}).catch((err) => {
console.log(err);
return false
});
}
createKycDocument(myUser.Id, myKycDocument)
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 createKycDocument(userId, kycDocumentObject)
begin
response = MangoPay::KycDocument.create(userId, kycDocumentObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: 'accept'
}
createKycDocument(myUser[:Id], myKycDocument)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.core.enumerations.KycDocumentType;
import com.mangopay.entities.KycDocument;
import java.lang.reflect.Field;
public class CreateKYCDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
KycDocument createKycDoc = mangopay.getUserApi().createKycDocument(
userId,
KycDocumentType.IDENTITY_PROOF,
"accept"
);
System.out.println(String.format("id: %s", createKycDoc.getId()));
printObjectFields(createKycDoc);
}
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 Document, LegalUser
legal_user = LegalUser(
id = '210760575'
)
kyc_document = Document(type='REGISTRATION_PROOF', user=legal_user)
create_kyc_document = kyc_document.save()
pprint(create_kyc_document)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var tag = "accept";
var createKycDoc = await api.Users.CreateKycDocumentAsync(userId, KycDocumentType.IDENTITY_PROOF, tag);
string prettyPrint = JsonConvert.SerializeObject(createKycDoc, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"Type": "IDENTITY_PROOF",
"UserId": "user_m_01J8J0Y9DPNYRA9RB532CCND9Q",
"Flags": [],
"Id": "kyc_01JA5M2N33ENJHWVPQXVJ6Q51P",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1728913167,
"ProcessedDate": null,
"Status": "CREATED",
"RefusedReasonType": null,
"RefusedReasonMessage": null
}
Caution – Legacy endpoints being superseded by the hosted KYC/KYB solutionMangopay’s hosted KYC/KYB solution is becoming mandatory for all platforms (relying on the IDV Session object). The legacy KYC Document endpoints remain available for the sole purposes of sending additional documents, but this use case will also be handled by the hosted solution in future.
Tag to accept to simulate acceptance of the document after submission. Other values are available to simulate different refusal reasons – see the guide for details.
Path parameters
string
required
The unique identifier of the user.
Body parameters
string
required
Allowed values:
IDENTITY_PROOF, REGISTRATION_PROOF, ARTICLES_OF_ASSOCIATION, SHAREHOLDER_DECLARATION, ADDRESS_PROOFThe type of the document for the user verification.string
Max. length: 255 charactersCustom data that you can add to this object.
Responses
200
200
string
Returned values:
IDENTITY_PROOF, REGISTRATION_PROOF, ARTICLES_OF_ASSOCIATION, SHAREHOLDER_DECLARATION, ADDRESS_PROOFThe type of the document for the user verification.string
The unique identifier of the user.
array
Returned values: A code from the Flags list.The series of codes providing more precision regarding the reason why the identity proof document was refused. You can review the explanations for each code in the Flags list.
string
The unique identifier of the KYC Document.
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.
Unix timestamp
The date and time at which the document was processed by Mangopay’s team.
string
Returned values:
CREATED, VALIDATION_ASKED, VALIDATED, REFUSED, OUT_OF_DATEThe status of the document:CREATED– The document container is created and files can be uploaded using the POST Create a KYC Document Page endpoint before submission.VALIDATION_ASKED– The document is submitted to Mangopay for validation.VALIDATED– The document is validated by Mangopay’s teams.REFUSED– The document is rejected by Mangopay’s teams and a new KYC Document object needs to be created to resubmit it. You can learn more about the reason why it was refused in theRefusedReasonTypeparameter.OUT_OF_DATE– The document is downgraded and a new KYC Document object needs to be created to resubmit it.
string
Returned values: DOCUMENT_DO_NOT_MATCH_USER_DATA, DOCUMENT_FALSIFIED, DOCUMENT_HAS_EXPIRED, DOCUMENT_INCOMPLETE, DOCUMENT_MISSING, DOCUMENT_NOT_ACCEPTED, DOCUMENT_UNREADABLE, SPECIFIC_CASE, UNDERAGE_PERSONReturned
null unless Status is REFUSED.The reason for the document refusal. See the refused reason types for more information depending on the document type.string
Max. length: 255 charactersDefault value: nullAdditional information about why the KYC Document was refused, provided by Mangopay’s team.
400 - Natural user only allows IDENTITY_PROOF and ADDRESS_PROOF
400 - Natural user only allows IDENTITY_PROOF and ADDRESS_PROOF
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "da212cf3-7afb-4a49-9c6d-8fa2753f243c#1727446970",
"Date": 1727446971,
"errors": {
"Type": "REGISTRATION_PROOF cannot be submitted for NATURAL_PERSON user"
}
}
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "3824ad65-c0da-4da6-824c-697a58a77b2e#1727446982",
"Date": 1727446983,
"errors": {
"Type": "ARTICLES_OF_ASSOCIATION cannot be submitted for NATURAL_PERSON user"
}
}
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "d91835a1-ce46-4e55-866d-6f1e0de61e75#1727448032",
"Date": 1727448034,
"errors": {
"Type": "SHAREHOLDER_DECLARATION cannot be submitted for NATURAL_PERSON user"
}
}
400 - Legal users don't allow ADDRESS_PROOF
400 - Legal users don't allow ADDRESS_PROOF
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "43cddfad-fad7-4ed5-a9c6-bcc4d4b0ef42#1727447421",
"Date": 1727447422,
"errors": {
"Type": "ADDRESS_PROOF cannot be submitted for BUSINESS user"
}
}
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "573e126e-800a-42c4-89cd-b78ff10f0327#1727447489",
"Date": 1727447490,
"errors": {
"Type": "ADDRESS_PROOF cannot be submitted for PARTNERSHIP user"
}
}
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "2fb6cf62-cfb4-4a62-9401-763a53d7f602#1727447342",
"Date": 1727447343,
"errors": {
"Type": "ADDRESS_PROOF cannot be submitted for ORGANIZATION user"
}
}
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "444f5241-5263-4cc0-9ad2-26c871a6cf44#1727447141",
"Date": 1727447142,
"errors": {
"Type": "ADDRESS_PROOF cannot be submitted for SOLETRADER user"
}
}
400 - Soletrader doesn't allow ARTICLES_OF_ASSOCIATION
400 - Soletrader doesn't allow ARTICLES_OF_ASSOCIATION
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "fa1adc02-dc72-47be-ab3c-4a0a4ce4ef6b#1727447083",
"Date": 1727447084,
"errors": {
"Type": "ARTICLES_OF_ASSOCIATION cannot be submitted for SOLETRADER user"
}
}
{
"Type": "IDENTITY_PROOF",
"UserId": "user_m_01J8J0Y9DPNYRA9RB532CCND9Q",
"Flags": [],
"Id": "kyc_01JA5M2N33ENJHWVPQXVJ6Q51P",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1728913167,
"ProcessedDate": null,
"Status": "CREATED",
"RefusedReasonType": null,
"RefusedReasonMessage": null
}
{
"Tag": "accept",
"Type": "IDENTITY_PROOF"
}
<?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 = '198675238';
$kycDocument = new \MangoPay\KycDocument();
$kycDocument->Type = \MangoPay\KycDocumentType::IdentityProof;
$kycDocument->Tag = 'accept';
$response = $api->Users->CreateKycDocument($userId, $kycDocument);
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'
}
let myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: "accept"
}
const createKycDocument = async (userId, kycDocument) => {
return await mangopay.Users.createKycDocument(userId, kycDocument)
.then((response) => {
console.info(response)
return response
}).catch((err) => {
console.log(err);
return false
});
}
createKycDocument(myUser.Id, myKycDocument)
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 createKycDocument(userId, kycDocumentObject)
begin
response = MangoPay::KycDocument.create(userId, kycDocumentObject)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to create KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Type: 'IDENTITY_PROOF',
Tag: 'accept'
}
createKycDocument(myUser[:Id], myKycDocument)
import com.mangopay.MangoPayApi;
import com.mangopay.core.Address;
import com.mangopay.core.enumerations.KycDocumentType;
import com.mangopay.entities.KycDocument;
import java.lang.reflect.Field;
public class CreateKYCDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
KycDocument createKycDoc = mangopay.getUserApi().createKycDocument(
userId,
KycDocumentType.IDENTITY_PROOF,
"accept"
);
System.out.println(String.format("id: %s", createKycDoc.getId()));
printObjectFields(createKycDoc);
}
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 Document, LegalUser
legal_user = LegalUser(
id = '210760575'
)
kyc_document = Document(type='REGISTRATION_PROOF', user=legal_user)
create_kyc_document = kyc_document.save()
pprint(create_kyc_document)
using MangoPay.SDK;
using MangoPay.SDK.Core.Enumerations;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
var tag = "accept";
var createKycDoc = await api.Users.CreateKycDocumentAsync(userId, KycDocumentType.IDENTITY_PROOF, tag);
string prettyPrint = JsonConvert.SerializeObject(createKycDoc, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I