{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/optimizely/main/json-schema/optimizely-insite-order-web-api-v1-api-models-order-model-schema.json",
  "title": "Insite.Order.WebApi.V1.ApiModels.OrderModel",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optimizely-orders-api-openapi.yml#/components/schemas/Insite.Order.WebApi.V1.ApiModels.OrderModel",
  "type": "object",
  "properties": {
    "uri": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "erpOrderNumber": {
      "type": "string"
    },
    "webOrderNumber": {
      "type": "string"
    },
    "orderDate": {
      "format": "date-time",
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "statusDisplay": {
      "type": "string"
    },
    "customerNumber": {
      "type": "string"
    },
    "customerSequence": {
      "type": "string"
    },
    "customerPO": {
      "type": "string"
    },
    "currencyCode": {
      "type": "string"
    },
    "currencySymbol": {
      "type": "string"
    },
    "terms": {
      "type": "string"
    },
    "shipCode": {
      "type": "string"
    },
    "salesperson": {
      "type": "string"
    },
    "btCompanyName": {
      "type": "string"
    },
    "btAddress1": {
      "type": "string"
    },
    "btAddress2": {
      "type": "string"
    },
    "btAddress3": {
      "type": "string"
    },
    "btAddress4": {
      "type": "string"
    },
    "billToCity": {
      "type": "string"
    },
    "billToState": {
      "type": "string"
    },
    "billToPostalCode": {
      "type": "string"
    },
    "btCountry": {
      "type": "string"
    },
    "stCompanyName": {
      "type": "string"
    },
    "stAddress1": {
      "type": "string"
    },
    "stAddress2": {
      "type": "string"
    },
    "stAddress3": {
      "type": "string"
    },
    "stAddress4": {
      "type": "string"
    },
    "shipToCity": {
      "type": "string"
    },
    "shipToState": {
      "type": "string"
    },
    "shipToPostalCode": {
      "type": "string"
    },
    "stCountry": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "productTotal": {
      "format": "decimal",
      "type": "number"
    },
    "orderSubTotal": {
      "format": "decimal",
      "type": "number"
    },
    "discountAmount": {
      "format": "decimal",
      "type": "number",
      "readOnly": true
    },
    "orderDiscountAmount": {
      "format": "decimal",
      "type": "number"
    },
    "productDiscountAmount": {
      "format": "decimal",
      "type": "number"
    },
    "shippingAndHandling": {
      "format": "decimal",
      "type": "number",
      "readOnly": true
    },
    "shippingCharges": {
      "format": "decimal",
      "type": "number"
    },
    "handlingCharges": {
      "format": "decimal",
      "type": "number"
    },
    "otherCharges": {
      "format": "decimal",
      "type": "number"
    },
    "taxAmount": {
      "format": "decimal",
      "type": "number"
    },
    "orderTotal": {
      "format": "decimal",
      "type": "number"
    },
    "modifyDate": {
      "format": "date-time",
      "type": "string"
    },
    "requestedDeliveryDateDisplay": {
      "format": "date-time",
      "type": "string"
    },
    "orderLines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insite.Order.WebApi.V1.ApiModels.OrderLineModel"
      }
    },
    "orderPromotions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insite.Order.WebApi.V1.ApiModels.OrderPromotionModel"
      }
    },
    "shipmentPackages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insite.Order.Services.Dtos.ShipmentPackageDto"
      }
    },
    "returnReasons": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "orderHistoryTaxes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insite.Order.Services.Dtos.OrderHistoryTaxDto"
      }
    },
    "productTotalDisplay": {
      "type": "string"
    },
    "orderSubTotalDisplay": {
      "type": "string"
    },
    "orderTotalDisplay": {
      "type": "string"
    },
    "orderGrandTotalDisplay": {
      "type": "string"
    },
    "discountAmountDisplay": {
      "type": "string",
      "readOnly": true
    },
    "orderDiscountAmountDisplay": {
      "type": "string"
    },
    "productDiscountAmountDisplay": {
      "type": "string"
    },
    "taxAmountDisplay": {
      "type": "string"
    },
    "totalTaxDisplay": {
      "type": "string"
    },
    "shippingAndHandlingDisplay": {
      "type": "string"
    },
    "shippingChargesDisplay": {
      "type": "string"
    },
    "handlingChargesDisplay": {
      "type": "string"
    },
    "otherChargesDisplay": {
      "type": "string"
    },
    "canAddToCart": {
      "type": "boolean"
    },
    "canAddAllToCart": {
      "type": "boolean"
    },
    "showTaxAndShipping": {
      "type": "boolean"
    },
    "shipViaDescription": {
      "type": "string"
    },
    "fulfillmentMethod": {
      "type": "string"
    },
    "customerVatNumber": {
      "type": "string"
    },
    "vmiLocationId": {
      "type": "string"
    },
    "vmiLocationName": {
      "type": "string"
    },
    "properties": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "Insite.Catalog.Services.Dtos.AvailabilityDto": {
      "type": "object",
      "properties": {
        "messageType": {
          "format": "int32",
          "enum": [
            0,
            1,
            2,
            3
          ],
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "requiresRealTimeInventory": {
          "type": "boolean"
        }
      }
    },
    "Insite.Catalog.Services.Dtos.BrandDto": {
      "type": "object",
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "urlSegment": {
          "type": "string"
        },
        "logoSmallImagePath": {
          "type": "string"
        },
        "logoLargeImagePath": {
          "type": "string"
        },
        "logoImageAltText": {
          "type": "string"
        },
        "detailPagePath": {
          "type": "string"
        }
      }
    },
    "Insite.Order.Services.Dtos.OrderHistoryTaxDto": {
      "type": "object",
      "properties": {
        "taxCode": {
          "type": "string"
        },
        "taxDescription": {
          "type": "string"
        },
        "taxRate": {
          "format": "decimal",
          "type": "number"
        },
        "taxAmount": {
          "format": "decimal",
          "type": "number"
        },
        "taxAmountDisplay": {
          "type": "string"
        },
        "sortOrder": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "Insite.Order.Services.Dtos.SectionOptionDto": {
      "type": "object",
      "properties": {
        "sectionOptionId": {
          "format": "uuid",
          "type": "string"
        },
        "sectionName": {
          "type": "string"
        },
        "optionName": {
          "type": "string"
        }
      }
    },
    "Insite.Order.Services.Dtos.ShipmentPackageDto": {
      "type": "object",
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "shipmentDate": {
          "format": "date-time",
          "type": "string"
        },
        "packageNumber": {
          "type": "string"
        },
        "carrier": {
          "type": "string"
        },
        "shipVia": {
          "type": "string"
        },
        "trackingUrl": {
          "type": "string"
        },
        "trackingNumber": {
          "type": "string"
        },
        "packSlip": {
          "type": "string"
        },
        "shipmentPackageLineDtos": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Order.Services.Dtos.ShipmentPackageLineDto"
          }
        }
      }
    },
    "Insite.Order.Services.Dtos.ShipmentPackageLineDto": {
      "type": "object",
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "productName": {
          "type": "string"
        },
        "productDescription": {
          "type": "string"
        },
        "productCode": {
          "type": "string"
        },
        "qtyOrdered": {
          "format": "decimal",
          "type": "number"
        },
        "qtyShipped": {
          "format": "decimal",
          "type": "number"
        },
        "price": {
          "format": "decimal",
          "type": "number"
        },
        "orderLineId": {
          "format": "uuid",
          "type": "string"
        }
      }
    },
    "Insite.Order.WebApi.V1.ApiModels.OrderLineModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "productId": {
          "type": "string"
        },
        "productUri": {
          "type": "string"
        },
        "mediumImagePath": {
          "type": "string"
        },
        "altText": {
          "type": "string"
        },
        "productName": {
          "type": "string"
        },
        "manufacturerItem": {
          "type": "string"
        },
        "customerName": {
          "type": "string"
        },
        "shortDescription": {
          "type": "string"
        },
        "productErpNumber": {
          "type": "string"
        },
        "customerProductNumber": {
          "type": "string"
        },
        "requiredDate": {
          "format": "date-time",
          "type": "string"
        },
        "lastShipDate": {
          "format": "date-time",
          "type": "string"
        },
        "customerNumber": {
          "type": "string"
        },
        "customerSequence": {
          "type": "string"
        },
        "lineType": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "lineNumber": {
          "format": "decimal",
          "type": "number"
        },
        "releaseNumber": {
          "format": "decimal",
          "type": "number"
        },
        "linePOReference": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "warehouse": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "qtyOrdered": {
          "format": "decimal",
          "type": "number"
        },
        "qtyShipped": {
          "format": "decimal",
          "type": "number"
        },
        "unitOfMeasure": {
          "type": "string"
        },
        "unitOfMeasureDisplay": {
          "type": "string"
        },
        "unitOfMeasureDescription": {
          "type": "string"
        },
        "availability": {
          "$ref": "#/$defs/Insite.Catalog.Services.Dtos.AvailabilityDto"
        },
        "inventoryQtyOrdered": {
          "format": "decimal",
          "type": "number"
        },
        "inventoryQtyShipped": {
          "format": "decimal",
          "type": "number"
        },
        "unitPrice": {
          "format": "decimal",
          "type": "number",
          "readOnly": true
        },
        "unitNetPrice": {
          "format": "decimal",
          "type": "number"
        },
        "extendedUnitNetPrice": {
          "format": "decimal",
          "type": "number"
        },
        "discountPercent": {
          "format": "decimal",
          "type": "number"
        },
        "discountAmount": {
          "format": "decimal",
          "type": "number",
          "readOnly": true
        },
        "unitDiscountAmount": {
          "format": "decimal",
          "type": "number"
        },
        "promotionAmountApplied": {
          "format": "decimal",
          "type": "number",
          "readOnly": true
        },
        "totalDiscountAmount": {
          "format": "decimal",
          "type": "number"
        },
        "lineTotal": {
          "format": "decimal",
          "type": "number",
          "readOnly": true
        },
        "totalRegularPrice": {
          "format": "decimal",
          "type": "number"
        },
        "unitListPrice": {
          "format": "decimal",
          "type": "number"
        },
        "unitRegularPrice": {
          "format": "decimal",
          "type": "number"
        },
        "unitCost": {
          "format": "decimal",
          "type": "number"
        },
        "orderLineOtherCharges": {
          "format": "decimal",
          "type": "number"
        },
        "taxRate": {
          "format": "decimal",
          "type": "number"
        },
        "taxAmount": {
          "format": "decimal",
          "type": "number"
        },
        "returnReason": {
          "type": "string"
        },
        "rmaQtyRequested": {
          "format": "decimal",
          "type": "number"
        },
        "rmaQtyReceived": {
          "format": "decimal",
          "type": "number"
        },
        "unitPriceDisplay": {
          "type": "string",
          "readOnly": true
        },
        "unitNetPriceDisplay": {
          "type": "string"
        },
        "extendedUnitNetPriceDisplay": {
          "type": "string"
        },
        "discountAmountDisplay": {
          "type": "string",
          "readOnly": true
        },
        "unitDiscountAmountDisplay": {
          "type": "string"
        },
        "promotionAmountAppliedDisplay": {
          "type": "string",
          "readOnly": true
        },
        "totalDiscountAmountDisplay": {
          "type": "string"
        },
        "lineTotalDisplay": {
          "type": "string",
          "readOnly": true
        },
        "totalRegularPriceDisplay": {
          "type": "string"
        },
        "unitListPriceDisplay": {
          "type": "string"
        },
        "unitRegularPriceDisplay": {
          "type": "string"
        },
        "unitCostDisplay": {
          "type": "string"
        },
        "orderLineOtherChargesDisplay": {
          "type": "string"
        },
        "costCode": {
          "type": "string"
        },
        "canAddToCart": {
          "type": "boolean"
        },
        "isActiveProduct": {
          "type": "boolean"
        },
        "sectionOptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Order.Services.Dtos.SectionOptionDto"
          }
        },
        "salePriceLabel": {
          "type": "string"
        },
        "canAddToWishlist": {
          "type": "boolean"
        },
        "brand": {
          "$ref": "#/$defs/Insite.Catalog.Services.Dtos.BrandDto"
        },
        "netPriceWithVat": {
          "format": "decimal",
          "type": "number"
        },
        "netPriceWithVatDisplay": {
          "type": "string"
        },
        "unitPriceWithVat": {
          "format": "decimal",
          "type": "number"
        },
        "unitPriceWithVatDisplay": {
          "type": "string"
        },
        "vmiBinNumber": {
          "type": "string"
        },
        "vmiBinId": {
          "type": "string"
        },
        "isActiveVmiBin": {
          "type": "boolean"
        },
        "isDiscontinued": {
          "type": "boolean"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Insite.Order.WebApi.V1.ApiModels.OrderPromotionModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "amount": {
          "format": "double",
          "type": "number"
        },
        "amountDisplay": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "orderHistoryLineId": {
          "format": "uuid",
          "type": "string"
        },
        "promotionResultType": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}