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-decoupled?cartId={cartId}
2
or
3
GET https://{baseurl}/api-cart/cart-decoupled?userAuthToken={userAuthToken}
Copied!
Retrieves existing cart details, by cartId (for guest users) or the userAuthToken (for logged in users).

Headers

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

By CartId
1
https://{baseurl}/api-cart/cart-decoupled?cartId=5f13883765bc750008b58293
Copied!
By Authorization Token
1
https://{baseurl}/api-cart/cart-decoupled?userAuthToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmMTM4ODIwNzA4ZmZiMDAwN2U2MDliMCIsInJvbGVzIjpbeyJpZCI6IjVkZDY4NDVkNTMzYTZlYjQ5NTNhYzVlNSJ9XSwiaWF0IjoxNTk1MTE1NTYzLCJleHAiOjE1OTUxMTczNjN9.G_Mx4KcK0D4oZ4ZorXXRDEbPtiV74IK_E2TouKwubYbNNmktUaqMlhy4JgES9qnzvUd8y7QthrJbzJHZHRBYZA
Copied!

Response

Response Code: 200
Message: OK
Sample
1
{
2
"_id": "5f13883765bc750008b58293",
3
"deleted": false,
4
"registeredUser": false,
5
"cartId": 1534,
6
"items": [
7
{
8
"price": {
9
"discount": {
10
"price": 0,
11
"discountAmount": 0,
12
"promosApplied": []
13
},
14
"sale": 68,
15
"base": 85,
16
"currency": "USD"
17
},
18
"discountedQuantity": 0,
19
"group": [
20
"5e31a1f9fcc2b500089c10e8"
21
],
22
"weightUnit": "lb",
23
"createdAt": "2020-07-18T22:19:41.035Z",
24
"updatedAt": "2020-07-18T23:43:26.299Z",
25
"_id": "5f13889465bc750008b58297",
26
"itemId": 1000000038,
27
"quantity": 2,
28
"sku": "1554213",
29
"taxCode": "PH060771",
30
"title": "Glo Pillow Light Gray",
31
"weight": 2,
32
"lineItemId": 1,
33
"totalPrice": {
34
"currency": "USD",
35
"amount": 136
36
},
37
"id": "5f13889465bc750008b58297"
38
}
39
],
40
"userId": "5f138820708ffb0007e609b0",
41
"allPromosApplied": [],
42
"createdAt": "2020-07-18T23:39:35.978Z",
43
"updatedAt": "2020-07-18T23:43:26.323Z",
44
"__v": 0,
45
"totalAmount": {
46
"currency": "USD",
47
"amount": 136
48
},
49
"quantity": 2,
50
"errors": {
51
"inventory": [],
52
"price": [],
53
"promo": []
54
}
55
}
Copied!
Response Code: 404
Message: Cart Not Found
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).
1
}
Copied!

Change Log

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