Design an event-driven architecture for a B2B platform using Platform Events for order status, CPQ calculations, and entitlement changes.
Suggested answer
An event-driven B2B architecture decouples the order, CPQ, and entitlement systems:
Order Status Events: When an ERP processes an order (packed, shipped, delivered), it publishes a Order_Status__e Platform Event to Salesforce. A Platform Event-triggered Flow or Apex trigger updates the Salesforce Order record status and triggers customer notification automations. Decouples ERP timing from Salesforce UI refresh.
CPQ Calculation Events: For complex pricing scenarios that require external system input (e.g., real-time inventory pricing from ERP), a CPQ Price Rule can invoke an Apex action that publishes a calculation request event. An external system subscribes via CometD, calculates the price, and pushes back the result via a REST callout to Salesforce, which then re-triggers the CPQ calculator.
Entitlement Change Events: When a contract is amended or a subscription is upgraded in CPQ, a Entitlement_Change__e event notifies downstream systems (ERP licence server, Field Service entitlement engine, partner portal) to update the customer's entitlements synchronously. Each subscriber handles their own domain without coupling.
Architecture principle: Define clear event schemas (event name, payload fields) and use a service catalogue approach to document producers and consumers. Prevent event payload bloat — include only the data needed for subscriber decision-making, not full record copies.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.