---
title: Validates cart and returns information related to cart totals, validation messages.
slug: cms-12/api/gdch-validates-cart-and-returns-information-related-to-cart-totals-validation-messages
docTags: 
createdAt: 2026-08-28T13:16:06.833Z
---

{
  "id": "7iK5iYN2_mTyPc3SIfhmq",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/episerver/v3.0/me/carts/{cartName}/{marketId}/preparecheckout",
    "servers": [],
    "name": "Validates cart and returns information related to cart totals, validation messages.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "cartName",
          "type": "string",
          "description": "The cart name."
        },
        {
          "kind": "required",
          "name": "marketId",
          "type": "string",
          "description": "The market id."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/problem+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Represents the response data for cart operations.",
            "customType": "checkout",
            "schema": [
              {
                "name": "cart",
                "kind": "optional",
                "type": "object",
                "description": "Represents a cart.",
                "modelRef": "#/components/schemas/cart",
                "customType": "cart",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "The cart id.",
                    "format": "int32"
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "The cart name."
                  },
                  {
                    "name": "customerId",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "nullable": true,
                    "description": "The customer the cart belongs to.",
                    "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",
                    "nullable": true,
                    "description": "The shipments.",
                    "modelRef": "#/components/schemas/shipment",
                    "customType": "shipment[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "The shipping id.",
                        "format": "int32"
                      },
                      {
                        "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/address",
                        "customType": "address",
                        "schema": [
                          {
                            "name": "firstName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The first name."
                          },
                          {
                            "name": "lastName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The last name."
                          },
                          {
                            "name": "line1",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The line1."
                          },
                          {
                            "name": "line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The line2."
                          },
                          {
                            "name": "city",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The city."
                          },
                          {
                            "name": "countryName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The country name."
                          },
                          {
                            "name": "countryCode",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The country code."
                          },
                          {
                            "name": "postalCode",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The postal code"
                          },
                          {
                            "name": "regionName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The region name/state</p>"
                          },
                          {
                            "name": "email",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The email."
                          },
                          {
                            "name": "phoneNumber",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The phone number."
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The name."
                          }
                        ]
                      },
                      {
                        "name": "shippingMethodId",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "The shipping method id.",
                        "format": "uuid"
                      },
                      {
                        "name": "lineItems",
                        "kind": "optional",
                        "type": "array",
                        "nullable": true,
                        "description": "the line items that belong to the cart.",
                        "modelRef": "#/components/schemas/lineItem",
                        "customType": "lineItem[]",
                        "schema": [
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "integer<int32>",
                            "description": "The line item id.",
                            "format": "int32"
                          },
                          {
                            "name": "contentId",
                            "kind": "optional",
                            "type": "string<uuid>",
                            "description": "The content id.",
                            "format": "uuid"
                          },
                          {
                            "name": "code",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "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",
                            "nullable": true,
                            "description": "The display name."
                          },
                          {
                            "name": "isGift",
                            "kind": "optional",
                            "type": "boolean",
                            "description": "Indicates whether the line item is a gift item."
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "payments",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "The payments.",
                    "modelRef": "#/components/schemas/payment",
                    "customType": "payment[]",
                    "schema": [
                      {
                        "name": "amount",
                        "kind": "optional",
                        "type": "number<decimal>",
                        "description": "Gets or sets the amount.",
                        "format": "decimal"
                      },
                      {
                        "name": "authorizationCode",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the authorization code."
                      },
                      {
                        "name": "billingAddress",
                        "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/address",
                        "customType": "address",
                        "schema": [
                          {
                            "name": "firstName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The first name."
                          },
                          {
                            "name": "lastName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The last name."
                          },
                          {
                            "name": "line1",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The line1."
                          },
                          {
                            "name": "line2",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The line2."
                          },
                          {
                            "name": "city",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The city."
                          },
                          {
                            "name": "countryName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The country name."
                          },
                          {
                            "name": "countryCode",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The country code."
                          },
                          {
                            "name": "postalCode",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The postal code"
                          },
                          {
                            "name": "regionName",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "<p>The region name/state</p>"
                          },
                          {
                            "name": "email",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The email."
                          },
                          {
                            "name": "phoneNumber",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The phone number."
                          },
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The name."
                          }
                        ]
                      },
                      {
                        "name": "savedBillingAddressName",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the billing address."
                      },
                      {
                        "name": "customerName",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the name of the customer."
                      },
                      {
                        "name": "paymentId",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "Gets the payment identifier.",
                        "format": "int32"
                      },
                      {
                        "name": "systemKeyword",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the name of the payment method."
                      },
                      {
                        "name": "paymentType",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the type of the payment."
                      },
                      {
                        "name": "providerTransactionID",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the provider transaction identifier."
                      },
                      {
                        "name": "status",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the status."
                      },
                      {
                        "name": "transactionID",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the transaction identifier."
                      },
                      {
                        "name": "transactionType",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the type of the transaction."
                      },
                      {
                        "name": "validationCode",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": "Gets or sets the validation code."
                      },
                      {
                        "name": "extendedProperties",
                        "kind": "optional",
                        "type": "array",
                        "nullable": true,
                        "description": "Custom properties added by partner or customer.",
                        "modelRef": "#/components/schemas/extendedProperty",
                        "customType": "extendedProperty[]",
                        "schema": [
                          {
                            "name": "name",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "Name of the property"
                          },
                          {
                            "name": "value",
                            "kind": "optional",
                            "type": "string",
                            "nullable": true,
                            "description": "The property value."
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "couponCodes",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "The coupon codes.",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ]
              },
              {
                "name": "totals",
                "kind": "optional",
                "type": "object",
                "description": "Represents cart totals.",
                "modelRef": "#/components/schemas/totals",
                "customType": "totals",
                "schema": [
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The total.",
                    "format": "decimal"
                  },
                  {
                    "name": "subTotal",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The subtotal.",
                    "format": "decimal"
                  },
                  {
                    "name": "shippingTotal",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The shipping total.",
                    "format": "decimal"
                  },
                  {
                    "name": "handlingTotal",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The handling total.",
                    "format": "decimal"
                  },
                  {
                    "name": "taxTotal",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The tax total.",
                    "format": "decimal"
                  },
                  {
                    "name": "discountTotal",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The order form discount total.",
                    "format": "decimal"
                  },
                  {
                    "name": "shippingTotals",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "The shipping totals.",
                    "modelRef": "#/components/schemas/shippingTotals",
                    "customType": "shippingTotals[]",
                    "schema": [
                      {
                        "name": "shipmentId",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "The shipping id.",
                        "format": "int32"
                      },
                      {
                        "name": "shippingCost",
                        "kind": "optional",
                        "type": "number<decimal>",
                        "description": "The shipping cost.",
                        "format": "decimal"
                      },
                      {
                        "name": "shippingTax",
                        "kind": "optional",
                        "type": "number<decimal>",
                        "description": "The shipping tax.",
                        "format": "decimal"
                      },
                      {
                        "name": "itemsTotal",
                        "kind": "optional",
                        "type": "number<decimal>",
                        "description": "The extended price total for the line items in the shipment.",
                        "format": "decimal"
                      },
                      {
                        "name": "lineItemPrices",
                        "kind": "optional",
                        "type": "array",
                        "nullable": true,
                        "description": "The line item prices.",
                        "modelRef": "#/components/schemas/lineItemPrices",
                        "customType": "lineItemPrices[]",
                        "schema": [
                          {
                            "name": "lineItemId",
                            "kind": "optional",
                            "type": "integer<int32>",
                            "description": "The line item id.",
                            "format": "int32"
                          },
                          {
                            "name": "extendedPrice",
                            "kind": "optional",
                            "type": "number<decimal>",
                            "description": "The extended price.",
                            "format": "decimal"
                          },
                          {
                            "name": "discountedPrice",
                            "kind": "optional",
                            "type": "number<decimal>",
                            "description": "The discounted price.",
                            "format": "decimal"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "name": "availableShippingMethods",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "The available shipping methods per shipment.",
                "modelRef": "#/components/schemas/shippingMethod",
                "customType": "shippingMethod[]",
                "schema": [
                  {
                    "name": "shipmentId",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "The shipping id.",
                    "format": "int32"
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "The id.",
                    "format": "uuid"
                  },
                  {
                    "name": "displayName",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The display name."
                  },
                  {
                    "name": "price",
                    "kind": "optional",
                    "type": "number<decimal>",
                    "description": "The price.",
                    "format": "decimal"
                  }
                ]
              },
              {
                "name": "validationIssues",
                "kind": "optional",
                "type": "array",
                "nullable": true,
                "description": "The validation issues per line item.",
                "modelRef": "#/components/schemas/lineItemValidation",
                "customType": "lineItemValidation[]",
                "schema": [
                  {
                    "name": "contentId",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "The content id.",
                    "format": "uuid"
                  },
                  {
                    "name": "code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "The sku code."
                  },
                  {
                    "name": "validationIssues",
                    "kind": "optional",
                    "type": "array",
                    "nullable": true,
                    "description": "The validation issues.",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/checkout",
            "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": "VMCK6Qf-oYVkpzPqBPRQi",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /api/episerver/v3.0/me/carts/{cartName}/{marketId}/preparecheckout \\\n     --header 'accept: application/json'"
        },
        {
          "id": "bctAan5-ym7BL1raMhd3x",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/api/episerver/v3.0/me/carts/{cartName}/{marketId}/preparecheckout\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "1L6KR33_N0tGOsD2-fcYf",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/episerver/v3.0/me/carts/{cartName}/{marketId}/preparecheckout\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "g9rEAjlaw9zLE9h2FxiK5",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/episerver/v3.0/me/carts/{cartName}/{marketId}/preparecheckout\"\n\npayload = {}\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": "VMCK6Qf-oYVkpzPqBPRQi"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"cart\": {\n    \"id\": \"\",\n    \"name\": \"\",\n    \"customerId\": \"\",\n    \"market\": \"\",\n    \"currency\": \"\",\n    \"lastUpdated\": \"\",\n    \"shipments\": [\n      {\n        \"id\": \"\",\n        \"shippingAddress\": {\n          \"firstName\": \"\",\n          \"lastName\": \"\",\n          \"line1\": \"\",\n          \"line2\": \"\",\n          \"city\": \"\",\n          \"countryName\": \"\",\n          \"countryCode\": \"\",\n          \"postalCode\": \"\",\n          \"regionName\": \"\",\n          \"email\": \"\",\n          \"phoneNumber\": \"\",\n          \"name\": \"\"\n        },\n        \"shippingMethodId\": \"\",\n        \"lineItems\": [\n          {\n            \"id\": \"\",\n            \"contentId\": \"\",\n            \"code\": \"\",\n            \"placedPrice\": \"\",\n            \"quantity\": \"\",\n            \"displayName\": \"\",\n            \"isGift\": false\n          }\n        ]\n      }\n    ],\n    \"payments\": [\n      {\n        \"amount\": \"\",\n        \"authorizationCode\": \"\",\n        \"billingAddress\": {\n          \"firstName\": \"\",\n          \"lastName\": \"\",\n          \"line1\": \"\",\n          \"line2\": \"\",\n          \"city\": \"\",\n          \"countryName\": \"\",\n          \"countryCode\": \"\",\n          \"postalCode\": \"\",\n          \"regionName\": \"\",\n          \"email\": \"\",\n          \"phoneNumber\": \"\",\n          \"name\": \"\"\n        },\n        \"savedBillingAddressName\": \"\",\n        \"customerName\": \"\",\n        \"paymentId\": \"\",\n        \"systemKeyword\": \"\",\n        \"paymentType\": \"\",\n        \"providerTransactionID\": \"\",\n        \"status\": \"\",\n        \"transactionID\": \"\",\n        \"transactionType\": \"\",\n        \"validationCode\": \"\",\n        \"extendedProperties\": [\n          {\n            \"name\": \"\",\n            \"value\": \"\"\n          }\n        ]\n      }\n    ],\n    \"couponCodes\": [\n      \"\"\n    ]\n  },\n  \"totals\": {\n    \"total\": \"\",\n    \"subTotal\": \"\",\n    \"shippingTotal\": \"\",\n    \"handlingTotal\": \"\",\n    \"taxTotal\": \"\",\n    \"discountTotal\": \"\",\n    \"shippingTotals\": [\n      {\n        \"shipmentId\": \"\",\n        \"shippingCost\": \"\",\n        \"shippingTax\": \"\",\n        \"itemsTotal\": \"\",\n        \"lineItemPrices\": [\n          {\n            \"lineItemId\": \"\",\n            \"extendedPrice\": \"\",\n            \"discountedPrice\": \"\"\n          }\n        ]\n      }\n    ]\n  },\n  \"availableShippingMethods\": [\n    {\n      \"shipmentId\": \"\",\n      \"id\": \"\",\n      \"displayName\": \"\",\n      \"price\": \"\"\n    }\n  ],\n  \"validationIssues\": [\n    {\n      \"contentId\": \"\",\n      \"code\": \"\",\n      \"validationIssues\": [\n        \"\"\n      ]\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": ""
    }
  ]
}