The
_cycle property format is subject to change as we iterate on it. Integrations and automations should use Shopify Flow instead of relying directly on this token._cycle property is attached to Shopify order line items and contains all information needed to create a rental. If an item doesn’t have a _cycle property, Supercycle will not process that item.
Structure
The_cycle format organizes rental data into two special sections (item and attachments), with all other rental attributes at the root level.
Root level fields
| Field | Type | Description |
|---|---|---|
item | Object | Item selection rules. |
attachments | Object (optional) | Additional data attached to the rental. |
method_type | String | Rental type: calendar, subscription, membership, or resale. |
rental_start | Date | When the rental period starts. |
rental_end | Date | When the rental period ends. |
Item object
Theitem object specifies what is being rented and how to filter available inventory.
| Field | Type | Description |
|---|---|---|
item.type | String | Only existing for now (selects from existing inventory). |
item.filters | Object (optional) | Rules for selecting which item to use. |
Filters
| Field | Type | Description |
|---|---|---|
item.filters.availability | Object (optional) | Date range filter. |
item.filters.availability.from | Date | Item must be available from this date. |
item.filters.availability.to | Date | Item must be available until this date. |
item.filters.location | Object (optional) | Location filter. |
item.filters.location.shopify_id | Integer | Shopify location ID. |
item.filters.condition | Object (optional) | Condition filter. |
item.filters.condition.ids | Array of integers | Acceptable condition IDs. |
Attachments object
Theattachments object contains optional add-ons for the rental. All attachments are optional.
| Field | Type | Description |
|---|---|---|
attachments.membership_credit | Object (optional) | Membership credit information. |
attachments.membership_credit.cost | Integer | Credit cost for this rental. |
attachments.deposit | Object (optional) | Deposit information. |
attachments.deposit.shopify_id | Integer | Shopify variant ID for the deposit. |
attachments.custom_fields | Object (optional) | Custom field key-value pairs. |
attachments.subscription_contract | Object (optional) | Subscription contract details. |
Code example
Validations property
A separate_validations property on the line item contains cart validation rules. This property exists alongside the _cycle property.
Available validations
| Validation | Fields | Description |
|---|---|---|
quantity | max (integer) | Maximum quantity that can be added to cart. Corresponds to the available item count. |
membership | credits (integer) | Credit cost for membership rentals. |
required_variant | id (integer), per_line (integer) | Required variant (e.g., deposit) that must be in cart. id is the Shopify variant ID, per_line is quantity required per line item. |
uniformity | key (string), value (any) | Enforces that all line items in cart have the same value for a given key. |
Example
Examples
How it works
- Generation: The
_cycleproperty is generated when a customer selects rental options in the storefront. - Storage: The property is attached to the line item as a custom property named
_cycle. - Processing: When an order is processed, Supercycle reads the property and creates rentals based on the information it contains.