INT-Q08Design IntermediateIntegration & data#integration

An agent's console must show live warnings when a customer's payment fails in the billing system. Design it.

Your confidence:Not rated

Model answer

Pattern: UI update based on data changes.

  1. Billing emits a payment failed event (or webhook) to middleware.
  2. Middleware maps the billing customer to the Salesforce account (external ID) and publishes Payment_Failed__e through the Pub/Sub API (or REST).
  3. A platform event trigger (or flow) in Salesforce persists a Payment Alert record on the account, so the warning survives page reloads and appears in reports.
  4. An LWC on the console subscribes with lightning/empApi and shows a banner immediately if the agent has that customer open; it also reads open alerts on load.
  5. Security: the event carries no sensitive card data; the integration user can publish only that event.
  6. Resilience: replay IDs in middleware for retries; if real-time delivery fails, the persisted alert still appears on the next load.

โœ” Key points to hit

โœ– Red-flag answers

  • Polling the billing API every few seconds from the browser
  • Showing alerts only via events, so they vanish on reload

โ†ช Follow-ups

Why persist the alert as well as publishing the event?

Events are transient and only reach subscribers connected at the time. A record gives history, reporting, and a reliable display when the agent opens the customer later.

How many users can subscribe to events in LWC?

There are allocations for event delivery to CometD/empApi clients; for large contact centres, check the allocation and keep event payloads small โš‘ verify current limits.