{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nevlo-io/json-schema/nevlo-io-invoice-schema.json",
  "title": "Invoice",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/nevlo-io-api-openapi.json#/components/schemas/Invoice",
  "type": "object",
  "required": [
    "id",
    "status",
    "currency",
    "amountDue",
    "amountPaid",
    "subtotal",
    "total",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Stripe invoice ID"
    },
    "number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable invoice number assigned by Stripe"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "open",
        "paid",
        "uncollectible",
        "void",
        "unknown"
      ]
    },
    "billingReason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why Stripe issued the invoice (e.g. subscription_create, subscription_cycle)"
    },
    "subscriptionId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stripe subscription this invoice belongs to, if any"
    },
    "currency": {
      "type": "string"
    },
    "amountDue": {
      "type": "number",
      "description": "Amount due in major currency units"
    },
    "amountPaid": {
      "type": "number",
      "description": "Amount actually paid in major currency units"
    },
    "subtotal": {
      "type": "number",
      "description": "Net subtotal before tax in major currency units (Stripe's excluding-tax figure when reported)"
    },
    "tax": {
      "type": [
        "number",
        "null"
      ],
      "description": "Tax share in major currency units. Null when no tax breakdown is reported."
    },
    "total": {
      "type": "number"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "paidAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "periodStart": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Billing period start (null when the Stripe API version no longer reports it at invoice level)"
    },
    "periodEnd": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Billing period end (null when the Stripe API version no longer reports it at invoice level)"
    },
    "hostedInvoiceUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Publicly hosted invoice page served by Stripe"
    },
    "invoicePdf": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "PDF download URL served by Stripe"
    }
  }
}