Clearing the storefront cart
This article covers how you can clear the storefront cart when a customer returns to the storefront after completing a purchase.
Platform:
- Custom
Overview
It is recommended you clear the customer's cart on an external ecommerce platform or site after you've processed their order with Recharge. This avoids any confusion the customer would experience if they returned to the storefront to see the items they just purchased are still in the cart.
1. Receive checkout/processed webhook
Listen for the checkout/processed
webhook which confirms an order is successfully processed.
2. Clear storefront cart
The checkout/processed
payload contains the cart id
. Match this ID with the ecommerce platform's cart ID and make the API calls necessary to clear the cart.
Updated 2 months ago