OCR PDF or image

View as MarkdownOpen in Claude
Use this endpoint to upload a document file for OCR processing as `multipart/form-data`, with the file in a field named `file`. The accepted file formats include PDF, JPG, JPEG, PNG, and GIF. Specify the desired type of result (either 'bill' or 'invoice') in the path parameter `typeResult`. The response will contain the OCR processing results, including extracted data such as bill number, vendor information, bill items, and more. To send the file as a Base64-encoded string in a JSON body instead, use `ocrDocumentJson`.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

OR
requestTokenstring

Long-lived API token sent in the requestToken header. See API token authentication.

Path parameters

typeResultstringRequired

The type of object to create in Payabli. Accepted values are bill and invoice.

Request

This endpoint expects a multipart form containing a file.
filefileRequired

The document to process, sent as a file upload in a field named file. Accepted formats are PDF, JPG, JPEG, PNG, and GIF.

Response

OCR document processing result
isSuccessboolean

Boolean indicating whether the operation was successful. A true value indicates success. A false value indicates failure.

responseTextstring

Response text for operation: ‘Success’ or ‘Declined’.

responseCodeinteger

Code for the response. Learn more in API Response Codes.

responseDataobjectOptional
Details of the OCR processing result

Errors

400
Bad Request Error
401
Unauthorized Error
500
Internal Server Error
503
Service Unavailable Error