You can remove the already added primary line items from the cart details page. Every line item on the cart details page has a checkbox beside it. Selecting the checkbox opens a drawer with a list of selected items. From the Select action, select Delete from cart and click Confirm to remove the selected line items from the cart. You can also use the Select All option to select and remove all the line items available in the cart.

The following API is used to delete line item(s) from the cart. For more information, click here.

DELETE https://<URL_of_the_Instance>/api/cart/v1/carts/{cartId}/items

To delete a specific line item from the cart, use the Delete button, which is available for each line item.