{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-graph-subscription-response-schema.json",
  "title": "GraphSubscriptionResponse",
  "description": "Response for graph or repository subscription details.",
  "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/GraphSubscriptionResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Subscription ID"
    },
    "resource_type": {
      "type": "string",
      "title": "Resource Type",
      "description": "Resource type (graph or repository)"
    },
    "resource_id": {
      "type": "string",
      "title": "Resource Id",
      "description": "Resource identifier"
    },
    "user_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id",
      "description": "Organization member the subscription belongs to. Set for repository subscriptions, which are billed to the org but granted per user."
    },
    "plan_name": {
      "type": "string",
      "title": "Plan Name",
      "description": "Current plan name"
    },
    "plan_display_name": {
      "type": "string",
      "title": "Plan Display Name",
      "description": "Human-readable plan name for UI display"
    },
    "billing_interval": {
      "type": "string",
      "title": "Billing Interval",
      "description": "Billing interval"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Subscription status"
    },
    "base_price_cents": {
      "type": "integer",
      "title": "Base Price Cents",
      "description": "Base price in cents"
    },
    "current_period_start": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Period Start",
      "description": "Current billing period start"
    },
    "current_period_end": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Period End",
      "description": "Current billing period end"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At",
      "description": "Subscription start date"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Canceled At",
      "description": "Cancellation date"
    },
    "ends_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ends At",
      "description": "Subscription end date (when access will be revoked, especially relevant for cancelled subscriptions)"
    },
    "created_at": {
      "type": "string",
      "title": "Created At",
      "description": "Creation timestamp"
    },
    "operation_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Operation Id",
      "description": "Operation ID for tracking async tier changes via SSE"
    }
  },
  "type": "object",
  "required": [
    "id",
    "resource_type",
    "resource_id",
    "plan_name",
    "plan_display_name",
    "billing_interval",
    "status",
    "base_price_cents",
    "created_at"
  ]
}