5

I am using woocommerce rest API to build an e commerce Android application.

I want to implement the change password using woocommerce rest API ,I have refer this link

https://woocommerce.github.io/woocommerce-rest-api-docs/ but it is not working.

How I can implement change password?

maulik
  • 140
  • 9

1 Answers1

1

I had the same problem using Ionic3 for building an App with woocommerce as backend.

The following code worked for me, but you need to find a way to figure out the customer id.

updateCustomer(){
    this.customer.id=YOUR_CUSTOMER_ID;
    this.customer.password = NEW_PASSWORD;
    this.WooCommerce.putAsync("customers/" + this.customer.id, {customer: this.customer}).then((res)=>{
      if(JSON.parse(res.body).customer){
        console.log('customer updated');
      }
    }, (err)=>{
      console.log(err.body)
    })
}