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.
string
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.
undefined parameters are omitted from the request.
Returns
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".Offer, or null if the API responds 404. Other errors reject.
Caching behaviour
Every offer returned bylist() 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.