{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-cancellation-question-dto-schema.json",
  "title": "CancellationQuestionDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-cancellationquestions-api-api-openapi.yml#/components/schemas/CancellationQuestionDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string"
    },
    "reasonTitle": {
      "type": "string"
    },
    "category": {
      "type": "string",
      "enum": [
        "PRICE",
        "QUANTITY_AND_STOCK",
        "VARIANT",
        "QUALITY",
        "OTHER"
      ]
    },
    "retentionStrategy": {
      "allOf": [
        {
          "$ref": "#/$defs/RetentionStrategyDto"
        }
      ]
    },
    "isActive": {
      "type": "boolean"
    },
    "order": {
      "type": "number",
      "description": "The order of the question in the list"
    },
    "hiddenFromShopper": {
      "type": "boolean"
    },
    "secondaryQuestions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/SecondaryCancellationQuestionDto"
      }
    }
  },
  "required": [
    "id",
    "createdAt",
    "updatedAt",
    "reasonTitle",
    "category",
    "retentionStrategy",
    "isActive",
    "order",
    "hiddenFromShopper",
    "secondaryQuestions"
  ],
  "$defs": {
    "IncentiveDto": {
      "type": "object",
      "properties": {
        "discountType": {
          "type": "string",
          "enum": [
            "PERCENTAGE",
            "AMOUNT",
            "FIXED_AMOUNT"
          ]
        },
        "discountValue": {
          "type": "number"
        },
        "discountCode": {
          "type": "string"
        },
        "deliveriesToSkip": {
          "type": "number"
        },
        "supportNumber": {
          "type": "string"
        },
        "supportNumberDisplayed": {
          "type": "string"
        },
        "supportLinkHref": {
          "type": "string"
        }
      },
      "required": [
        "discountType",
        "discountValue",
        "discountCode",
        "deliveriesToSkip",
        "supportNumber",
        "supportNumberDisplayed",
        "supportLinkHref"
      ]
    },
    "RetentionStrategyDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "incentiveType": {
          "type": "string",
          "enum": [
            "discount",
            "skip",
            "pause",
            "swap",
            "frequency",
            "support",
            "gift",
            "link",
            "PAUSE_LIMIT",
            "APPLY_DISCOUNT"
          ]
        },
        "incentive": {
          "allOf": [
            {
              "$ref": "#/$defs/IncentiveDto"
            }
          ]
        },
        "ctaButtonCopy": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "createdAt",
        "updatedAt",
        "title",
        "subtitle",
        "incentiveType",
        "incentive",
        "ctaButtonCopy"
      ]
    },
    "SecondaryCancellationQuestionDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "reasonTitle": {
          "type": "string"
        },
        "category": {
          "type": "string",
          "enum": [
            "PRICE",
            "QUANTITY_AND_STOCK",
            "VARIANT",
            "QUALITY",
            "OTHER"
          ]
        },
        "retentionStrategy": {
          "allOf": [
            {
              "$ref": "#/$defs/RetentionStrategyDto"
            }
          ]
        },
        "isActive": {
          "type": "boolean"
        },
        "order": {
          "type": "number",
          "description": "The order of the question in the list"
        },
        "hiddenFromShopper": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "createdAt",
        "updatedAt",
        "reasonTitle",
        "category",
        "retentionStrategy",
        "isActive",
        "order",
        "hiddenFromShopper"
      ]
    }
  }
}