{
"document_type": {
"value": "invoice",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.9
},
"vendor": {
"name": {
"value": "Global Wholesaler",
"quote": "Global Wholesaler",
"confidence": 0.95
},
"address": {
"value": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"quote": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
},
"email": {
"value": "[email protected]",
"quote": "[email protected]",
"confidence": 0.95
},
"phone": {
"value": "(870)-931-0505",
"quote": "(870)-931-0505",
"confidence": 0.95
},
"iban": {
"value": "US1234567890",
"quote": "US1234567890",
"confidence": 0.95
}
},
"customer": {
"name": {
"value": "YourCompany",
"quote": "YourCompany, Mitchell Admin",
"confidence": 0.95
},
"address": {
"value": "215 Vine St Scranton PA 18503 United States",
"quote": "215 Vine St Scranton PA 18503 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
}
},
"invoice_number": {
"value": "INV/2023/03/0008",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.95
},
"order_number": {
"value": "CUSTREF123",
"quote": "Reference:CUSTREF123",
"confidence": 0.95
},
"issue_date": {
"value": "2023-03-20",
"quote": "03/20/2023",
"confidence": 0.9
},
"due_date": {
"value": "2023-04-04",
"quote": "04/04/2023",
"confidence": 0.9
},
"currency": {
"value": "USD",
"quote": "$ 112.00",
"confidence": 0.9
},
"payment_terms": {
"value": "15 Days",
"quote": "Payment terms: 15 Days",
"confidence": 0.95
},
"totals": {
"subtotal": {
"value": 262.9,
"quote": "Subtotal $ 262.90",
"confidence": 0.98
},
"vat_total": {
"value": 16.94,
"quote": "Tax 15% on $ 112.90 $ 16.94",
"confidence": 0.98
},
"total": {
"value": 279.84,
"quote": "Total $ 279.84",
"confidence": 0.98
},
"amount_due": {
"value": null,
"quote": null,
"confidence": null
}
},
"vat_breakdown": [
{
"rate": 15,
"base": 112.9,
"amount": 16.94,
"quote": "$ 16.94",
"confidence": 0.85
}
],
"line_items": [
{
"description": "Beeswax XL",
"quantity": 1,
"unit_price": 42,
"amount": 42,
"vat_rate": 15,
"quote": "[17589684] Beeswax XL Acme beeswax 1.00 kg 42.00 0.00 15.00% $ 42.00",
"confidence": 0.85
},
{
"description": "Office Chair",
"quantity": 1,
"unit_price": 70,
"amount": 70,
"vat_rate": 15,
"quote": "[FURN_7777] Office Chair 1.00 Units 70.00 0.00 15.00% $ 70.00",
"confidence": 0.85
},
{
"description": "Olive Oil",
"quantity": 1,
"unit_price": 1,
"amount": 0.9,
"vat_rate": 15,
"quote": "*987123* Olive Oil 1.00 L 1.00 10.00 15.00% $ 0.90",
"confidence": 0.85
},
{
"description": "Luxury Truffles",
"quantity": 15,
"unit_price": 10,
"amount": 150,
"vat_rate": null,
"quote": "[LUX_TRF] Luxury Truffles 15.00 g 10.00 0.00 $ 150.00",
"confidence": 0.85
}
],
"checks": {
"subtotal_plus_vat_equals_total": true,
"line_items_sum_equals_subtotal_or_total": true,
"vat_breakdown_sum_equals_vat_total": true,
"due_date_not_before_issue_date": true
},
"overall_confidence": 0.94,
"missing": [
"vendor_vat_id",
"customer_vat_id",
"amount_due"
],
"pages": 1,
"billed_usd": 0.0075,
"input": "pdf",
"text_chars": 1036,
"model": "@cf/mistralai/mistral-small-3.1-24b-instruct",
"timing_ms": {
"pdf_text_ms": 826,
"extract_ms": 14828,
"total": 15654
},
"confidence_method": "Per field: 0.6 if the quote is found verbatim in the document text (+0.3 if the value matches the quote; 0.35 base if the quote is not verbatim), then +0.08/-0.15 from the arithmetic checks for totals. Values with confidence < 0.6 should be reviewed.",
"limits": "LLM extraction can misread layouts; check important values (quotes make that quick). Scanned PDFs need image input. Documents are not stored.",
"sources": [
{
"name": "Cloudflare Workers AI: toMarkdown (PDF text layer), Mistral Small 3.1 24B (OCR of images + field extraction; fallback Llama 3.3 70B / Llama 4 Scout / Gemma 3 12B)",
"url": "https://developers.cloudflare.com/workers-ai/",
"note": "Documents are processed in memory and not stored or logged. No third-party LLM API."
}
]
}
curl --location --request GET 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37076/invoice+to+json?url=https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/AzureInterior.pdf' --header 'Authorization: Bearer YOUR_API_KEY'
{
"document_type": {
"value": "invoice",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.9
},
"vendor": {
"name": {
"value": "Global Wholesaler",
"quote": "Global Wholesaler",
"confidence": 0.95
},
"address": {
"value": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"quote": "Azure Interior 4557 De Silva St Fremont CA 94538 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
},
"email": {
"value": "[email protected]",
"quote": "[email protected]",
"confidence": 0.95
},
"phone": {
"value": "(870)-931-0505",
"quote": "(870)-931-0505",
"confidence": 0.95
},
"iban": {
"value": "US1234567890",
"quote": "US1234567890",
"confidence": 0.95
}
},
"customer": {
"name": {
"value": "YourCompany",
"quote": "YourCompany, Mitchell Admin",
"confidence": 0.95
},
"address": {
"value": "215 Vine St Scranton PA 18503 United States",
"quote": "215 Vine St Scranton PA 18503 United States",
"confidence": 0.95
},
"vat_id": {
"value": null,
"quote": null,
"confidence": null
}
},
"invoice_number": {
"value": "INV/2023/03/0008",
"quote": "Invoice INV/2023/03/0008",
"confidence": 0.95
},
"order_number": {
"value": "CUSTREF123",
"quote": "Reference:CUSTREF123",
"confidence": 0.95
},
"issue_date": {
"value": "2023-03-20",
"quote": "03/20/2023",
"confidence": 0.9
},
"due_date": {
"value": "2023-04-04",
"quote": "04/04/2023",
"confidence": 0.9
},
"currency": {
"value": "USD",
"quote": "$ 112.00",
"confidence": 0.9
},
"payment_terms": {
"value": "15 Days",
"quote": "Payment terms: 15 Days",
"confidence": 0.95
},
"totals": {
"subtotal": {
"value": 262.9,
"quote": "$ 262.90",
"confidence": 0.98
},
"vat_total": {
"value": 16.94,
"quote": "$ 16.94",
"confidence": 0.98
},
"total": {
"value": 279.84,
"quote": "$ 279.84",
"confidence": 0.98
},
"amount_due": {
"value": null,
"quote": null,
"confidence": null
}
},
"vat_breakdown": [
{
"rate": 15,
"base": 112.9,
"amount": 16.94,
"quote": "$ 16.94",
"confidence": 0.85
}
],
"line_items": [
{
"description": "Beeswax XL",
"quantity": 1,
"unit_price": 42,
"amount": 42,
"vat_rate": 15,
"quote": "[17589684] Beeswax XL Acme beeswax 1.00 kg 42.00 0.00 15.00% $ 42.00",
"confidence": 0.85
},
{
"description": "Office Chair",
"quantity": 1,
"unit_price": 70,
"amount": 70,
"vat_rate": 15,
"quote": "[FURN_7777] Office Chair 1.00 Units 70.00 0.00 15.00% $ 70.00",
"confidence": 0.85
},
{
"description": "Olive Oil",
"quantity": 1,
"unit_price": 1,
"amount": 0.9,
"vat_rate": 15,
"quote": "*987123* Olive Oil 1.00 L 1.00 10.00 15.00% $ 0.90",
"confidence": 0.85
},
{
"description": "Luxury Truffles",
"quantity": 15,
"unit_price": 10,
"amount": 150,
"vat_rate": null,
"quote": "[LUX_TRF] Luxury Truffles 15.00 g 10.00 0.00 $ 150.00",
"confidence": 0.85
}
],
"checks": {
"subtotal_plus_vat_equals_total": true,
"line_items_sum_equals_subtotal_or_total": true,
"vat_breakdown_sum_equals_vat_total": true,
"due_date_not_before_issue_date": true
},
"overall_confidence": 0.94,
"missing": [
"vendor_vat_id",
"customer_vat_id",
"amount_due"
],
"pages": 1,
"billed_usd": 0.0075,
"input": "pdf",
"text_chars": 1036,
"model": "@cf/mistralai/mistral-small-3.1-24b-instruct",
"timing_ms": {
"pdf_text_ms": 719,
"extract_ms": 17579,
"total": 18298
},
"confidence_method": "Per field: 0.6 if the quote is found verbatim in the document text (+0.3 if the value matches the quote; 0.35 base if the quote is not verbatim), then +0.08/-0.15 from the arithmetic checks for totals. Values with confidence < 0.6 should be reviewed.",
"limits": "LLM extraction can misread layouts; check important values (quotes make that quick). Scanned PDFs need image input. Documents are not stored.",
"sources": [
{
"name": "Cloudflare Workers AI: toMarkdown (PDF text layer), Mistral Small 3.1 24B (OCR of images + field extraction; fallback Llama 3.3 70B / Llama 4 Scout / Gemma 3 12B)",
"url": "https://developers.cloudflare.com/workers-ai/",
"note": "Documents are processed in memory and not stored or logged. No third-party LLM API."
}
]
}
curl --location --request POST 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37077/invoice+to+json+post' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"url":"https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/AzureInterior.pdf"}'
{
"data": {
"order_id": "4471",
"company": "ACME GmbH",
"total": 1299,
"currency": "EUR",
"due_date": "2026-11-30",
"email": "[email protected]"
},
"method": "workers-ai",
"model": "@cf/meta/llama-3.1-8b-instruct-fp8-fast",
"missing": [],
"not_verbatim_in_text": [],
"limits": "Small-model / heuristic extraction; check important values. Text is not stored.",
"sources": [
{
"name": "Cloudflare Workers AI (Llama 3.1 8B fp8-fast, fallback Llama 3.3 70B / Mistral Small 3.1, JSON mode)",
"url": "https://developers.cloudflare.com/workers-ai/"
}
]
}
curl --location --request GET 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37078/text+to+json?text=Order #4471 from ACME GmbH, total EUR 1.299,00, due 2026-11-30, contact [email protected]&schema={"type":"object","properties":{"order_id":{"type":"string"},"company":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"due_date":{"type":"string","format":"date"},"email":{"type":"string","format":"email"}}}' --header 'Authorization: Bearer YOUR_API_KEY'
{
"data": {
"order_id": "4471",
"total": 1299
},
"method": "workers-ai",
"model": "@cf/meta/llama-3.1-8b-instruct-fp8-fast",
"missing": [],
"not_verbatim_in_text": [],
"limits": "Small-model / heuristic extraction; check important values. Text is not stored.",
"sources": [
{
"name": "Cloudflare Workers AI (Llama 3.1 8B fp8-fast, fallback Llama 3.3 70B / Mistral Small 3.1, JSON mode)",
"url": "https://developers.cloudflare.com/workers-ai/"
}
]
}
curl --location --request POST 'https://zylalabs.com/api/14523/invoice+and+text+to+json+extraction+api/37079/text+to+json+post' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"text":"Order ID: 4471, Total: EUR 1.299,00","schema":{"type":"object","properties":{"order_id":{"type":"string"},"total":{"type":"number"}}}}'
After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Invoice and Text to JSON Extraction API simply include your bearer token in the Authorization header.
| Header | Description |
|---|---|
Authorization
|
Required
Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.
|
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
Turn invoices, receipts and unstructured text into structured JSON with confidence scores.
The Invoice to JSON endpoints return structured JSON data from invoices and receipts, including vendor details, customer information, invoice numbers, and financial totals. The Text to JSON endpoints return clean JSON based on messy text input, structured according to a user-defined schema.
Key fields in the Invoice to JSON response include vendor name, address, VAT ID, email, phone, invoice number, issue date, currency, subtotal, VAT total, and line items. For Text to JSON, key fields depend on the provided schema, such as order ID, total, and due date.
The returned data is in JSON format, structured with key-value pairs. For invoices, it follows a fixed schema with nested objects for vendor and customer details. Text to JSON responses are structured based on the user-defined schema, ensuring type consistency.
The Invoice to JSON endpoints provide detailed invoice and receipt information, including vendor and customer data, financial totals, and line items. The Text to JSON endpoints extract relevant data from unstructured text based on a specified schema.
Users can send parameters such as {url}, {file_base64, mime_type}, or {text} for the Invoice to JSON endpoints. For Text to JSON, users provide messy text and a JSON schema. GET requests can also use ?url= or ?text= parameters.
The response data is organized into structured JSON objects. Each key field contains a value, a verbatim quote from the source, and a confidence score. This organization allows users to easily access and interpret the extracted information.
Data accuracy is maintained through confidence scores for each extracted field, indicating the reliability of the information. Arithmetic checks ensure that totals match, and the use of advanced AI models enhances extraction quality.
Typical use cases include automating invoice processing, extracting key information from receipts for accounting, and converting unstructured text into structured data for analysis. Users can streamline data entry and improve accuracy in financial records.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund