XM

Retrieve Cart by Cart ID or userAuthToken

Path:

GET api-cart/cart?cartId={cartId}

Existing cart details can be retrieved through this endpoint, by specifying the cartId (for guest users) or the userAuthToken (for logged in users) in the request path.

Headers

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

Consumes

  • application/json

Produces

  • application/json

Parameters

Type : query

Name : Either the cartId (for guest user) or the userAuthToken (for logged in user)

Required: true

Sample Request

By CartId

https://{baseurl}/cart?cartId=5f13883765bc750008b58293

By userAuthToken

https://{baseurl}/cart?userAuthToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmMTM4ODIwNzA4ZmZiMDAwN2U2MDliMCIsInJvbGVzIjpbeyJpZCI6IjVkZDY4NDVkNTMzYTZlYjQ5NTNhYzVlNSJ9XSwiaWF0IjoxNTk1MTE1NTYzLCJleHAiOjE1OTUxMTczNjN9.G_Mx4KcK0D4oZ4ZorXXRDEbPtiV74IK_E2TouKwubYbNNmktUaqMlhy4JgES9qnzvUd8y7QthrJbzJHZHRBYZA

Response

Response Code: 200

Message: OK

Description: You'll see this message when the cart details are successfully retrieved.

Sample

{
"_id": "5f13883765bc750008b58293",
"deleted": false,
"registeredUser": false,
"cartId": 1534,
"items": [
{
"price": {
"discount": {
"price": 0,
"discountAmount": 0,
"promosApplied": []
},
"sale": 68,
"base": 85,
"currency": "USD"
},
"discountedQuantity": 0,
"group": [
"5e31a1f9fcc2b500089c10e8"
],
"weightUnit": "lb",
"createdAt": "2020-07-18T22:19:41.035Z",
"updatedAt": "2020-07-18T23:44:19.858Z",
"_id": "5f13889465bc750008b58297",
"itemId": 1000000038,
"quantity": 2,
"sku": "1554213",
"taxCode": "PH060771",
"title": "Glo Pillow Light Gray",
"weight": 2,
"lineItemId": 1,
"totalPrice": {
"currency": "USD",
"amount": 136
},
"id": "5f13889465bc750008b58297"
}
],
"userId": "5f138820708ffb0007e609b0",
"allPromosApplied": [],
"createdAt": "2020-07-18T23:39:35.978Z",
"updatedAt": "2020-07-18T23:44:19.878Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 136
},
"quantity": 2,
"errors": {
"inventory": [],
"price": [],
"promo": []
}
}

Response Code: 404

Message: Not in stock

Changelog

  • April-2021 last updated

  • July-2020 First updated