XM
Members
Update Cart
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
PATCH https://{baseurl}/api-cart/cart-decoupled/{cartId}/items
Copied!
The ideal use case is to allow your customers to decrement the quantity of an item in their cart, any time before billing.
To add new items or increment item quantity, the Add Items to Cart API is recommended. To remove existing items, the Remove Item from Cart API is recommended.

Headers

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

Parameters

Type: requestBody
Name: The details of the items to be updated in the cart.
Required: true

Sample Request

1
{
2
"items": [{
3
"lineItemId": 1,
4
"itemId": "1000000012",
5
"quantity": 15,
6
"price": {
7
"currency":"USD",
8
"sale": 0,
9
"base": 260,
10
"discount": {
11
"price": 0
12
}
13
}
14
},
15
{
16
"lineItemId": 2,
17
"itemId": "1000000014",
18
"quantity": 15,
19
"price": {
20
"currency":"USD",
21
"sale": 0,
22
"base": 380,
23
"discount": {
24
"price": 0
25
}
26
}
27
}]
28
}
Copied!

Sample Response

Response Code: 200
Message: OK
1
{
2
"_id": "60803e46630ef900087e2f61",
3
"deleted": false,
4
"registeredUser": false,
5
"cartId": 1488,
6
"items": [
7
{
8
"price": {
9
"discount": {
10
"discountAmount": 0,
11
"price": 0,
12
"promosApplied": []
13
},
14
"sale": 0,
15
"base": 19,
16
"currency": "USD"
17
},
18
"sample": false,
19
"discountedQuantity": 0,
20
"group": [
21
"5ecef789df21ae00077e7a2f"
22
],
23
"weightUnit": "lb",
24
"isPickup": false,
25
"createdAt": "2021-04-21T14:54:05.290Z",
26
"updatedAt": "2021-04-21T14:54:05.290Z",
27
"_id": "60803e46630ef900087e2f63",
28
"itemId": 1000000040,
29
"sku": "sk231212",
30
"taxCode": "123455123",
31
"title": "fabric t-shirt",
32
"weight": 4.2,
33
"quantity": 2,
34
"lineItemId": 1,
35
"attributeTotalPrice": 0,
36
"totalPrice": {
37
"currency": "USD",
38
"amount": 38
39
},
40
"attributes": [],
41
"id": "60803e46630ef900087e2f63"
42
},
43
{
44
"price": {
45
"discount": {
46
"discountAmount": 0,
47
"price": 0,
48
"promosApplied": []
49
},
50
"sale": 0,
51
"base": 19,
52
"currency": "USD"
53
},
54
"sample": false,
55
"discountedQuantity": 0,
56
"group": [
57
"5ecef789df21ae00077e7a2f"
58
],
59
"weightUnit": "lb",
60
"isPickup": false,
61
"createdAt": "2021-04-21T14:54:05.290Z",
62
"updatedAt": "2021-04-21T15:07:36.374Z",
63
"_id": "60803e46630ef900087e2f62",
64
"itemId": 1000000167,
65
"sku": "sk231212",
66
"taxCode": "TC1234567890",
67
"title": "fabric t-shirt",
68
"weight": 4.2,
69
"quantity": 9,
70
"lineItemId": 2,
71
"attributeTotalPrice": 0,
72
"totalPrice": {
73
"currency": "USD",
74
"amount": 171
75
},
76
"attributes": [],
77
"priceListId": null,
78
"id": "60803e46630ef900087e2f62"
79
}
80
],
81
"allPromosApplied": [],
82
"attributes": [],
83
"createdAt": "2021-04-21T15:01:26.051Z",
84
"updatedAt": "2021-04-21T15:07:36.411Z",
85
"__v": 0,
86
"totalAmount": {
87
"currency": "USD",
88
"amount": 209
89
},
90
"quantity": 11,
91
"errors": []
92
}
Copied!
Response Code: 400
Message: Bad Request - Cart Doesn't Exist
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 1mo ago
Copy link
Contents
Change Log