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.
Security Schemes
| Scheme | Type | Use Case |
|---|---|---|
| SCRAM-SHA-256 | SASL Authentication | Kafka broker connection authentication |
| OAuth2 (Client Credentials) | Token-based | Schema Registry access and management API |
Kafka Topic Configuration
| Topic | Partitions | Replicas | Cleanup | Retention |
|---|---|---|---|---|
| shop.orders.events | 12 | 3 | delete | 7 days |
| shop.products.inventory.updates | 6 | 3 | compact | Indefinite (compacted) |
| shop.payments.status | 6 | 3 | delete | 30 days |