{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lune/json-schema/lune-bundle-portfolio-schema.json",
  "title": "BundlePortfolio",
  "description": "A curated group of predefined project bundles., e.g., Oxford Offsetting Principles.\n\nProject bundles for a particular Bundle portfolio may change over time.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lune-bundle-portfolios-api-openapi.yml#/components/schemas/BundlePortfolio",
  "type": "object",
  "required": [
    "id",
    "identifier",
    "label",
    "bundle_selection"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Bundle portfolio unique identifier."
    },
    "identifier": {
      "type": "string",
      "description": "Identifier of the bundle portfolio."
    },
    "label": {
      "type": "string",
      "description": "Human readable name of the bundle portfolio."
    },
    "bundle_selection": {
      "$ref": "#/$defs/BundleSelection"
    }
  },
  "$defs": {
    "BundlePercentage": {
      "type": "object",
      "description": "Maps a bundle's unique identifier to an allocation ratio",
      "required": [
        "bundle_id",
        "percentage"
      ],
      "properties": {
        "bundle_id": {
          "type": "string",
          "description": "The bundle's unique identifier"
        },
        "percentage": {
          "oneOf": [
            {
              "type": "integer",
              "description": "Selection percentage",
              "x-lune-name": "Selection percentage as integer"
            },
            {
              "type": "string",
              "pattern": "^[0-9]+(\\.\\d{1,2})?$",
              "description": "Selection percentage in decimals",
              "x-lune-name": "Selection percentage in decimals"
            }
          ]
        }
      }
    },
    "BundleSelection": {
      "type": "array",
      "description": "A Bundle Selection represents an account's default project bundle ratios that are used when an order is placed without specifying project bundles.\n\nAn account initial project bundle selection is\n* Conserving forests in Asia - 95%\n* Ocean Carbon Removal - 5%\n",
      "items": {
        "$ref": "#/$defs/BundlePercentage"
      }
    }
  }
}