{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-plan-schema.json",
  "title": "Plan",
  "description": "A billing plan defining the recurring charge amount and frequency. Reusable across multiple subscriptions.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-plans-api-openapi.yml#/components/schemas/Plan",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Plan ID. Prefix: plan_"
    },
    "entity": {
      "type": "string",
      "enum": [
        "plan"
      ]
    },
    "interval": {
      "type": "integer",
      "description": "Number of periods between charges. For daily period, minimum interval is 7."
    },
    "period": {
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly",
        "quarterly",
        "yearly"
      ],
      "description": "Billing frequency unit. daily requires interval ≥ 7."
    },
    "item": {
      "$ref": "#/$defs/Item",
      "description": "The item (price, currency, name) billed each cycle."
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer"
    }
  },
  "$defs": {
    "Item": {
      "type": "object",
      "description": "A reusable catalog item used in invoice line items.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Item ID. Prefix: item_"
        },
        "entity": {
          "type": "string",
          "enum": [
            "item"
          ]
        },
        "active": {
          "type": "boolean",
          "description": "Whether the item is active and available for use in new invoices."
        },
        "amount": {
          "type": "integer",
          "description": "Item price in paise (smallest INR unit)."
        },
        "unit_amount": {
          "type": "integer",
          "description": "Per-unit price in paise."
        },
        "currency": {
          "type": "string",
          "default": "INR"
        },
        "name": {
          "type": "string",
          "description": "Display name of the item."
        },
        "description": {
          "type": "string"
        },
        "created_at": {
          "type": "integer"
        }
      }
    },
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    }
  }
}