{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nbrain-studio.github.io/schemas/zatca-invoice.schema.json",
  "title": "NBrain Saudi ZATCA Phase 1/2 Invoice Payload",
  "type": "object",
  "required": [
    "sellerName",
    "vatNumber",
    "timestamp",
    "totalWithVat",
    "vatTotal"
  ],
  "properties": {
    "sellerName": {
      "type": "string",
      "minLength": 1
    },
    "vatNumber": {
      "type": "string",
      "pattern": "^3[0-9]{13}3$"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "totalWithVat": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]{2}$"
    },
    "vatTotal": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]{2}$"
    },
    "xmlHash": {
      "type": "string"
    },
    "ecdsaSignature": {
      "type": "string"
    }
  }
}
