Salesforce Decode
Salesforcedecode
Back to questions
Headless 360Advancedcomposite-apicheckoutperformancerest

Reduce headless checkout latency with Composite REST API patterns

Real World Scenario

Single-page checkout makes seven sequential Salesforce callouts causing 4-second submit times on mobile networks during flash sales.

Expected Answer

• Batch related GETs into Composite REST subrequests reducing round trips • Use Composite graph for dependent writes: create order, payment authorization, inventory decrement in one HTTP call where supported • Move non-critical post-order actions—email, loyalty credit—to async queue after confirmation response • Implement BFF aggregating Salesforce and payment provider calls server-side near user region • Set aggressive timeouts with user-visible retry on idempotent payment steps only • Load test composite payloads at peak concurrency including auth token refresh overhead • Document partial failure handling when composite subrequest succeeds but sibling fails

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Batch related GETs into Composite REST subrequests reducing round trips. Use Composite graph for dependent writes: create order, payment authorization, inventory decrement in one HTTP call where supported. Pick based on your integration pattern and team capability. Headless checkout performance is network architecture—composite patterns and async side effects beat micro-optimizing individual API calls. Optimize for scale and operational observability.

Architect Perspective

Headless checkout performance is network architecture—composite patterns and async side effects beat micro-optimizing individual API calls.