giftCardsGetCatalogWithHttpInfo method

Future<Response> giftCardsGetCatalogWithHttpInfo({
  1. String? countryCode,
  2. String? category,
  3. String? valueType,
  4. bool? isRedeemableGlobally,
  5. String? currency,
  6. String? cursor,
  7. int? limit,
  8. Future<void>? abortTrigger,
})

Gift card catalog

Returns every gift card with its offers, page by page, for partner inventory. Returns { items, nextCursor }, ordered by card ID, with the search filters except q. Continue with nextCursor as cursor, the same filters and the same currency until it is null; a page can hold fewer cards than limit, even none, while nextCursor is not null. A cursor reused with other filters or another currency gives 400 / 10001. The walk is not a frozen snapshot: a card that appears or disappears during it may be missing. Quote confirms the final price and availability.

Note: This method returns the HTTP Response.

Parameters:

  • String countryCode: Optional ISO 3166-1 alpha-2 issuing country, in either case; every country when omitted. A card without a country is not listed when it is set, and a blank value or GLOBAL is rejected.

  • String category: Keep the cards of this category; categories lists the values.

  • String valueType: Keep only fixed or only range offers; a card left without an offer is dropped.

  • bool isRedeemableGlobally: true keeps only cards that can be redeemed in any country.

  • String currency: Price currency, three letters in either case; the API key's currency when omitted. An unsupported code gives 404 / 10004.

  • String cursor: The nextCursor of the previous page; omit it for the first page. Reuse it only with the same filters and currency.

  • int limit: Page size, 1 to 100; default 100.

Implementation

Future<Response> giftCardsGetCatalogWithHttpInfo({ String? countryCode, String? category, String? valueType, bool? isRedeemableGlobally, String? currency, String? cursor, int? limit, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/giftcards/catalog';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (countryCode != null) {
    queryParams.addAll(_queryParams('', 'countryCode', countryCode));
  }
  if (category != null) {
    queryParams.addAll(_queryParams('', 'category', category));
  }
  if (valueType != null) {
    queryParams.addAll(_queryParams('', 'valueType', valueType));
  }
  if (isRedeemableGlobally != null) {
    queryParams.addAll(_queryParams('', 'isRedeemableGlobally', isRedeemableGlobally));
  }
  if (currency != null) {
    queryParams.addAll(_queryParams('', 'currency', currency));
  }
  if (cursor != null) {
    queryParams.addAll(_queryParams('', 'cursor', cursor));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}