Endpoints
Intent
Create a rental intent for a variant, including any add-ons, through the Storefront API
POST
Returns the form attributes that turn a line item into a cycle when it’s added to the cart.
Each method (calendar, subscription, membership, and resale) stores its options in a product metafield. Every option has a
With the variant ID and the option’s
Copy every property except
global_id, which is what you pass to this endpoint.
The options array in each metafield carries a
global_id per option:
Calendar configuration
global_id, call this endpoint to get the attributes to attach to the line item so Supercycle processes it as a cycle.
The response attributes object is a set of key-value pairs to include when you submit the add-to-cart form. Add each one as a hidden input on the product form, or set it on the request body when you submit with AJAX. See Cycle line item property and Validations line item property for the full schema.
Hidden inputs
AJAX with fetch
Shipping destination
On stores using the new shipping settings, send the destination you sent to the Availability log as alogistics object, so the booked dates match the availability the customer saw.
Intent shipping to a postal code
Add-ons
add_ons are extra variants to submit in the same /cart/add request as the cycle, in the format of Shopify’s Cart AJAX API. Include every add-on property except cart_quantity as items[n][property]:
Add-ons in the cart request
cart_quantity. If you leave off parent_id, the add-on isn’t nested under the cycle.
cart_quantity isn’t submitted. It’s the maximum total quantity of that variant that should be in the cart. Before you add the add-on, check the current cart and skip it if the quantity would exceed cart_quantity.
Submit parent_id from the response. It’s the Shopify variant ID of the cycle. Shopify nests the add-on under that cart line and removes the add-on with the line. Deposits and card authorizations omit parent_id and stay separate lines.
Shopify POS adds the add-on as its own line. Draft orders can’t nest a line, so the add-on stays separate there too.
Send the cycle and the add-on in the same request, as the product form does. A later request is rejected with Cannot reference existing parent lines by variant_id, and the add-on isn’t added.
properties[For] is the cycle product’s title, stored as a line item property on the add-on.
When the same product is rented twice with the same add-on, each cycle gets its own add-on line.
Those two add-on lines can share a Shopify line
key. Remove by line to remove one of them. Removing by key removes both.Path Parameters
Body
application/json
Response
Successful response with intent attributes and add-ons