{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://froggit.ai/offers.schema.json",
  "title": "Froggit paid offer catalog",
  "description": "Machine-readable schema for Froggit offer catalog entries, same-origin buy routes, and Stripe checkout fallbacks.",
  "type": "object",
  "required": ["$schema", "updated_at", "namespace", "offers"],
  "properties": {
    "$schema": {
      "const": "https://froggit.ai/offers.schema.json"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "namespace": {
      "const": "commerce"
    },
    "description": {
      "type": "string"
    },
    "currency": {
      "const": "USD"
    },
    "contact": {
      "type": "string"
    },
    "pricing": {
      "type": "string",
      "format": "uri"
    },
    "buy_json": {
      "type": "string",
      "format": "uri"
    },
    "buy_page": {
      "type": "string",
      "format": "uri"
    },
    "buy_html": {
      "type": "string",
      "format": "uri"
    },
    "checkout_page": {
      "type": "string",
      "format": "uri"
    },
    "checkout_html": {
      "type": "string",
      "format": "uri"
    },
    "checkout_routes": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://froggit\\.ai/buy/"
      }
    },
    "checkout_alias_routes": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://froggit\\.ai/buy/"
      }
    },
    "recommended_first_checkout": {
      "$ref": "#/$defs/offer"
    },
    "recommended_quick_checkout": {
      "$ref": "#/$defs/offer"
    },
    "recommendedFirstCheckoutUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://froggit\\.ai/buy/"
    },
    "recommendedFirstDirectStripeCheckoutUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://buy\\.stripe\\.com/"
    },
    "recommendedQuickCheckoutUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://froggit\\.ai/buy/"
    },
    "recommendedQuickDirectStripeCheckoutUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://buy\\.stripe\\.com/"
    },
    "fast_paid_starts": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/offer"
      }
    },
    "offers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/offer"
      }
    },
    "links": {
      "type": "object",
      "required": [
        "label",
        "contact_url",
        "href"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "contact_url": {
          "type": "string",
          "format": "uri"
        },
        "subject": {
          "type": "string"
        },
        "href": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://froggit\\.ai/(invoice|buy/invoice|contact)"
        }
      },
      "additionalProperties": true
    }
  },
  "$defs": {
    "offer": {
      "type": "object",
      "required": ["id", "name", "price_usd", "cadence", "canonical_path"],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "price_usd": {
          "type": "number",
          "minimum": 0
        },
        "cadence": {
          "type": "string"
        },
        "canonical_path": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://froggit\\.ai/buy/"
        },
        "route_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://froggit\\.ai/buy/"
        },
        "checkout_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://buy\\.stripe\\.com/"
        }
      },
      "additionalProperties": true
    },
    "offer": {
      "type": "object",
      "required": [
        "name",
        "price",
        "route_url",
        "checkout_url"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "price": {
          "type": "number",
          "minimum": 0
        },
        "cadence": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
      "preferred_url": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://froggit\\.ai/buy/"
      },
        "route_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://froggit\\.ai/buy/"
        },
        "checkout_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://buy\\.stripe\\.com/"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
