updateVerificationType method

Future<SdkVerificationResponse> updateVerificationType({
  1. required String verificationId,
  2. required VerificationType verificationType,
})

Update verification type

verificationId - The verification ID verificationType - New verification type

Returns SdkVerificationResponse

Implementation

Future<SdkVerificationResponse> updateVerificationType({
  required String verificationId,
  required VerificationType verificationType,
}) async {
  try {
    final response = await _apiClient.patch(
      '/sdk/kyc-verification/verifications/$verificationId/verification-type',
      body: {'verificationType': _verificationTypeToString(verificationType)},
    );

    final jsonData = json.decode(response.body) as Map<String, dynamic>;
    return SdkVerificationResponse.fromJson(jsonData);
  } catch (e) {
    if (e is ApexKycException) {
      rethrow;
    }
    throw ApexKycException(
      'Failed to update verification type: ${e.toString()}',
      originalError: e,
    );
  }
}