XM
Powered By GitBook
Empty Cart
Path:
1
PATCH https://{baseurl}/api-cart/cart-decoupled/{cartId}/empty
Copied!
Empties the cart, by cart ID. Here, the cart continues to exist, but with 0 item in it. For deleting the cart altogether, the Delete Cart by ID API is recommended.

Headers

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : path
Name : The cartID (from the Add Items to Cart or Retrieve Cart by userAuthToken API)
Required: true

Sample Request

1
PATCH https://{baseurl}/api-cart/cart-decoupled/6080420ee1ae0600085fa6b1/empty
Copied!

Sample Response

Response Code: 200
Message: OK
1
{
2
"_id": "6080420ee1ae0600085fa6b1",
3
"deleted": false,
4
"registeredUser": false,
5
"cartId": 1489,
6
"items": [],
7
"allPromosApplied": [],
8
"attributes": [],
9
"createdAt": "2021-04-21T15:17:34.462Z",
10
"updatedAt": "2021-04-21T15:17:53.257Z",
11
"__v": 0,
12
"totalAmount": {
13
"currency": "",
14
"amount": 0
15
},
16
"quantity": 0
17
}
Copied!
Response Code: 404
Message: Cart Not Found
Error Code: 403
Message: Forbidden
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).
1
{
2
"message": "Forbidden"
3
}
Copied!

Change Log

    June - 2021
    July - 2020 First updated
Last modified 2mo ago
Copy link
Contents
Change Log