{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/commercetools/main/json-schema/commercetools-order-from-cart-draft-schema.json",
  "title": "OrderFromCartDraft",
  "description": "Request body for creating an order from an existing cart.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commercetools-orders-api-openapi.yml#/components/schemas/OrderFromCartDraft",
  "type": "object",
  "required": [
    "cart",
    "version"
  ],
  "properties": {
    "cart": {
      "$ref": "#/$defs/Reference"
    },
    "version": {
      "type": "integer",
      "description": "Current version of the cart being converted to an order."
    },
    "orderNumber": {
      "type": "string",
      "description": "User-defined order number for the created order."
    },
    "paymentState": {
      "type": "string",
      "enum": [
        "Paid",
        "Pending",
        "Failed",
        "CreditOwed",
        "BalanceDue"
      ],
      "description": "Initial payment state of the order."
    },
    "orderState": {
      "type": "string",
      "enum": [
        "Open",
        "Confirmed",
        "Complete",
        "Cancelled"
      ],
      "description": "Initial order state of the created order."
    }
  },
  "$defs": {
    "Reference": {
      "type": "object",
      "description": "A reference to another resource by its typeId and id.",
      "required": [
        "typeId",
        "id"
      ],
      "properties": {
        "typeId": {
          "type": "string",
          "description": "The type identifier of the referenced resource (e.g., 'product', 'category')."
        },
        "id": {
          "type": "string",
          "description": "The system-generated unique identifier of the referenced resource."
        }
      }
    }
  }
}