rr_execute_replenishment_action
Create draft purchase and transfer orders for replenishment actions with idempotent execution, rejecting stale data to prevent duplicate or conflicting orders.
Instructions
Execute a replenishment action in draft mode: creates a draft purchase order and/or draft transfer order for the action's items. Idempotent by idempotency_key; rejects with conflict if the action changed since prepare (stale expected_updated_at) or if the same key is reused with a different payload or actor. Never auto-sends to suppliers and never commits stock.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action_id | Yes | Replenishment action UUID | |
| idempotency_key | Yes | Caller-chosen idempotency key; replay with the same key + payload returns the original result | |
| expected_updated_at | Yes | The action updated_at from rr_prepare_replenishment_action; execute fails if it no longer matches |