Search code examples
wordpresswoocommercewordpress-rest-apiwoocommerce-rest-api

Wordpress UserIDs and WooCommerce CustomerIDs


I am trying to figure out whether a Wordpress UserID is always equal to a WooCommerce CustomerID.

I need to find this value to identify a user, but need to ensure that the IDs are always equal across both the WordPress and WooCommerce APIs.


Solution

  • Yes, in both cases ID of users are same. Users who registered through WooCommerce registrations form are also stored into the same wp_users table. Only difference is their role. Through WooCommerce form registered user role is Customer and WordPress form through registered user role is Subscriber.