getMerchants GraphQL query to retrieve the current list of available merchants and their offers from the Fluz catalog. This is the primary way to discover which merchants are available and what kinds of deals they offer.
You can refine the results using optional input arguments:
name: Filter merchants by a specific name.paginate: Control the number of results per page (limit) and the starting point (offset).offerTypes: Specify whether you wantgiftCardOffers,cardLinkedOffers, or both using boolean flags (e.g.,{ giftCardOffer: true, cardLinkedOffer: false }).filterBy: An object used to apply specific filters to the offers within each merchant. If a merchant has no offers remaining after filtering, it is excluded from the final results.
Available filters:deliveryFormat: Filters gift card offers by their delivery method.
Allowed values:URL,CODES,PIN_AS_CODE,PIN_WITH_URL.
📘 Retrieving the entire merchant catalog without filters can be time-consuming. We recommend fetching the full, unfiltered catalog only once per day. For more frequent updates or specific lookups, use thenameorofferTypesfilters.
📘 Notes on pagination: The default and max limit for pagination is 20. The result will not necessarily return the amount that you define as the limit. For example, you may request a limit of 10, but the response may only have 7 results. When an offset is included, remember to include the limit amount in your offset calculation for the next batch. If no limit is specified, you will need to offset by the default limit of 20 (e.g. offset+20).
📘 Fetching the full merchant catalog: If you want all available merchants, you must paginate until the API returns an empty array. Steps to fetch the full catalog:
- Call getMerchants (offset = 0, limit = 20).
- Append the returned merchants to your local list.
- Increase the offset by your limit (offset += 20).
- Repeat the request.
- Stop only when the API returns an empty array ([]).
Basic query structure
Here’s a flexible query structure using variables. You can adjust theofferTypes variable to fetch the specific offers you need. This example requests only the most common, basic fields.
Sample request:
json
Response details
TheMerchant object returned by the getMerchants query includes the following fields:
Common Offer Fields (within offers array):
These fields are present in every
Offer object, regardless of its type.
Offer type specific details
The real details of an offer depend on itstype. You need to request and interpret different fields based on the offer type:
- For gift card offers (
GIFT_CARD_OFFER,EXCLUSIVE_RATE_OFFER):- Key fields include
offerRates,stockInfo,hasStockInfo,denominationsType,allowedPaymentMethods. - See the Gift Card Offers subpage for a detailed explanation and query examples.
- Key fields include
- For card linked offers (
CARD_LINKED_OFFER):- The primary field is
cloDetails, which contains rates, periods, and conditions. - See the Card Linked Offers subpage for a detailed explanation and query examples.
- The primary field is