Idempotent Execution

API calls that trigger Integration services often run multiple times for the same cart. The integration APIs are designed to clean up and resolve the results of prior calls (idempotentcy) before updating the cart. When a failure occurs, the cart executes a retry. Usually the integration service or a buyer action causes errors.

An integration can be executed using partial results from a previous execution. Partial results are a mix of null and non-null values. Before writing updated values, the code cleans up the integration results from previous executions.

This example integration clears the price of all items with a bulk write and then attempts to recalculate the prices.