To fetch a rental intent token, you will need the ID of the option that you are wanting to create a rental for, the option ID’s can be found under the configuration metafield of the product

product.metafields.supercycle.subscription_configuration

product.metafields.supercycle.membership_configuration

product.metafields.supercycle.calendar_configuration

Here is what the calendar_configuration metafield looks like, each rental period option will have a global_id.

{
  "rental_periods": [
    {
      "global_id": "gid://supercycle/CalendarRental::RentalPeriod/1",
      ...
    },
    {
      "global_id": "gid://supercycle/CalendarRental::RentalPeriod/2",
      ...
    }
  ],
  "fixed_fees": [...]
}

You will need to provide

  • The global_id of the option you would like to create a rental.
  • params for the option.

Calendar

ParamDescriptionRequired
rental_startThe date of when the customer would like to receive the item.Required

Subscription

ParamDescriptionRequired
rental_startThe date of when the customer would like to receive the item.Optional

Membership

No parameters.

Fetch rental intent token

POST {proxyPathPrefix}/rental_intents

supercycleFetch(
  "POST",
  "/rental_intents",
  { body: JSON.stringify({
	  variantId: 123456789,
	  option: {
		  globalID: "gid://supercycle/CalendarRental::RentalPeriod/1",
		  params: { rental_start: "2025-01-01" }
		}
  })
}).then(console.log)

The response will be a JSON object that will need to be added as a line item property with the key _rental_intent_token.