LearnGrok
Prompts
PromptIntermediateBuilding on the API

Purchase order exceptions for approval

Create a three-way match exception list for operations and procurement staff handling invoice approval and supplier follow-up.

5 min read

Use these prompts to turn purchase orders, receipt records and invoices into decisions that someone can audit. They suit operations and procurement staff who need to stop unsupported invoices reaching approval, while giving suppliers a specific route to resolve genuine mismatches.

Start with the records, not the invoice total. A valid three-way match usually needs a purchase order, evidence that the goods or service were received, and an invoice that identifies the same commitment.

Key point

Match the evidence, not the narrative

An invoice can look correct and still lack an authorised PO, a receipt, or support for an extra charge.

Choose the right prompt

If you have Use What you get
One invoice and its supporting records Single invoice three-way match A line-by-line decision and next owner
A payment-run export or several supplier invoices Batch exception register A prioritised list of exceptions
An approved tolerance policy Tolerance policy review Decisions tied to the written rule
A confirmed discrepancy to send outside the business Supplier invoice query A focused request for correction or evidence
Findings ready for an internal approver Approval and rejection summary A decision register and payment-run actions

Do not use the supplier query before you have checked your own PO and receipt records. A query based on an internal data-entry error wastes time and makes the supplier less likely to treat later requests seriously.

Prepare the records

  1. Export or copy the PO lines, not just the PO header. Include the PO number, supplier, currency, line number, quantity, unit price, tax and any agreed delivery charge.
  2. Add the goods-received record. For physical goods, include receipt number, date, accepted quantity and rejected quantity. For services, use the approved acceptance record if that is your process.
  3. Copy the invoice fields exactly as billed. Keep invoice number, invoice date, descriptions, quantities, prices, tax, charges, total and payment terms.
  4. Remove information that is not needed for matching, such as bank details or personal contact data. Keep the reference numbers needed to trace the result back to the source documents.
  5. Paste the records into the selected prompt under the named headings. Do not merge values from different documents into one rewritten summary.

Watch out

Do not fill blanks from memory

A missing receipt number or line reference is an exception, not an invitation to guess which delivery it represents.

For a batch, retain the source row or line number in the pasted data. This makes the resulting exception ID useful when accounts payable must locate the original record. If your data contains different currencies, keep them separate. Comparing a PO value in one currency with an invoice value in another creates a false variance unless an approved conversion rule is supplied.

Read the decision fields

The prompts use four actions. Keep their meanings consistent across the payment run:

  • Approve means the supplied evidence supports payment under the PO and your stated policy.
  • Reject means the invoice should not be paid in its present form, for example where it has no valid PO or is a duplicate risk.
  • Hold for evidence means a decision cannot yet be supported. It is not an approval delayed by habit.
  • Supplier follow-up means the supplier needs to provide a correction, credit note or confirmation. Keep the invoice out of payment until your process allows it to proceed.

A tolerance policy only helps if it is pasted in full. If the policy is unclear about freight, tax, partial deliveries or service acceptance, the result should identify the gap rather than applying an imagined rule. Product behaviour and available features can vary, so check the relevant guidance in the xAI documentation overview when you need to confirm how you are providing records.

Check the exception list before using it

Check three things against the source documents. First, select a few rows from each decision group and verify the PO number, invoice number and line values character for character. Second, recalculate at least one stated variance from the source values. Third, inspect every row marked Approve and confirm that it has both an authorised PO and receipt or acceptance evidence.

Check

A usable result is traceable

Every decision should point to a PO, invoice and receipt reference, or explicitly say which reference is missing.

The output is wrong or incomplete if it does any of the following:

  • Treats a supplier name match as proof that a specific PO line matches.
  • Adds quantities across different items or receipt dates without saying so.
  • Marks a missing receipt as approved because the invoice is below the PO total.
  • Calculates a percentage variance where either comparison value is absent.
  • States that a charge is within tolerance when no applicable policy rule was supplied.
  • Recommends rejection without identifying the document field that conflicts.

If you find one of these faults, correct the source data or use the single-invoice prompt for the affected record. Do not edit the decision label alone. The evidence and the decision need to change together.

