AI Document Invoice Data Extraction API

Starting from 500 atoms
AI tier


This Utility API focuses on AI-based invoice data extraction, concentrating on identifying key information within documents of invoices, utility bills, and purchase orders.
This API can extract fields and line items from documents of various formats and quality, including phone-captured images, scanned documents, and digital PDFs. The API analyzes invoice text, extracting crucial details like customer name, billing address, due date, and amount due, returning a structured JSON data representation and can be really useful for automating invoice processing, reducing manual data entry, and enhancing accuracy in financial workflows.
The atoms cost is subjected to change depending on the size of the input file and the provider selected. The list of providers and the atoms cost for each provider is given below:
Provider (requested_service)Atoms
Note: In order to test the API on API Playground, just click on "Show optional inputs" and enter the Authentication token for the provider before clicking on Send request. The output response structure and the result of the AI utility APIs depend on the service provider and it may vary depending on which service provider is selected.
Select API Endpoints

API Playground

API Documentation

input file: output json

Request example

curl --location --request POST 'https://api.apyhub.com/ai/document/extract/invoice/file' \
--header 'apy-token: {{token}}' \
--form 'file=@"sample.jpg"'
--form 'requested_service="azure"'
--form 'azure_key="your-azure-key"'
--form 'azure_endpoint="your-azure-endpoint"'
Provider (requested_service)Atoms
Method: POST
Content Type: multipart/form-data
Request Body
filefileYesthe source document file in any of supported formats (jpeg, jpg, png, tiff, heif, bmp, pdf, docx, xlsx, pptx ,html)
requested_serviceStringyesthe name of service provider. Supported providers are azure, apyhub. Defaults to apyhub
azure_keyStringyes (if azure is selected in requested_service)service key provided by azure
azure_endpointStringyes (if azure is selected in requested_service)the endpoint provided by azure
Sample Response
A successful request returns the extracted invoice data as response in the output parameter specified. If the request fails, the response contains an error code and a message to help determine what went wrong.

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
400Invalid input - the file is corrupt or the supported inputs are not provided.
401Required authentication information is either missing or not valid for the resource.
500If any unexpected error occurs while processing the request.


All API requests to ApyHub services need to be authenticated. Currently we support tokens or basic authentication mechanisms. You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".
Points to note:
  • Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
  • Use the apy-token as the header parameter to pass the token.
  • Use the Authorization header to send the basic authentication credentials.

Error codes

"error": {
"code": 105,
"message": "Invalid URL"
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.