Northwind ERP Operations
Use this skill when the task involves Northwind Components operational decisions -- expedite dispatch, kit replenishment, allocation transfer, supplier scorecards, or procurement quality control -- against a live shared ERP REST API.
Core Pattern
Every Northwind operational task follows the same structure:
- Read the business-context payload (memo, request, or notes) and the
answer_template.json that defines the required output shape.
- Query the live ERP API at the runner-provided
<TASK_ENV_BASE_URL> to get current records for orders, products, customers, inventory, warehouses, BOMs, purchase orders, suppliers, and incidents.
- Cross-reference live records against the business rules described below.
- Return a single JSON object conforming strictly to the answer template. No narrative outside the JSON.
API Reference
The API is read-only, unauthenticated, and served at <TASK_ENV_BASE_URL>. All endpoints accept GET only.
| Endpoint |
Query parameters |
Returns |
/health |
none |
API health status |
/products |
none |
Array of all products |
/products/<sku> |
path: sku |
Single product |
/customers |
none |
Array of all customers |
/customers/<customer_id> |
path: customer_id |
Single customer |
/warehouses |
none |
Array of all warehouses with zip codes |
/inventory |
warehouse_id, sku |
Inventory record with on-hand, reserved, held, and quarantined quantities |
/orders |
wave, required_date, customer_id |
Array of orders matching filters |
/orders/<order_id> |
path: order_id |
Single order with lines (sku, quantity, requested warehouse) |
/shipping/quote |
warehouse_id, destination_zip, weight_lb, speed |
Shipping quote with zone, days, and cost |
/purchase_orders |
supplier_id, sku, status |
Array of purchase orders |
/incidents |
start, end, supplier_id, sku, incident_type, status |
Array of incidents within window |
/suppliers |
none |
Array of all suppliers with quality status and default warehouse |
/boms |
none |
Array of all BOMs (ids and names) |
/boms/<bom_id> |
path: bom_id |
BOM with component list (sku, quantity per) |
API Usage Conventions
- Parallelize independent API calls to minimize round trips. For example, fetch all orders in a wave first, then batch product, inventory, and customer lookups based on the SKUs and customer IDs found.
- When a task references a specific date (e.g.
as_of_date or analysis_date), use that date to filter incidents and purchase orders. For inventory, always query the live record; the API returns current state.
- Currency values from the API (shipping costs, unit costs, incident resolution costs) are in USD. Round all calculated costs to 2 decimal places.
- Sort list fields in ascending order by their natural key unless the answer template specifies a different ordering.
Business Domain Concepts
Effective Inventory
The API returns four inventory quantities per warehouse/SKU pair:
on_hand: total physical units
reserved: units allocated to released orders
held: units in quality hold or quarantine
quarantined: units under investigation
Effective available = on_hand - reserved - held - quarantined. A negative value means the warehouse is already over-committed. Always use effective available for fulfillment decisions, never raw on-hand.
Customer Risk Flags
Customers carry status flags that override inventory availability:
| Flag |
Meaning |
Dispatch behavior |
review_required |
Account needs manual sign-off |
Route to manual_review; do not release automatically |
account_blocked |
Account frozen |
Route to reject_hold or manual_review with hold_credit_or_fraud |
fraud_watch |
Suspicious activity |
Route to manual_review with hold_credit_or_fraud |
credit_watch |
Payment risk |
Route to manual_review or delayed_release |
Customer exception checking is the first gate. If a customer has any risk flag, apply the most restrictive action before evaluating inventory.
Product Master
Products carry an active boolean. An inactive (discontinued) product cannot be released through normal dispatch. Flag lines with inactive SKUs for manual_review with reason inactive_product or escalate_product_master. Inactive SKUs also appear in the inactive_skus lists for expedite tasks.
Inventory Status Classification (Expedite)
For each order, classify the worst inventory status across all its lines:
| Status |
Condition |
ready |
All lines have non-negative effective available and all SKUs are active |
low_stock |
Some lines have low but non-negative effective available; all SKUs active |
shortage |
At least one line has negative effective available; all SKUs active |
inactive_sku |
At least one line has an inactive SKU; all active SKUs have non-negative effective |
inactive_and_shortage |
At least one inactive SKU and at least one line with negative effective available |
Dispatch Decision Mapping
| Customer exception |
Inventory status |
Final decision |
Next action |
account_blocked or fraud_watch |
any |
reject_hold |
hold_credit_or_fraud |
review_required or credit_watch |
any |
manual_review |
send_account_review |
none |
ready |
ship_now |
release_to_pick |
none |
low_stock |
delayed_release |
delay_and_monitor |
none |
inactive_sku or inactive_and_shortage |
manual_review |
escalate_product_master |
none |
shortage |
backorder |
create_backorder |
Allocation Line Actions (Transfer Review)
For mixed-warehouse allocation, evaluate each line independently:
ship: the requested warehouse has enough effective available (>= line quantity)
transfer: the requested warehouse cannot fill the full line, but another warehouse can cover the gap with its own effective stock. Ship what the requested warehouse can provide, transfer the remainder from one chosen source.
backorder: no warehouse has sufficient effective stock to cover the line
manual_review: customer has a risk flag or the SKU is inactive
Transfer source selection: pick the warehouse (other than the requested one) with the largest positive effective available for that SKU. Only use a single source per line.
Kit Replenishment
When planning component material for BOM builds:
- Explode BOM: component_required = BOM quantity_per * build_quantity. Sum across all kit targets for each SKU.
- Target effective available: current effective available at the target warehouse plus all confirmed/open POs for that SKU at that warehouse with delivery before the build date.
- Gap: total_required - target_effective_available. A positive gap needs covering.
- Coverage hierarchy (most preferred first):
- Timely PO coverage: open/confirmed POs at the target warehouse whose delivery date precedes the build date. POs in other statuses are not timely.
- Inter-warehouse transfer: available effective stock at other warehouses (transferring warehouse must retain positive effective after the transfer).
- Purchase requisition: buy what remains from the SKU's supplier.
- Component actions:
no_action_stocked: gap <= 0 and no exclusion applies
timely_po_covered: timely POs fully cover the gap
transfer_only: transfers fully cover the gap, no purchase needed
purchase_required: purchase requisition needed (may be combined with transfers)
overstock_excluded: effective available already exceeds total required and no timely POs are in play
- Exclusions: components with
target_overstock (gap is negative and no timely POs), timely_po_covers_gap (POs cover it), or stocked_no_gap (already sufficient stock) go into excluded_components.
- Supplier mapping: each product's
supplier_id field identifies the default supplier. Use that supplier for purchase requisitions.
- Costs: requisition
unit_cost comes from the product record. extended_cost = unit_cost * quantity.
Supplier Incident Scorecard
- Filter incidents by
open_date within the analysis window (inclusive on both ends).
- Group by supplier. For each supplier compute:
- Incident count and percentage of filtered population (round to 1 decimal)
- Total resolution cost (sum of
resolution_cost field, round to 2 decimals)
- Average duration: for closed incidents,
close_date - open_date in calendar days; for open incidents, analysis_date - open_date
- RMA count (incidents with
incident_type = RMA)
- Work order count (incidents with
incident_type = WORK_ORDER)
- Open incident count (incidents with
status = open)
- Severe count (incidents with
severity in high or critical)
- Recommendation codes (apply in precedence order, first match wins):
| Code |
Trigger conditions |
ESCALATE_SUPPLIER |
supplier quality_status = quality_hold AND incident_count >= 3; OR any critical RMA; OR RMA_count >= 3 AND total_resolution_cost >= 15000.00 |
PROCESS_REVIEW |
WORK_ORDER_count >= 3 AND WORK_ORDER_count > RMA_count |
WATCHLIST |
supplier quality_status in (watch, quality_hold); OR incident_count >= 4; OR total_resolution_cost >= 12000.00; OR severe_count >= 2 |
MONITOR |
none of the above |
Procurement Quality Control
Given a list of target supplier IDs and an analysis window:
- Fetch incidents for the window and the target suppliers. Also fetch supplier records for quality_status, and purchase orders for each supplier (status = open or confirmed).
- For each supplier, compute: recent incident count, RMA count, severe/critical count, open incident count, affected SKUs (SKUs referenced in their incidents), and sample incident IDs (up to 5 most recent).
- Decision logic:
| Decision |
Conditions |
freeze_new_replenishment |
quality_status = quality_hold AND (recent_incident_count >= 3 OR severe_or_critical_count >= 1), AND there are open/confirmed POs to hold |
buyer_review_required |
quality_status = quality_hold OR watch AND recent_incident_count >= 2 AND there are open/confirmed POs; OR severe_or_critical_count >= 2 AND any quality status |
monitor_only |
none of the above |
held_po_ids: for suppliers with freeze_new_replenishment or buyer_review_required, include all their open/confirmed POs. For monitor_only, held_po_ids is empty.
release_supplier_ids: all suppliers whose decision is monitor_only.
Shipping Quotes
Call /shipping/quote with:
warehouse_id: the order's requested warehouse
destination_zip: from the customer record
weight_lb: sum of product weights across all order lines (product weight_lb field * line quantity)
speed: from the order record (shipping_speed or requested_speed field)
If the order has no explicit speed, default to standard. The quote returns zone_distance (integer), service_days (integer), and total_cost_usd (number, 2 decimals).
Cross-Reference Workflow
For typical operational tasks, follow this sequence:
- Fetch the business payload and answer template from the input.
- Extract the wave/order IDs/supplier IDs/BOM IDs from the payload.
- Query orders (by wave or IDs) to get lines, SKUs, quantities, requested warehouses, and customer IDs.
- Batch query products for all SKUs found, checking active status, weight, supplier, and unit cost.
- Batch query customers for all customer IDs found, checking status flags and zip codes.
- For inventory-sensitive tasks, query inventory for each warehouse/SKU combination.
- For replenishment tasks, query BOMs and purchase orders for coverage analysis.
- For scorecard/procurement tasks, query incidents within the specified date window and suppliers for quality status.
- Compute decisions per the business rules above.
- Request shipping quotes where the template requires them.
- Assemble the JSON response matching the template exactly. Sort all lists as specified.
Output Formatting Rules
- Currency values: round to 2 decimal places.
- Percentages: round to 1 decimal place.
- Duration averages: round to 2 decimal places.
- Sort list fields: ascending by their natural key (order_id, sku, supplier_id, line_id, incident_id, po_id) unless the template specifies a different sort order.
- Nullable fields: use JSON
null (not the string "null") when the template allows it.
- Empty lists: use
[], never omit them.
- Date strings: use ISO 8601 YYYY-MM-DD format.
- Response must be valid JSON. No trailing commas, no comments, no narrative text outside the JSON root.
1---2name: northwind-erp-operations-53description: Solve Northwind Components ERP operational dispatch, replenishment, allocation, scorecard, and procurement-control tasks against a live REST API by following JSON answer templates and cross-referencing products, inventory, orders, BOMs, customers, suppliers, purchase orders, warehouses, shipping quotes, and incidents.4metadata:5 source: https://skillmd.com/skills/prism-shadow/northwind-erp-operations-56---78# Northwind ERP Operations910Use this skill when the task involves Northwind Components operational decisions -- expedite dispatch, kit replenishment, allocation transfer, supplier scorecards, or procurement quality control -- against a live shared ERP REST API.1112## Core Pattern1314Every Northwind operational task follows the same structure:15161. Read the business-context payload (memo, request, or notes) and the `answer_template.json` that defines the required output shape.172. Query the live ERP API at the runner-provided `<TASK_ENV_BASE_URL>` to get current records for orders, products, customers, inventory, warehouses, BOMs, purchase orders, suppliers, and incidents.183. Cross-reference live records against the business rules described below.194. Return a single JSON object conforming strictly to the answer template. No narrative outside the JSON.2021## API Reference2223The API is read-only, unauthenticated, and served at `<TASK_ENV_BASE_URL>`. All endpoints accept GET only.2425| Endpoint | Query parameters | Returns |26|---|---|---|27| `/health` | none | API health status |28| `/products` | none | Array of all products |29| `/products/<sku>` | path: sku | Single product |30| `/customers` | none | Array of all customers |31| `/customers/<customer_id>` | path: customer_id | Single customer |32| `/warehouses` | none | Array of all warehouses with zip codes |33| `/inventory` | `warehouse_id`, `sku` | Inventory record with on-hand, reserved, held, and quarantined quantities |34| `/orders` | `wave`, `required_date`, `customer_id` | Array of orders matching filters |35| `/orders/<order_id>` | path: order_id | Single order with lines (sku, quantity, requested warehouse) |36| `/shipping/quote` | `warehouse_id`, `destination_zip`, `weight_lb`, `speed` | Shipping quote with zone, days, and cost |37| `/purchase_orders` | `supplier_id`, `sku`, `status` | Array of purchase orders |38| `/incidents` | `start`, `end`, `supplier_id`, `sku`, `incident_type`, `status` | Array of incidents within window |39| `/suppliers` | none | Array of all suppliers with quality status and default warehouse |40| `/boms` | none | Array of all BOMs (ids and names) |41| `/boms/<bom_id>` | path: bom_id | BOM with component list (sku, quantity per) |4243### API Usage Conventions4445- Parallelize independent API calls to minimize round trips. For example, fetch all orders in a wave first, then batch product, inventory, and customer lookups based on the SKUs and customer IDs found.46- When a task references a specific date (e.g. `as_of_date` or `analysis_date`), use that date to filter incidents and purchase orders. For inventory, always query the live record; the API returns current state.47- Currency values from the API (shipping costs, unit costs, incident resolution costs) are in USD. Round all calculated costs to 2 decimal places.48- Sort list fields in ascending order by their natural key unless the answer template specifies a different ordering.4950## Business Domain Concepts5152### Effective Inventory5354The API returns four inventory quantities per warehouse/SKU pair:55- `on_hand`: total physical units56- `reserved`: units allocated to released orders57- `held`: units in quality hold or quarantine58- `quarantined`: units under investigation5960**Effective available** = `on_hand` - `reserved` - `held` - `quarantined`. A negative value means the warehouse is already over-committed. Always use effective available for fulfillment decisions, never raw on-hand.6162### Customer Risk Flags6364Customers carry status flags that override inventory availability:6566| Flag | Meaning | Dispatch behavior |67|---|---|---|68| `review_required` | Account needs manual sign-off | Route to `manual_review`; do not release automatically |69| `account_blocked` | Account frozen | Route to `reject_hold` or `manual_review` with `hold_credit_or_fraud` |70| `fraud_watch` | Suspicious activity | Route to `manual_review` with `hold_credit_or_fraud` |71| `credit_watch` | Payment risk | Route to `manual_review` or `delayed_release` |7273Customer exception checking is the first gate. If a customer has any risk flag, apply the most restrictive action before evaluating inventory.7475### Product Master7677Products carry an `active` boolean. An inactive (discontinued) product cannot be released through normal dispatch. Flag lines with inactive SKUs for `manual_review` with reason `inactive_product` or `escalate_product_master`. Inactive SKUs also appear in the `inactive_skus` lists for expedite tasks.7879### Inventory Status Classification (Expedite)8081For each order, classify the worst inventory status across all its lines:8283| Status | Condition |84|---|---|85| `ready` | All lines have non-negative effective available and all SKUs are active |86| `low_stock` | Some lines have low but non-negative effective available; all SKUs active |87| `shortage` | At least one line has negative effective available; all SKUs active |88| `inactive_sku` | At least one line has an inactive SKU; all active SKUs have non-negative effective |89| `inactive_and_shortage` | At least one inactive SKU and at least one line with negative effective available |9091### Dispatch Decision Mapping9293| Customer exception | Inventory status | Final decision | Next action |94|---|---|---|---|95| `account_blocked` or `fraud_watch` | any | `reject_hold` | `hold_credit_or_fraud` |96| `review_required` or `credit_watch` | any | `manual_review` | `send_account_review` |97| `none` | `ready` | `ship_now` | `release_to_pick` |98| `none` | `low_stock` | `delayed_release` | `delay_and_monitor` |99| `none` | `inactive_sku` or `inactive_and_shortage` | `manual_review` | `escalate_product_master` |100| `none` | `shortage` | `backorder` | `create_backorder` |101102### Allocation Line Actions (Transfer Review)103104For mixed-warehouse allocation, evaluate each line independently:105106- `ship`: the requested warehouse has enough effective available (>= line quantity)107- `transfer`: the requested warehouse cannot fill the full line, but another warehouse can cover the gap with its own effective stock. Ship what the requested warehouse can provide, transfer the remainder from one chosen source.108- `backorder`: no warehouse has sufficient effective stock to cover the line109- `manual_review`: customer has a risk flag or the SKU is inactive110111Transfer source selection: pick the warehouse (other than the requested one) with the largest positive effective available for that SKU. Only use a single source per line.112113### Kit Replenishment114115When planning component material for BOM builds:1161171. **Explode BOM**: component_required = BOM quantity_per * build_quantity. Sum across all kit targets for each SKU.1182. **Target effective available**: current effective available at the target warehouse plus all confirmed/open POs for that SKU at that warehouse with delivery before the build date.1193. **Gap**: total_required - target_effective_available. A positive gap needs covering.1204. **Coverage hierarchy** (most preferred first):121 - Timely PO coverage: open/confirmed POs at the target warehouse whose delivery date precedes the build date. POs in other statuses are not timely.122 - Inter-warehouse transfer: available effective stock at other warehouses (transferring warehouse must retain positive effective after the transfer).123 - Purchase requisition: buy what remains from the SKU's supplier.1245. **Component actions**:125 - `no_action_stocked`: gap <= 0 and no exclusion applies126 - `timely_po_covered`: timely POs fully cover the gap127 - `transfer_only`: transfers fully cover the gap, no purchase needed128 - `purchase_required`: purchase requisition needed (may be combined with transfers)129 - `overstock_excluded`: effective available already exceeds total required and no timely POs are in play1306. **Exclusions**: components with `target_overstock` (gap is negative and no timely POs), `timely_po_covers_gap` (POs cover it), or `stocked_no_gap` (already sufficient stock) go into `excluded_components`.1317. **Supplier mapping**: each product's `supplier_id` field identifies the default supplier. Use that supplier for purchase requisitions.1328. **Costs**: requisition `unit_cost` comes from the product record. `extended_cost` = unit_cost * quantity.133134### Supplier Incident Scorecard1351361. Filter incidents by `open_date` within the analysis window (inclusive on both ends).1372. Group by supplier. For each supplier compute:138 - Incident count and percentage of filtered population (round to 1 decimal)139 - Total resolution cost (sum of `resolution_cost` field, round to 2 decimals)140 - Average duration: for closed incidents, `close_date - open_date` in calendar days; for open incidents, `analysis_date - open_date`141 - RMA count (incidents with `incident_type` = RMA)142 - Work order count (incidents with `incident_type` = WORK_ORDER)143 - Open incident count (incidents with `status` = open)144 - Severe count (incidents with `severity` in high or critical)1453. **Recommendation codes** (apply in precedence order, first match wins):146147| Code | Trigger conditions |148|---|---|149| `ESCALATE_SUPPLIER` | supplier `quality_status` = quality_hold AND incident_count >= 3; OR any critical RMA; OR RMA_count >= 3 AND total_resolution_cost >= 15000.00 |150| `PROCESS_REVIEW` | WORK_ORDER_count >= 3 AND WORK_ORDER_count > RMA_count |151| `WATCHLIST` | supplier `quality_status` in (watch, quality_hold); OR incident_count >= 4; OR total_resolution_cost >= 12000.00; OR severe_count >= 2 |152| `MONITOR` | none of the above |153154### Procurement Quality Control155156Given a list of target supplier IDs and an analysis window:1571581. Fetch incidents for the window and the target suppliers. Also fetch supplier records for quality_status, and purchase orders for each supplier (status = open or confirmed).1592. For each supplier, compute: recent incident count, RMA count, severe/critical count, open incident count, affected SKUs (SKUs referenced in their incidents), and sample incident IDs (up to 5 most recent).1603. **Decision logic**:161162| Decision | Conditions |163|---|---|164| `freeze_new_replenishment` | `quality_status` = quality_hold AND (recent_incident_count >= 3 OR severe_or_critical_count >= 1), AND there are open/confirmed POs to hold |165| `buyer_review_required` | `quality_status` = quality_hold OR watch AND recent_incident_count >= 2 AND there are open/confirmed POs; OR severe_or_critical_count >= 2 AND any quality status |166| `monitor_only` | none of the above |1671684. `held_po_ids`: for suppliers with `freeze_new_replenishment` or `buyer_review_required`, include all their open/confirmed POs. For `monitor_only`, held_po_ids is empty.1695. `release_supplier_ids`: all suppliers whose decision is `monitor_only`.170171### Shipping Quotes172173Call `/shipping/quote` with:174- `warehouse_id`: the order's requested warehouse175- `destination_zip`: from the customer record176- `weight_lb`: sum of product weights across all order lines (product `weight_lb` field * line quantity)177- `speed`: from the order record (`shipping_speed` or `requested_speed` field)178179If the order has no explicit speed, default to `standard`. The quote returns `zone_distance` (integer), `service_days` (integer), and `total_cost_usd` (number, 2 decimals).180181## Cross-Reference Workflow182183For typical operational tasks, follow this sequence:1841851. Fetch the business payload and answer template from the input.1862. Extract the wave/order IDs/supplier IDs/BOM IDs from the payload.1873. Query orders (by wave or IDs) to get lines, SKUs, quantities, requested warehouses, and customer IDs.1884. Batch query products for all SKUs found, checking active status, weight, supplier, and unit cost.1895. Batch query customers for all customer IDs found, checking status flags and zip codes.1906. For inventory-sensitive tasks, query inventory for each warehouse/SKU combination.1917. For replenishment tasks, query BOMs and purchase orders for coverage analysis.1928. For scorecard/procurement tasks, query incidents within the specified date window and suppliers for quality status.1939. Compute decisions per the business rules above.19410. Request shipping quotes where the template requires them.19511. Assemble the JSON response matching the template exactly. Sort all lists as specified.196197## Output Formatting Rules198199- Currency values: round to 2 decimal places.200- Percentages: round to 1 decimal place.201- Duration averages: round to 2 decimal places.202- Sort list fields: ascending by their natural key (order_id, sku, supplier_id, line_id, incident_id, po_id) unless the template specifies a different sort order.203- Nullable fields: use JSON `null` (not the string "null") when the template allows it.204- Empty lists: use `[]`, never omit them.205- Date strings: use ISO 8601 YYYY-MM-DD format.206- Response must be valid JSON. No trailing commas, no comments, no narrative text outside the JSON root.