{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xestando-com/json-schema/xestando-com-invoice-v1-schema.json",
  "title": "InvoiceV1",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xestando-com-openapi.json#/components/schemas/InvoiceV1",
  "type": "object",
  "properties": {
    "baseAmount": {
      "type": "number",
      "format": "double"
    },
    "compliance": {
      "$ref": "#/$defs/ComplianceStatusV1"
    },
    "currency": {
      "type": "string"
    },
    "customer": {
      "$ref": "#/$defs/PartyV1"
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "issueDate": {
      "type": "string",
      "format": "date"
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LineV1"
      }
    },
    "notes": {
      "type": "string"
    },
    "number": {
      "type": "string"
    },
    "seriesCode": {
      "type": "string"
    },
    "taxAmount": {
      "type": "number",
      "format": "double"
    },
    "taxWithheld": {
      "type": "number",
      "format": "double"
    },
    "total": {
      "type": "number",
      "format": "double"
    }
  },
  "$defs": {
    "ComplianceStatusV1": {
      "type": "object",
      "properties": {
        "completedAt": {
          "type": "string",
          "format": "date-time"
        },
        "errorCode": {
          "type": "string"
        },
        "errorMessage": {
          "type": "string"
        },
        "fingerprint": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "issuedAt": {
          "type": "string",
          "format": "date-time"
        },
        "qrPayload": {
          "type": "string"
        },
        "regime": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "LineV1": {
      "type": "object",
      "properties": {
        "baseAmount": {
          "type": "number",
          "format": "double"
        },
        "description": {
          "type": "string"
        },
        "quantity": {
          "type": "number",
          "format": "double"
        },
        "taxAmount": {
          "type": "number",
          "format": "double"
        },
        "taxRate": {
          "type": "number",
          "format": "double"
        },
        "total": {
          "type": "number",
          "format": "double"
        },
        "unitPrice": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "PartyV1": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "countryCode": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "postCode": {
          "type": "string"
        },
        "province": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "taxId": {
          "type": "string"
        },
        "town": {
          "type": "string"
        },
        "tradeName": {
          "type": "string"
        }
      }
    }
  }
}