Supporting Documents and Packages

This document details API endpoints for managing supporting documents and packages related to entities.

Get Supporting Documents Related to an Entity

Endpoint

GET https://api.icomplykyc.com/api/v2/entities/:id/documents

Purpose: Retrieve all supporting documents associated with a specific legal entity.

Authentication Type: API Key

Sample Query

https://api.icomplykyc.com/api/v2/entities/1234567e-fcff-4c10-9dd3-da74422e1c30/documents

Path Parameters

Name Type Description
id String The entity ID you wish to retrieve documents for

Responses 

200: OK
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"documentId": "1234567a-aff8-4b24-8606-f40a6ef6ec90",
"fileName": "Supporting document example 3",
"type": "Proof of Address",
"description": null,
"dateReceived": "2020-09-01 14:38:57",
"documentApproved": false
},
{
"documentId": "1234567a-adf1-4afa-a072-b1f80cdfdef0",
"fileName": "Supporting document example 2",
"type": "Proof of Address",
"description": null,
"dateReceived": "2020-09-01 14:44:39",
"documentApproved": true
},
{
"documentId": "1234567e-3b78-42fb-9547-dd0fb62e8d51",
"fileName": "Supporting document example 1",
"type": "Proof of Wealth",
"description": null,
"dateReceived": "2020-09-02 09:26:34",
"documentApproved": false
},
{
"documentId": "12345672-fadf-4b26-8c9d-bbb3bae5a6cf",
"fileName": "Supporting document example 4",
"type": "Proof of Address",
"description": null,
"dateReceived": "2020-09-02 09:29:24",
"documentApproved": false
}
]
}
 
404: Not Found The entity ID provided was not found
{
// Response
}

 

Get Supporting Document by Document ID

Endpoint

GET https://api.icomplykyc.com/api/v2/documents/:id

Purpose: Retrieve the details and binary file of a specified document. The document is returned as a base64-encoded string, which must be decoded into a binary file.

Authentication Type: Api Key

Sample Query: https://api.icomplykyc.com/api/v2/documents/1234567e-fcff-4c10-9dd3-da74422e1c30

Path Parameters
 
Name Type Description

id

String

The ID of the document to retrieve

200: OK 
{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"fileName": "SampleFile.jpg_1234567-884b-414a-8ac0-943bba161727.jpg",
"format": "PDF",
"data": "/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1...2Q=="
}
]
}

404: Not Found

{
"code": 404,
"status": "failure",
"message": "there is no document with given id",
"data": null
}

Managing Supporting Document Packages

Add an Item to a Package

Endpoint

PUT ~/api/v2/entities/{entityId}/packages/{eventHistoryId}/items

Purpose: Add an item to a package for a specific entity. The functionality mirrors the dashboard.

Path Parameters

Name Type Description
entityId String The unique identifier for the entity
eventHistoryId String The ID of the created package linked to the entity (not the package ID in the app)

Form Data

Name Type Description
files Array An array of items where each item is of type document
itemIds Array Each element is linked to a corresponding file in the files array
answers Array Contains answers to questions. Each element includes itemId, answer, and type

Example Payload

{
"files": [
{ "document": "file1.pdf" },
{ "document": "file2.pdf" }
],
"itemIds": [
"item123",
"item124"
],
"answers": [
{
"itemId": "item125",
"answer": "42",
"type": "Numerical Field"
}
]
}

Example 1:

Example 2:

Additional Endpoints for Managing Packages

  1. Retrieve All Supporting Document Packages GET ~/api/v{version:apiVersion}/supporting-document-packages

    • Purpose: Returns all existing packages. The EntityType field indicates the entity type (0 - NP, 1 - LE).

  2. Retrieve Items in a Package GET ~/api/v{version:apiVersion}/supporting-document-packages/{packageId}/items

    • Purpose: Retrieves items within a specific package using the packageId.

  3. Add a Package to an Entity POST ~/api/v{version:apiVersion}/entities/{entityId}/packages

    • Purpose: Adds an entire package to an entity. Includes a fullName field for the uploader.

  4. Retrieve All Packages for an Entity GET ~/api/v{version:apiVersion}/entities/{entityId}/packages

    • Purpose: Retrieves all packages created for a specific entity.

  5. Retrieve Specific Package Details GET ~/api/v{version:apiVersion}/entities/{entityId}/packages/{eventHistoryId}

    • Purpose: Retrieves details of a specific package using eventHistoryId.