XM

Remove Promo

Path:

PATCH https://{baseurl}/api-cart/cart/remove-promo

Removing a promotional code is as easy as it is adding them. This API facilitates removal of promotional code, at any stage before the billing is completed.

Headers

Content-Type : application/json

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

Parameters

Type : requestBody

Name : The 24 character system-generated cart ID (from the Add Items to Cart or Retrieve Cart by Authorization Token API) and the promo ID.

Required: true

Sample Request

Path:

PATCH https://{baseurl}/api-cart/cart/remove-promo

Request Body:

‚Äč
{
"cartId": "607f8a8f0118960009a8e6ee",
"promoId": "605b821da953e9000759f735"
}

Response

Success Code: 200

Message: OK

Description: You'll see this message when the promo is successfully applied.

{
"_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-21T18:47:46.423Z",
"_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": [],
"id": "607f8a8f0118960009a8e6ef"
},
{
"price": {
"discount": {
"discountAmount": 0,
"price": 0,
"promosApplied": []
},
"sale": 48,
"base": 148,
"currency": "USD"
},
"sample": false,
"discountedQuantity": 0,
"group": [
"123123123123123213212222"
],
"weightUnit": "lb",
"isPickup": false,
"createdAt": "2021-04-21T02:14:38.620Z",
"updatedAt": "2021-04-21T18:47:46.424Z",
"_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": 96
},
"attributes": [],
"id": "607f8a8f0118960009a8e6f0"
}
],
"userId": "600a56593245200007982fac",
"allPromosApplied": [],
"attributes": [],
"createdAt": "2021-04-21T02:14:39.048Z",
"updatedAt": "2021-04-21T18:47:46.463Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 3696
},
"quantity": 6,
"errors": {
"inventory": [],
"price": [],
"promo": []
}
}

Error Code: 404

Message: Not found

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

{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}

Error Code: 400

Message: Request validation

Description: You will see this error when the specified cart ID is lesser or greater than 24 characters.

{
"code": "REQUEST_VALIDATION",
"message": "Invalid data in path: /cartId should NOT be shorter than 24 characters"
}

Error Code: 400

Message: Bad Request

Description: You will see this error when the promo doesn't exist in the system.

{
"code": "PROMO_NOT_FOUND",
"message": "605b821da953e9000759f735 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).

Change Log

  • June - 2021

  • July - 2020 First updated