Learn how to parse a basic invoice using OmniAI’s extract API
This tutorial will walk you through the process of parsing a basic invoice using extract API.
Create a document template
Create a document template by either using our pre-defined invoice templates or by uploading an example of your invoice.
Build an extraction schema
Build a extraction schema to parse the invoice. Let’s extract the following fields:
object
- invoice totals, including tax, subtotal, and totalobject
- vendor details, including name and addressobject
- invoice details, including date and numberarray
- line items, including amount, quantity, unit price, and descriptionExample invoice JSON schema
Test the template
Run the template on an example invoice to ensure it’s working as expected. You can also upload multiple invoices to test the template on different invoices.
Using the API
Once you’ve tested the template and confirmed it’s working as expected, you can use the API to parse invoices.
You can retrieve your API keys from the settings page.
Basic usage of the API:
The following code demonstrates how to parse an invoice using the API.