XM
Members
Retrieve Cart by Cart ID or Authorization Token
This documentation is now outdated, please find the latest docs for this endpoint here
Path:
1
GET https://{baseurl}/api-cart/cart?cartId={cartId}
2
or
3
GET https://{baseurl}/api-cart/cart?userAuthToken={userAuthToken}
Copied!
Facilitates retrieval of an existing cart details based on the cart ID or the Authorization Token.

Headers

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

Parameters

Type : query
Name : Either the cartId (from the Add Items to Cart API) or the Authorization Token (JWT userAuthToken from the Login API).
Required: true

Sample Request

Path: By Cart ID
1
https://{baseurl}/api-cart/cart?cartId=607f8a8f0118960009a8e6ee
Copied!
Path: By Authorization Token
1
https://{baseurl}/api-cart/cart?userAuthToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmMTM4ODIwNzA4ZmZiMDAwN2U2MDliMCIsInJvbGVzIjpbeyJpZCI6IjVkZDY4NDVkNTMzYTZlYjQ5NTNhYzVlNSJ9XSwiaWF0IjoxNTk1MTE1NTYzLCJleHAiOjE1OTUxMTczNjN9.G_Mx4KcK0D4oZ4ZorXXRDEbPtiV74IK_E2TouKwubYbNNmktUaqMlhy4JgES9qnzvUd8y7QthrJbzJHZHRBYZA
Copied!

Response

Success Code: 200
Message: OK
Description: You'll see this message when the cart details are successfully retrieved based on the cart ID.
Sample Response
1
{
2
"_id": "607f8a8f0118960009a8e6ee",
3
"deleted": false,
4
"registeredUser": true,
5
"cartId": 1475,
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-21T02:14:38.620Z",
26
"updatedAt": "2021-04-21T17:47:19.244Z",
27
"_id": "607f8a8f0118960009a8e6ef",
28
"itemId": 1000000051,
29
"quantity": 2,
30
"priceListId": 100269,
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": "607f8a8f0118960009a8e6ef"
43
},
44
{
45
"price": {
46
"discount": {
47
"discountAmount": 0,
48
"price": 0,
49
"promosApplied": []
50
},
51
"sale": 48,
52
"base": 148,
53
"currency": "USD"
54
},
55
"sample": false,
56
"discountedQuantity": 0,
57
"group": [
58
"123123123123123213212222"
59
],
60
"weightUnit": "lb",
61
"isPickup": false,
62
"createdAt": "2021-04-21T02:14:38.620Z",
63
"updatedAt": "2021-04-21T17:47:19.244Z",
64
"_id": "607f8a8f0118960009a8e6f0",
65
"itemId": 1000000052,
66
"quantity": 2,
67
"priceListId": 100269,
68
"sku": "1583908",
69
"taxCode": "PH060771",
70
"title": "Embellished Pillow Pink",
71
"weight": 1,
72
"lineItemId": 2,
73
"attributeTotalPrice": 0,
74
"totalPrice": {
75
"currency": "USD",
76
"amount": 96
77
},
78
"attributes": [],
79
"id": "607f8a8f0118960009a8e6f0"
80
}
81
],
82
"userId": "600a56593245200007982fac",
83
"allPromosApplied": [],
84
"attributes": [],
85
"createdAt": "2021-04-21T02:14:39.048Z",
86
"updatedAt": "2021-04-21T17:47:19.269Z",
87
"__v": 0,
88
"totalAmount": {
89
"currency": "USD",
90
"amount": 1896
91
},
92
"quantity": 4,
93
"errors": {
94
"inventory": [],
95
"price": [],
96
"promo": []
97
}
98
}
Copied!
Success Code: 200
Message: OK
Description: You'll see this message when the cart details are successfully retrieved based on the Authorization token.
Sample Response
1
{
2
"_id": "607f8a8f0118960009a8e6ee",
3
"deleted": false,
4
"registeredUser": true,
5
"cartId": 1475,
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-21T02:14:38.620Z",
26
"updatedAt": "2021-04-21T17:48:43.011Z",
27
"_id": "607f8a8f0118960009a8e6ef",
28
"itemId": 1000000051,
29
"quantity": 2,
30
"priceListId": 100269,
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": "607f8a8f0118960009a8e6ef"
43
},
44
{
45
"price": {
46
"discount": {
47
"discountAmount": 0,
48
"price": 0,
49
"promosApplied": []
50
},
51
"sale": 48,
52
"base": 148,
53
"currency": "USD"
54
},
55
"sample": false,
56
"discountedQuantity": 0,
57
"group": [
58
"123123123123123213212222"
59
],
60
"weightUnit": "lb",
61
"isPickup": false,
62
"createdAt": "2021-04-21T02:14:38.620Z",
63
"updatedAt": "2021-04-21T17:48:43.011Z",
64
"_id": "607f8a8f0118960009a8e6f0",
65
"itemId": 1000000052,
66
"quantity": 2,
67
"priceListId": 100269,
68
"sku": "1583908",
69
"taxCode": "PH060771",
70
"title": "Embellished Pillow Pink",
71
"weight": 1,
72
"lineItemId": 2,
73
"attributeTotalPrice": 0,
74
"totalPrice": {
75
"currency": "USD",
76
"amount": 96
77
},
78
"attributes": [],
79
"id": "607f8a8f0118960009a8e6f0"
80
}
81
],
82
"userId": "600a56593245200007982fac",
83
"allPromosApplied": [],
84
"attributes": [],
85
"createdAt": "2021-04-21T02:14:39.048Z",
86
"updatedAt": "2021-04-21T17:48:43.031Z",
87
"__v": 0,
88
"totalAmount": {
89
"currency": "USD",
90
"amount": 1896
91
},
92
"quantity": 4,
93
"errors": {
94
"inventory": [],
95
"price": [],
96
"promo": []
97
}
98
}
Copied!
Error Code: 404
Message: Cart 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!
Error 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