Library › Finance AI › Accountants
Extract invoice fields into JSON and compute the due date
- For Accountants
- You practice Asking for a format you can use
- Time about 5 minutes
- Level Intermediate
About this exercise
You're capturing an invoice for AP. Write a prompt for one JSON code block holding one object with exactly the keys vendor, invoice_number, invoice_date, due_date, subtotal, shipping and total. Dates as YYYY-MM-DD, amounts as numbers. The due date is the invoice date plus the net terms. One key per line is fine. Outside the code block write at most 12 words.
Common mistakes when you ask AI for this
- Using the PO number. The AI sets invoice_number to 7712. Try: Add: "invoice_number is the invoice's own number, not the PO reference."
- Wrong due date. The AI copies the invoice date or adds 30 to the wrong month. Try: Say: "due_date = invoice date + 30 days."
- Dollar signs and strings. The AI writes "$1,900.00" as text. Try: Add: "Amounts as numbers (no $ or commas)."
- Wrong keys. The AI uses 'Vendor Name' or adds extra keys. Try: Say: "Exactly these keys: vendor, invoice_number, ..."
- Commentary around the block. The AI explains the extraction. Try: Add: "At most 12 words outside the code block."
What a strong prompt includes
- Gives the keys
- Sets date format and rule
- Excludes other numbers
- Sets amount format
- Limits prose
Related exercises
- Accrue goods received but not invoiced at PO price (Finance AI · Accountants)
- Adapt one ad image to 3 sizes with Midjourney (Image & Video AI · Marketing and content)
- Age open requisitions as of today and flag the old ones (Finance AI · FP&A and financial analysts)
- Age reconciling items and escalate those over 60 days (Finance AI · Accountants)
- Allocate shared rent by headcount using the right roster (Finance AI · Accountants)