Skip to content

Link Document

Request URL

POST /customer/kyc/document-link (deprecated)

Description

This endpoint is deprecated. Instead of using /customer/kyc and /document endpoints, we recommend the use of the /akepa endpoints for KYC/KYB verification and document upload.

This request can be used if a document file has been uploaded separately and needs to be associated with an existing customer document id. The /document/generate and /document/upload/:documentId requests are pre-requisites. After the separate document ID has been generated and a file has been uploaded for that document ID using these pre-requisite requests, then a request may be made to /customer/kyc/document-link to associate the newly generated and uploaded document with the existing customer document id.

If the existing customer document ID references a document that has already been uploaded, then making a document-link request will overwrite the existing file associated with that ID using the new, separately uploaded document. A document-link request can be successfully made, even if the customer's KYC status is already "APPROVED".

Required Properties Description Schema Example Values
customerId Customer ID in connectFi string "csta_2DrPdoqtfvsfLdBBvHDla"
documentId Document ID linked to customer in connectFi (from the kycDocumentList returned from the /customer/kyc/init request) string "doc-LwKISlnb04sviMV1x82MM"
separateDocumentId Separate document ID in connectFi (from the /document/generate request made when initializing a document not associated with a customer) string "sdoc-2M5GA6wYiyTXsQQPPMBaGY"

Request body

HEADERS

{
    "Content-Type": "application/json",
    "x-connectfi-token": "a long random string" //Authorization token received from /auth/get-token request
}

REQUEST BODY

{
    "customerId" : "csta-YbQeg60v7orvQFIYA7gKU", //customer ID in connectFi
    "documentId" : "doc-45SKHDbSp1Imxr1hjGOmfW", //existing customer document ID (can be obtained using a /customer/kyc/status request)
    "separateDocumentId" : "sdoc_lnj0CHjHqUms6VgpFwU2Q" //separate document ID obtained using a /document/generate request
}

Successful Response Example

200 (HTTP response status code) -- Separate document was successfully linked to existing customer document id

{
    "code": "0", //Success
    "data": {
        "customer": {
            "reference": "2222369478", //unique external reference in your system
            "customerId": "csta-YbQeg60v7orvQFIYA7gKU", //customer ID in connectFi
            "customerType": "individual",
            "customer": { //customer object
            },
            "kycStatus": "WAITING_DATA",
            "boises": [],
            "dtsCreatedAt": "2022-10-07T17:18:56.424Z"
        },
        "kyc": {
            "attributeCodes": [
                "cardAttributes"
            ],
            "system": "condor",
            "mode": "licenseUSACondor",
            "status": "WAITING_DATA"
        },
        "kycDocumentList": [
            {
                "id": "doc-45SKHDbSp1Imxr1hjGOmfW", //existing customer document ID that was used in the request body
                "label": "LICENSE FRONT",
                "type": "LICENSE",
                "documentSide": "FRONT",
                "uploadStatus": true,
                "extension": "png"
            },
            {
                "id": "doc-45SKHEQURjRQQQzcUOJZyY",
                "label": "LICENSE BACK",
                "type": "LICENSE",
                "documentSide": "BACK",
                "uploadStatus": false
            }
        ],
        "kycAttributes": {
            "cardAttributes": {
                "productID": "AWSM_API_Evolve_Test",
                "nameOnCard": "JOHN TESTMAN UWUR",
                "designId": "1",
                "addressType": "PRIMARY",
                "issueType": "NEW",
                "additionalData": {
                    "designId": "1"
                }
            }
        }
    }
    "requestId": "5e687b70b85511ed94b4966a132cde12"
}

Errors

400 (HTTP response status code) -- Document not found (existing customer document)

In this example, a separate document ID has been generated using a /document/generate API request and the document file has been uploaded using a /document/upload/:documentId request. The customerId given was also valid. However, the existing customer document ID given was invalid. The existing customer document ID can be located by making a /customer/kyc/status request (it will be in data.kycDocumentList[document index].id in the KYC status response body).

{
    "requestId": "a3adca00b85511ed94b4966a132cde12",
    "code": "documentNotFound",
    "message": "Document sdoc_2ztSzf9y8Gc77tEA7f8UCK not found"
}

400 (HTTP response status code) -- Document not found (separate document)

In this example, a separate document ID has not yet been generated using a /document/generate API request.

Note: This error will also be produced if a separate document ID has been generated, but has already been linked to an existing customer document. You cannot reuse the same separate document ID to make more than one document-link request if it has already been successfully linked.

{
    "requestId": "aea19770b85511ed94b4966a132cde12",
    "code": "documentNotFound",
    "message": "Document sdoc_2ztSzf9y8Gc77tEA7f8UCK1 not found"
}

400 (HTTP response status code) -- Document not uploaded

In this example, a separate document ID was generated using a /document/generate API request, but the document file was not yet uploaded using a /document/upload/:documentId request.

{
    "requestId": "d51e0a00b85511ed94b4966a132cde12",
    "code": "documentNotUploaded",
    "message": "Document sdoc_6llmzUqpMNmIMM0fRUDmKK do not uploaded"
}