XM
Members
Delete Cart
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
PATCH https://{baseurl}/api-cart/cart/{cartId}/orderNumber
Copied!
Upon checkout, this API automatically deletes the customer's cart. After checkout, if the customer adds a new item to the cart, a new cart ID is created.
Content-Type : application/json
x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : path
Name : The 24 character system-generated cart ID (from the Add Items to Cart or Retrieve Cart by userAuthToken API).
Required: true
Type : requestBody
Name : The order number that is generated after a successful checkout.
Required: true

Sample Request

Path:
1
PATCH https://{baseurl}/api-cart/cart/60807478d14ffd000843db2c/orderNumber
Copied!
Request Body:
1
{
2
"orderNumber": "1234-1234-12345"
3
}
Copied!

Response

Response Code: 200
Message: OK
Description: You'll see this message when the cart is successfully deleted.
1
{
2
"_id": "60807478d14ffd000843db2c",
3
"deleted": true,
4
"registeredUser": false,
5
"cartId": 1493,
6
"items": [
7
{
8
"price": {
9
"discount": {
10
"discountAmount": 0,
11
"price": 0,
12
"promosApplied": []
13
},
14
"sale": 0,
15
"base": 900,
16
"currency": "USD"
17
},
18
"sample": false,
19
"discountedQuantity": 0,
20
"group": [
21
"123123123123123213212222"
22
],
23
"weightUnit": "lb",
24
"isPickup": false,
25
"createdAt": "2021-04-21T18:51:24.975Z",
26
"updatedAt": "2021-04-21T18:52:42.418Z",
27
"_id": "60807478d14ffd000843db2d",
28
"itemId": 1000000051,
29
"priceListId": 100269,
30
"quantity": 2,
31
"sku": "1538910",
32
"taxCode": "PH060771",
33
"title": "Luminous Cushion Lagoon",
34
"weight": 1,
35
"lineItemId": 1,
36
"attributeTotalPrice": 0,
37
"totalPrice": {
38
"currency": "USD",
39
"amount": 1800
40
},
41
"attributes": [],
42
"id": "60807478d14ffd000843db2d"
43
}
44
],
45
"allPromosApplied": [],
46
"attributes": [],
47
"createdAt": "2021-04-21T18:52:40.513Z",
48
"updatedAt": "2021-04-21T18:53:59.793Z",
49
"__v": 0,
50
"orderNumber": "1234-1234-12345",
51
"totalAmount": {
52
"currency": "USD",
53
"amount": 1800
54
},
55
"quantity": 2
56
}
Copied!
Response Code: 404
Message: Not found
Description: You will see this error when the cart ID doesn't exist in the system.
1
{
2
"code": "CART_NOT_FOUND",
3
"message": "Cart not found."
4
}
Copied!
Response Code: 400
Message: Request validation
Description: You will see this error when the cart ID is lesser or greater than 24 characters.
1
{
2
"code": "REQUEST_VALIDATION",
3
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
4
}
Copied!
Error Code: 500
Message: Internal Server Error
Description: You will see this error when the account number is incorrect in the x-site-context (for a multi-tenent client).

Change Log

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