Skip to main content
Upload a PDF or image file for invoice extraction.

Endpoint

POST /api/upload

Request

Content-Type: multipart/form-data

Body Parameters

ParameterTypeRequiredDescription
fileFileYesPDF or image file (max 10MB)
clientIdstringNoAssign to a specific client

Example

curl -X POST https://vatextract.com/api/upload \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "file=@invoice.pdf" \
  -F "clientId=client_abc123"

Response

{
  "id": "inv_abc123xyz",
  "status": "processing",
  "fileName": "invoice.pdf",
  "createdAt": "2024-01-15T10:30:00Z"
}

Response Fields

FieldTypeDescription
idstringUnique invoice ID
statusstringprocessing, completed, or failed
fileNamestringOriginal filename
createdAtstringISO 8601 timestamp

Processing Status

After upload, the invoice is processed asynchronously. Check status by fetching the invoice:
GET /api/invoices/inv_abc123xyz
StatusDescription
processingOCR extraction in progress
completedExtraction finished, data available
failedExtraction failed (see textractFailureReason)
Processing typically takes 5-15 seconds. VAT validation happens asynchronously after extraction completes.

Supported Formats

FormatMax SizeNotes
PDF10MBNative and scanned
JPEG10MBHigh resolution recommended
PNG10MBHigh resolution recommended

Error Responses

StatusErrorDescription
400No file providedMissing file in request
400Invalid file typeUnsupported format
413File too largeExceeds 10MB limit
401UnauthorizedInvalid/missing auth token