5

I am creating a mobile app for a WooCommerce website and have gotten to a stage where I want the user to login or signup to the WooCommerce website before they continue with a purchase.

I can create a new customer no problem but I am having trouble when trying to authenticate an existing customer. After looking at the rest api docs for WooCommerce, I haven't come across any endpoint that will allow an existing user to log in to their account. Is there any endpoint that will allow me to do this that isn't documented?

Win
  • 2,503
  • 3
  • 22
  • 34

1 Answers1

4

There might be other ways but what comes to my mind immediately is to use JWT Authentication for WP REST API plugin.

Using this plugin you can request for authentication on the server using the username and password. It will return a token if successful. Then use the token for checking if this user/customer is valid. If valid, use wc api to create an order for this customer.

Reigel
  • 61,807
  • 21
  • 115
  • 133
  • 2
    Due to the latest version of woocommerce 3.3.x, it's reported as incompatible https://wordpress.org/support/topic/not-compatible-with-woocommerce-3-3-x-and-above/ – Mike Castro Demaria May 15 '18 at 13:29