{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/infiniteaudience-ai/json-schema/infiniteaudience-ai-monthly-renewal-control-result-schema.json",
  "title": "MonthlyRenewalControlResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/infiniteaudience-ai-integrations-api-openapi.yml#/components/schemas/MonthlyRenewalControlResult",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "authorization"
      ],
      "properties": {
        "authorization": {
          "oneOf": [
            {
              "$ref": "#/$defs/MonthlyRenewalAuthorization"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    {
      "type": "object",
      "required": [
        "billing_terms_fingerprint",
        "billing_channel",
        "currency",
        "worst_case_cents",
        "full_limit_fits_budget",
        "selected_fields",
        "max_records_per_month",
        "max_charge_cents_per_month",
        "expires_at"
      ],
      "properties": {
        "billing_terms_fingerprint": {
          "type": "string"
        },
        "billing_channel": {
          "type": "string",
          "enum": [
            "native",
            "shopify"
          ]
        },
        "currency": {
          "type": "string"
        },
        "worst_case_cents": {
          "type": "integer",
          "minimum": 0
        },
        "full_limit_fits_budget": {
          "type": "boolean"
        },
        "selected_fields": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "max_records_per_month": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000000
        },
        "max_charge_cents_per_month": {
          "type": "integer",
          "minimum": 1
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  ],
  "$defs": {
    "MonthlyRenewalAuthorization": {
      "type": "object",
      "required": [
        "version",
        "org_id",
        "provider",
        "connection_id",
        "revision",
        "enabled",
        "scope",
        "selected_fields",
        "max_records_per_month",
        "max_charge_cents_per_month",
        "expires_at",
        "currency",
        "billing_terms_fingerprint",
        "approved_by",
        "approved_at",
        "revoked_by",
        "revoked_at"
      ],
      "properties": {
        "version": {
          "type": "integer",
          "const": 1
        },
        "org_id": {
          "type": "string"
        },
        "provider": {
          "type": "string",
          "enum": [
            "shopify",
            "hubspot",
            "klaviyo"
          ]
        },
        "connection_id": {
          "type": "string",
          "description": "Numeric shop ID for Shopify; provider-prefixed connection ID for HubSpot/Klaviyo."
        },
        "revision": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "scope": {
          "type": "string",
          "const": "known_expired_connection_identities"
        },
        "selected_fields": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "max_records_per_month": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000000
        },
        "max_charge_cents_per_month": {
          "type": "integer",
          "minimum": 1
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "currency": {
          "type": "string"
        },
        "billing_terms_fingerprint": {
          "type": "string"
        },
        "approved_by": {
          "type": "string"
        },
        "approved_at": {
          "type": "string",
          "format": "date-time"
        },
        "revoked_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "revoked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}