{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getoneprofile-ai/json-schema/getoneprofile-ai-subscription-read-schema-schema.json",
  "title": "SubscriptionReadSchema",
  "description": "Response schema for subscription information.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getoneprofile-ai-billing-api-openapi.yml#/components/schemas/SubscriptionReadSchema",
  "properties": {
    "billing_email": {
      "anyOf": [
        {
          "format": "email",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The billing email address for invoices and billing alerts. ",
      "title": "Billing Email"
    },
    "billing_interval": {
      "anyOf": [
        {
          "enum": [
            "month",
            "year"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The billing interval of the subscription. None for free plans.",
      "title": "Billing Interval"
    },
    "cancel_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The date when the subscription is scheduled to be canceled. If set, the subscription will be canceled at this time. None if the subscription is not scheduled for cancellation.",
      "title": "Cancel At"
    },
    "credit_quantity": {
      "description": "The monthly credit allowance the subscription's own price grants.",
      "title": "Credit Quantity",
      "type": "integer"
    },
    "credit_tier_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The selected credit volume (e.g. 'team_tier_20k'). None for free plans.",
      "title": "Credit Tier Key"
    },
    "current_period_end": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The end of the current Stripe billing period. None for free plans: credit period truth lives on the credit balance.",
      "title": "Current Period End"
    },
    "current_period_start": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The start of the current Stripe billing period. None for free plans: credit period truth lives on the credit balance.",
      "title": "Current Period Start"
    },
    "current_price_decimal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "What the subscription actually costs per `billing_interval` unit, in cents, read off its own Stripe price. None for free plans. Prefer this over recomputing from the catalog: it stays right for a grandfathered price or a volume the catalog has since retired.",
      "title": "Current Price Decimal"
    },
    "data_retention": {
      "description": "Data retention period.",
      "format": "duration",
      "title": "Data Retention",
      "type": "string"
    },
    "included_credits": {
      "description": "Credits granted each period (the period allowance).",
      "title": "Included Credits",
      "type": "integer"
    },
    "is_product_limited": {
      "description": "Whether the product is currently limited due to usage or payment issues. \nWhen True, the organization cannot perform billable actions. \nThis happens in two scenarios: \n1. The credit balance is exhausted. \n2. The subscription status is UNPAID (payment failed or cancelled). \n",
      "title": "Is Product Limited",
      "type": "boolean"
    },
    "max_integrations": {
      "description": "Maximum number of integrations allowed. 0 means unlimited.",
      "title": "Max Integrations",
      "type": "integer"
    },
    "max_rows_per_table": {
      "description": "Maximum number of rows per table. 0 means unlimited.",
      "title": "Max Rows Per Table",
      "type": "integer"
    },
    "max_tables": {
      "description": "Maximum number of tables allowed. 0 means unlimited.",
      "title": "Max Tables",
      "type": "integer"
    },
    "payment_method": {
      "anyOf": [
        {
          "$ref": "#/$defs/PaymentMethodReadSchema"
        },
        {
          "type": "null"
        }
      ],
      "description": "The default payment card summary. None when no card is on file."
    },
    "product_name": {
      "description": "The product name for the subscription.",
      "title": "Product Name",
      "type": "string"
    },
    "product_type": {
      "$ref": "#/$defs/ProductTier",
      "description": "The product name for the subscription."
    },
    "seats": {
      "description": "Number of seats included. 0 means unlimited.",
      "title": "Seats",
      "type": "integer"
    },
    "status": {
      "$ref": "#/$defs/SubscriptionStatus",
      "description": "The subscription status. \n- active: User has active product with no past due fees. \n  - Product remains active with full functionality. \n- incomplete_payment: The first payment failed or is processing. \n  - Product remains active with full functionality. \n  - User action is required to activate. Otherwise the product will become UNPAID. \n- past_due: The subscription fees aren't paid. Stripe will retry to collect the payment. \n  - Product remains active with full functionality. \n  - No user action is needed yet. However a user can proactively solve the issue. \n- unpaid: The subscription fees aren't paid. Stripe will no longer try to collect the payment. \n  - Product is not functional anymore. \n  - Needs user action to activate. \n"
    }
  },
  "required": [
    "product_name",
    "product_type",
    "status",
    "current_period_start",
    "current_period_end",
    "billing_interval",
    "credit_tier_key",
    "current_price_decimal",
    "credit_quantity",
    "payment_method",
    "billing_email",
    "is_product_limited",
    "max_integrations",
    "included_credits",
    "max_tables",
    "max_rows_per_table",
    "data_retention",
    "seats"
  ],
  "type": "object",
  "$defs": {
    "PaymentMethodReadSchema": {
      "description": "Displayable summary of the organization's default payment card.",
      "properties": {
        "brand": {
          "description": "The card brand, e.g. 'visa'.",
          "title": "Brand",
          "type": "string"
        },
        "exp_month": {
          "description": "The card expiry month (1-12).",
          "title": "Exp Month",
          "type": "integer"
        },
        "exp_year": {
          "description": "The four-digit card expiry year.",
          "title": "Exp Year",
          "type": "integer"
        },
        "last4": {
          "description": "The last four digits of the card number.",
          "title": "Last4",
          "type": "string"
        }
      },
      "required": [
        "brand",
        "last4",
        "exp_month",
        "exp_year"
      ],
      "title": "PaymentMethodReadSchema",
      "type": "object"
    },
    "ProductTier": {
      "description": "The tier of a product in Stripe.\n\nDeclared cheapest-first. Free and Enterprise never touch Stripe: Free is\nfree, Enterprise is sales-led and has no self-serve price.\n\nA subscription's tier is recovered from its price's ``product_tier``\nmetadata, never by reverse-parsing a Stripe product name: a product is named\nfor the plan AND the credit volume it sells (\"Team Plan (10,000 credits)\"),\nso the name has not round-tripped to a tier since prices collapsed to one\nper plan+volume.",
      "enum": [
        "free_plan",
        "team_plan",
        "pro_plan",
        "enterprise_plan"
      ],
      "title": "ProductTier",
      "type": "string"
    },
    "SubscriptionStatus": {
      "description": "The status of a subscription for an organization.\n\nActive is the good state for all types of products. All other states are transitional states.\n\nWhen a subscription is cancelled, it becomes Free plan. We treat cancelled Stripe subscriptions\nas non-existent. Customer won't see any cancelled subscriptions on billing portal.\n\nThere is a long transition from:\nActive -> Past Due -> Unpaid -> Free",
      "enum": [
        "active",
        "incomplete_payment",
        "past_due",
        "unpaid"
      ],
      "title": "SubscriptionStatus",
      "type": "string"
    }
  }
}