XM

Delete Cart

Path:

PATCH https://{baseurl}/cart/{cartId}/orderNumber

This API is automatically triggered when the checkout is complete, and it deletes the existing cart. At a later point, when the user picks up an item, a new cart (with a new cartId) is created.

Headers

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

Parameters

Type : path

Name : The cartID (from the Add Items to Cart or Retrieve Cart by userAuthToken API)

Required: true

Type: requestBody

Name: The order number.

Required: true

Sample Request

Path:

https://{baseURL}/api-cart/cart/5e990107fcef0314e06b64aa/orderNumber

Body:

{
"orderNumber": "1234-1234-12345"
}

Response

Response Code: 200

Message: OK

{
"_id": "6080420ee1ae0600085fa6b1",
"deleted": true,
"registeredUser": false,
"cartId": 1489,
"items": [],
"allPromosApplied": [],
"attributes": [],
"createdAt": "2021-04-21T15:17:34.462Z",
"updatedAt": "2021-04-21T15:19:49.652Z",
"__v": 0,
"orderNumber": "1234-1234-12345",
"totalAmount": {
"currency": "",
"amount": 0
},
"quantity": 0
}

Error Code: 404

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