> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/catalogs/inventory-service-plugin/sample-flows.md ## Article Content: # Sample Flows This article presents sample flows you can support. You aren't limited to these exact flows, but they can be helpful jumping off points as you plan your inventory integration. ## Decrement inventory as part of order placed flow You can reduce inventory levels when customers place orders to ensure accurate stock tracking and prevent overselling. To decrement inventory when an order is placed: 1. A site visitor completes the checkout process. 2. Wix sends a [Decrement Availability](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalogs/inventory-service-plugin/decrement-availability.md) request to your integration with `restrictInventoryValue` set to `true`. 3. Your service validates that the requested items are in stock: + If sufficient inventory is available, deduct the items from stock and return an empty response object. + If any items have insufficient stock, return an error without modifying inventory levels. 4. When an error is returned, the site visitor cannot complete the checkout and is notified about the unavailable items. ## Update inventory as part of order edit flow You can adjust inventory levels when merchants edit existing orders, handling both items being added and removed from orders. To update inventory when an order is edited: 1. A merchant edits an order in the Wix dashboard. 2. The merchant replaces a line item with a different item from the same catalog. 3. When the merchant commits the changes, Wix sends 2 requests to your service: + A [Decrement Availability](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalogs/inventory-service-plugin/decrement-availability.md) request for the newly added item with `restrictInventoryValue` set to `false`. + An [Increment Availability](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalogs/inventory-service-plugin/increment-availability.md) request for the removed item to restore its stock. 4. Since these requests are initiated by the merchant and should not fail the order edit, the decrement request uses `restrictInventoryValue: false`, allowing your service to proceed even if it would result in negative inventory.