{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-subscription-offer-dto-schema.json",
  "title": "SubscriptionOfferDto",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-commerce-openapi.yml#/components/schemas/SubscriptionOfferDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string"
    },
    "externalId": {
      "type": "string",
      "description": "The shopify selling plan group ID"
    },
    "type": {
      "type": "string",
      "enum": [
        "ONETIME_AND_SUBSCRIPTION",
        "ONE_TIME_AND_PREPAID_SUBSCRIPTION",
        "SUBSCRIPTION_ONLY",
        "PREPAID_SUBSCRIPTION_ONLY",
        "ONETIME_AND_SUBSCRIPTION_AND_PREPAID",
        "SUBSCRIPTION_AND_PREPAID",
        "MEMBERSHIP"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "ARCHIVED",
        "DRAFT"
      ]
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "subscriptionOfferOptions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SubscriptionOfferOptionDto"
      }
    },
    "cancellationFlowId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the associated cancellation flow, if any"
    },
    "trialDurationValue": {
      "type": [
        "number",
        "null"
      ]
    },
    "trialDurationUnit": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "DAYS",
        "WEEKS",
        "MONTHS",
        "YEARS"
      ]
    }
  },
  "required": [
    "id",
    "createdAt",
    "updatedAt",
    "externalId",
    "type",
    "status",
    "name",
    "description",
    "subscriptionOfferOptions",
    "trialDurationValue",
    "trialDurationUnit"
  ],
  "$defs": {
    "SubscriptionOfferOptionDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "externalId": {
          "type": "string",
          "description": "The shopify selling plan ID"
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "ONETIME_AND_SUBSCRIPTION",
            "ONE_TIME_AND_PREPAID_SUBSCRIPTION",
            "SUBSCRIPTION_ONLY",
            "PREPAID_SUBSCRIPTION_ONLY",
            "ONETIME_AND_SUBSCRIPTION_AND_PREPAID",
            "SUBSCRIPTION_AND_PREPAID",
            "MEMBERSHIP"
          ]
        },
        "name": {
          "type": "string"
        },
        "deliveryCadenceCount": {
          "type": "number"
        },
        "deliveryCadenceUnit": {
          "type": "string",
          "enum": [
            "HOUR",
            "DAY",
            "MONTH",
            "WEEK",
            "YEAR"
          ]
        },
        "billingCadenceCount": {
          "type": "number"
        },
        "billingCadenceUnit": {
          "type": "string",
          "enum": [
            "HOUR",
            "DAY",
            "MONTH",
            "WEEK",
            "YEAR"
          ]
        },
        "discount": {
          "type": "number"
        },
        "discountModifier": {
          "type": "string",
          "enum": [
            "PERCENTAGE",
            "AMOUNT",
            "FIXED_AMOUNT"
          ]
        },
        "archived": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "createdAt",
        "updatedAt",
        "externalId",
        "type",
        "name",
        "deliveryCadenceCount",
        "deliveryCadenceUnit",
        "billingCadenceCount",
        "billingCadenceUnit",
        "discount",
        "discountModifier",
        "archived"
      ]
    }
  }
}