Keep the audit trail

Save the final register alongside the payment-run evidence. Record the reviewer, review date, PO number, invoice number, action and the document that closed each exception. For supplier queries, retain the sent email and the supplier response with the original invoice record.

Note

Separate review from approval

The prompt can organise evidence and draft a decision record. Your authorised approver remains responsible for the approval decision.

When the prompts do not work

Stop and split the work if the data is too mixed to identify reliable pairs of records. Run the batch prompt first to find unclear matches, then review those invoices one at a time. If the output repeatedly cannot match PO lines to invoice lines, improve the export by adding line numbers, item descriptions and receipt references. Where documents conflict, keep the action as Hold for evidence until the record owner or supplier supplies the missing proof.

Stop

Do not force an approval to clear a payment run

An unresolved match should stay visible with an owner and required evidence, rather than being relabelled as a minor variance.

Copy-ready prompts

5 prompts. Open one to read it, or take the whole pack.

1Single invoice three-way matchUse this when one invoice needs a clear approval, rejection or query decision before it enters the payment run.
Review this purchase order, goods-received record and supplier invoice as a three-way match.

Purchase order:
[paste purchase order, including PO number, supplier, currency, line descriptions, quantities, unit prices, tax, delivery charges and approval status]

Goods-received record:
[paste goods-received note or receipt data, including PO number, receipt date, received quantities, rejected quantities and receiver comments]

Supplier invoice:
[paste invoice, including invoice number, invoice date, PO number, line descriptions, quantities, unit prices, tax, delivery charges, total and payment terms]

Use the PO as the authorised commitment. Compare each invoice line against the PO and the goods-received record. Check supplier name, PO number, currency, duplicate invoice risk, quantities, unit prices, tax, freight or other charges, and totals.

Return a Markdown table with these columns: PO number | invoice number | line or charge | PO value | received quantity/value | invoiced value | exception type | evidence | recommended action | owner.

Set recommended action to exactly one of: Approve, Reject, Hold for evidence, or Supplier follow-up. Set owner to exactly one of: Accounts payable, Procurement, Goods receiver, or Supplier.

After the table, provide:
1. Decision: one of Approve, Reject, Hold for evidence, or Supplier follow-up.
2. A numbered list of the specific reasons for that decision.
3. A list headed Missing or ambiguous information.

Do not assume that a blank field is a match. Do not invent a tolerance, receipt, approval or tax treatment. If evidence conflicts, describe both values and recommend Hold for evidence.
2Batch exception registerUse this for a payment-run batch or a spreadsheet export containing several purchase orders, receipts and invoices.
Create an exception register from the purchase order, goods-received and invoice data below.

Purchase order data:
[paste table or CSV export with PO number, supplier, currency, line number, item or service description, ordered quantity, unit price, line value, tax, delivery charge, approver and PO status]

Goods-received data:
[paste table or CSV export with PO number, line number, receipt number, receipt date, received quantity, rejected quantity and receiver note]

Invoice data:
[paste table or CSV export with invoice number, supplier, invoice date, PO number, line number, description, invoiced quantity, unit price, line value, tax, other charges, invoice total and payment terms]

Match records using PO number first, then line number. Where either identifier is missing, use supplier, description, quantity and value only to suggest a possible match. Mark that match as unconfirmed.

Return one Markdown table, sorted with Reject first, then Hold for evidence, Supplier follow-up and Approve. Use these columns: exception ID | PO number | invoice number | supplier | line number | exception category | PO amount | received amount or quantity | invoice amount or quantity | variance | action | owner | required evidence.

Use only these exception categories: no PO, PO closed or cancelled, supplier mismatch, duplicate invoice risk, quantity mismatch, price mismatch, receipt missing, receipt short, unapproved charge, tax mismatch, total mismatch, unclear match.

Calculate a variance only where both compared values are stated. Otherwise write Not calculable. Set action to exactly one of: Approve, Reject, Hold for evidence, Supplier follow-up. At the end, give counts by action and a separate list of records that could not be reliably matched. Do not create records that are not present in the supplied data.
3Tolerance policy reviewUse this when your team has an approved matching policy and needs consistent decisions on small quantity or price differences.
Apply the stated invoice-matching policy to the transaction data below. Produce an approval exception list.

