{
  "$defs": {
    "__schema0": {
      "const": "1.0",
      "type": "string"
    },
    "__schema1": {
      "items": {
        "$ref": "#/$defs/__schema2"
      },
      "maxItems": 1000,
      "type": "array"
    },
    "__schema10": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "items": {
            "$ref": "#/$defs/__schema10"
          },
          "type": "array"
        },
        {
          "additionalProperties": {
            "$ref": "#/$defs/__schema10"
          },
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        }
      ]
    },
    "__schema11": {
      "items": {
        "$ref": "#/$defs/__schema12"
      },
      "maxItems": 1000,
      "type": "array"
    },
    "__schema12": {
      "maxLength": 5000,
      "minLength": 1,
      "type": "string"
    },
    "__schema13": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema14": {
      "const": "order_acknowledgment",
      "type": "string"
    },
    "__schema15": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema16": {
      "enum": [
        "purchase_order",
        "purchase_order_change"
      ],
      "type": "string"
    },
    "__schema17": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema18": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema19": {
      "description": "An ISO 8601 timestamp with a UTC offset",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      "type": "string"
    },
    "__schema2": {
      "additionalProperties": false,
      "description": "A typed business reference",
      "properties": {
        "description": {
          "$ref": "#/$defs/__schema6"
        },
        "extensions": {
          "$ref": "#/$defs/__schema7"
        },
        "issuer": {
          "$ref": "#/$defs/__schema5"
        },
        "type": {
          "$ref": "#/$defs/__schema3"
        },
        "value": {
          "$ref": "#/$defs/__schema4"
        }
      },
      "required": [
        "type",
        "value"
      ],
      "type": "object"
    },
    "__schema20": {
      "enum": [
        "accepted",
        "accepted_with_changes",
        "rejected"
      ],
      "type": "string"
    },
    "__schema21": {
      "items": {
        "$ref": "#/$defs/__schema22"
      },
      "maxItems": 100,
      "minItems": 1,
      "type": "array"
    },
    "__schema22": {
      "additionalProperties": false,
      "description": "A business party participating in a document",
      "properties": {
        "address": {
          "$ref": "#/$defs/__schema32"
        },
        "contacts": {
          "$ref": "#/$defs/__schema40"
        },
        "extensions": {
          "$ref": "#/$defs/__schema48"
        },
        "identifiers": {
          "$ref": "#/$defs/__schema24"
        },
        "name": {
          "$ref": "#/$defs/__schema31"
        },
        "role": {
          "$ref": "#/$defs/__schema23"
        }
      },
      "required": [
        "role",
        "identifiers"
      ],
      "type": "object"
    },
    "__schema23": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema24": {
      "items": {
        "$ref": "#/$defs/__schema25"
      },
      "maxItems": 100,
      "minItems": 1,
      "type": "array"
    },
    "__schema25": {
      "additionalProperties": false,
      "description": "A value qualified by an identifier scheme",
      "properties": {
        "agency": {
          "$ref": "#/$defs/__schema28"
        },
        "description": {
          "$ref": "#/$defs/__schema29"
        },
        "extensions": {
          "$ref": "#/$defs/__schema30"
        },
        "scheme": {
          "$ref": "#/$defs/__schema26"
        },
        "value": {
          "$ref": "#/$defs/__schema27"
        }
      },
      "required": [
        "scheme",
        "value"
      ],
      "type": "object"
    },
    "__schema26": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema27": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "__schema28": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema29": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "__schema3": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema30": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema31": {
      "maxLength": 300,
      "minLength": 1,
      "type": "string"
    },
    "__schema32": {
      "additionalProperties": false,
      "description": "A postal address with country-neutral field names",
      "properties": {
        "administrativeArea": {
          "$ref": "#/$defs/__schema36"
        },
        "countryCode": {
          "$ref": "#/$defs/__schema38"
        },
        "extensions": {
          "$ref": "#/$defs/__schema39"
        },
        "lines": {
          "$ref": "#/$defs/__schema33"
        },
        "locality": {
          "$ref": "#/$defs/__schema35"
        },
        "postalCode": {
          "$ref": "#/$defs/__schema37"
        }
      },
      "required": [
        "lines",
        "countryCode"
      ],
      "type": "object"
    },
    "__schema33": {
      "items": {
        "$ref": "#/$defs/__schema34"
      },
      "maxItems": 5,
      "minItems": 1,
      "type": "array"
    },
    "__schema34": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema35": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema36": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema37": {
      "maxLength": 40,
      "minLength": 1,
      "type": "string"
    },
    "__schema38": {
      "description": "ISO 3166-1 alpha-2 country code",
      "pattern": "^[A-Z]{2}$",
      "type": "string"
    },
    "__schema39": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema4": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "__schema40": {
      "items": {
        "$ref": "#/$defs/__schema41"
      },
      "maxItems": 100,
      "type": "array"
    },
    "__schema41": {
      "additionalProperties": false,
      "description": "Contact information associated with a party",
      "properties": {
        "department": {
          "$ref": "#/$defs/__schema44"
        },
        "email": {
          "$ref": "#/$defs/__schema45"
        },
        "extensions": {
          "$ref": "#/$defs/__schema47"
        },
        "name": {
          "$ref": "#/$defs/__schema43"
        },
        "phone": {
          "$ref": "#/$defs/__schema46"
        },
        "role": {
          "$ref": "#/$defs/__schema42"
        }
      },
      "type": "object"
    },
    "__schema42": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema43": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema44": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema45": {
      "format": "email",
      "maxLength": 320,
      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
      "type": "string"
    },
    "__schema46": {
      "maxLength": 50,
      "minLength": 1,
      "type": "string"
    },
    "__schema47": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema48": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema49": {
      "items": {
        "$ref": "#/$defs/__schema50"
      },
      "maxItems": 50000,
      "type": "array"
    },
    "__schema5": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "__schema50": {
      "additionalProperties": false,
      "description": "A line-level business response to an order",
      "properties": {
        "acceptedQuantity": {
          "$ref": "#/$defs/__schema64"
        },
        "backorderedQuantity": {
          "$ref": "#/$defs/__schema65"
        },
        "expectedShipDate": {
          "$ref": "#/$defs/__schema66"
        },
        "extensions": {
          "$ref": "#/$defs/__schema70"
        },
        "lineNumber": {
          "$ref": "#/$defs/__schema51"
        },
        "orderedQuantity": {
          "$ref": "#/$defs/__schema58"
        },
        "product": {
          "$ref": "#/$defs/__schema53"
        },
        "reason": {
          "$ref": "#/$defs/__schema68"
        },
        "reasonCode": {
          "$ref": "#/$defs/__schema67"
        },
        "references": {
          "$ref": "#/$defs/__schema69"
        },
        "status": {
          "$ref": "#/$defs/__schema52"
        }
      },
      "required": [
        "lineNumber",
        "status"
      ],
      "type": "object"
    },
    "__schema51": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema52": {
      "enum": [
        "accepted",
        "accepted_with_changes",
        "rejected",
        "backordered",
        "substituted",
        "cancelled"
      ],
      "type": "string"
    },
    "__schema53": {
      "additionalProperties": false,
      "description": "A product identified independently of any one industry",
      "properties": {
        "classifications": {
          "$ref": "#/$defs/__schema56"
        },
        "description": {
          "$ref": "#/$defs/__schema55"
        },
        "extensions": {
          "$ref": "#/$defs/__schema57"
        },
        "identifiers": {
          "$ref": "#/$defs/__schema54"
        }
      },
      "required": [
        "identifiers"
      ],
      "type": "object"
    },
    "__schema54": {
      "items": {
        "$ref": "#/$defs/__schema25"
      },
      "maxItems": 100,
      "minItems": 1,
      "type": "array"
    },
    "__schema55": {
      "maxLength": 1000,
      "minLength": 1,
      "type": "string"
    },
    "__schema56": {
      "items": {
        "$ref": "#/$defs/__schema25"
      },
      "maxItems": 100,
      "type": "array"
    },
    "__schema57": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema58": {
      "$ref": "#/$defs/__schema59"
    },
    "__schema59": {
      "additionalProperties": false,
      "description": "A precision-safe quantity and unit",
      "properties": {
        "extensions": {
          "$ref": "#/$defs/__schema63"
        },
        "qualifier": {
          "$ref": "#/$defs/__schema62"
        },
        "unitCode": {
          "$ref": "#/$defs/__schema61"
        },
        "value": {
          "$ref": "#/$defs/__schema60"
        }
      },
      "required": [
        "value",
        "unitCode"
      ],
      "type": "object"
    },
    "__schema6": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "__schema60": {
      "description": "A base-10 decimal value without exponent notation",
      "maxLength": 100,
      "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
      "type": "string"
    },
    "__schema61": {
      "description": "A mutually agreed unit-of-measure code",
      "maxLength": 20,
      "minLength": 1,
      "type": "string"
    },
    "__schema62": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema63": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema64": {
      "$ref": "#/$defs/__schema59"
    },
    "__schema65": {
      "$ref": "#/$defs/__schema59"
    },
    "__schema66": {
      "description": "An ISO 8601 calendar date",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "type": "string"
    },
    "__schema67": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema68": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "__schema69": {
      "items": {
        "$ref": "#/$defs/__schema2"
      },
      "maxItems": 1000,
      "type": "array"
    },
    "__schema7": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema70": {
      "$ref": "#/$defs/__schema8"
    },
    "__schema71": {
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "__schema72": {
      "maxLength": 1000,
      "minLength": 1,
      "type": "string"
    },
    "__schema8": {
      "additionalProperties": {
        "$ref": "#/$defs/__schema10"
      },
      "description": "Namespaced, JSON-compatible extension values",
      "propertyNames": {
        "$ref": "#/$defs/__schema9"
      },
      "type": "object"
    },
    "__schema9": {
      "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*:[A-Za-z][A-Za-z0-9_.-]*$",
      "type": "string"
    }
  },
  "$id": "urn:loomedi:canonical:v1:order-acknowledgment",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "A canonical order acknowledgment, commonly mapped to X12 855 or 865",
  "properties": {
    "acknowledgedAt": {
      "$ref": "#/$defs/__schema19"
    },
    "acknowledgmentFor": {
      "$ref": "#/$defs/__schema16"
    },
    "acknowledgmentNumber": {
      "$ref": "#/$defs/__schema15"
    },
    "documentType": {
      "$ref": "#/$defs/__schema14"
    },
    "extensions": {
      "$ref": "#/$defs/__schema13"
    },
    "lines": {
      "$ref": "#/$defs/__schema49"
    },
    "notes": {
      "$ref": "#/$defs/__schema11"
    },
    "parties": {
      "$ref": "#/$defs/__schema21"
    },
    "purchaseOrderChangeNumber": {
      "$ref": "#/$defs/__schema18"
    },
    "purchaseOrderNumber": {
      "$ref": "#/$defs/__schema17"
    },
    "reason": {
      "$ref": "#/$defs/__schema72"
    },
    "reasonCode": {
      "$ref": "#/$defs/__schema71"
    },
    "references": {
      "$ref": "#/$defs/__schema1"
    },
    "schemaVersion": {
      "$ref": "#/$defs/__schema0"
    },
    "status": {
      "$ref": "#/$defs/__schema20"
    }
  },
  "required": [
    "schemaVersion",
    "documentType",
    "acknowledgmentNumber",
    "acknowledgmentFor",
    "purchaseOrderNumber",
    "acknowledgedAt",
    "status",
    "parties"
  ],
  "title": "OrderAcknowledgment",
  "type": "object"
}
