utilitySearchWithHttpInfo method

Future<Response> utilitySearchWithHttpInfo(
  1. String countryCode, {
  2. String? category,
  3. String? serviceType,
  4. String? q,
  5. String? currency,
  6. int? page,
  7. int? limit,
  8. Future<void>? abortTrigger,
})

Search billers

Searches the billers of a country and returns them with their offers, one page at a time. Returns { items, pagination }. countryCode is required; category, serviceType and q select billers. Utility has no value or price filter. Pages count billers that still have an offer, and prices are indicative, in currency. Quote and order take an offer's publicId, never the biller's id. An invalid or unknown parameter gives 400 / 10001; an unsupported currency gives 404 / 10004.

Note: This method returns the HTTP Response.

Parameters:

  • String countryCode (required): Required ISO 3166-1 alpha-2 country code of the billers, in either case.

  • String category: Keep the billers of this category, for example electricity.

  • String serviceType: Keep prepaid or postpaid billers.

  • String q: Text in the biller name, case-insensitive; at most 100 characters, without control characters.

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

  • int page: Page number, from 1; default 1.

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

Implementation

Future<Response> utilitySearchWithHttpInfo(String countryCode, { String? category, String? serviceType, String? q, String? currency, int? page, int? limit, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/utility/search';

  // ignore: prefer_final_locals
  Object? postBody;

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

    queryParams.addAll(_queryParams('', 'countryCode', countryCode));
  if (category != null) {
    queryParams.addAll(_queryParams('', 'category', category));
  }
  if (serviceType != null) {
    queryParams.addAll(_queryParams('', 'serviceType', serviceType));
  }
  if (q != null) {
    queryParams.addAll(_queryParams('', 'q', q));
  }
  if (currency != null) {
    queryParams.addAll(_queryParams('', 'currency', currency));
  }
  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  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,
  );
}