XM

Update Cart

Path:

PATCH /cart/{cartId}/items

At any stage of before the billing, users have the flexibility to add (additional items), modify (change the quantity), or remove existing items. This API ensure the cart is maintained up-to-date, at any given point.

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: body

Name: Item details

Required: true

Sample Request

{
"items": [{
"lineItemId": 1,
"itemId": "1000000012",
"quantity": 15,
"price": {
"currency":"USD",
"sale": 0,
"base": 260,
"discount": {
"price": 0
}
}
},
{
"lineItemId": 2,
"itemId": "1000000014",
"quantity": 15,
"price": {
"currency":"USD",
"sale": 0,
"base": 380,
"discount": {
"price": 0
}
}
}]
}

Sample Response

Response Code: 200

Message: OK

{
"_id": "5e99d75cfcef0314e06b64b8",
"deleted": false,
"allPromosApplied": [],
"cartId": 355,
"items": [
{
"price": {
"discount": {
"promosApplied": [],
"price": 0
},
"validate": true,
"sale": 0,
"base": 260,
"currency": "USD"
},
"group": [
"5ddd1a156c5a5fed1e0d91fb"
],
"createdAt": "2020-04-17T01:02:12.054Z",
"updatedAt": "2020-04-17T16:32:40.241Z",
"_id": "5e99d75cfcef0314e06b64b9",
"itemId": 1000000012,
"quantity": 15,
"sku": "1554369",
"taxCode": "PH060771",
"lineItemId": 1,
"totalPrice": {
"currency": "USD",
"amount": 3900
},
"id": "5e99d75cfcef0314e06b64b9"
},
{
"price": {
"discount": {
"promosApplied": [],
"price": 0
},
"validate": true,
"sale": 0,
"base": 380,
"currency": "USD"
},
"group": [
"5ddd1a156c5a5fed1e0d91fb"
],
"createdAt": "2020-04-17T01:02:12.054Z",
"updatedAt": "2020-04-17T16:32:40.271Z",
"_id": "5e99d75cfcef0314e06b64ba",
"itemId": 1000000014,
"quantity": 15,
"sku": "1539213",
"taxCode": "PH060771",
"lineItemId": 2,
"totalPrice": {
"currency": "USD",
"amount": 5700
},
"id": "5e99d75cfcef0314e06b64ba"
},
{
"price": {
"discount": {
"promosApplied": [],
"price": 0
},
"validate": true,
"sale": 0,
"base": 260,
"currency": "USD"
},
"group": [
"5ddd1a156c5a5fed1e0d91fb"
],
"createdAt": "2020-04-17T01:02:12.054Z",
"updatedAt": "2020-04-17T16:32:40.291Z",
"_id": "5e99d6e2fcef0314e06b64b2",
"itemId": 1000000012,
"quantity": 2,
"sku": "1554369",
"taxCode": "PH060771",
"lineItemId": 3,
"totalPrice": {
"currency": "USD",
"amount": 520
},
"id": "5e99d6e2fcef0314e06b64b2"
},
{
"price": {
"discount": {
"promosApplied": [],
"price": 0
},
"validate": true,
"sale": 0,
"base": 380,
"currency": "USD"
},
"group": [
"5ddd1a156c5a5fed1e0d91fb"
],
"createdAt": "2020-04-17T01:02:12.054Z",
"updatedAt": "2020-04-17T16:32:40.309Z",
"_id": "5e99d6e2fcef0314e06b64b3",
"itemId": 1000000014,
"quantity": 2,
"sku": "1539213",
"taxCode": "PH060771",
"lineItemId": 4,
"totalPrice": {
"currency": "USD",
"amount": 760
},
"id": "5e99d6e2fcef0314e06b64b3"
}
],
"userId": "5e97947d3cb8553c0e43d87f",
"createdAt": "2020-04-17T16:20:44.093Z",
"updatedAt": "2020-04-17T16:32:40.312Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 10880
},
"quantity": 34,
"errors": {
"inventory": [],
"price": []
}
}

‚Äč

Changelog

  • April-2021 last updated

  • July-2020 First updated