XM

Remove Promo

Path:

PATCH /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

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: cartId and promoId

Required: true

Sample Request

{
"cartId": "5ebb73b5684a750007fb121a",
"promoId": "5eabcc2a26d7dc0008fc1262"
}

Response

Response Code: 200

Message: OK

{
"_id": "5ebb73b5684a750007fb121a",
"deleted": false,
"isLoggedIn": false,
"cartId": 78,
"items": [
{
"price": {
"discount": {
"price": 0,
"promosApplied": []
},
"sale": 0,
"base": 400,
"currency": "USD"
},
"discountedQuantity": 0,
"group": [
"5ddd1a156c5a5fed1e0d91fb"
],
"createdAt": "2020-05-13T04:12:36.802Z",
"updatedAt": "2020-05-13T04:13:51.203Z",
"_id": "5ebb73b5684a750007fb121b",
"itemId": 1000000016,
"quantity": 2,
"sku": "1586729",
"taxCode": "PH060771",
"lineItemId": 1,
"totalPrice": {
"currency": "USD",
"amount": 800
},
"id": "5ebb73b5684a750007fb121b"
}
],
"allPromosApplied": [],
"createdAt": "2020-05-13T04:12:37.389Z",
"updatedAt": "2020-05-13T04:13:51.228Z",
"__v": 0,
"totalAmount": {
"currency": "USD",
"amount": 800
},
"quantity": 2,
"errors": {
"inventory": [],
"price": [],
"promo": []
}
}

Response Code: 400

Message: Bad Request

Description: You will see this error when the promotional code is not found.

Sample

{
"code": "PROMO_NOT_FOUND",
"message": "5eb3a24483dbc50007fe5b73 not found."
}

Response Code: 404

Message: Promo not found

Changelog

  • April-2021 last updated

  • July-2020 First updated