API reference · Custom Cart

Delete Custom Cart by ID

DELETEhttps://api.sandbox.cws.digital/customCart/deleteById/{id}

Description

Deletes a custom cart, or only some of its items.

Without a body, the whole cart is deleted, and the link stops working for the customer.

Parameters

Path parameters

FieldTypeRequiredDescriptionValue
idintegerYes

Cart id, as it came in cartId on creation.

Request body

Content-Typeapplication/json
Edit the body with
FieldTypeRequiredDescriptionValue
customKeyarray of stringNo

Keys (products[].key) of the items to remove. See Delete only some items.

Separate values with commas or line breaks.

Business rules

Delete only some items

Send in customKey the keys (products[].key) of the items to remove. Only the default cart accepts deleting part of the items.

With no item left, the whole cart is deleted.

Carts that can be deleted

Only a cart that has not become an order nor been canceled or deleted. The cart must belong to your store, or to a store you are linked to.

Responses

  • 200

    Cart or items deleted.

  • 401

    Missing, malformed or expired token.

  • 404

    The cart does not exist or is not in your scope.

Try it

Sandbox

Language

Credentials

Access token: saved in this tab and used on every endpoint.

Each token only reaches the partner's own data and that of the branches with an authorized link.

Don't have sandbox credentials yet? See how to request them

Request

cURL
curl --request DELETE \
  --url 'https://api.sandbox.cws.digital/customCart/deleteById/4470001' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customKey": [
    "proposta-item-1"
  ]
}'

Response

Click Try it to see the real response here, or pick a documented example: