API Reference

Bundle APIs overview

Loop bundle API suite consists of 7 APIs which can be used to

  1. Sell a subscription bundle with a custom experience
  2. Update a subscription bundle from the custom experience

Sell a subscription bundle

Stores can leverage the below APIs to sell a subscription bundle from a custom experience.

Retrieve a list of all active bundles.

Use case: Featuring a landing page listing all the bundles a store offers. Example bundles listing page .

Read bundle details for a specific bundle ID. Details include boxSizes, sellingPlans, products, discounts (if any), categories (if any).

Use case: Display the bundle builder page where customers select different products as part of their bundle. Example bundle builder page.

You must create a bundle transaction to create a bundle subscription in Loop. If not done, then once the subscription is purchased, line items are not bundled and remain separate.

Transaction ID must be created everytime a customer adds a bundle to the cart/ checkout. It helps ensure Loop has the latest and updated bundle data.

Add the generated txnId (API response) as line item property _bundleId: txnId for all bundle lines on the Shopify add.js call. Make sure that the property key name is _bundleId otherwise, Loop won't create the line as a bundle line.

Fetch translations for a specific bundle and in a particular locale.

Fetch bundle preferences as configured on the Loop admin portal.


Update a subscription bundle

Leverage the APIs below to update the bundle from a custom editing experience. These APIs work for both scenarios where brands use Loop’s or a custom subscription portal.

Whenever a customer lands on the edit bundle custom URL (configured on Loop admin), fetch details of a specific bundle the customer wants to edit by passing transactionId and token.

From Loop’s subscription portal
Customers will be redirected to the configured bundle edit page along with transactionId and token as URL query parameters which can be used to hit the API.

From a custom subscription portal
Use read subscription details API to read value of _bundleId line item property from any of the concerned bundle line items and pass it as transactionId. Use generate access token API and pass the accessToken as token in the API input.

Update details of the specific subscription bundle based on the new selection made from a custom bundle editing experience.

For authentication, pass the accessToken in API headers generated during the previous step.

On success, the API endpoint will respond with a returnUrl which can be further used to redirect customers back to the Loop subscription portal (if needed).