verifyCustomer method

Future<VerifyCustomerResult> verifyCustomer(
  1. String customerId
)

Check if a customer ID is valid and registered for this client.

customerId - The customer ID to verify Returns verification result

Implementation

Future<VerifyCustomerResult> verifyCustomer(String customerId) async {
  final response = await _post(
    '/api/customers/verify',
    json.encode({
      'clientId': _clientId,
      'customerId': customerId,
    }),
  );

  if (response.statusCode != 200) {
    return VerifyCustomerResult(
      valid: false,
      message: 'Verification failed',
    );
  }

  return VerifyCustomerResult.fromJson(
    json.decode(response.body) as Map<String, dynamic>,
  );
}