{
  "$id": "https://schema.nfh.global/Invoice/v2.1",
  "x-iri": "https://schema.nfh.global/Invoice/v2.1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Schema definition for Invoice in the Beckn Protocol v2.0.1",
  "title": "Invoice",
  "type": "object",
  "properties": {
    "dueDate": {
      "type": [
        "string",
        "null"
      ],
      "x-jsonld": {
        "@id": "schema:paymentDueDate"
      },
      "format": "date"
    },
    "id": {
      "description": "Stable invoice identifier (system id)",
      "type": "string",
      "x-jsonld": {
        "@id": "schema:identifier"
      }
    },
    "invoiceAttributes": {
      "description": "Attribute Pack for tax regime (e.g., GST/VAT), e-invoice refs, legal boilerplate, etc.",
      "$ref": "https://schema.nfh.global/Attributes/v2.0/schema.json"
    },
    "issueDate": {
      "type": "string",
      "x-jsonld": {
        "@id": "schema:dateIssued"
      },
      "format": "date"
    },
    "number": {
      "description": "Human-visible invoice number",
      "type": "string",
      "x-jsonld": {
        "@id": "schema:confirmationNumber"
      }
    },
    "payee": {
      "description": "Seller / issuer of the invoice",
      "x-jsonld": {
        "@id": "schema:provider"
      },
      "$ref": "https://schema.nfh.global/Provider/v2.1/schema.json"
    },
    "payer": {
      "description": "consumer being invoiced",
      "x-jsonld": {
        "@id": "schema:customer"
      },
      "$ref": "https://schema.nfh.global/Consumer/v2.0/schema.json"
    },
    "costBreakup": {
      "type": "array",
      "items": {
        "$ref": "https://schema.nfh.global/PriceSpecification/v2.1/schema.json"
      }
    }
  },
  "required": [
    "id",
    "number",
    "issueDate",
    "payee",
    "payer"
  ],
  "additionalProperties": false,
  "x-tags": [
    "common"
  ]
}
