We extract the necessary information to process invoices
Let's say we get a lot of invoices as a PDF. But for each invoice, we only want to extract the first and last name of the person that gets billed and the total amount to pay.
Now let's construct a Shape to extract those fields.
[ {"name":"first_name","type":"string","description":"The first name of the one who receives the bill.","isArray":false }, {"name":"last_name","type":"string","description":"The last name of the one who receives the bill.","isArray":false }, {"name":"total","type":"number","description":"Total amount to pay","isArray":false }]
Once the shape is defined, we can call the /extract-document endpoint with it and the invoice PDF in the payload to create this job:
With urls["get"] we can now query that job. This calls our job endpoint with the correct job_id conveniently already pre-filled.
If we call this URL 20s later when the job has finished, we get back the following: