{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "InvoiceLine.json",
  "title": "Invoice line",
  "description": "One line on an invoice.",
  "type": "object",
  "properties": {
    "serviceId": {
      "type": "integer",
      "format": "int32",
      "description": "The service in the organization's catalogue."
    },
    "description": {
      "type": "string",
      "description": "Ready to display: the service name, then — detail, then (qty × rate)."
    },
    "detail": {
      "type": [
        "string",
        "null"
      ],
      "description": "Your detail text for the line."
    },
    "quantity": {
      "type": "number",
      "format": "decimal",
      "description": "Quantity. 1 when the line was sent as an amount."
    },
    "unitPrice": {
      "type": "number",
      "format": "decimal",
      "description": "Rate per unit."
    },
    "amount": {
      "type": "number",
      "format": "decimal",
      "description": "Line amount, net of VAT."
    }
  },
  "required": [
    "serviceId",
    "description",
    "detail",
    "quantity",
    "unitPrice",
    "amount"
  ]
}
