Order Processing & Event Streaming Guide
Order Processing & Event Streaming Guide
Manage store orders, track fulfillment status, and process real-time AsyncAPI webhooks.
The Plant Store order system processes customer purchases and synchronizes stock levels across channels. This guide covers placing orders via REST endpoints and receiving real-time event updates via AsyncAPI.
Order Lifecycle Overview
1. Placing an Order
To reserve items and initiate checkout, post an order schema to /store/order:
2. Tracking Order Status & Inventory
Fetch Order by ID
Fetch Store Inventory Map
Returns a breakdown of quantity by status across all items:
3. Real-Time AsyncAPI Event Streaming
In addition to HTTP endpoints, the platform emits asynchronous event notifications over WebSockets/Webhooks as defined in asyncapi.yaml.
Subscribing to Order State Changes
Subscribe to wss://stream.plantstore.dev/v1/orders/updates to receive streaming JSON payloads whenever order statuses change:
JavaScript WebSocket Subscriber Example
4. Order Cancellation
To cancel an order before fulfillment, invoke DELETE /store/order/{orderId}:
Deleting an order instantly returns reserved stock from pending status back to available status in the catalog.