<?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 {
$kycDocumentId = '148967714';
$response = $api->KycDocuments->Get($kycDocumentId);
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 kycDocument = {
Id: 'kyc_01HSXNH060XEFTTQ57RKYBHHQ1',
}
const getKycDocument = async (kycDocumentId) => {
return await mangopay.KycDocuments.get(kycDocumentId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getKycDocument(kycDocument.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 viewKycDocument(userId, kycDocumentId)
begin
response = MangoPay::KycDocument.fetch(userId, kycDocumentId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Id: '194510406',
}
viewKycDocument(myUser[:Id], myKycDocument[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.KycDocument;
public class ViewKycDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
String kycDocId = "kyc_01HSB6MMPT9RPDFHSG1BN9BKPP";
KycDocument viewKycDoc = mangopay.getUserApi().getKycDocument(userId, kycDocId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(submitKycDoc);
System.out.println(viewKycDoc);
}
}
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
kyc_document = Document(
id = '211551193'
)
try:
view_kyc_document = Document.get(kyc_document.id)
pprint(vars(view_kyc_document))
except Document.DoesNotExist:
print('The KYC document {} does not exist'.format(kyc_document.id))
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_01J2TZ261WZNDM0ZDRWGDYA4GN";
var kycDocId = "kyc_01J2V2W9CJKMS9V0SGFWHPQY87";
var viewKycDoc = await api.Users.GetKycDocumentAsync(userId, kycDocId);
string prettyPrint = JsonConvert.SerializeObject(viewKycDoc, 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": 1728913173,
"Status": "VALIDATED",
"RefusedReasonType": null,
"RefusedReasonMessage": null
}
KYC documents
View a KYC Document
GET
/
v2.01
/
{ClientId}
/
kyc
/
documents
/
{KycDocumentId}
<?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 {
$kycDocumentId = '148967714';
$response = $api->KycDocuments->Get($kycDocumentId);
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 kycDocument = {
Id: 'kyc_01HSXNH060XEFTTQ57RKYBHHQ1',
}
const getKycDocument = async (kycDocumentId) => {
return await mangopay.KycDocuments.get(kycDocumentId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getKycDocument(kycDocument.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 viewKycDocument(userId, kycDocumentId)
begin
response = MangoPay::KycDocument.fetch(userId, kycDocumentId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Id: '194510406',
}
viewKycDocument(myUser[:Id], myKycDocument[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.KycDocument;
public class ViewKycDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
String kycDocId = "kyc_01HSB6MMPT9RPDFHSG1BN9BKPP";
KycDocument viewKycDoc = mangopay.getUserApi().getKycDocument(userId, kycDocId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(submitKycDoc);
System.out.println(viewKycDoc);
}
}
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
kyc_document = Document(
id = '211551193'
)
try:
view_kyc_document = Document.get(kyc_document.id)
pprint(vars(view_kyc_document))
except Document.DoesNotExist:
print('The KYC document {} does not exist'.format(kyc_document.id))
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_01J2TZ261WZNDM0ZDRWGDYA4GN";
var kycDocId = "kyc_01J2V2W9CJKMS9V0SGFWHPQY87";
var viewKycDoc = await api.Users.GetKycDocumentAsync(userId, kycDocId);
string prettyPrint = JsonConvert.SerializeObject(viewKycDoc, 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": 1728913173,
"Status": "VALIDATED",
"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.
Path parameters
string
required
The unique identifier of the KYC Document.
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
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.
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.
{
"Type": "IDENTITY_PROOF",
"UserId": "user_m_01J8J0Y9DPNYRA9RB532CCND9Q",
"Flags": [],
"Id": "kyc_01JA5M2N33ENJHWVPQXVJ6Q51P",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1728913167,
"ProcessedDate": 1728913173,
"Status": "VALIDATED",
"RefusedReasonType": null,
"RefusedReasonMessage": null
}
<?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 {
$kycDocumentId = '148967714';
$response = $api->KycDocuments->Get($kycDocumentId);
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 kycDocument = {
Id: 'kyc_01HSXNH060XEFTTQ57RKYBHHQ1',
}
const getKycDocument = async (kycDocumentId) => {
return await mangopay.KycDocuments.get(kycDocumentId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getKycDocument(kycDocument.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 viewKycDocument(userId, kycDocumentId)
begin
response = MangoPay::KycDocument.fetch(userId, kycDocumentId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch KYC Document: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myUser = {
Id: '194150513'
}
myKycDocument = {
Id: '194510406',
}
viewKycDocument(myUser[:Id], myKycDocument[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.KycDocument;
public class ViewKycDoc {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
String userId = "user_m_01HR9SZTXDRY1PCFHSJFAPC0YJ";
String kycDocId = "kyc_01HSB6MMPT9RPDFHSG1BN9BKPP";
KycDocument viewKycDoc = mangopay.getUserApi().getKycDocument(userId, kycDocId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(submitKycDoc);
System.out.println(viewKycDoc);
}
}
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
kyc_document = Document(
id = '211551193'
)
try:
view_kyc_document = Document.get(kyc_document.id)
pprint(vars(view_kyc_document))
except Document.DoesNotExist:
print('The KYC document {} does not exist'.format(kyc_document.id))
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_01J2TZ261WZNDM0ZDRWGDYA4GN";
var kycDocId = "kyc_01J2V2W9CJKMS9V0SGFWHPQY87";
var viewKycDoc = await api.Users.GetKycDocumentAsync(userId, kycDocId);
string prettyPrint = JsonConvert.SerializeObject(viewKycDoc, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?