{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/payments-ai/json-schema/payments-ai-public-api-plan-schema.json",
  "title": "PublicApiPlan",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/payments-ai-products-api-openapi.yml#/components/schemas/PublicApiPlan",
  "type": "object",
  "required": [
    "id",
    "productId",
    "name",
    "type",
    "billingPeriod",
    "lengthOfBillingPeriod",
    "amount",
    "initialPrice",
    "currency",
    "freeTrial",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "productId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "type": "string"
    },
    "billingPeriod": {
      "type": "string"
    },
    "lengthOfBillingPeriod": {
      "type": "integer",
      "format": "int32"
    },
    "amount": {
      "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
    },
    "initialPrice": {
      "allOf": [
        {
          "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
        }
      ],
      "description": "Amount charged at checkout today. Zero for recurring plans with a free trial; otherwise matches amount."
    },
    "currency": {
      "type": "string"
    },
    "freeTrial": {
      "type": "integer",
      "format": "int32"
    },
    "taxBehavior": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "exclusive",
        "inclusive"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "SharedTypes.MoneyAmountValue": {
      "type": "number",
      "format": "decimal",
      "description": "Decimal money amount for financial values."
    }
  }
}