Place order
place_orderPlace an order by providing product ID and quantity. Validates product availability and stock, then decrements inventory and returns a confirmation.
Instructions
Place an order for a given quantity of a product. Validates the product exists and that enough stock is available, decrements stock, and returns a mock order confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quantity | Yes | How many units to order. Must be a positive integer. | |
| productId | Yes | The product id to order, e.g. "sku-001". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| total | Yes | ||
| status | Yes | ||
| orderId | Yes | ||
| quantity | Yes | ||
| productId | Yes | ||
| unitPrice | Yes | ||
| remainingStock | Yes |