This endpoint reduces a product’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/astrxnomo/shop-microservers/llms.txt
Use this file to discover all available pages before exploring further.
stock count by the supplied decrement value and returns the updated product record. It is designed to be called by the orders service as part of the checkout flow — after a successful order is created, the orders service calls this endpoint for each line item to commit the inventory change in the catalog database.
Endpoint
No token-based authentication is enforced on this route. Access control relies on the internal Docker network — this endpoint is not intended to be reachable from outside the service mesh.
Request
Path parameters
The CUID of the product whose stock should be decremented.
Request body
A positive integer representing the quantity to subtract from the product’s current
stock. Must be a whole number greater than zero. Validated against StockDecrementSchema (z.number().int().positive()).Example request
Response
200 — Success
Returns the full updated product object after the stock decrement has been applied.400 — Validation Error
Returned when the request body fails schema validation — for example, ifdecrement is missing, is not an integer, or is zero or negative.
404 — Product Not Found
Returned when no product with the givenid exists in the catalog database.
409 — Insufficient Stock
Returned when the requesteddecrement value exceeds the product’s current stock count. The stock will not be modified.