{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/red-hat-3scale/json-schema/red-hat-3scale-invoice-list-schema.json",
  "title": "InvoiceList",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/red-hat-3scale-invoices-api-openapi.yml#/components/schemas/InvoiceList",
  "type": "object",
  "properties": {
    "invoices": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Invoice"
      }
    }
  },
  "$defs": {
    "Invoice": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "pending",
            "unpaid",
            "paid",
            "failed",
            "cancelled"
          ]
        },
        "friendly_id": {
          "type": "string",
          "description": "Human-readable invoice ID (e.g., 2026-00000001)"
        },
        "month": {
          "type": "string",
          "description": "Billing month in YYYY-MM format"
        },
        "due_on": {
          "type": "string",
          "format": "date"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "cost": {
          "type": "number",
          "format": "float",
          "description": "Invoice total amount"
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code"
        },
        "account": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "org_name": {
              "type": "string"
            }
          }
        },
        "line_items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InvoiceLineItem"
          }
        }
      }
    },
    "InvoiceLineItem": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string",
          "description": "Description of the line item"
        },
        "cost": {
          "type": "number",
          "description": "Cost for this line item"
        },
        "quantity": {
          "type": "number",
          "description": "Quantity consumed"
        },
        "type": {
          "type": "string",
          "description": "Type of charge (setup, recurring, variable)"
        }
      }
    }
  }
}