A cart does not exist until a customer initiates their first add-to-cart action. When a customer adds the first product to a cart, a cart is created with a unique reference ID and the product is added as a cart item. You need the reference ID field for any action related to the cart, such as updating, deleting or checking out a cart.
Generating a cart reference ID
Regardless of the way the reference ID was created (through the SDK or a custom feature), the API remembers it, and uses the reference ID to create an order ID. Make sure you take note of this field, as you also need it.
Handling a cart after payment
After the cart has been checked out and the order has been paid, the cart still exists. You can manually delete the cart. All carts are automatically purged seven days after the customer last uses it.