{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commsharbor/json-schema/commsharbor-oferta-de-assinatura-schema.json",
  "title": "OfertaDeAssinatura",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commsharbor-credito-api-openapi.yml#/components/schemas/OfertaDeAssinatura",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Offer ID: 2 to 64 characters. Start with a lowercase letter. Use lowercase letters, digits, hyphens or underscores."
    },
    "produto": {
      "type": "string",
      "description": "Product ID, with the same format as the offer ID."
    },
    "versao": {
      "type": "integer",
      "description": "Offer version: 1 to 1,000,000."
    },
    "preco_centavos": {
      "type": "integer",
      "description": "Price per cycle in cents: 500 to 1,000,000."
    },
    "moeda": {
      "type": "string",
      "description": "Fixed currency: BRL."
    },
    "ciclo": {
      "type": "string",
      "description": "MONTHLY for a monthly offer; WEEKLY for a weekly offer."
    },
    "renovacao_automatica": {
      "type": "boolean",
      "description": "true: billing repeats each cycle until cancellation."
    },
    "compromisso_meses": {
      "type": "integer",
      "description": "Present only for MONTHLY: one calendar month."
    },
    "compromisso_semanas": {
      "type": "integer",
      "description": "Present only for WEEKLY: one seven-day period."
    },
    "cancelamento": {
      "type": "string",
      "description": "stop_future_charges: stop new charges."
    },
    "acesso_pago": {
      "type": "string",
      "description": "until_paid_period_end: keep access until the paid period ends."
    },
    "teste_dias": {
      "type": "integer",
      "description": "Configured trial length: 0 to 30 days. Reading the catalog grants no trial or benefit."
    },
    "primeira_cobranca": {
      "type": "string",
      "description": "First charge date in Brasilia (YYYY-MM-DD), selected by the server to preserve the current period. Included in the offer hash and acceptance."
    },
    "desconto_primeira_cobranca_centavos": {
      "type": "integer",
      "description": "Deduction in cents for the first invoice only, at most the cycle price. Requires primeira_cobranca and is included in the accepted offer hash. Following cycles keep preco_centavos."
    },
    "conversao_teste": {
      "type": "string",
      "description": "opt_in: a trial does not create or renew a subscription."
    },
    "beneficios": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BeneficioDeAssinatura"
      },
      "description": "1 to 8 distinct capabilities for each paid period."
    },
    "hash": {
      "type": "string",
      "description": "SHA-256 of the complete offer: 64 lowercase hexadecimal characters."
    }
  },
  "required": [
    "id",
    "produto",
    "versao",
    "preco_centavos",
    "moeda",
    "ciclo",
    "renovacao_automatica",
    "compromisso_meses",
    "compromisso_semanas",
    "cancelamento",
    "acesso_pago",
    "teste_dias",
    "conversao_teste",
    "beneficios",
    "hash"
  ],
  "$defs": {
    "BeneficioDeAssinatura": {
      "type": "object",
      "properties": {
        "sku": {
          "type": "string",
          "description": "Product capability: a lowercase letter followed by letters, digits or underscores; at most 64 characters."
        },
        "quantidade": {
          "type": "integer",
          "description": "1 to 1,000,000 units for each paid period."
        }
      },
      "required": [
        "sku",
        "quantidade"
      ]
    }
  }
}