XPM

Cart - Delete Cart by ID

Path:

PATCH /cart/{cartId}/orderNumber

This endpoint is automatially 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

Content-Type :application/json

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: path

Name: cartId

Required: true

Type: body

Name: orderNumber

Required: true

Sample Request

Path:

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

Body:

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

Response

Response Code: 200

Message: OK

Description: You will see this message when the cart is successfully deleted.

Sample

{
"_id": "5e990107fcef0314e06b64aa",
"deleted": true,
"allPromosApplied": [],
"cartId": 353,
"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-17T01:06:15.349Z",
"_id": "5e990107fcef0314e06b64ab",
"itemId": 1000000012,
"quantity": 2,
"sku": "1554369",
"taxCode": "PH060771",
"lineItemId": 1,
"totalPrice": {
"currency": "USD",
"amount": 520
},
"id": "5e990107fcef0314e06b64ab"
},
{
"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-17T01:06:15.368Z",
"_id": "5e990107fcef0314e06b64ac",
"itemId": 1000000014,
"quantity": 2,
"sku": "1539213",
"taxCode": "PH060771",
"lineItemId": 2,
"totalPrice": {
"currency": "USD",
"amount": 760
},
"id": "5e990107fcef0314e06b64ac"
}
],
"createdAt": "2020-04-17T01:06:15.316Z",
"updatedAt": "2020-04-17T01:06:24.817Z",
"__v": 0,
"orderNumber": "1234-1234-12345",
"totalAmount": {
"currency": "USD",
"amount": 1280
},
"quantity": 4
}

Changelog

  • July-2020 last updated