woocommerce / wc-api-python

A Python wrapper for the WooCommerce API.
https://pypi.org/project/WooCommerce/
MIT License
212 stars 112 forks source link

wp_api=True constructs invalid path to endpoint #14

Closed chbichsel closed 8 years ago

chbichsel commented 8 years ago

When constructing the API class, passing wp_api=True adds "wc-jason" to the path which is incorrect: https://kashalife-beta.com/**wp-json/**v3/products

wcapi = API( url="https://domain.com/", consumer_key="ck_9e374df9cbd431466d0ff", consumer_secret="cs_fb0dbeb028e0ef76c", wp_api=True, version="v3", )

According to the http://woothemes.github.io/woocommerce-rest-api-docs/#schema the correct endpoint is https://www.your-store.com/wc-api/v3

Commenting the below out in def __get_url(self, endpoint) fixes the issue: **#if self.wp_api:

api = "wp-json"**

claudiosanches commented 8 years ago

@chbichsel because include support for our integration with WP REST API: https://woocommerce.wordpress.com/2016/04/22/new-rest-api-based-on-the-wp-rest-api-in-2-6/