Skip to main content
All methods return promises and reject with an SdkApiError on API failure. Offers returned by these methods are cached by slug so they can be passed to openOffer() and trackingUrl() as strings. If a member is signed in, requests include their token so the API can return member-specific rates where applicable.

offers.list()

Fetch a page of offers.
Free-text search. Matches against the offer name and domain, case-insensitively.
string
Return only offers whose category equals this string exactly.
number
Maximum number of offers to return. Defaults to the server’s page size.
number
default:"0"
Number of offers to skip, for pagination.
Empty-string and undefined parameters are omitted from the request. Returns
Offer[]
The offers for this page, with pinned offers first. See Offer.
number
Total number of offers matching the filters, across all pages.

offers.get()

Fetch a single offer by slug.
string
required
The offer’s slug, e.g. "nike".
Returns the Offer, or null if the API responds 404. Other errors reject.

Caching behaviour

Every offer returned by list() or get() is stored in an in-memory map keyed by slug for the lifetime of the page. This cache exists so that openOffer("nike") and trackingUrl("nike") can resolve a slug to its clickUrl without a network round trip. It is not a response cache — calling list() twice makes two requests.