wcCustomerInfo method

Future<WCCustomerInfoResponse> wcCustomerInfo({
  1. String? userToken,
})

Get the user's WooCommerce customer information.

Returns a WCCustomerInfoResponse future. Throws a WooCommerceNotFoundException if WooCommerce is not active, InvalidUserTokenException if the token is not valid.

Implementation

Future<WCCustomerInfoResponse> wcCustomerInfo({String? userToken}) async {
  // send http request
  final Map<String, dynamic> json = await _http(
      method: "GET",
      url: _urlForRouteType(WPRouteType.WCCustomerInfo),
      userToken: userToken,
      shouldAuthRequest: true);

  return WCCustomerInfoResponse.fromJson(json);
}