---
agentTools:
  projectIndex: https://rye-docs.readme.io/llms.txt
---

# removeCart

Removes an existing shopping cart based on the provided cart ID. It allows users to remove a cart that is no longer needed or relevant.

> 🚧
>
> The cart will be removed regardless if the products are present in the cart or not and regardless cart submission status.

***

## Arguments

`input` : [`CartDeleteInput!`](https://rye-docs.readme.io/reference/cartdeleteinput)

The `input` object contains the unique identifier (ID) for the cart that needs to be deleted.

***

## Returns

[`DeletedCart.deletedId`](https://rye-docs.readme.io/reference/deletedcart): [`DeletedCart`](https://rye-docs.readme.io/reference/deletedcart)

The unique identifier (ID) of the deleted cart.

***

## Examples

```json Query arguments
{
    "input": {
        "id": "{{cartId}}"
    }
}
```

```graphql
mutation ($input: CartDeleteInput!) {
    removeCart(input: $input) {
        deletedId
    }
}
```

```json Response
{
    "data": {
        "removeCart": {
            "deletedId": "teWvPufPy8c2AcfkfBo9"
        }
    }
}
```

***

## Errors

If the cart is not found then a corresponding error is returned

```json
{
    "errors": [
        {
            "message": "Cart not found: someInvalidCartId",
            "path": [
                "getCart"
            ]
        }
    ],
    "data": null
}
```