XM

Retrieve Cart by Ship-to ID

Path:

GET https://{baseurl}/api-cart/ship-to/{shipTo-ID/cart

Through this endpoint, a user's cart details can be retrieved by passing the associated shipToId as a path parameter.

Alternatively, the Get Cart by cartID or UserID may be used, when the shipToId is not available.

Headers

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 ship-to ID (from the Add Shipping API)

Required: true

https://{baseurl}/api-cart/ship-to/608190fe0f1686000978616f/cart

Response

Response Code: 200

Message: OK

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

Sample

{
"_id": "607f8a8f0118960009a8e6ee",
"deleted": false,
"registeredUser": true,
"cartId": 1475,
"items": [
{
"price": {
"discount": {
"discountAmount": 0,
"price": 0,
"promosApplied": []
},
"sale": 0,
"base": 900,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 0,
"group": [
"123123123123123213212222"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T02:14:38.620Z",
"updatedAt": "2021-04-22T15:08:28.456Z",
"_id": "607f8a8f0118960009a8e6ef",
"itemId": 1000000051,
"quantity": 4,
"priceListId": 100269,
"sku": "1538910",
"taxCode": "PH060771",
"title": "Luminous Cushion Lagoon",
"weight": 1,
"lineItemId": 1,
"attributeTotalPrice": 0,
"totalPrice": {
"currency": "USD",
"amount": 3600
},
"attributes": [],
"shipTo": {
"_id": "608190fe0f1686000978616f",
"shipMethod": {
"cost": {
"amount": 10,
"base": 10,
"realPrice": 10,
"discount": 0
},
"shipMethodId": "10002",
"shipmentCarrier": "Fedex",
"shipmentMethod": "Next Day"
},
"address": {
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"name": {
"first": "John",
"last": "Smith"
},
"street1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "shipping",
"email": "[email protected]"
},
"billTo": [
"60803ab6880a2e0009bc5250"
],
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"cartId": "607f8a8f0118960009a8e6ee",
"shipToId": 817,
"createdAt": "2021-04-22T15:06:38.984Z",
"updatedAt": "2021-04-22T15:08:28.349Z",
"__v": 0
},
"id": "607f8a8f0118960009a8e6ef"
},
{
"price": {
"discount": {
"discountAmount": 28.12,
"price": 119.88,
"promosApplied": [
{
"unit": "%OFF",
"value": 19,
"ON": {
"kind": "SKU",
"value": null
},
"id": "608026f0a2cfe000077aa70e",
"promoId": "608026f0a2cfe000077aa70c"
}
]
},
"sale": 48,
"base": 148,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 2,
"group": [
"123123123123123213212222"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T02:14:38.620Z",
"updatedAt": "2021-04-22T15:08:28.456Z",
"_id": "607f8a8f0118960009a8e6f0",
"itemId": 1000000052,
"quantity": 2,
"priceListId": 100269,
"sku": "1583908",
"taxCode": "PH060771",
"title": "Embellished Pillow Pink",
"weight": 1,
"lineItemId": 2,
"attributeTotalPrice": 0,
"totalPrice": {
"currency": "USD",
"amount": 239.76
},
"attributes": [],
"id": "607f8a8f0118960009a8e6f0"
}
],
"userId": "600a56593245200007982fac",
"allPromosApplied": [
{
"promoId": "608026f0a2cfe000077aa70c"
}
],
"attributes": [],
"createdAt": "2021-04-21T02:14:39.048Z",
"updatedAt": "2021-04-22T15:08:28.511Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 3839.76
},
"quantity": 6
}

Error Code: 404

Message: Not found

Description: You will see this error when the specified ship-to ID doesn't exist in the system.

{
"code": "SHIPTO_NOT_FOUND",
"message": "Ship-to not found."

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).

{
"message": "Forbidden"
}

Change Log

  • June - 2021

  • July - 2020 First updated