{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.traceoriginal.com/trace-original-bill-of-exchange-epu-en-schema-v1.2.json",
  "title": "trace:original Bill of Exchange ePU Content Schema v1.2",
  "allOf": [{"$ref": "https://schema.traceoriginal.com/trace-original-agreement-en-schema-v1.2.json"}],
  "definitions": {
    "BillOfExchange": {
      "type": "object",
      "properties": {
        "ePU Details": {
          "type": "object",
          "properties": {
            "Principal Amount" : {
              "oneOf": [{"type": "string"},{"type": "number"}],
              "position": 1
            },
            "Applicable Currency": {
              "type": "string",
              "position": 2
            },
            "Maturity Date": {
              "oneOf": [{"type": "string"}, {"type": "number"}],
              "position": 3
            },
            "Payment Place": {
              "oneOf": [{"type": "string"}, {"type": "number"}],
              "position": 4
            }
          },
          "position": 1
        },
        "Payment Details": {
          "type": "object",
          "properties": {
            "Payable At": {
              "oneOf": [{"type": "string"},{"type": "number"}],
              "position": 1
            },
            "Account Number": {
              "oneOf": [{"type": "string"},{"type": "number"}],
              "position": 2
            },
            "Sort Code": {
              "oneOf": [{"type": "string"},{"type": "number"}],
              "position": 3
            },
            "IBAN": {
              "oneOf": [{"type": "string"},{"type": "number"}],
              "position": 4
            }
          },
          "position": 2
        },
        "Terms and Conditions": {
          "type": "string",
          "position": 3
        },
        "additionalItems": false
      },
      "additionalItems": false,
      "minProperties": 1
    }
  },
  "properties": {
    "Content": {
      "type": "object",
      "properties": {
        "Agreement terms": {
          "$ref": "#/definitions/BillOfExchange"
        }
      }
    },
    "Amendments": {
      "type": "array",
      "items": {
        "Content": {
          "anyOf": [
            {
              "$ref": "#/definitions/BillOfExchange"
            },
            {
              "type": "string"
            }
          ]
        }
      }
    }
  }
}
