Skip to content

Loading Offers & Businesses

The Loop Media SDK provides consistent interfaces for loading offer and business related data.



Searching Collections by Tag

Lists of collections can be retrieved with the following code:

// lmgClient is an instance of Client
lmgClient.collection.list(); // returns Promise<Array<Collection>>

list() optionally accepts a list of collection "tags" to filter by

lmgClient.collection.list({ tags: ["tag-1", "tag-2"] });

Loading Collection Details and Contents

Load details for a specific Collection:

lmgClient.collection.get(collectionId); // returns Promise<Collection>

Load Businesses and Offers in a specific Collection:; // returns Promise<PagedList<Business>>

Each Business contains a list of Offers at that Business.

Global ordering point and geo area are used to sort and filter Locations and Offers.


Loading Offer Details

Get details of a specific Offer:

lmgClient.offer.get(offerId); // returns Promise<Offer>

Global ordering point is used to sort Offer's Locations.

Using Offers

Offer status and redemption are handled through a RedemptionController

Get a redemption controller for an Offer

const redemptionController = lmgClient.offer.getRedemptionController(

The redemption controller takes callbacks to be executed when something happens

// Called every time the Offer's redemption state is updated
// Guaranteed to be called once when attached
redemptionController.onStateChanged((redemptionState) => {
  console.log('State changed to ' + redemptionState.displayStatus);

// Called when there is an error redeeming
redemptionController.onError((error) => {

// Called when redemption is cancelled
redemptionController.onRedemptionCancelled(() => {
  console.log('Redemption cancelled');

// Called when redemption controller needs user confirmation
redemptionController.onPromptRequired((resolver) => {
  const useOffer = window.confirm('Are you sure you want to use this offer?');

Redeem offer

// returns nothing
// will result in callback for onStateChanged, onPromptRequired, or onError

Business Details

Get details of a specific Business, locationId) // returns Promise<Business>

Global ordering point and geo area are used to sort and filter Business' Locations and Offers.

Locations Lists

List Business Locations for Maps


Global ordering point and geo area are used to sort and filter Locations.


To search for offers:{ searchQuery: "Search Query" }); // returns Promise<PagedList<Business>>

Global ordering point and geo area are used to sort and filter Offers.

Bookmarked Offers

Bookmark an offer

  offerId,         // offer id to bookmark
  isBookmarked,    // true: set bookmark
                   // false: unset existing bookmark
    locationIds, // array of locationIds
    businessId   // string

Get bookmarked Offers{ limitToSaved: true }); // returns Promise<PagedList<Offer>>