XM

Empty Cart

Path:

PATCH /cart/{cartId}/empty

At any stage of before the billing, user may decide to remove all the items in the cart. This API supports emptying of the cart based on the specified cartId. In this case, the cart will continue to exist, but with 0 item in it. For deleting the cart altogether, the PATCH /cart/{cartId}/orderNumber (Delete Cart by ID) endpoint is recommended.

Headers

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

Parameters

Type : path

Name : cartId

Required: true

Sample Request

https://{baseurl}cart/5e990062fcef0314e06b649f/empty

Sample Response

Response Code: 200

Message: OK

{
"_id": "5e990062fcef0314e06b649f",
"deleted": false,
"allPromosApplied": [],
"cartId": 352,
"items": [],
"createdAt": "2020-04-17T01:03:30.815Z",
"updatedAt": "2020-04-17T01:05:28.826Z",
"__v": 0,
"totalAmount": {
"currency": "",
"amount": 0
},
"quantity": 0
}

Response Code: 404

Message: Cart 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

‚Äč