{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sitegpt-ai/json-schema/sitegpt-ai-invoice-schema.json",
  "title": "Invoice",
  "description": "A billing transaction with its invoice download link.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sitegpt-ai-openapi.json#/components/schemas/Invoice",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "subscriptionStatus": {
      "type": [
        "string",
        "null"
      ]
    },
    "customerId": {
      "type": "string"
    },
    "subscriptionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "invoiceId": {
      "type": [
        "string",
        "null"
      ]
    },
    "invoiceNumber": {
      "type": [
        "string",
        "null"
      ]
    },
    "currencyCode": {
      "type": "string"
    },
    "amount": {
      "type": [
        "string",
        "null"
      ]
    },
    "amountFormatted": {
      "type": [
        "string",
        "null"
      ]
    },
    "origin": {
      "type": "string"
    },
    "collectionMode": {
      "type": "string"
    },
    "billingPeriod": {
      "$ref": "#/$defs/GenericObject",
      "description": "Billing period start and end."
    },
    "billedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "paidAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "downloadUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "PDF invoice download URL, when available."
    },
    "paymentMethod": {
      "type": [
        "string",
        "null"
      ]
    },
    "products": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GenericObject",
        "description": "Purchased product line item."
      }
    }
  },
  "$defs": {
    "GenericObject": {
      "type": "object",
      "additionalProperties": true
    }
  }
}