{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quickbooks/json-schema/quickbooks-changeorderrequest-schema.json",
  "title": "changeorderrequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quickbooks-changeorder-api-openapi.yml#/components/schemas/changeorderrequest",
  "type": "object",
  "properties": {
    "DocNumber": {
      "type": "string",
      "description": "Reference number for the change order (for example, CO-001). If not provided, the value is null.",
      "x-intuit-required": "Optional",
      "x-intuit-filterable": true,
      "x-intuit-sortable": true
    },
    "TxnStatus": {
      "type": "string",
      "description": "Current status of the change order. Valid values: Pending, Accepted, Closed, Rejected.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "Pending"
    },
    "PrivateNote": {
      "type": "string",
      "description": "Organization-private note about the change order. This note does not appear on documents sent to the customer.",
      "x-intuit-required": "Optional"
    },
    "TxnDate": {
      "type": "string",
      "format": "date",
      "description": "The date entered by the user when this transaction occurred. If not supplied, the current date on the server is used.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "current server date",
      "x-intuit-filterable": true,
      "x-intuit-sortable": true
    },
    "BillEmail": {
      "allOf": [
        {
          "$ref": "#/$defs/emailaddress"
        }
      ],
      "description": "Email address where the change order is sent. Required when EmailStatus is set to NeedToSend.",
      "x-intuit-required": "Conditionally required"
    },
    "CustomerMemo": {
      "allOf": [
        {
          "$ref": "#/$defs/memoref"
        }
      ],
      "description": "User-entered message to the customer; visible on the Change Order document sent to the customer.",
      "x-intuit-required": "Optional"
    },
    "ProjectRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the project this change order belongs to. The project must be active. Without a valid ProjectRef, the change order will not appear in the Projects dashboard.",
      "x-intuit-required": "Required",
      "x-intuit-filterable": true
    },
    "PrintStatus": {
      "type": "string",
      "description": "Printing status of the change order. Valid values: NotSet, NeedToPrint, PrintComplete.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "<span class=\"literal\">NotSet</span>"
    },
    "ExpirationDate": {
      "type": "string",
      "format": "date",
      "description": "Date by which the change order must be accepted before it expires.",
      "x-intuit-required": "Optional"
    },
    "Line": {
      "type": "object",
      "x-intuit-type": "Change Order line object",
      "description": "Individual line items describing the work being added or removed. Each line must include a LinkedTxn array referencing the parent project estimate with TxnType: \"Estimate\". All lines must reference the same parent estimate. Supports SalesItemLineDetail line type.",
      "x-intuit-required": "Required"
    },
    "CustomerRef": {
      "allOf": [
        {
          "$ref": "#/$defs/referencetype"
        }
      ],
      "description": "Reference to the customer associated with this change order. Must match the customer on the parent project estimate. Query the Customer name list resource to determine the appropriate Customer object for this reference. Use Customer.Id and Customer.DisplayName from that object for CustomerRef.value and CustomerRef.name, respectively.",
      "x-intuit-required": "Required",
      "x-intuit-filterable": true
    },
    "EmailStatus": {
      "type": "string",
      "description": "Email status of the change order. Valid values: NotSet, NeedToSend, EmailSent.",
      "x-intuit-required": "Optional",
      "x-intuit-default": "<span class=\"literal\">NotSet</span>"
    }
  },
  "required": [
    "CustomerRef",
    "Line",
    "ProjectRef"
  ],
  "$defs": {
    "emailaddress": {
      "type": "object",
      "title": "emailaddress",
      "properties": {
        "Address": {
          "type": "string",
          "description": "An email address. The address format must follow the RFC 822 standard.",
          "x-intuit-required": "Optional"
        }
      }
    },
    "memoref": {
      "type": "object",
      "title": "memoref",
      "properties": {
        "value": {
          "type": "string",
          "description": "User-entered message to the customer; this message is visible to the end user on their transactions.",
          "x-intuit-required": "Required"
        }
      },
      "required": [
        "value"
      ]
    },
    "referencetype": {
      "type": "object",
      "title": "referencetype",
      "properties": {
        "name": {
          "type": "string",
          "description": "An identifying name for the object being referenced by value and is derived from the field that holds the common name of that object. This varies by context and specific type of object referenced. For example, references to a Customer object use Customer.DisplayName to populate this field. Optionally returned in responses, implementation dependent.",
          "x-intuit-required": "Optional"
        },
        "value": {
          "type": "string",
          "description": "The ID for the referenced object as found in the Id field of the object payload. The context is set by the type of reference and is specific to the QuickBooks company file.",
          "x-intuit-required": "Required"
        }
      },
      "required": [
        "value"
      ]
    }
  }
}