{
  "$id": "https://schema.nfh.global/Invoice/v2.0",
  "x-iri": "https://schema.nfh.global/Invoice/v2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Schema definition for Invoice in the Beckn Protocol",
  "title": "Invoice",
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "format": "uri",
      "example": "https://raw.githubusercontent.com/beckn/protocol-specifications-new/refs/heads/main/schema/core/v2/context.jsonld"
    },
    "@type": {
      "type": "string",
      "enum": [
        "beckn:Invoice"
      ],
      "x-jsonld": {
        "@id": "schema:Invoice"
      }
    },
    "beckn:id": {
      "type": "string",
      "description": "Stable invoice identifier (system id)",
      "x-jsonld": {
        "@id": "schema:identifier"
      }
    },
    "beckn:number": {
      "type": "string",
      "description": "Human-visible invoice number",
      "x-jsonld": {
        "@id": "schema:confirmationNumber"
      }
    },
    "beckn:issueDate": {
      "type": "string",
      "format": "date",
      "x-jsonld": {
        "@id": "schema:dateIssued"
      }
    },
    "beckn:dueDate": {
      "type": "string",
      "format": "date",
      "nullable": true,
      "x-jsonld": {
        "@id": "schema:paymentDueDate"
      }
    },
    "beckn:payee": {
      "$ref": "https://schema.nfh.global/Provider/v2.1/schema.json",
      "description": "Seller / issuer of the invoice",
      "x-jsonld": {
        "@id": "schema:provider"
      }
    },
    "beckn:payer": {
      "$ref": "https://schema.nfh.global/Buyer/v2.0/schema.json",
      "description": "Buyer being invoiced",
      "x-jsonld": {
        "@id": "schema:customer"
      }
    },
    "beckn:totals": {
      "$ref": "https://schema.nfh.global/PriceSpecification/v2.1/schema.json",
      "description": "Invoice grand totals (tax/shipping/discount components inside)",
      "x-jsonld": {
        "@id": "schema:priceSpecification"
      }
    },
    "beckn:invoiceAttributes": {
      "$ref": "https://schema.nfh.global/Attributes/v2.0/schema.json",
      "description": "Attribute Pack for tax regime (e.g., GST/VAT), e-invoice refs, legal boilerplate, etc."
    }
  },
  "required": [
    "@context",
    "@type",
    "beckn:id",
    "beckn:number",
    "beckn:issueDate",
    "beckn:totals",
    "beckn:payee",
    "beckn:payer"
  ],
  "additionalProperties": false
}
