{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/siima-online/json-schema/siima-online-plan-schema.json",
  "title": "Plan",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/siima-online-openapi.json#/components/schemas/Plan",
  "type": "object",
  "required": [
    "id",
    "name",
    "dataBytes",
    "durationDays",
    "priceUsd",
    "countries",
    "coverageType"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "providerId": {
      "type": "string"
    },
    "providerProductId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "dataBytes": {
      "type": "integer",
      "description": "Data allowance in bytes. Unlimited plans report Number.MAX_SAFE_INTEGER (9007199254740991) — treat that as \"unlimited\", never as a byte count, and exclude it from per-GB arithmetic."
    },
    "durationDays": {
      "type": "integer"
    },
    "priceUsd": {
      "type": "number",
      "description": "Wholesale-derived base price in USD. The buyer's final total is returned by createCheckoutLink."
    },
    "regions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "countries": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 2
      },
      "description": "ISO 3166-1 alpha-2 codes."
    },
    "coverageType": {
      "type": "string",
      "enum": [
        "country",
        "regional",
        "global"
      ]
    },
    "coverageLabel": {
      "type": [
        "string",
        "null"
      ]
    },
    "profileName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Supplier profile family (e.g. \"Profile 1\"). A top-up can only be added to an eSIM on the same profile; null means unknown and is never treated as compatible."
    },
    "throttleAtMb": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Unlimited plans only: megabytes at full speed before the fair-use limit, exactly as the supplier states it. Null for fixed-GB plans and for unlimited plans whose supplier publishes no figure — never substitute another plan's value."
    },
    "throttleSpeedKbps": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Unlimited plans only: speed after the fair-use limit, in kbps, as the supplier states it."
    },
    "throttlePeriod": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "day",
        "plan",
        null
      ],
      "description": "\"day\" = throttleAtMb refills every 24 hours from activation; \"plan\" = one allowance for the whole plan; null = not determinable."
    },
    "unlimitedTier": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "lite",
        "essential",
        "plus",
        "premium",
        null
      ],
      "description": "Which unlimited family this plan belongs to. Null on every fixed-GB plan, and on any unlimited plan whose family cannot be determined — null means unknown, never \"no family\". Not a price ladder: Premium gives one allowance for the whole plan rather than a daily one and undercuts Plus in many destination/length combinations, so order by price, not by family. Several families sell the same dataBytes and durationDays for one destination, so this is the field that tells those listings apart."
    },
    "isActive": {
      "type": "boolean"
    },
    "creditBackPercent": {
      "type": "number"
    },
    "syncedAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}