How to setup streaks?
This article explains how to set up streaks feature on your custom storefront.
Before you start
- Setting up streaks requires use of Loop storefront API here.
- To learn what is streaks and how to set it up on your admin portal, please refer to this help article.
Pre-requisites
- Configure everything in Loop admin (program, eligibility, streak length, grace period, rewards, texts) and set the program Active.
- On the storefront, you only fetch streak details and render the banner (no streak logic on frontend).
- Keep subscriptionId ready and pass locale if you want localized banner texts in the endpoint.
Storefront API - Fetch Streak Details
- Endpoint (GET):
- Path Params:
subscriptionId: The unique identifier for a subscription in Loop.
- Query Params:
locale(string, optional): This parameter allows you to fetch streak banner texts in a specific language.
Note: If locale is not passed, the API returns content in the store’s default language.
Endpoint payload (what it returns)
The response includes:
programName(string): streak program namestreakLength(integer): total milestones (example: 5-order streak)gracePeriod(integer): allowed window after due date to keep the streakstatus(string): current streak state (example:ACTIVE)nextDueDate(string): next scheduled order date/time (UTC)rewards(array): milestone list
Each milestone contains:
orderNumber(integer): milestone number (1, 2, 3…)rewardType(string): reward at that milestone (example:NONE,GIFT)rewardConfig(object | null): reward metadata (null whenrewardType=NONE)texts(object): banner text + optional images (locale-aware via?locale=)
Updated 1 day ago