Alladdin

Work in progress

Site en construction

الموقع قيد الإنشاء

Alladdin
POST

Upload a document

Scope: inbox:inbox.write https://api.alladdin.com/api/v2/inbox

Uploads 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

object document string<binary> required

Document file to upload

Request

python
import requests

url = "https://api.alladdin.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

json
{
  "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

201 Document uploaded successfully application/json object id string

Unique identifier of the incoming document

status string

Current status

Enum: new processing error pending_to_verify done rejected origin object

Origin metadata

id string name string type string Enum: email upload alladdinToAlladdin bankTransaction source string | null document_number string | null

Document number extracted from the file

type string | null

Document type

Enum: invoice salesreceipt creditnote purchase order purchaseshipment salesorder receipt purchaserefund estimate waybill proform receiptnote invoicerecurring purchaserecurring payroll payrollrecurring amazonorder productionorder invoicingforecast `` outcome object | null

Linked document outcome if the document has been processed

documentId string | null documentNumber string | null type string | null isDraft boolean | null exportedAt string<date-time> | null attached boolean

True if the incoming document was attached to an existing document (as opposed to creating a new one)

date string<date-time>

Creation date in ISO 8601 format

contact_name string | null

Name of the associated contact

total string | null

Total amount as decimal string

file object | null

Primary file associated with the document

filename string path string thumbnail string | null

Thumbnail URL (reserved for future use)

signature object | null

Certified digitization signature file

filename string path string scanned_at string | null

Date the document was scanned (ISO 8601)

seen_at string | null

Date the document was first seen (ISO 8601)

errors[] string[]

List of error codes if the scan failed

draft object

Draft metadata extracted from the document

description string | null

Error responses

400 Bad request application/json 401 Invalid or missing API key application/json 403 Insufficient permissions application/json 429 Rate limit exceeded application/json

Next →Attach incoming document to a document →