{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-plan-percentage-tiers-schema.json",
  "title": "PlanPercentageTiers",
  "description": "Required if `tier_type != \"flat\"` and `usage_type == \"percentage\"`.\nArray of objects which must have at least one set of tiers\nper currency and the currency code. The tier_type must be `volume` or `tiered`,\nif not, it must be absent. There must be one tier without an `ending_amount_in_cents` value\nwhich represents the final tier.\n",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-plan-add-ons-api-openapi.yml#/components/schemas/PlanPercentageTiers",
  "type": "array",
  "items": {
    "$ref": "#/$defs/PercentageTierCollection"
  },
  "$defs": {
    "PercentageTierCollection": {
      "type": "object",
      "title": "Percentage Tier",
      "required": [
        "currency",
        "tiers"
      ],
      "properties": {
        "currency": {
          "type": "string",
          "title": "currency"
        },
        "tiers": {
          "$ref": "#/$defs/PercentageTiersArray"
        }
      }
    },
    "PercentageTierObject": {
      "type": "object",
      "title": "Tier",
      "required": [
        "ending_amount_in_cents",
        "usage_percentage"
      ],
      "properties": {
        "ending_amount_in_cents": {
          "type": "integer",
          "title": "Ending amount in cents"
        },
        "usage_percentage": {
          "$ref": "#/$defs/TierUsagePercentage"
        }
      }
    },
    "PercentageTiersArray": {
      "type": "array",
      "title": "Percentage Tiers",
      "items": {
        "$ref": "#/$defs/PercentageTierObject"
      }
    },
    "TierUsagePercentage": {
      "type": "string",
      "pattern": "^(100(\\.0{1,4})?|\\d{1,2}(\\.\\d{1,4})?)$",
      "description": "The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0000 and 100.0."
    }
  }
}