Recorded run on sample data · 28 Nov 2026 · 15 s
5 items at or below reorder level. Cheapest supplier chosen in code for each: 4 purchase orders, $1,683.60 in total, within your $2,500 limit. Each waits for your OK; nothing is written until you approve.
Risks, assumptions and checks
- Check
Shipping box 40x30x20 cm: the cheapest supplier is too slow
Brookfield Box Co takes 9 days, but stock lasts about 5 days at 60 a day. Halden Packaging delivers in 5 days for $30 more. It kept the cheapest, as asked; you choose at the OK step.
- Passed
Total $1,683.60 is within your $2,500 limit
5 lines across 4 suppliers, added up in code.
What it understood
- Your request
- Reorder everything in the MAIN warehouse that is at or below its reorder level. Use the cheapest supplier for each item and keep the total under $2,500.
- Understood as
- Create draft purchase orders for every MAIN warehouse item at or below its reorder level, using the cheapest supplier for each item, with total spend kept under $2,500.
- Applied in code
- warehouse = MAIN; on hand at or below reorder level; cheapest unit price per item; reorder quantity, raised to the supplier's minimum; total under $2,500
- Kind of request
- Reorder stock
- Permission check
- Allowed: it reads with GET calls and only proposes writes the key permits.
Totals
- Items
- 5
- Purchase orders
- 4
- Total
- $1,683.60
- Your limit
- $2,500
- Limit check
- Within the limit
Read-only lookups it would make 2
| Call | Why | Access |
|---|---|---|
| GET /items?warehouse=MAIN&below_reorder=true | Find MAIN items at or below reorder level | Read-only |
| GET /suppliers/{supplier_id}/prices?sku={sku} | Compare each supplier's unit price and minimum order for every candidate item to pick the cheapest | Read-only |
Result, computed in code from your data 5
| Item | Code | On hand | Reorder level | Cheapest supplier | Unit price | Qty | Line total | Note |
|---|---|---|---|---|---|---|---|---|
| Shipping box 40x30x20 cm | PK-1001 | 330 | 400 | Brookfield Box Co | $0.39 | 1,000 | $390 | Cheapest of 2 suppliers. Takes 9 days; stock lasts about 5. |
| Packing tape 48 mm | PK-1002 | 95 | 120 | Tallis Supplies | $1.60 | 200 | $320 | Cheapest of 2 suppliers. |
| Printer ribbon 110 mm | LB-2002 | 6 | 10 | Tallis Supplies | $7.40 | 24 | $177.60 | Cheapest of 2 suppliers. |
| Nitrile gloves (box of 100) | CL-3001 | 40 | 40 | Pemberton Hygiene | $4.10 | 60 | $246 | Cheapest of 2 suppliers. |
| Wooden pallet 1200x1000 | PL-4001 | 22 | 30 | Ashby Timber | $11 | 50 | $550 | Cheapest of 2 suppliers. Raised from 40 to the supplier's minimum order of 50. |
Write actions it proposes: each waits for your OK
- Draft purchase order · Brookfield Box Co, $390 · waits for your OK
POST /purchase-orders
{
"supplier_id": "SUP-02",
"warehouse": "MAIN",
"status": "draft",
"lines": [
{ "sku": "PK-1001", "qty": 1000, "unit_price": 0.39 }
],
"note": "Reorder: items at or below reorder level. $390 total. Prepared by the AI agent."
} - Draft purchase order · Tallis Supplies, $497.60 · waits for your OK
POST /purchase-orders
{
"supplier_id": "SUP-03",
"warehouse": "MAIN",
"status": "draft",
"lines": [
{ "sku": "PK-1002", "qty": 200, "unit_price": 1.6 },
{ "sku": "LB-2002", "qty": 24, "unit_price": 7.4 }
],
"note": "Reorder: items at or below reorder level. $497.60 total. Prepared by the AI agent."
} - Draft purchase order · Pemberton Hygiene, $246 · waits for your OK
POST /purchase-orders
{
"supplier_id": "SUP-05",
"warehouse": "MAIN",
"status": "draft",
"lines": [
{ "sku": "CL-3001", "qty": 60, "unit_price": 4.1 }
],
"note": "Reorder: items at or below reorder level. $246 total. Prepared by the AI agent."
} - Draft purchase order · Ashby Timber, $550 · waits for your OK
POST /purchase-orders
{
"supplier_id": "SUP-06",
"warehouse": "MAIN",
"status": "draft",
"lines": [
{ "sku": "PL-4001", "qty": 50, "unit_price": 11 }
],
"note": "Reorder: items at or below reorder level. $550 total. Prepared by the AI agent."
}
What your API lets the agent do 9
| Call | Scope | Agent allowed |
|---|---|---|
| GET /items?warehouse={code}&below_reorder=true | read:items | Yes |
| GET /items/{sku} | read:items | Yes |
| GET /suppliers/{supplier_id}/prices?sku={sku} | read:suppliers | Yes |
| GET /stock/{sku}/movements?days=30 | read:stock | Yes |
| POST /purchase-orders | write:purchase_orders:draft | Yes |
| POST /purchase-orders/{id}/release | write:purchase_orders:release | No |
| PATCH /items/{sku} | write:items | No |
| DELETE /items/{sku} | admin | No |
| DELETE /suppliers/{supplier_id} | admin | No |
What it did
Done: Read the request
Create draft purchase orders for every MAIN warehouse item at or below its reorder level, using the cheapest supplier for each item, with total spend kept under $2,500.
Done: Read your data
13 rows, 13 columns.
Done: Checked permissions against your API description
5 of 9 endpoints allowed for the agent's key. Everything this request needs is allowed.
Done: Planned the read-only lookups
2 GET calls. In this demo your CSV stands in for their answers.
Done: Found items at or below their reorder level
5 of 7 items (warehouse = MAIN).
Picked the cheapest supplier and worked out quantities Flagged
Reorder quantity, raised to the supplier's minimum where needed. 1 item would arrive after stock runs out.
Done: Added up the totals
$1,683.60 in total; limit $2,500.
Done: Built the API calls
4 purchase orders with status "draft", one per supplier.
Nothing written Note
4 API calls wait for your OK on the approval screen.



