{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/checkoutCart",
  "title": "checkoutCart",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Cart ID, provided after creating a cart with a POST.",
      "format": "uuid"
    },
    "customer_id": {
      "type": "integer",
      "description": "ID of the customer to which the cart belongs.",
      "format": "int32"
    },
    "email": {
      "type": "string",
      "description": "The cart\u02bcs email. This is the same email that is used in the billing address."
    },
    "currency": {
      "title": "Currency",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The currency name."
        },
        "code": {
          "type": "string",
          "description": "ISO-4217 currency code. (See: http://en.wikipedia.org/wiki/ISO_4217.)"
        },
        "symbol": {
          "type": "string",
          "description": "The currency symbol."
        },
        "decimalPlaces": {
          "type": "number",
          "description": "The number of decimal places for the currency. For example, the USD currency has two decimal places.",
          "format": "double"
        }
      },
      "description": "The currency in which prices are displayed; the store default currency."
    },
    "isTaxIncluded": {
      "type": "boolean",
      "description": "Boolean representing whether tax information is included."
    },
    "baseAmount": {
      "type": "number",
      "description": "Cost of cart\u2019s contents, before applying discounts.",
      "format": "double"
    },
    "discountAmount": {
      "type": "number",
      "description": "Discounted amount.",
      "format": "double"
    },
    "cartAmount": {
      "type": "number",
      "description": "Sum of line-items amounts, minus cart-level discounts and coupons. This amount includes taxes, where applicable.",
      "format": "double"
    },
    "coupons": {
      "type": "array",
      "description": "",
      "items": {
        "$ref": "#/components/schemas/CartCoupon"
      }
    },
    "discounts": {
      "type": "array",
      "description": "",
      "items": {
        "title": "Applied Discount",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name provided by the merchant."
          },
          "discountedAmount": {
            "type": "number",
            "description": "The discounted amount applied within a given context.",
            "format": "double"
          }
        }
      }
    },
    "lineItems": {
      "type": "object",
      "description": "",
      "items": {
        "title": "Line Item",
        "required": [
          "digitalItems",
          "physicalItems"
        ],
        "type": "object",
        "properties": {
          "physicalItems": {
            "type": "array",
            "description": "",
            "items": {
              "title": "Item Physical",
              "required": [
                "quantity"
              ],
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The line-item ID."
                },
                "parentId": {
                  "type": "string",
                  "description": "The product is part of a bundle such as a product pick list, then the parentId or the main product ID will populate."
                },
                "variantId": {
                  "type": "integer",
                  "description": "ID of the variant."
                },
                "productId": {
                  "type": "integer",
                  "description": "ID of the product."
                },
                "sku": {
                  "type": "string",
                  "description": "SKU of the variant."
                },
                "name": {
                  "type": "string",
                  "description": "The item\u02bcs product name."
                },
                "url": {
                  "type": "string",
                  "description": "The product URL."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity of this item.",
                  "format": "double"
                },
                "isTaxable": {
                  "type": "boolean",
                  "description": "Whether the item is taxable."
                },
                "imageUrl": {
                  "type": "string",
                  "description": "A publicly-accessible URL for an image of this item."
                },
                "discounts": {
                  "type": "array",
                  "description": "A list of discounts applied to this item, as an array of AppliedDiscount objects.",
                  "items": {
                    "title": "Applied Discount",
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name provided by the merchant."
                      },
                      "discountedAmount": {
                        "type": "number",
                        "description": "The discounted amount applied within a given context.",
                        "format": "double"
                      }
                    }
                  }
                },
                "discountAmount": {
                  "type": "number",
                  "description": "The total value of all discounts applied to this item (excluding coupon).",
                  "format": "double"
                },
                "couponAmount": {
                  "type": "number",
                  "description": "The total value of all coupons applied to this item.",
                  "format": "double"
                },
                "listPrice": {
                  "type": "number",
                  "description": "The item\u2019s list price, as quoted by the manufacturer or distributor.",
                  "format": "double"
                },
                "salePrice": {
                  "type": "number",
                  "description": "The item\u02bcs price after all discounts are applied. The final price before tax calculation.",
                  "format": "double"
                },
                "extendedListPrice": {
                  "type": "number",
                  "description": "The item\u02bcs list price multiplied by the quantity.",
                  "format": "double"
                },
                "extendedSalePrice": {
                  "type": "number",
                  "description": "The item\u02bcs sale price multiplied by the quantity.",
                  "format": "double"
                },
                "comparisonPrice": {
                  "type": "number",
                  "description": "The item\u02bcs comparison price"
                },
                "extendedComparisonPrice": {
                  "type": "number",
                  "description": "The item\u02bcs comparison price multiplied by the quantity."
                },
                "type": {
                  "type": "string",
                  "description": "the product type - physical or digital"
                },
                "addedByPromotion": {
                  "type": "boolean",
                  "description": "If the item was added automatically by a promotion, such as a coupon or buy one, get one."
                },
                "isShippingRequired": {
                  "type": "boolean",
                  "description": "Whether this item requires shipping to a physical address."
                },
                "isMutable": {
                  "type": "boolean",
                  "description": ""
                },
                "giftWrapping": {
                  "title": "Gift Wrapping",
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": ""
                    },
                    "message": {
                      "type": "string",
                      "description": ""
                    },
                    "amount": {
                      "type": "number",
                      "description": "",
                      "format": "double"
                    }
                  }
                }
              }
            }
          },
          "digitalItems": {
            "type": "array",
            "description": "",
            "items": {
              "title": "Item Digital",
              "required": [
                "quantity"
              ],
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The line-item ID."
                },
                "parentId": {
                  "type": "string",
                  "description": "Bundled items will have their parent\u02bcs item ID."
                },
                "variantId": {
                  "type": "number",
                  "description": "ID of the variant.",
                  "format": "double"
                },
                "productId": {
                  "type": "number",
                  "description": "ID of the product.",
                  "format": "double"
                },
                "sku": {
                  "type": "string",
                  "description": "SKU of the variant."
                },
                "name": {
                  "type": "string",
                  "description": "The item\u02bcs product name."
                },
                "url": {
                  "type": "string",
                  "description": "The product URL."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity of this item.",
                  "format": "double"
                },
                "isTaxable": {
                  "type": "boolean",
                  "description": "Whether the item is taxable."
                },
                "imageUrl": {
                  "type": "string",
                  "description": "A publicly-accessible URL for an image of this item."
                },
                "discounts": {
                  "type": "array",
                  "description": "A list of discounts applied to this item, as an array of AppliedDiscount objects.",
                  "items": {
                    "title": "Applied Discount",
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name provided by the merchant."
                      },
                      "discountedAmount": {
                        "type": "number",
                        "description": "The discounted amount applied within a given context.",
                        "format": "double"
                      }
                    }
                  }
                },
                "discountAmount": {
                  "type": "number",
                  "description": "The total value of all discounts applied to this item (excluding coupon).",
                  "format": "double"
                },
                "couponAmount": {
                  "type": "number",
                  "description": "The total value of all coupons applied to this item.",
                  "format": "double"
                },
                "listPrice": {
                  "type": "number",
                  "description": "The item\u2019s list price, as quoted by the manufacturer or distributor.",
                  "format": "double"
                },
                "salePrice": {
                  "type": "number",
                  "description": "The item\u02bcs price after all discounts are applied. The final price before tax calculation.",
                  "format": "double"
                },
                "extendedListPrice": {
                  "type": "number",
                  "description": "The item\u02bcs list price multiplied by the quantity.",
                  "format": "double"
                },
                "extendedSalePrice": {
                  "type": "number",
                  "description": "The item\u02bcs sale price multiplied by the quantity.",
                  "format": "double"
                },
                "type": {
                  "type": "string",
                  "description": "The product type - physical or digital."
                },
                "isShippingRequired": {
                  "type": "boolean",
                  "description": "Whether this item requires shipping to a physical address."
                },
                "downloadFileUrls": {
                  "type": "array",
                  "description": "URLs to download all product files.",
                  "items": {
                    "type": "string"
                  }
                },
                "downloadPageUrl": {
                  "type": "string",
                  "description": "The URL for the combined downloads page."
                },
                "downloadSize": {
                  "type": "string",
                  "description": "Specifies the combined download size in human-readable style; for example, `30MB`."
                }
              }
            }
          },
          "giftCertificate": {
            "type": "array",
            "description": "",
            "items": {
              "title": "Item Gift Certificate",
              "required": [
                "amount",
                "recipient",
                "sender",
                "theme"
              ],
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Gift certificate identifier"
                },
                "name": {
                  "type": "string",
                  "description": "The name of the purchased gift certificate; for example, `$20 Gift Certificate`."
                },
                "theme": {
                  "type": "string",
                  "description": "Currently supports `Birthday`, `Boy`, `Celebration`, `Christmas`, `General`, and `Girl`."
                },
                "amount": {
                  "type": "number",
                  "description": "Value must be between $1.00 and $1,000.00.",
                  "format": "double"
                },
                "taxable": {
                  "type": "boolean",
                  "description": ""
                },
                "sender": {
                  "title": "Contact Entity",
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": ""
                    },
                    "email": {
                      "type": "string",
                      "description": ""
                    }
                  }
                },
                "recipient": {
                  "title": "Contact Entity",
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": ""
                    },
                    "email": {
                      "type": "string",
                      "description": ""
                    }
                  }
                },
                "message": {
                  "type": "string",
                  "description": "Limited to 200 characters."
                },
                "type": {
                  "type": "string",
                  "description": "Explicitly specifying the gift certificate type."
                }
              }
            }
          },
          "customItems": {
            "type": "array",
            "items": {
              "title": "Item Custom",
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "ID of the custom item."
                },
                "sku": {
                  "type": "string",
                  "description": "Custom item SKU."
                },
                "name": {
                  "type": "string",
                  "description": "Item name."
                },
                "quantity": {
                  "type": "string"
                },
                "listPrice": {
                  "type": "string",
                  "description": "Price of the item. With or without tax depending on your store setup."
                }
              },
              "description": "Add a custom item to the shoppers cart.\n* Custom items are not added to the catalog.\n* The price should be set to match the store settings for taxes."
            }
          }
        }
      }
    },
    "createdTime": {
      "type": "string",
      "description": "Time when the cart was created."
    },
    "updatedTime": {
      "type": "string",
      "description": "Time when the cart was last updated."
    }
  },
  "description": "A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.",
  "x-internal": false
}