woocommerce / wc-api-node

This client is obsolete and will no longer receive updates, a new JavaScript library is available under the name of @woocommerce/woocommerce-rest-api
https://www.npmjs.com/package/woocommerce-api
MIT License
144 stars 63 forks source link

401 Unauthorized error when posting. #54

Closed rishab121 closed 7 years ago

rishab121 commented 7 years ago

I am able to make get calls with it successfully but when I try to post it gives me 401 invalid signature error.

my code for Ionic 2. var WooCommerce = new WooCommerceAPI({ url: 'http://vishaljoshi.in/woocommerce', consumerKey: 'ck', consumerSecret: 'cs', wpApi: true, version: 'wc/v1', wpAPIPrefix: 'wp-json'
})

WooCommerce.post('customers', this.data, function(err, data, res) { console.log(res); }); // Am i missing something here?

fahad-nxvt commented 7 years ago

@rishab121 what was the issue? i am facing the same problem can you please guide me please?

rishab121 commented 7 years ago

I wasn't able to resolve issue with the node.js wrapper. so instead of directly posting data from Ionic to woocommerce; I posted the data from Ionic to python api (bottle) and then used python wrapper to post data to woocommerce server.