This is an auto-generated client library for Onfido API v2
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

The Onfido API is used to submit check requests.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 1.4.0
  • Build date: 2018-11-08T15:57:09.622Z
  • Build package: class io.swagger.codegen.languages.PhpClientCodegen


PHP 5.4.0 and later

Installation & Usage


To install the bindings via Composer, add the following to composer.json:

  "repositories": [
      "type": "git",
      "url": ""
  "require": {
    "onfido/api-php-client": "1.4.0"

Then run composer install

Manual Installation

Download the files and include autoload.php:



To run the unit tests:

composer install

Getting Started

Please follow the installation procedure and then run the following:

require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Token
Onfido\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'token=' . 'YOUR_API_KEY');
Onfido\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Token');

// Limit the at-rest region, if needed (optional, see

$api_instance = new Onfido\Api\DefaultApi();

// setting applicant details
$applicant = new Onfido\Models\Applicant();
$applicant->setDob(new DateTime('1980-01-22'));

$address = new Onfido\Models\Address();
$address->setStreet('Main Street');
$address->setPostcode('SW4 6EH');


// setting check request details
$check = new Onfido\Models\CheckCreationRequest();

$report = new Onfido\Models\Report();


try {
    $result = $api_instance->createApplicant($applicant);
    $applicant_id = $result->getId();
    $result = $api_instance->createCheck($applicant_id, $check);
} catch (Exception $e) {


Documentation for API Endpoints

All URIs are relative to

Class Method HTTP request Description
DefaultApi cancelReport POST /checks/{check_id}/reports/{report_id}/cancel This endpoint is for cancelling individual paused reports.
DefaultApi createApplicant POST /applicants Create Applicant
DefaultApi createCheck POST /applicants/{applicant_id}/checks Create a check
DefaultApi createWebhook POST /webhooks Create a webhook
DefaultApi destroyApplicant DELETE /applicants/{applicant_id} Delete Applicant
DefaultApi downloadDocument GET /applicants/{applicant_id}/documents/{document_id}/download Download a documents raw data
DefaultApi downloadLivePhoto GET /live_photos/{live_photo_id}/download Download live photo
DefaultApi findAddresses GET /addresses/pick Search for addresses by postcode
DefaultApi findApplicant GET /applicants/{applicant_id} Retrieve Applicant
DefaultApi findCheck GET /applicants/{applicant_id}/checks/{check_id} Retrieve a Check
DefaultApi findDocument GET /applicants/{applicant_id}/documents/{document_id} A single document can be retrieved by calling this endpoint with the document’s unique identifier.
DefaultApi findLivePhoto GET /live_photos/{live_photo_id} Retrieve live photo
DefaultApi findReport GET /checks/{check_id}/reports/{report_id} A single report can be retrieved using this endpoint with the corresponding unique identifier.
DefaultApi findReportTypeGroup GET /report_type_groups/{report_type_group_id} Retrieve single report type group object
DefaultApi findWebhook GET /webhooks/{webhook_id} Retrieve a Webhook
DefaultApi listApplicants GET /applicants List Applicants
DefaultApi listChecks GET /applicants/{applicant_id}/checks Retrieve Checks
DefaultApi listDocuments GET /applicants/{applicant_id}/documents List documents
DefaultApi listLivePhotos GET /live_photos List live photos
DefaultApi listReportTypeGroups GET /report_type_groups Retrieve all report type groups
DefaultApi listReports GET /checks/{check_id}/reports All the reports belonging to a particular check can be listed from this endpoint.
DefaultApi listWebhooks GET /webhooks List webhooks
DefaultApi resumeCheck POST /checks/{check_id}/resume Resume a Check
DefaultApi resumeReport POST /checks/{check_id}/reports/{report_id}/resume This endpoint is for resuming individual paused reports.
DefaultApi updateApplicant PUT /applicants/{applicant_id} Update Applicant
DefaultApi uploadDocument POST /applicants/{applicant_id}/documents Upload a document
DefaultApi uploadLivePhoto POST /live_photos Upload live photo

Documentation For Models