kfGetGeoInfo static method

Future kfGetGeoInfo({
  1. required String pincode,
  2. required String userAuthToken,
})

Resolves city/state for a 6-digit pincode via the partner geoinfo endpoint. Uses muToken header for standalone (kwikforms) mode auth — the kwikpass-mode equivalent is ApiService.getGeoInfo.

Implementation

static Future<dynamic> kfGetGeoInfo({
  required String pincode,
  required String userAuthToken,
}) async {
  // Fires per pincode entry — safe only because the gate caches (see
  // [_healthTtl]); without it every lookup would double its traffic.
  await checkKwikFormsHealth();
  final gokwik = DioClient().getClient();
  final response = await gokwik.get(
    cdnConfigInstance.getEndpoint(APIEndpointKeys.kfGeoInfo)!,
    queryParameters: {'pincode': pincode},
    options: Options(headers: {
      APIHeader.muToken: userAuthToken,
    }),
  );
  return response.data;
}