{
  "$schema": "http://json-schema.org/schema#",
  "title": "WE, Import",
  "description": "Приём УПД",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "PACKAGE": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "POSTOBJECT": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "action": {
                "type": "string"
              },
              "Id": {
                "type": "string"
              },
              "WE": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "SMDOCUMENTS": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "COMMENTARY": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "CREATEDAT": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "TOTALSUM": {
                          "type": "number"
                        },
                        "CLIENTINN": {
                          "type": "string"
                        },
                        "CLIENTKPP": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "LOCATIONKPP": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "CREATEDAT",
                        "TOTALSUM",
                        "CLIENTINN",
                        "CLIENTKPP",
                        "LOCATIONKPP"
                      ]
                    }
                  },
                  "SMWAYBILLSEXT": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "SUPPLIERDOC": {
                          "type": "string"
                        },
                        "SUPPLIERINVOICE": {
                          "type": "string"
                        },
                        "SUPPLINVOICECREATE": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "CONSIGNECLIENTINN": {
                          "type": "string"
                        },
                        "CONSIGNECLIENTKPP": {
                          "type": "string"
                        },
                        "EDOID": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "SUPPLIERDOC",
                        "SUPPLIERINVOICE",
                        "SUPPLINVOICECREATE",
                        "CONSIGNECLIENTINN",
                        "CONSIGNECLIENTKPP",
                        "EDOID"
                      ]
                    }
                  },
                  "SMCOMMONBASES": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "BASEDOCTYPE": {
                          "type": "string"
                        },
                        "BASEID": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "BASEDOCTYPE",
                        "BASEID"
                      ]
                    }
                  },
                  "SMSPECWE": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "SPECITEM": {
                          "type": "integer"
                        },
                        "SUPPLIERARTICLE": {
                          "type": "string"
                        },
                        "COUNTRYOKCM": {
                          "type": "string"
                        },
                        "DISPLAYITEM": {
                          "type": "integer"
                        },
                        "ITEMPRICE": {
                          "type": "number"
                        },
                        "ITEMPRICENOTAX": {
                          "type": "number"
                        },
                        "QUANTITY": {
                          "type": "number"
                        },
                        "TOTALPRICE": {
                          "type": "number"
                        },
                        "TOTALPRICENOTAX": {
                          "type": "number"
                        },
                        "VATRATE": {
                          "type": "number",
                          "default": 0.0
                        },
                        "VATSUM": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "SPECITEM",
                        "SUPPLIERARTICLE",
                        "COUNTRYOKCM",
                        "DISPLAYITEM",
                        "ITEMPRICE",
                        "ITEMPRICENOTAX",
                        "QUANTITY",
                        "TOTALPRICENOTAX",
                        "VATSUM"
                      ]
                    }
                  },
                  "SMSPECTOBACCOWE": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "SPECITEM": {
                          "type": "integer"
                        },
                        "MARKCODE": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "SPECITEM",
                        "MARKCODE"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
