{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendletter-eu/json-schema/sendletter-eu-invoice-schema.json",
  "title": "Invoice",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendletter-eu-openapi.json#/components/schemas/Invoice",
  "type": "object",
  "required": [
    "id",
    "letterId",
    "issuedAt",
    "status",
    "priceCents",
    "vatCents",
    "totalCents",
    "currency",
    "reverseCharge",
    "pdfUrl",
    "creditNote"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Immutable invoice number, for example 2026-0042."
    },
    "letterId": {
      "type": "string",
      "description": "The letter this invoice belongs to."
    },
    "issuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "issued",
        "credited"
      ]
    },
    "priceCents": {
      "type": "integer",
      "description": "Net amount, excluding VAT."
    },
    "vatCents": {
      "type": "integer"
    },
    "totalCents": {
      "type": "integer"
    },
    "currency": {
      "type": "string",
      "enum": [
        "EUR"
      ]
    },
    "reverseCharge": {
      "type": "boolean"
    },
    "pdfUrl": {
      "type": "string",
      "description": "Authenticated API download path."
    },
    "creditNote": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "id",
        "issuedAt",
        "priceCents",
        "vatCents",
        "totalCents",
        "currency",
        "pdfUrl"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Immutable credit-note number."
        },
        "issuedAt": {
          "type": "string",
          "format": "date-time"
        },
        "priceCents": {
          "type": "integer",
          "description": "Negative net reversal."
        },
        "vatCents": {
          "type": "integer",
          "description": "Negative VAT reversal."
        },
        "totalCents": {
          "type": "integer",
          "description": "Negative gross reversal."
        },
        "currency": {
          "type": "string",
          "enum": [
            "EUR"
          ]
        },
        "pdfUrl": {
          "type": "string",
          "description": "Authenticated API download path."
        }
      }
    }
  }
}