IntegrationIntermediatecompositerestrelationships
Design REST Composite tree requests for parent-child record creation
Real World Scenario
Order API must create Order, OrderItems, and Payment in one atomic REST call from ecommerce middleware.
Expected Answer
• Composite tree API up to 200 records with referenceId linking parent child
• Single HTTP POST allOrNone true for atomicity
• referenceId maps response ids to created records
• Validate governor limits 200 nodes per tree
• Error response identifies failing node for partial retry design
• Alternative Composite sObject batch for independent records
• Document tree template OpenAPI for partner consumers
Follow-Up Questions & Answers
Click to expand — each follow-up includes a direct, interview-ready answer
Main difference: use case and scale. Composite tree API up to 200 records with referenceId linking parent child. Single HTTP POST allOrNone true for atomicity. Pick based on your integration pattern and team capability. Composite tree is atomic multi-level create—use when middleware must not orphan child records. Balance speed of delivery with maintainability.
Architect Perspective
Composite tree is atomic multi-level create—use when middleware must not orphan child records.