---
title: Creates new cart as per provided model.
slug: cms-12/api/yqkq-creates-new-cart-as-per-provided-model
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "UXmrYbLZa4vHwMeF18XWL",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://localhost:65349//api/episerver/v2.0/carts",
    "servers": [
      {
        "url": "http://localhost:65349//api/episerver/v2.0/carts"
      }
    ],
    "name": "Creates new cart as per provided model.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "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": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The cart model.",
          "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
        }
      ],
      "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
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "b7lHt9_2zRHyFn8nKOpoe",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url http://localhost:65349//api/episerver/v2.0/carts \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"Name\": \"\",\n     \"Market\": \"\",\n     \"Currency\": \"\",\n     \"Shipments\": [\n     {\n     \"LineItems\": [\n     {\n     \"Quantity\": \"\"\n     }\n     ]\n     }\n     ]\n     }'"
        },
        {
          "id": "Apfv_Ot-A0r5K2ARdALtS",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"Name\": \"\",\n   \"Market\": \"\",\n   \"Currency\": \"\",\n   \"Shipments\": [\n      {\n         \"LineItems\": [\n            {\n               \"Quantity\": \"\"\n            }\n         ]\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://localhost:65349//api/episerver/v2.0/carts\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nQlOnHFnmnERae1sqnAH-",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:65349//api/episerver/v2.0/carts\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"Name\": \"\",\n   \"Market\": \"\",\n   \"Currency\": \"\",\n   \"Shipments\": [\n      {\n         \"LineItems\": [\n            {\n               \"Quantity\": \"\"\n            }\n         ]\n      }\n   ]\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "a_3H_2aNN6D7cefIJ1Sg0",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:65349//api/episerver/v2.0/carts\"\n\npayload = json.dumps({\n   \"Name\": \"\",\n   \"Market\": \"\",\n   \"Currency\": \"\",\n   \"Shipments\": [\n      {\n         \"LineItems\": [\n            {\n               \"Quantity\": \"\"\n            }\n         ]\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "b7lHt9_2zRHyFn8nKOpoe"
    },
    "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"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}