{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commsharbor/json-schema/commsharbor-billing-public-schema.json",
  "title": "BillingPublic",
  "description": "The public billing view: catalog, x402 configuration and whether signup is invite-only.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commsharbor-billing-api-openapi.yml#/components/schemas/BillingPublic",
  "type": "object",
  "properties": {
    "catalog": {
      "allOf": [
        {
          "$ref": "#/$defs/BillingCatalog"
        }
      ],
      "description": "Plans and prices in force."
    },
    "payment": {
      "allOf": [
        {
          "$ref": "#/$defs/PlanoX402"
        }
      ],
      "description": "x402 configuration: network, asset, facilitator and where to pay."
    },
    "invite_only": {
      "type": "boolean",
      "description": "Whether new organizations require an invitation."
    }
  },
  "required": [
    "catalog",
    "payment",
    "invite_only"
  ],
  "$defs": {
    "BillingCatalog": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Catalog version, so a client can tell prices changed."
        },
        "trial": {
          "type": "object",
          "description": "What a new organization gets for free."
        },
        "pass": {
          "type": "object",
          "description": "The paid pass: what it grants and what it costs."
        },
        "topup": {
          "type": "object",
          "description": "One-off send top-up: size and price."
        },
        "checkout_live": {
          "type": "boolean",
          "description": "Whether live checkout is enabled. While false, a purchase returns an x402 challenge."
        },
        "global_recipient_hard_cap": {
          "type": "integer",
          "description": "Real recipients per month across the whole platform. This always prevails."
        },
        "auto_renew": {
          "type": "boolean",
          "description": "Always false — nothing here renews by itself."
        }
      },
      "required": [
        "version",
        "trial",
        "pass",
        "topup",
        "checkout_live",
        "global_recipient_hard_cap",
        "auto_renew"
      ],
      "description": "Plans and prices, versioned. Nothing here auto-renews — a pass or a top-up is bought once and runs out."
    },
    "PlanoX402": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Always `x402` — the only billing protocol accepted."
        },
        "mode": {
          "type": "string",
          "description": "Seller mode: `live` charges for real, `dev` lets calls through unpaid."
        },
        "network": {
          "type": "string",
          "description": "USDC network: `base` in production, `base-sepolia` in staging."
        },
        "chain_id": {
          "type": "integer",
          "description": "EVM chain ID of the network above, so the wallet signs on the right chain."
        },
        "pay_to": {
          "type": [
            "string",
            "null"
          ],
          "description": "Address that receives the payment."
        },
        "homolog": {
          "type": "boolean",
          "description": "Staging seam on: the loop can be closed without spending USDC."
        },
        "dev": {
          "type": "boolean",
          "description": "Development mode: the 402 is simulated."
        },
        "dev_gate": {
          "type": [
            "string",
            "null"
          ],
          "description": "How dev mode is unlocked, when it exists."
        },
        "facilitator": {
          "type": "string",
          "description": "URL of the facilitator that verifies and settles the payment."
        },
        "asset": {
          "type": "string",
          "description": "Accepted currency — always `USDC`."
        },
        "asset_address": {
          "type": "string",
          "description": "USDC contract on the network above."
        },
        "faucet": {
          "type": [
            "string",
            "null"
          ],
          "description": "Test-USDC faucet; only on base-sepolia."
        },
        "wallets": {
          "type": "object",
          "description": "Links to wallets that speak x402 (metamask, coinbase, base_app)."
        }
      },
      "required": [
        "provider",
        "mode",
        "network",
        "chain_id",
        "pay_to",
        "homolog",
        "dev",
        "dev_gate",
        "facilitator",
        "asset",
        "asset_address",
        "faucet",
        "wallets"
      ],
      "description": "x402 payment configuration in force. Comes from `planPublic` and is the same across the products."
    }
  }
}