{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/halaxy/json-schema/halaxy-invoice-schema.json",
  "title": "Invoice",
  "description": "An Invoice.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/halaxy-invoice-api-openapi.yml#/components/schemas/Invoice",
  "type": "object",
  "deprecated": false,
  "properties": {
    "identifier": {
      "description": "Business Identifier for item",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FhirIdentifier"
      }
    },
    "recipient": {
      "description": "The individual or organization billed on this invoice (patient or organization)",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirReference"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "description": "Status of the invoice",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "active",
        "deleted",
        "issued",
        "write-off",
        "pending-confirmation",
        null
      ]
    },
    "date": {
      "description": "Date of the invoice",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "dueDate": {
      "description": "Due date of the invoice",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "payorType": {
      "description": "Type of payor billed on the invoice",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "organisation",
        "patient",
        null
      ]
    },
    "title": {
      "description": "The patient's name as the invoice title",
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "description": "The kind of invoice document - e.g. invoice or quote",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirCodeableConcept"
        },
        {
          "type": "null"
        }
      ]
    },
    "practitioner": {
      "description": "PractitionerRole (practitioner and location) who created the invoice",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirReference"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "description": "Additional comments in the Notes section of the invoice (may contain HTML elements)",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirAnnotation"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalNet": {
      "description": "Total amount of the invoice without taxes",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirMoney"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalGross": {
      "description": "Total amount of the invoice with taxes",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirMoney"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalBalance": {
      "description": "Total unpaid amount on the invoice",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirMoney"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalTax": {
      "description": "Total amount of the taxes",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirMoney"
        },
        {
          "type": "null"
        }
      ]
    },
    "totalPaid": {
      "description": "Total paid amount on the invoice",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirMoney"
        },
        {
          "type": "null"
        }
      ]
    },
    "text": {
      "readOnly": true,
      "description": "Text summary of the resource, for human interpretation",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirNarrative"
        },
        {
          "type": "null"
        }
      ]
    },
    "contained": {
      "readOnly": true,
      "description": "Contained, inline Resources",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FhirResourceInterface"
      }
    },
    "id": {
      "readOnly": true,
      "description": "Logical id of this artifact",
      "type": [
        "string",
        "null"
      ]
    },
    "meta": {
      "description": "Metadata about the resource",
      "anyOf": [
        {
          "$ref": "#/$defs/FhirResourceMeta"
        },
        {
          "type": "null"
        }
      ]
    },
    "resourceType": {
      "description": "Resource Type",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "FhirAnnotation": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "authorString": {
          "description": "The individual responsible for making the annotation",
          "type": [
            "string",
            "null"
          ]
        },
        "authorReference": {
          "anyOf": [
            {
              "$ref": "#/$defs/FhirReference"
            },
            {
              "type": "null"
            }
          ]
        },
        "time": {
          "description": "Indicates when this particular annotation was made",
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "text": {
          "description": "The text of the annotation",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirCodeableConcept": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "coding": {
          "description": "defined by a terminology system",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FhirCoding"
          }
        },
        "text": {
          "description": "Plain text representation of the concept",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirCoding": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "system": {
          "format": "uri",
          "description": "Identity of the terminology system",
          "type": [
            "string",
            "null"
          ]
        },
        "code": {
          "description": "Symbol in syntax defined by the system",
          "type": [
            "string",
            "null"
          ]
        },
        "display": {
          "description": "Representation defined by the system",
          "type": [
            "string",
            "null"
          ]
        },
        "userSelected": {
          "readOnly": true,
          "description": "If this coding was chosen directly by the user",
          "type": [
            "boolean",
            "null"
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirIdentifier": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "use": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "usual",
            "official",
            "temp",
            "secondary",
            "old",
            null
          ]
        },
        "type": {
          "description": "Description of identifier",
          "anyOf": [
            {
              "$ref": "#/$defs/FhirCodeableConcept"
            },
            {
              "type": "null"
            }
          ]
        },
        "system": {
          "description": "The namespace for the identifier value",
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "description": "The unique identifier",
          "type": [
            "string",
            "null"
          ]
        },
        "period": {
          "description": "The time period when identifier is/was valid for use",
          "anyOf": [
            {
              "$ref": "#/$defs/FhirPeriodDateTime"
            },
            {
              "type": "null"
            }
          ]
        },
        "assigner": {
          "description": "Organization that issued id (may be just text)",
          "anyOf": [
            {
              "$ref": "#/$defs/FhirReference"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirMoney": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "value": {
          "description": "The numerical value of the amount",
          "type": [
            "number",
            "null"
          ]
        },
        "currency": {
          "description": "The currency used in ISO 4217 currency code",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "AED",
            "AFN",
            "ALL",
            "AMD",
            "ANG",
            "AOA",
            "ARS",
            "AUD",
            "AWG",
            "AZN",
            "BAM",
            "BBD",
            "BDT",
            "BGN",
            "BHD",
            "BIF",
            "BMD",
            "BND",
            "BOB",
            "BRL",
            "BSD",
            "BTN",
            "BWP",
            "BYN",
            "BZD",
            "CAD",
            "CDF",
            "CHF",
            "CLP",
            "CNY",
            "COP",
            "CRC",
            "CUC",
            "CUP",
            "CVE",
            "CZK",
            "DJF",
            "DKK",
            "DOP",
            "DZD",
            "EGP",
            "ERN",
            "ETB",
            "EUR",
            "FJD",
            "FKP",
            "FOK",
            "GBP",
            "GEL",
            "GGP",
            "GHS",
            "GIP",
            "GMD",
            "GNF",
            "GTQ",
            "GYD",
            "HKD",
            "HNL",
            "HRK",
            "HTG",
            "HUF",
            "IDR",
            "ILS",
            "IMP",
            "INR",
            "IQD",
            "IRR",
            "ISK",
            "JEP",
            "JMD",
            "JOD",
            "JPY",
            "KES",
            "KGS",
            "KHR",
            "KID",
            "KMF",
            "KRW",
            "KWD",
            "KYD",
            "KZT",
            "LAK",
            "LBP",
            "LKR",
            "LRD",
            "LSL",
            "LYD",
            "MAD",
            "MDL",
            "MGA",
            "MKD",
            "MMK",
            "MNT",
            "MOP",
            "MRU",
            "MUR",
            "MVR",
            "MWK",
            "MXN",
            "MYR",
            "MZN",
            "NAD",
            "NGN",
            "NIO",
            "NOK",
            "NPR",
            "NZD",
            "OMR",
            "PAB",
            "PEN",
            "PGK",
            "PHP",
            "PKR",
            "PLN",
            "PYG",
            "QAR",
            "RON",
            "RSD",
            "RUB",
            "RWF",
            "SAR",
            "SBD",
            "SCR",
            "SDG",
            "SEK",
            "SGD",
            "SHP",
            "SLL",
            "SOS",
            "SRD",
            "SSP",
            "STN",
            "SVC",
            "SYP",
            "SZL",
            "THB",
            "TJS",
            "TMT",
            "TND",
            "TOP",
            "TRY",
            "TTD",
            "TVD",
            "TWD",
            "TZS",
            "UAH",
            "UGX",
            "USD",
            "USN",
            "UYI",
            "UYU",
            "UZS",
            "VEF",
            "VND",
            "VUV",
            "WST",
            "XAF",
            "XAG",
            "XAU",
            "XBA",
            "XBB",
            "XBC",
            "XBD",
            "XCD",
            "XDR",
            "XOF",
            "XPD",
            "XPF",
            "XPT",
            "XSU",
            "XTS",
            "XUA",
            "XXX",
            "YER",
            "ZAR",
            "ZMW",
            "ZWL",
            null
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirNarrative": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "status": {
          "readOnly": true,
          "description": "Describes how the narrative was generated",
          "type": "string",
          "enum": [
            "generated",
            "extensions",
            "additional",
            "empty"
          ]
        },
        "div": {
          "readOnly": true,
          "description": "Limited xhtml content",
          "type": "string"
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirPeriodDateTime": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "start": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "end": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirReference": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "required": [
        "reference"
      ],
      "properties": {
        "reference": {
          "description": "The URL (relative or absolute) to the resource being referenced",
          "type": "string"
        },
        "type": {
          "description": "The type of resource being referenced",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "Organization",
            "Patient",
            "Practitioner",
            "PractitionerRole",
            "Appointment",
            "Coverage",
            "Invoice",
            "Communication",
            "Group",
            "DocumentReference",
            "InvoiceLine",
            "PaymentTransaction",
            "Referral",
            "ReferralDefinition",
            "Schedule",
            "Slot",
            "HealthcareService",
            "AllergyIntolerance",
            "Condition",
            "Immunization",
            "Subscription",
            "SubscriptionTopic",
            "ChargeItemDefinition",
            "ServiceRequest",
            "Medication",
            "MedicationRequest",
            "Questionnaire",
            "QuestionnaireResponse",
            "ValueSet",
            "ValueSetConcept",
            "Observation",
            "Binary",
            "Bundle",
            "OperationOutcome",
            "Parameters",
            "List",
            null
          ]
        },
        "id": {
          "readOnly": true,
          "description": "ID of the FHIR element (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FhirResourceInterface": {
      "type": "object",
      "description": "",
      "deprecated": false
    },
    "FhirResourceMeta": {
      "type": "object",
      "description": "",
      "deprecated": false,
      "properties": {
        "lastUpdated": {
          "readOnly": true,
          "description": "When the resource version last changed",
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "profile": {
          "description": "Profiles this resource claims to conform to",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}