When a small food seller finds a bad batch, they have to find every buyer who got it, refund that item and tell the buyer. With PayPal invoices, that means opening invoices one by one.

In Lot Recall the seller types or records one sentence, for example "The timur achar made between March 1 and March 20 may contain peanuts."

  1. Whisper on Groq turns a voice note into text. The app reads the seller's PayPal invoices with all lines.
  2. gpt-oss-120b on Groq picks the lines that are the recalled product and marks lookalikes such as timur salt. For each line it has to quote the invoice text.
  3. The server decides each action in code. The quote has to match the invoice line, the invoice date has to fall inside the recall dates, and every amount is computed in cents from PayPal's data. A refund is capped at what the buyer paid minus earlier refunds.
  4. The dry run shows each line in an AG Grid as Refund, Pull line, Edit draft or Refused, with the reason. Nothing changes in PayPal yet.
  5. After the seller ticks "I reviewed the dry run" and confirms, the server calls PayPal one invoice at a time. A paid invoice gets a refund of that one line. An unpaid invoice or a draft loses the line.
  6. A local ledger records each done line, so a second run sends no new refunds.
  7. Each buyer gets a notice preview with their own order number and refund.

In the sandbox run on 18 demo invoices, 9 paid invoices got line refunds worth $158.95, 3 unpaid invoices lost the line, 2 drafts were edited, and 4 lines were refused: 2 were timur salt and 2 were timur achar from outside the dates. The second run reported 14 of 14 lines already done. On the PayPal payer page, the first invoice shows "Partially refunded" by $18.70.

How PayPal is used

Invoicing API v2 in the sandbox: search-invoices, get invoice, create, send, record payment, refund, and PUT to edit lines. No Payouts.

How AI is used

gpt-oss-120b on Groq, in JSON mode, returns the product, the dates, a verdict and quote for each line, and a notice template. whisper-large-v3-turbo on Groq transcribes the voice note, with the item names as hints. The server sets every amount and every action.

Limits

No buyer logs in during the demo, so the payments and refunds are recorded in the sandbox as external payments and no sandbox money moves. The notices are previews and the app sends no email. Dry runs stay in server memory. The seller and the 18 invoices are made up. The app does not replace a food regulator's recall process.

128 tests cover the rules and the PayPal calls. MIT license.

Built With

Share this project:

Updates

Submission history