> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# DeleteCart

# Package: purchaseFlow

# Namespace: CartService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/delete-cart.md

## Permission Scopes:
Write Carts V2 (PII): SCOPE.ECOM.WRITE-CARTS-V2_LIMITED

## Introduction

Deletes a cart.

---

## REST API

### Schema

```
 Method: deleteCart
 Description: Deletes a cart.
 URL: https://www.wixapis.com/ecom/v2/carts/{cartId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  cartId
 Method parameters: 
   param name: cartId | type:   none | required: true 
 Return type: DeleteCartResponse
  EMPTY-OBJECT {}


```

### Examples

### Delete Cart
Deletes a cart.

```curl
curl -X DELETE \
'https://www.wixapis.com/ecom/v2/carts/ca727402-f531-4bcf-ab09-db70ea0bd008' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.cartV2.deleteCart(cartId)
 Description: Deletes a cart.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  cartId
 Method parameters: 
   param name: cartId | type: string | description: Cart GUID. | required: true | validation: format GUID
 Return type: PROMISE<DeleteCartResponse>
  EMPTY-OBJECT {}


```

### Examples

### Delete a cart
```javascript
import { cartV2 } from "@wix/ecom";

async function deleteCart() {
  await cartV2.deleteCart("ca727402-f531-4bcf-ab09-db70ea0bd008");
}

```

### deleteCart (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { cartV2 } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { cartV2 },
  // Include the auth strategy and host as relevant
});


async function deleteCart(cartId) {
  const response = await myWixClient.cartV2.deleteCart(cartId);
};
```

---