{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/credit_note/v3.json",
  "title": "credit_note contract v3",
  "type": "object",
  "required": [
    "counterparty",
    "currency",
    "direction",
    "external_id",
    "issued_on",
    "status",
    "total"
  ],
  "properties": {
    "total": {
      "type": "number",
      "description": "the credit note total including tax",
      "x-demiton-requiredness": "required",
      "x-demiton-type": "money"
    },
    "due_on": {
      "type": "string",
      "description": "when the credit falls due",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "number": {
      "type": "string",
      "description": "the credit note number",
      "x-demiton-requiredness": "optional"
    },
    "status": {
      "type": "string",
      "description": "draft, authorised, paid or voided",
      "x-demiton-requiredness": "required"
    },
    "currency": {
      "type": "currency",
      "description": "the currency the credit note is in",
      "x-demiton-requiredness": "required"
    },
    "subtotal": {
      "type": "number",
      "description": "the total before tax",
      "x-demiton-requiredness": "optional",
      "x-demiton-type": "money"
    },
    "direction": {
      "type": "string",
      "description": "whether this is a receivable credit or a payable credit",
      "x-demiton-requiredness": "required"
    },
    "issued_on": {
      "type": "string",
      "description": "the credit note's date",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "reference": {
      "type": "string",
      "description": "the counterparty's reference",
      "x-demiton-requiredness": "optional"
    },
    "total_tax": {
      "type": "number",
      "description": "the tax on the credit note",
      "x-demiton-requiredness": "optional",
      "x-demiton-type": "money"
    },
    "line_items": {
      "type": "array",
      "description": "the credit note's lines",
      "x-demiton-requiredness": "optional"
    },
    "allocations": {
      "type": "array",
      "description": "which invoices the credit was applied to",
      "x-demiton-requiredness": "optional"
    },
    "external_id": {
      "type": "string",
      "description": "the source system's own credit note id",
      "x-demiton-requiredness": "required"
    },
    "counterparty": {
      "type": "string",
      "description": "the customer or supplier the credit is with",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "legal_entity": {
      "type": "string",
      "description": "the legal entity that holds the credit note",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "exchange_rate": {
      "type": "number",
      "description": "the exchange rate applied",
      "x-demiton-requiredness": "optional",
      "x-demiton-type": "decimal"
    },
    "fully_paid_on": {
      "type": "string",
      "description": "when the credit was fully used",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "day",
      "format": "date",
      "x-demiton-type": "date"
    },
    "applied_amount": {
      "type": "number",
      "description": "credit already applied",
      "x-demiton-requiredness": "optional",
      "x-demiton-type": "money"
    },
    "remaining_credit": {
      "type": "number",
      "description": "credit not yet allocated",
      "x-demiton-requiredness": "optional",
      "x-demiton-type": "money"
    }
  },
  "x-demiton-register-type": "credit_note",
  "x-demiton-contract-version": "3.0.1",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": [
      {
        "code": "ATO record-keeping rules",
        "title": "ATO business record-keeping rules (ITAA 1936 s 262A; TAA 1953 Sch 1 s 382-5)",
        "access": "public_summary",
        "region": "Australia",
        "edition": "ATO page updated 2025-08-01",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Corporations Act 2001 (Cth) s 286",
        "title": "Corporations Act 2001 (Cth) - obligation to keep financial records",
        "access": "full_text_verified",
        "clause": "s 286(1), 286(2) (7 years)",
        "region": "Australia",
        "edition": "current",
        "checked_on": "2026-09-14"
      },
      {
        "code": "PINT A-NZ Billing BIS",
        "title": "Peppol PINT A-NZ Billing BIS",
        "access": "full_text_verified",
        "clause": "preceding-invoice reference for credit notes",
        "region": "Australia",
        "edition": "1.1.3",
        "checked_on": "2026-09-14"
      },
      {
        "code": "EN 16931-1:2017",
        "title": "CEN EN 16931-1 semantic data model (covers invoice and credit note)",
        "access": "public_summary",
        "region": "European Union",
        "edition": "2017 (2026 edition published)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "Peppol BIS Billing 3.0",
        "title": "Peppol BIS Billing 3.0 (CIUS of EN 16931)",
        "access": "full_text_verified",
        "clause": "conformance statement; business requirement groups",
        "region": "International",
        "edition": "3.0.21 (May 2026 release)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "GST Act 1985 (NZ)",
        "title": "Goods and Services Tax Act 1985 (NZ) - supply correction information",
        "access": "public_summary",
        "clause": "supply correction information (s 19N per legislation index)",
        "region": "New Zealand",
        "edition": "from 1 Apr 2023",
        "checked_on": "2026-09-14"
      },
      {
        "code": "PINT A-NZ Billing BIS",
        "title": "Peppol PINT A-NZ Billing BIS",
        "access": "full_text_verified",
        "clause": "preceding-invoice reference for credit notes",
        "region": "New Zealand",
        "edition": "1.1.3",
        "checked_on": "2026-09-14"
      }
    ]
  },
  "description": "Credit notes issued against invoices.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/credit_note/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}