• Resolved Mtzas

    (@mahmoudtaha)


    Hi,

    Please work on creating a WooCommerce app by Flutter.
    The question here is: How can I get the user id?

    Using this link:
    https://ycadeau.com/wp-json/jwt-auth/v1/toke

    With passing the username and the password
    A token is being generated, but so I can access this page?:
    /wp-json/wc/v3/customers/

    I need a user id, how do I get it?

    Or how do I use the token to get the user id?

    Please Help
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    You can find more about retrieving the customer information in the documentation below:

    https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-customer

    I hope this helps.

    Thread Starter Mtzas

    (@mahmoudtaha)

    Hi,

    Well, there it says that retrieving the customer information through the user ID. How then do I get this ID?
    I completed a large part of the flutter app by displaying the products page, categories page, category products page, and the product page. The problem now is how to access the page you referred to, how do I get the user ID?

    Help Please,

    Thank you,,

    Saif

    (@babylon1999)

    Hello @mahmoudtaha,

    There is more than one way to get the user ID for a customer, here are a few examples:

    1- You can call all customers using /wp-json/wc/v3/customers to retrieve all user IDs.


    2- You can navigate to the WordPress dashboard > Users > All users > Edit user and find the user ID in the URL.


    3- Also, if you have access to the site’s database you can find all the user IDs in the wp_users table with SELECT*FROMwp_usersORDERBYwp_users.IDASC.


    Hope this helps!

    Hi there!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘woocommerce auth issue’ is closed to new replies.