{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-upcoming-invoice-schema.json",
  "title": "UpcomingInvoice",
  "description": "Upcoming invoice preview.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-billing-api-openapi.yml#/components/schemas/UpcomingInvoice",
  "properties": {
    "amount_due": {
      "type": "integer",
      "title": "Amount Due",
      "description": "Estimated amount due in cents"
    },
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "Currency code"
    },
    "period_start": {
      "type": "string",
      "title": "Period Start",
      "description": "Billing period start"
    },
    "period_end": {
      "type": "string",
      "title": "Period End",
      "description": "Billing period end"
    },
    "line_items": {
      "items": {
        "$ref": "#/$defs/InvoiceLineItem"
      },
      "type": "array",
      "title": "Line Items",
      "description": "Estimated line items"
    },
    "subscription_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Subscription Id",
      "description": "Associated subscription ID"
    }
  },
  "type": "object",
  "required": [
    "amount_due",
    "currency",
    "period_start",
    "period_end",
    "line_items"
  ],
  "$defs": {
    "InvoiceLineItem": {
      "properties": {
        "description": {
          "type": "string",
          "title": "Description",
          "description": "Line item description"
        },
        "amount": {
          "type": "integer",
          "title": "Amount",
          "description": "Amount in cents"
        },
        "quantity": {
          "type": "integer",
          "title": "Quantity",
          "description": "Quantity"
        },
        "period_start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Period Start",
          "description": "Billing period start"
        },
        "period_end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Period End",
          "description": "Billing period end"
        }
      },
      "type": "object",
      "required": [
        "description",
        "amount",
        "quantity"
      ],
      "title": "InvoiceLineItem",
      "description": "Invoice line item."
    }
  }
}