Upload KYC Document

This is a Multi-part file upload, it consists of a json body with metadata and the file contents in the "file" key.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
❗️

This endpoint differs from all the others because this is a Multi-part file upload instead of application/json

📘

When Lirium performs the KYC

Use Get KYC Link instead. Lirium collects the documents from the Customer directly and you never call this endpoint.

📘

Supported document_type values

id_front, id_back, proof_of_address, selfie

Additional documents. Beyond the four above, a Banking Partner can be asked for extra documents,
enabled for its integration only — usually to satisfy a local requirement. They are uploaded through
this same endpoint under their own document_type, and they do not replace any of the four.

Available today: segip, the identity certificate issued by SEGIP, the Bolivian national ID
authority, accepted for Banking Partners operating in Bolivia.

This is an example code that can be used to upload a file to this endpoint

import requests

def upload_file(url, file_name):
    data = {
        "document_type": "id_front",
        "file_length": 1024,
        "file_type": "image/png"
    }

    files = {
        "file": open(file_name, 'rb'),
    }

    resp = requests.post(url, files=files, data=data)

Please note that the example call generated by this page is not currently working, you need to add the "filename" field to the request, which is not added by the automatic call generator.

This is a valid request:

curl 'https://api.lirium-sandbox.com/v1/customers/{customer id}/documents' \
-H 'authorization: Bearer {JWT Token}'  \
-H 'content-type: multipart/form-data; boundary=----EXAMPLEMULTIPARTLIRIUMTEST--------'  \
 --data-raw $'------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="document_type"\r\n\r\n{document type}\r\n------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="file_type"\r\n\r\n{file type}\r\n------EXAMPLEMULTIPARTLIRIUMTEST--------\r\nContent-Disposition: form-data; name="file"; filename="sample1.jpg\r\n\r\n{file binary content}\r\n------EXAMPLEMULTIPARTLIRIUMTEST----------\r\n'
❗️

Content-Type

Supported file types:

  • application/pdf
  • image/png
  • image/jpeg
  • image/gif

We currently have a maximum upload size of 2MB, sending a file larger than this will result in an error (with http_code 413)

Error Responses

Error responses follow the format described in Errors and Error Codes.

StatusError CodeDescription
400requirement_not_pendingThe document_type is not pending submission for this customer — for example, a type that is not enabled for your integration
400requirement_already_approvedThe document type is already approved and cannot be replaced
400requirement_is_being_reviewedThe document is under review and cannot be changed until the review completes
400operation_not_allowedDocument upload is not available for your KYC configuration
413payload_too_largeThe file is larger than the 2MB limit
📘

Recipe

Onboarding Flow uploads each document_type and then waits for the Customer to reach the active state.

Path Params
string
required
Body Params
string
enum
required
Defaults to id_front
Allowed:
string
enum
required
Defaults to image/png
Allowed:
file
required

File content bytes

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json