---
title: Deletes a cart as per given cartId
slug: cms-12/api/x0xG-deletes-a-cart-as-per-given-cartid
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "a_RgxX1J1O0DlVch0r8kA",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "http://localhost:65349//api/episerver/v2.0/carts/{cartId}",
    "servers": [
      {
        "url": "http://localhost:65349//api/episerver/v2.0/carts/{cartId}"
      }
    ],
    "name": "Deletes a cart as per given cartId",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "cartId",
          "type": "string<uuid>",
          "description": "The unique cart id.",
          "format": "uuid"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "NoContent",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "YfpbI5WzZZ413HxzKX1yp",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url http://localhost:65349//api/episerver/v2.0/carts/{cartId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "i8jGoNN6P7g2hmWmJaJPZ",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"http://localhost:65349//api/episerver/v2.0/carts/{cartId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "vf7eYgV6Iw-qZ7nb5Kuah",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:65349//api/episerver/v2.0/carts/{cartId}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "iYdZTAiy_UgOB3hrP7Oov",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:65349//api/episerver/v2.0/carts/{cartId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "YfpbI5WzZZ413HxzKX1yp"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// NoContent\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}