---
title: Gets a cart.
slug: cms-12/api/WbNs-gets-a-cart
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "w0BA1XHvt49_ZCij-fmKA",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "http://localhost:65349//api/episerver/v2.0/carts/{cartId}",
    "servers": [
      {
        "url": "http://localhost:65349//api/episerver/v2.0/carts/{cartId}"
      }
    ],
    "name": "Gets a cart.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "cartId",
          "type": "string<uuid>",
          "description": "The cart id.",
          "format": "uuid"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "text/json",
            "application/xml",
            "text/xml"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Represents a cart.",
            "customType": "CartApiModel",
            "schema": [
              {
                "name": "Id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "The cart id.",
                "example": "00000000-0000-0000-0000-000000000000",
                "format": "uuid"
              },
              {
                "name": "Name",
                "kind": "required",
                "type": "string",
                "description": "The cart name."
              },
              {
                "name": "CustomerId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "The customer the cart belongs to.",
                "example": "00000000-0000-0000-0000-000000000000",
                "format": "uuid"
              },
              {
                "name": "Market",
                "kind": "required",
                "type": "string",
                "description": "The market in which the cart is valid."
              },
              {
                "name": "Currency",
                "kind": "required",
                "type": "string",
                "description": "The currency of the market in which the cart is valid."
              },
              {
                "name": "LastUpdated",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "The last updated timestamp.",
                "format": "date-time"
              },
              {
                "name": "Shipments",
                "kind": "optional",
                "type": "array",
                "description": "The shipments.",
                "modelRef": "#/components/schemas/ShipmentModel",
                "customType": "ShipmentModel[]",
                "schema": [
                  {
                    "name": "Id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "The shipping id.",
                    "example": "00000000-0000-0000-0000-000000000000",
                    "format": "uuid"
                  },
                  {
                    "name": "ShippingAddress",
                    "kind": "optional",
                    "type": "object",
                    "description": "<p>Represents a customer address\r\ntodo: associate with commerce customers via business foundation?\r\ntodo: add more properties.</p>",
                    "modelRef": "#/components/schemas/AddressModel",
                    "customType": "AddressModel",
                    "schema": [
                      {
                        "name": "FirstName",
                        "kind": "optional",
                        "type": "string",
                        "description": "The first name."
                      },
                      {
                        "name": "LastName",
                        "kind": "optional",
                        "type": "string",
                        "description": "The last name."
                      },
                      {
                        "name": "Line1",
                        "kind": "optional",
                        "type": "string",
                        "description": "The line1."
                      },
                      {
                        "name": "Line2",
                        "kind": "optional",
                        "type": "string",
                        "description": "The line2."
                      },
                      {
                        "name": "City",
                        "kind": "optional",
                        "type": "string",
                        "description": "The city."
                      },
                      {
                        "name": "CountryName",
                        "kind": "optional",
                        "type": "string",
                        "description": "The country name."
                      },
                      {
                        "name": "PostalCode",
                        "kind": "optional",
                        "type": "string",
                        "description": "The postal code"
                      },
                      {
                        "name": "RegionName",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The region name/state</p>"
                      },
                      {
                        "name": "Email",
                        "kind": "optional",
                        "type": "string",
                        "description": "The email."
                      },
                      {
                        "name": "PhoneNumber",
                        "kind": "optional",
                        "type": "string",
                        "description": "The phone number."
                      }
                    ]
                  },
                  {
                    "name": "ShippingMethodId",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "The shipping method id.",
                    "example": "00000000-0000-0000-0000-000000000000",
                    "format": "uuid"
                  },
                  {
                    "name": "LineItems",
                    "kind": "optional",
                    "type": "array",
                    "description": "the line items that belong to the cart.",
                    "modelRef": "#/components/schemas/LineItemModel",
                    "customType": "LineItemModel[]",
                    "schema": [
                      {
                        "name": "Id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "The line item id.",
                        "example": "00000000-0000-0000-0000-000000000000",
                        "format": "uuid"
                      },
                      {
                        "name": "ContentId",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "The content id.",
                        "example": "00000000-0000-0000-0000-000000000000",
                        "format": "uuid"
                      },
                      {
                        "name": "Code",
                        "kind": "optional",
                        "type": "string",
                        "description": "The sku code."
                      },
                      {
                        "name": "PlacedPrice",
                        "kind": "optional",
                        "type": "number<decimal>",
                        "description": "The placed price.",
                        "format": "decimal"
                      },
                      {
                        "name": "Quantity",
                        "kind": "required",
                        "type": "number<decimal>",
                        "description": "The quantity.",
                        "format": "decimal"
                      },
                      {
                        "name": "DisplayName",
                        "kind": "optional",
                        "type": "string",
                        "description": "The display name."
                      },
                      {
                        "name": "IsGift",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "Indicates whether the line item is a gift item."
                      }
                    ]
                  }
                ]
              },
              {
                "name": "CouponCodes",
                "kind": "optional",
                "type": "array",
                "description": "The coupon codes.",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/CartApiModel",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Forbidden",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "WyTbuCbaE22A64SMlsyVL",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url http://localhost:65349//api/episerver/v2.0/carts/{cartId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "NP4mIqwj3slocMLo0B2ll",
          "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: 'GET',\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": "des6CaVen5vuU8cVwBQKD",
          "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::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "RUJZSQ-_i-6NUd8_bwg-l",
          "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(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "WyTbuCbaE22A64SMlsyVL"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"Id\": \"00000000-0000-0000-0000-000000000000\",\n  \"Name\": \"\",\n  \"CustomerId\": \"00000000-0000-0000-0000-000000000000\",\n  \"Market\": \"\",\n  \"Currency\": \"\",\n  \"LastUpdated\": \"\",\n  \"Shipments\": [\n    {\n      \"Id\": \"00000000-0000-0000-0000-000000000000\",\n      \"ShippingAddress\": {\n        \"FirstName\": \"\",\n        \"LastName\": \"\",\n        \"Line1\": \"\",\n        \"Line2\": \"\",\n        \"City\": \"\",\n        \"CountryName\": \"\",\n        \"PostalCode\": \"\",\n        \"RegionName\": \"\",\n        \"Email\": \"\",\n        \"PhoneNumber\": \"\"\n      },\n      \"ShippingMethodId\": \"00000000-0000-0000-0000-000000000000\",\n      \"LineItems\": [\n        {\n          \"Id\": \"00000000-0000-0000-0000-000000000000\",\n          \"ContentId\": \"00000000-0000-0000-0000-000000000000\",\n          \"Code\": \"\",\n          \"PlacedPrice\": \"\",\n          \"Quantity\": \"\",\n          \"DisplayName\": \"\",\n          \"IsGift\": false\n        }\n      ]\n    }\n  ],\n  \"CouponCodes\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\n"
        },
        {
          "id": "response-2-403",
          "language": "403",
          "code": "// Forbidden\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Not Found\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}