E-Commerce Events API
Complete async event API documentation for an e-commerce platform. Covers order lifecycle events, inventory updates, and payment processing with Kafka protocol bindings, SASL authentication, and Schema Registry integration.
The E-Commerce Events API provides 3 channels, 4 operations, and 4 message types for event-driven communication between the order management system, inventory service, payment gateway, and notification service. All events flow through Apache Kafka with Confluent Schema Registry for schema evolution.
Architecture Overview
The event-driven architecture connects four services through Kafka topics:
Order Events Channel
All order lifecycle events flow through this channel, partitioned by orderId for ordered delivery within each order.
Publish Order Created
Publish Order Status Changed
Payment Status Channel
Payment outcome events from the payment gateway, consumed by the order service to advance order state.
Receive Payment Processed
Inventory Updates Channel
Stock level changes published by the inventory service, using Kafka log compaction for latest-state semantics.
Publish Inventory Updated
Message Payloads
All message payloads reference schemas defined in the Schema Editor, enabling end-to-end data lineage from event payloads to the e-commerce data model.
Payload for order lifecycle events. Contains the order details at the time the event was emitted, including customer reference, line items summary, and current status.
Payload for payment processing events. Emitted by the payment gateway when a payment attempt is completed, whether successful, failed, or refunded.
Payload for inventory change events. Emitted when product stock levels change due to orders, restocking, or manual adjustments.
Standard headers for event-driven messages. Provides correlation, tracing, and metadata fields that apply across all async API messages.