get customerId of the logged in customers of shopify store in shopify remix app

get customerId of the logged in customers of shopify store in shopify remix app

bootsgridDev
Shopify Partner
32 1 3

I want to get the logged in customers id of the shopify store in my shopify remix app to dynamically change the price of the product according the customers.  Is there any way to achieve this

Replies 2 (2)

WizzCommerce_Co
Trailblazer
181 26 42

Hi @bootsgridDev , thank you for posting here!

You can easily dynamically change the price of the product according to the customers (logged-in or non-logged-in customers) with Snap B2B Wholesale

  • WHOLESALE PRICING: custom price with multiple rules, edit price by product list
  • PRICE DISPLAY: display unique prices only for logged-in/tagged customers
If my answer is helpful, please let me know by accepting the Solution and giving a Like !!!
Skyrocket BFCM with Wizz's apps: BOGO+ Buy X Get Y Free Gift
| Wizz Flash Sale & Price Edit | Snap B2B Wholesale Pricing | Snap Product Page Coupon | Snap Presale & Backorder | SnapNoti FOMO Visitor Counter | SnapBundle Volume Discounts
Find more support, feel free to contact: support@wizzcommerce.io
If our suggestion is useful for your problem, please let us know by giving Like and Accept Solution !!!
greeshma
Shopify Partner
19 2 8

@bootsgridDev I found a solution for retrieving the customer ID in a Shopify Customer Account UI Extension app.

To get the authenticated customer's ID, add the following code in the JavaScript file located in the src folder:

const customerId = api.authenticatedAccount?.customer?.current?.id;

  • api.authenticatedAccount provides authentication details of the currently logged-in account.
  • .customer accesses the customer-related information.
  • .current refers to the authenticated customer.
  • .id retrieves the unique identifier of the customer