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,selfie
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)
RecipeOnboarding Flow uploads each
document_typeand then waits for the Customer to reach theactivestate.
