{"id":"acct-ap-aging-vendor-buckets-json","audience":"accounting","category":"finance-work","track":"finance","technique":"format","level":"intermediate","title":"Bucket open invoices by days past due into one JSON block","free":false,"task":"You're summarizing the AP aging as of Oct 31, 2026 for the controller. Write a prompt for one JSON code block: an array with one object per vendor, keys vendor, current, d1_30, d31_60, d61_plus and total, all numbers. Bucket by days past the due date (an invoice due on Oct 31 is current), not by invoice date. Outside the code block write at most 15 words.","materialLabel":"Source material (attached to your prompt automatically)","material":"AP OPEN INVOICES - as of Oct 31, 2026\n\nVendor | Invoice | Invoice date | Due date | Amount\nApex Freight | INV-101 | Oct 16 | Nov 15 | $1,200\nApex Freight | INV-099 | Sep 20 | Oct 20 | $800\nBirch Supply | INV-310 | Aug 26 | Sep 25 | $2,500\nBirch Supply | INV-322 | Sep 5 | Oct 5 | $400\nCobalt IT | INV-77 | Jul 31 | Aug 30 | $3,000\nCobalt IT | INV-81 | Oct 1 | Oct 31 | $600\n\nNotes: INV-310 is in dispute with Birch Supply over a freight charge but remains open and should be included. All invoices are on Net 30 terms. No credit memos are outstanding. The aging report is reviewed by the Controller on Nov 4 and then shared with the lender as part of the monthly package, so totals must tie to the AP control account of $8,500 total open payables for these three vendors.","rules":[{"type":"codeBlocks","count":1}],"promptHints":[{"label":"Names the keys","patterns":["d1_30","d31_60","d61_plus","current"]},{"label":"Buckets by due date","patterns":["past (the )?due","due date"]},{"label":"Handles the Oct 31 edge","patterns":["oct 31","current"]},{"label":"Limits to one code block","patterns":["one (json )?code block","json"]}],"mistakes":[{"title":"Bucketing by invoice date","why":"The AI ages from the invoice date.","fix":"Say: \"Bucket by days past the due date.\"","checks":["r1","r2"]},{"title":"Putting the due-today invoice in 1-30","why":"The AI treats Oct 31 as past due.","fix":"Add: \"An invoice due on Oct 31 is current.\"","checks":["r2"]},{"title":"Dropping the disputed invoice","why":"The AI leaves out INV-310.","fix":"Add: \"Include disputed invoices.\"","checks":["r1"]},{"title":"Wrong JSON shape","why":"The AI nests buckets or writes strings.","fix":"Add: \"One flat object per vendor, numbers not strings.\"","checks":["r0"]},{"title":"Wrong code block shape","why":"The AI splits the output or adds extra rows.","fix":"Say: \"One code block, header plus the exact rows.\"","checks":["codeBlocks"]}],"hint":"JSON is only as right as the bucket rules. Define them, including the edge case.","rubricLabels":["The JSON has three vendor objects (Apex Freight, Birch Supply, Cobalt IT) with the keys vendor, current, d1_30, d31_60, d61_plus and total","Apex is current 1200, d1_30 800, total 2000 and Birch is d1_30 400, d31_60 2500, total 2900","Cobalt is current 600, d61_plus 3000, total 3600 (the invoice due Oct 31 is current), all buckets are numbers, and the code block is the only block"]}