{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-create-order-request-schema.json",
  "title": "CreateOrderRequest",
  "description": "Document representing the order create request.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-orders-api-openapi.yml#/components/schemas/CreateOrderRequest",
  "additionalProperties": {
    "title": "Additional Property Support",
    "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
  },
  "required": [
    "billingAddress",
    "currency",
    "orderTotal",
    "paymentInstruments",
    "productItems",
    "shipments",
    "taxTotal"
  ],
  "properties": {
    "billingAddress": {
      "description": "The billing address. The name from the billing address is required and is used as the customer's name (for guest customer).",
      "allOf": [
        {
          "$ref": "#/$defs/Address"
        }
      ]
    },
    "businessType": {
      "description": "The business type.",
      "enum": [
        "b2c",
        "b2b"
      ],
      "type": "string"
    },
    "channelType": {
      "description": "The sales channel.",
      "enum": [
        "storefront",
        "callcenter",
        "marketplace",
        "dss",
        "store",
        "pinterest",
        "twitter",
        "facebookads",
        "subscriptions",
        "onlinereservation",
        "customerservicecenter",
        "instagramcommerce",
        "tiktok",
        "snapchat",
        "google",
        "whatsapp",
        "youtube"
      ],
      "type": "string"
    },
    "currency": {
      "$ref": "#/$defs/CurrencyCode"
    },
    "customerLocale": {
      "maxLength": 256,
      "description": "The locale of the customer who created the order.",
      "type": "string"
    },
    "orderNo": {
      "description": "The order number. This must be unique in the site and is generated if no orderNo is passed in payload.",
      "allOf": [
        {
          "$ref": "#/$defs/OrderNo"
        }
      ]
    },
    "orderPriceAdjustments": {
      "maxItems": 20,
      "description": "The order-level price adjustments.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateOrderPriceAdjustment"
      }
    },
    "orderTotal": {
      "format": "double",
      "description": "The total price, including products, shipping, and tax. If this value does not match the calculated value (sum of all grossPrices minus PriceAdjustments), an InvalidOrderTotalException is thrown.",
      "type": "number"
    },
    "paymentInstruments": {
      "maxItems": 20,
      "description": "The payment instruments list.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateOrderPaymentInstrument"
      }
    },
    "paymentStatus": {
      "description": "The payment status from the order.",
      "enum": [
        "paid",
        "not_paid"
      ],
      "type": "string"
    },
    "productItems": {
      "minItems": 1,
      "maxItems": 200,
      "description": "The product items.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateOrderProductItems"
      }
    },
    "shipments": {
      "minItems": 1,
      "maxItems": 10,
      "description": "The shipments.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CreateOrderShipment"
      }
    },
    "taxTotal": {
      "format": "double",
      "description": "The total tax amount.",
      "type": "number"
    }
  },
  "type": "object",
  "$defs": {
    "Address": {
      "description": "Document representing an order address.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "properties": {
        "address1": {
          "maxLength": 256,
          "description": "The first address line.",
          "type": "string"
        },
        "address2": {
          "maxLength": 256,
          "description": "The second address line.",
          "type": "string"
        },
        "city": {
          "maxLength": 256,
          "description": "The city.",
          "type": "string"
        },
        "companyName": {
          "maxLength": 256,
          "description": "The company name.",
          "type": "string"
        },
        "countryCode": {
          "$ref": "#/$defs/CountryCode"
        },
        "firstName": {
          "maxLength": 256,
          "description": "The first name.",
          "type": "string"
        },
        "fullName": {
          "maxLength": 256,
          "description": "The full name.",
          "type": "string"
        },
        "jobTitle": {
          "maxLength": 256,
          "description": "The job title.",
          "type": "string"
        },
        "lastName": {
          "maxLength": 256,
          "description": "The last name.",
          "type": "string"
        },
        "phone": {
          "maxLength": 256,
          "description": "The phone number.",
          "type": "string"
        },
        "postBox": {
          "maxLength": 256,
          "description": "The post office box.",
          "type": "string"
        },
        "postalCode": {
          "maxLength": 256,
          "description": "The postal code.",
          "type": "string"
        },
        "salutation": {
          "maxLength": 256,
          "description": "The salutation.",
          "type": "string"
        },
        "secondName": {
          "maxLength": 256,
          "description": "The second name.",
          "type": "string"
        },
        "stateCode": {
          "maxLength": 256,
          "description": "The state code.",
          "type": "string"
        },
        "suffix": {
          "maxLength": 256,
          "description": "The suffix.",
          "type": "string"
        },
        "suite": {
          "maxLength": 256,
          "description": "The suite.",
          "type": "string"
        },
        "title": {
          "maxLength": 256,
          "description": "The title.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CountryCode": {
      "pattern": "^[A-Z][A-Z]$",
      "description": "A two letter uppercase country code conforming to the [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 standard.",
      "type": "string"
    },
    "CreateOrderOptionItem": {
      "description": "An option item represents an optional purchase related to a product item, and is always associated with that parent product item. For example, a refrigerator item can have a set of option items representing different warranties on the refrigerator. A shopper can only purchase one of the warranty option items together with the parent refrigerator item.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "basePrice",
        "grossPrice",
        "netPrice",
        "tax",
        "optionId",
        "optionValueId",
        "productId"
      ],
      "properties": {
        "basePrice": {
          "format": "double",
          "description": "The base price of the line item, which is the unit price not including adjustments. If the taxation policy is net, it doesn't include tax. If the taxation policy is gross, it includes tax.",
          "type": "number"
        },
        "grossPrice": {
          "format": "double",
          "description": "The gross price of the line item before applying any adjustments.",
          "type": "number"
        },
        "itemText": {
          "maxLength": 256,
          "description": "The text describing the item.",
          "type": "string"
        },
        "netPrice": {
          "format": "double",
          "description": "The net price of the line item before applying any adjustments.",
          "type": "number"
        },
        "tax": {
          "format": "double",
          "description": "The tax on the line item before applying any adjustments.",
          "type": "number"
        },
        "taxBasis": {
          "format": "double",
          "description": "The amount used to calculate the tax for this item.",
          "type": "number"
        },
        "optionId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the option.",
          "type": "string"
        },
        "optionValueId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the option value.",
          "type": "string"
        },
        "priceAdjustments": {
          "maxItems": 20,
          "description": "The price adjustments.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreateOrderPriceAdjustment"
          }
        },
        "productId": {
          "$ref": "#/$defs/ProductId"
        }
      },
      "type": "object"
    },
    "CreateOrderPaymentInstrument": {
      "description": "Document representing a payment instrument.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "paymentMethodId"
      ],
      "properties": {
        "paymentMethodId": {
          "maxLength": 256,
          "description": "The payment method ID.",
          "type": "string"
        },
        "paymentTransaction": {
          "description": "The payment transaction.",
          "allOf": [
            {
              "$ref": "#/$defs/CreateOrderPaymentTransaction"
            }
          ]
        }
      },
      "type": "object"
    },
    "CreateOrderPaymentTransaction": {
      "description": "Document representing an order payment transaction.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "amount",
        "transactionId"
      ],
      "properties": {
        "amount": {
          "format": "double",
          "description": "The payment transaction amount.",
          "type": "number"
        },
        "authorizationStatus": {
          "description": "The authorization status of the payment transaction.",
          "allOf": [
            {
              "$ref": "#/$defs/Status"
            }
          ]
        },
        "transactionId": {
          "maxLength": 256,
          "description": "The payment service specific transaction ID.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CreateOrderPriceAdjustment": {
      "description": "The Price Adjustment without Promotion and Coupon references - handled as `AdHocPriceAdjustments` internally. \n\nThe following fields are set:\n- manual = true\n- custom = true\n- promotionId = AD_HOC_PRICE_ADJUSTMENT",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "grossPrice",
        "netPrice",
        "tax"
      ],
      "properties": {
        "amount": {
          "format": "double",
          "description": "Amount to deduct from the applied line item's price. If the taxation policy is net, it doesn't  include tax. If the taxation policy is gross, it includes tax.",
          "type": "number"
        },
        "basePrice": {
          "format": "double",
          "description": "The adjustment amount. If the taxation policy is net, it doesn't include tax. \nIf the taxation policy is gross, it includes tax.",
          "type": "number"
        },
        "grossPrice": {
          "format": "double",
          "description": "The adjustment amount, including tax.",
          "type": "number"
        },
        "itemText": {
          "description": "The text describing the price adjustment.",
          "type": "string"
        },
        "netPrice": {
          "format": "double",
          "description": "The adjustment amount, not including tax.",
          "type": "number"
        },
        "reasonCode": {
          "description": "The reason code why this price adjustment was made.",
          "type": "string"
        },
        "tax": {
          "format": "double",
          "description": "The tax on the adjustment amount.",
          "type": "number"
        },
        "taxBasis": {
          "format": "double",
          "description": "The amount used to calculate the tax for this adjustment.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "CreateOrderProductItems": {
      "description": "Document representing a product item for an order.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "basePrice",
        "grossPrice",
        "netPrice",
        "productId",
        "quantity",
        "shipmentId",
        "tax"
      ],
      "properties": {
        "basePrice": {
          "format": "double",
          "description": "The base price of the line item, which is the unit price not including adjustments. \nIf the taxation policy is net, it doesn't include tax. \nIf the taxation policy is gross, it includes tax.",
          "type": "number"
        },
        "brand": {
          "maxLength": 256,
          "description": "The brand of the line item.",
          "type": "string"
        },
        "grossPrice": {
          "format": "double",
          "description": "The gross price of the line item before applying any adjustments.",
          "type": "number"
        },
        "itemText": {
          "description": "The text describing the item.",
          "type": "string"
        },
        "netPrice": {
          "format": "double",
          "description": "The net price of the line item before applying any adjustments.",
          "type": "number"
        },
        "optionItems": {
          "maxItems": 10,
          "description": "The array of option items. This array can be empty.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreateOrderOptionItem"
          }
        },
        "priceAdjustments": {
          "maxItems": 20,
          "description": "The price adjustments on product line item.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/CreateOrderPriceAdjustment"
          }
        },
        "productId": {
          "$ref": "#/$defs/ProductId"
        },
        "productName": {
          "maxLength": 256,
          "description": "The name of the product.",
          "type": "string"
        },
        "quantity": {
          "minimum": 0,
          "format": "double",
          "description": "The ordered quantity of the products represented by this item.",
          "type": "number"
        },
        "shipmentId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the shipment to which this item belongs. Shipment 'me' is reserved for the system and is not valid to pass.",
          "type": "string"
        },
        "tax": {
          "format": "double",
          "description": "The tax on the line item before applying any adjustments.",
          "type": "number"
        },
        "taxBasis": {
          "format": "double",
          "description": "The amount used to calculate the tax for this item.",
          "type": "number"
        },
        "taxItems": {
          "maxItems": 10,
          "description": "The individual tax items for this product line item (e.g. state tax, county tax).\nWhen omitted, only the aggregated tax/taxRate values are persisted.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/TaxItem"
          }
        },
        "taxRate": {
          "format": "double",
          "description": "The tax rate applicable to this product line item.\nFor a 10% tax rate, the value is 0.1.\nJust for display. No calculation or sanity checks are applied.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "CreateOrderShipment": {
      "description": "Document representing a shipment for an order.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "shipmentId",
        "shippingMethod",
        "shippingAddress",
        "shippingTotal",
        "taxTotal"
      ],
      "properties": {
        "shipmentId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The order-specific ID of the shipment. The field shipmentId from line items refers to this value.\nThe first shipment always become the standard shipment and is named 'me'. The ID 'me' is reserved for the standard shipment and it is not allowed to be used by the API caller.",
          "type": "string"
        },
        "shippingMethod": {
          "description": "The shipping method. This has no reference to any shipments configured in the platform.",
          "type": "string"
        },
        "shippingAddress": {
          "description": "The shipping address.",
          "allOf": [
            {
              "$ref": "#/$defs/Address"
            }
          ]
        },
        "shippingTotal": {
          "format": "double",
          "description": "The total price of all shipping charges in the shipment.\nIf the taxation policy is net, it doesn't include tax.\nIf the taxation policy is gross, it includes tax.",
          "type": "number"
        },
        "taxTotal": {
          "format": "double",
          "description": "The total tax on the shipment.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "CurrencyCode": {
      "description": "A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.",
      "pattern": "^([A-Z][A-Z][A-Z]|N/A)$",
      "type": "string"
    },
    "OrderNo": {
      "description": "The order number",
      "minLength": 1,
      "maxLength": 50,
      "type": "string"
    },
    "ProductId": {
      "minLength": 1,
      "maxLength": 100,
      "type": "string",
      "description": "The id (SKU) of the product."
    },
    "Status": {
      "description": "Document representing a status of an object.",
      "additionalProperties": false,
      "properties": {
        "code": {
          "maxLength": 256,
          "description": "The status code.",
          "type": "string"
        },
        "message": {
          "maxLength": 256,
          "description": "The message corresponding to the status.",
          "type": "string"
        },
        "status": {
          "minimum": 0,
          "maximum": 2,
          "format": "int32",
          "description": "A constant corresponding to the status code. The value is 0 for OK, 1 for ERROR, and 2 for WARN.",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "TaxItem": {
      "description": "A specific tax item for a line item (e.g. state tax, county tax).",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "required": [
        "id",
        "rate"
      ],
      "properties": {
        "id": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The tax item identifier (e.g. STATE, COUNTY).",
          "type": "string"
        },
        "rate": {
          "format": "double",
          "description": "The tax rate for this tax item. For a 7% tax rate, the value is 0.07.",
          "type": "number"
        },
        "value": {
          "format": "double",
          "description": "The tax value (amount) for this tax item.",
          "type": "number"
        }
      },
      "type": "object"
    }
  }
}