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, clickhere.