{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-subscription-line-dto-schema.json",
  "title": "SubscriptionLineDto",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-commerce-openapi.yml#/components/schemas/SubscriptionLineDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string"
    },
    "externalId": {
      "type": "string",
      "description": "The shopify contract line ID"
    },
    "subscriptionId": {
      "type": "string"
    },
    "variant": {
      "$ref": "#/$defs/VariantDto"
    },
    "quantity": {
      "type": "number"
    },
    "currentPrice": {
      "type": "number"
    },
    "subscriptionOfferOptionId": {
      "type": [
        "string",
        "null"
      ]
    },
    "sellingPlanId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The shopify selling plan ID of the subscription offer option"
    },
    "productFulfillmentTypeRestriction": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "PHYSICAL_ONLY",
        "DIGITAL_ONLY"
      ],
      "description": "Fulfillment type restriction declared on the subscription offer, if any"
    },
    "schedule": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/SubscriptionLineScheduleDto"
        }
      ]
    },
    "customAttributes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CustomAttribute"
      }
    },
    "bundleItems": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/BundleItemDto"
      }
    },
    "deletedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "createdAt",
    "updatedAt",
    "externalId",
    "subscriptionId",
    "variant",
    "quantity",
    "currentPrice",
    "subscriptionOfferOptionId",
    "sellingPlanId",
    "productFulfillmentTypeRestriction",
    "schedule",
    "customAttributes"
  ],
  "$defs": {
    "BundleItemDto": {
      "type": "object",
      "properties": {
        "variant": {
          "nullable": true,
          "allOf": [
            {
              "$ref": "#/$defs/VariantDto"
            }
          ]
        },
        "quantity": {
          "type": "number"
        },
        "currentPrice": {
          "type": "number"
        }
      },
      "required": [
        "variant",
        "quantity",
        "currentPrice"
      ]
    },
    "CustomAttribute": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "ProductForVariantDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "externalId": {
          "type": "string",
          "description": "The shopify product ID"
        },
        "imageUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "productTitle": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "createdAt",
        "updatedAt",
        "externalId",
        "imageUrl",
        "productTitle",
        "description"
      ]
    },
    "SubscriptionLineScheduleDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "deliveryInterval": {
          "type": "number",
          "description": "The frequency multiplier that determines how often an add-on product is included with deliveries. Values: 1 (every delivery), 2 (every other delivery), 3 (every third delivery), etc"
        },
        "deliveryStartOffset": {
          "type": "number",
          "description": "How many orders to skip before starting the delivery cadence"
        },
        "lastIncludedOrderNumber": {
          "type": "number"
        },
        "lastIncludedDate": {
          "format": "date-time",
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "deliveryInterval",
        "deliveryStartOffset",
        "lastIncludedOrderNumber",
        "lastIncludedDate",
        "createdAt",
        "updatedAt"
      ]
    },
    "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"
      ]
    },
    "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"
      ]
    },
    "VariantDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "externalId": {
          "type": "string",
          "description": "The shopify variant ID"
        },
        "status": {
          "type": "string",
          "enum": [
            "ACTIVE",
            "DELETED"
          ]
        },
        "currentPrice": {
          "type": "number"
        },
        "variantTitle": {
          "type": "string"
        },
        "sku": {
          "type": [
            "string",
            "null"
          ]
        },
        "requiresShipping": {
          "type": "boolean"
        },
        "product": {
          "nullable": true,
          "allOf": [
            {
              "$ref": "#/$defs/ProductForVariantDto"
            }
          ]
        },
        "subscriptionOffer": {
          "$ref": "#/$defs/SubscriptionOfferDto"
        }
      },
      "required": [
        "id",
        "externalId",
        "status",
        "currentPrice",
        "variantTitle",
        "sku",
        "requiresShipping"
      ]
    }
  }
}