customerShopifySession method

Future<Result<Map<String, dynamic>>> customerShopifySession({
  1. required String email,
  2. required String shopifyCustomerId,
  3. required bool isMarketingEventSubscribed,
})

Check whether a Shopify customer with email already exists.

Pass shopifyCustomerId if available from a prior OTP-verify response. Set isMarketingEventSubscribed to opt the user into marketing notifications. If the response data.isNewUser == true, skip the OTP flow and treat as a new sign-up. Otherwise proceed to sendShopifyEmailVerificationCode.

Implementation

Future<Result<Map<String, dynamic>>> customerShopifySession({
  required String email,
  required String shopifyCustomerId,
  required bool isMarketingEventSubscribed,
}) async {
  try {
    final data = await ShopifyService.customerShopifySession(
      email: email,
      shopifyCustomerId: shopifyCustomerId,
      isMarketingEventSubscribed: isMarketingEventSubscribed,
    );
    return Success(data);
  } catch (err) {
    rethrow;
  }
}