Upload a document
inbox:inbox.writehttps://api.holded.com/api/v2/inboxUploads a document file to the inbox. Accepts a single file in multipart/form-data format. Use this when the user uploads a document file from your application.
Request body
Document file to upload: PDF, JPEG, PNG, GIF or BMP (converted to PDF); TIFF is not accepted, up to 20 MB, images at least 200 px wide and high
Request
import requests
url = "https://api.holded.com/api/v2/inbox"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())Responses
Response
{
"id": "string",
"status": "pending_to_verify",
"origin": {
"id": "string",
"name": "string",
"type": "upload",
"source": "string"
},
"document_number": "string",
"type": "invoice",
"outcome": {
"documentId": "string",
"documentNumber": "string",
"type": "string",
"isDraft": false,
"exportedAt": "2024-01-15T10:30:00Z",
"attached": false
},
"date": "2024-01-15T10:30:00Z",
"contact_name": "string",
"total": "100,00",
"file": {
"filename": "string",
"path": "string"
},
"thumbnail": "string",
"signature": {
"filename": "string",
"path": "string"
},
"scanned_at": "string",
"seen_at": "string",
"errors": [
"string"
],
"draft": {
"description": "string"
}
}Success responses
201Document uploaded successfullyapplication/jsonUnique identifier of the incoming document
Current status
newprocessingerrorpending_to_verifydonerejectedOrigin metadata
emailuploadholdedToHoldedbankTransactionDocument number extracted from the file
Document type
invoicesalesreceiptcreditnotepurchaseorderpurchaseshipmentsalesorderreceiptpurchaserefundestimatewaybillproformreceiptnoteinvoicerecurringpurchaserecurringpayrollpayrollrecurringamazonorderproductionorderinvoicingforecastLinked document outcome if the document has been processed
True if the incoming document was attached to an existing document (as opposed to creating a new one)
Creation date in ISO 8601 format
Name of the associated contact
Total amount as decimal string
Primary file associated with the document
Thumbnail URL (reserved for future use)
Certified digitization signature file
Date the document was scanned (ISO 8601)
Date the document was first seen (ISO 8601)
List of error codes if the scan failed
Draft metadata extracted from the document
Error responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json422The file type, size or image dimensions are not acceptedapplication/json429Rate limit exceededapplication/json