Approved policy:
[paste the policy, including any monetary, percentage, quantity, tax, freight, partial-delivery and service-acceptance rules]

Purchase order data:
[paste PO details]

Goods-received data:
[paste receipt details]

Invoice data:
[paste invoice details]

For each invoice line and charge, identify the applicable policy rule. Compare the invoice to the PO and goods-received record. Calculate the variance in currency and percentage only when the required values are available.

Return a Markdown table with: PO number | invoice number | line or charge | policy rule applied | PO value or quantity | received value or quantity | invoiced value or quantity | variance | within policy | decision | explanation.

Use Within policy as Yes, No, or Cannot determine. Use decision as Approve, Reject, Hold for evidence, or Supplier follow-up.

Below the table, provide a section called Policy gaps and ambiguity. List cases where the policy does not cover the charge, where more than one rule could apply, or where the data needed to apply a rule is missing. Do not choose a tolerance that is not written in the policy. If a policy rule conflicts with a stated contractual or PO term, flag the conflict and set the decision to Hold for evidence.
4Supplier invoice queryUse this after a mismatch is confirmed and you need a concise request that a supplier can act on.
Draft a supplier invoice query using the records below. The purpose is to obtain a corrected invoice, credit note or evidence needed to resolve an invoice-matching exception.

Supplier name and contact details:
[paste details]

Purchase order:
[paste relevant PO fields]

Goods-received record:
[paste relevant receipt fields]

Invoice:
[paste relevant invoice fields]

Internal exception notes:
[paste confirmed discrepancies and any approved next step]

Write a professional email in British English. Use this exact structure:
Subject: [write subject]

Dear [supplier contact],

Reference
- PO number:
- Invoice number:
- Invoice date:

Issue
[State each confirmed discrepancy in plain language. Include the expected value, invoiced value and relevant receipt status.]

Action requested
[Ask for exactly the evidence, corrected invoice or credit note required.]

Response requested by
[Use the supplied date. If no date is supplied, write: Please confirm your expected response date.]

Kind regards,
[operations team]

Do not accuse the supplier of an error where the records are incomplete. If the evidence does not establish which record is correct, ask the supplier to confirm the relevant order, delivery or billing detail. After the email, add an Internal follow-up list with owner, next action and the evidence that would close the exception.
5Approval and rejection summaryUse this when the reviewer has completed matching and an approver needs a short, traceable decision list.
Convert the reviewed three-way match findings below into an approval summary for the authorised approver.

Reviewed findings:
[paste exception register, reviewer notes, PO details, receipt evidence and invoice details]

Create a Markdown report with these sections.

1. Decision register
Use a table with: item ID | PO number | invoice number | supplier | amount and currency | decision | reason | evidence reviewed | action before payment.

Decision must be exactly one of: Approve, Reject, Hold for evidence, or Supplier follow-up.

2. Approval request
List only the items marked Approve. For each, state why the PO, receipt and invoice support payment.

3. Rejection and hold actions
List all other items. State the person or team who must act, the exact document or confirmation needed, and whether the invoice should be excluded from the payment run.

4. Reviewer limitations
List missing records, uncertain matches and assumptions that were not resolved.

Do not approve an item solely because its total appears plausible. Do not treat an invoice as received goods. If a decision is not supported by both the supplied data and the stated matching policy, use Hold for evidence.

Quick question about the API?

Short answers from the API pages here, with the page itself one tap below. Limits, models and prices go to xAI’s documentation, because those change and this does not chase them.

Last checked against xAI’s own pages on 2026-08-21. Grok changes quickly; anything version-specific should be confirmed upstream before you rely on it.

More in Building on the API

Found something out of date?

Grok changes quickly and this page is a snapshot. If something here is wrong, or you know a better resource, send it over.

Suggest a link →

Advertise on LearnGrok

$420.69one-time, for a 30-day run

Square works best. PNG, JPEG or WebP, up to 2 MB.

Stripe on the next step. Live once approved.