place_order
Validates customer and items, inserts order lines, and completes order; automatically deletes incomplete orders on failure.
Instructions
The three-call legacy protocol, wrapped with compensation.
HDR_INS validates the customer and creates an 'I' header; each line is inserted with the sequence numbers the backend insists on; FIN totals, decrements stock, and flips the order to pending. If anything fails after the header exists, the incomplete order is DELETED (compensating action) — the backend has no cross-call transactions, so cleanup is the wrapper's job, not the agent's.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| customer_id | Yes |