Skip to main content
The ApiKycDocuments class provides methods to retrieve and manage KYC documents submitted by users for identity verification purposes.

Methods

GetAll

Retrieves all KYC documents with optional pagination, sorting, and filtering.
public function GetAll(
    & $pagination = null,
    $sorting = null,
    $filter = null
)
return
\MangoPay\KycDocument[]
Array of KycDocument objects returned from the API

Example

$api = new \MangoPay\MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';

$pagination = new \MangoPay\Pagination(1, 100);
$sorting = new \MangoPay\Sorting();
$sorting->AddField('CreationDate', 'DESC');

$filter = new \MangoPay\FilterKycDocuments();
$filter->Status = \MangoPay\KycDocumentStatus::ValidationAsked;

$documents = $api->KycDocuments->GetAll($pagination, $sorting, $filter);

foreach ($documents as $document) {
    echo "Document ID: " . $document->Id . "\n";
    echo "Type: " . $document->Type . "\n";
    echo "Status: " . $document->Status . "\n";
}

Get

Retrieves a specific KYC document by its identifier.
public function Get($kycDocumentId)
return
\MangoPay\KycDocument
The KycDocument object returned from the API

Example

$api = new \MangoPay\MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';

$documentId = '12345678';
$document = $api->KycDocuments->Get($documentId);

echo "Document Type: " . $document->Type . "\n";
echo "Status: " . $document->Status . "\n";
echo "User ID: " . $document->UserId . "\n";

if ($document->Status === \MangoPay\KycDocumentStatus::Refused) {
    echo "Refused Reason: " . $document->RefusedReasonMessage . "\n";
}

CreateKycDocumentConsult

Creates temporary URLs where each page of a KYC document can be viewed.
public function CreateKycDocumentConsult(
    $kycDocumentId,
    & $pagination = null
)
return
\MangoPay\DocumentPageConsult[]
Array of DocumentPageConsult objects containing temporary URLs for viewing each page of the document

Example

$api = new \MangoPay\MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';

$documentId = '12345678';
$consults = $api->KycDocuments->CreateKycDocumentConsult($documentId);

foreach ($consults as $index => $consult) {
    echo "Page " . ($index + 1) . " URL: " . $consult->Url . "\n";
    echo "Expires at: " . date('Y-m-d H:i:s', $consult->ExpirationDate / 1000) . "\n";
}

KycDocument Object

The KycDocument object represents a KYC document in the system.
Id
string
The unique identifier of the document
Type
string
The type of KYC document. See \MangoPay\KycDocumentType for available values
Status
string
The current status of the document. See \MangoPay\KycDocumentStatus for available values:
  • CREATED - Document has been created
  • VALIDATION_ASKED - Document submitted for validation
  • VALIDATED - Document has been approved
  • REFUSED - Document has been rejected
UserId
string
The unique identifier of the user who submitted the document
RefusedReasonType
string
The type of reason why the document was refused (if applicable)
RefusedReasonMessage
string
Detailed message explaining why the document was refused
ProcessedDate
int
Unix timestamp of when the document was processed
Flags
array
Additional information regarding why the document has been rejected

DocumentPageConsult Object

The DocumentPageConsult object contains temporary viewing information for a document page.
Url
string
Temporary URL where the document page can be viewed
ExpirationDate
int
Unix timestamp (in milliseconds) when the temporary URL will expire

Build docs developers (and LLMs) love