This is a Multi-part file upload, it consists of a json body with metadata and the file contents in the "file" key.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
This endpoint differs from all the others because this is a Multi-part file upload instead of application/json
When Lirium performs the KYCUse Get KYC Link instead. Lirium collects the documents from the Customer directly and you never call this endpoint.
Supporteddocument_typevalues
id_front,id_back,proof_of_address,selfieAdditional 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 owndocument_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-TypeSupported file types:
application/pdfimage/pngimage/jpegimage/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.
| Status | Error Code | Description |
|---|---|---|
| 400 | requirement_not_pending | The document_type is not pending submission for this customer — for example, a type that is not enabled for your integration |
| 400 | requirement_already_approved | The document type is already approved and cannot be replaced |
| 400 | requirement_is_being_reviewed | The document is under review and cannot be changed until the review completes |
| 400 | operation_not_allowed | Document upload is not available for your KYC configuration |
| 413 | payload_too_large | The file is larger than the 2MB limit |
RecipeOnboarding Flow uploads each
document_typeand then waits for the Customer to reach theactivestate.
