skip to Main Content

I am trying to connect with WooCommerce using API v2.
I am using WooCommerceNET=0.8.1 and NETFramework=v4.7.2

Code:

using WooCommerceNET;
using WooCommerceNET.WooCommerce.v2;
using WooCommerceNET.WooCommerce.v2.Extension;

...
public void AddToWoocomerce()
        {
            string consumerKey = "ck_....";
            string consumerSecret = "cs_...";

            RestAPI rest = new RestAPI("http://makm862.vot.pl/wp-json/wp/v2/", consumerKey, consumerSecret);

            WCObject wc = new WCObject(rest);  
        }

I got exception:

Please use WooCommerce Restful API Version 2 url for this WCObject. e.g.: http://www.yourstore.co.nz/wp-json/wc/v2/

What I am doing wrong?

2

Answers


  1. Chosen as BEST ANSWER

    Yeah, that't right. I copied it from example with

    WPObject wc = new WPObject(rest);  
    

    not

    WCObject wc = new WCObject(rest);  
    

    and didnt noticed there is other url.

    Sorry for such a trivial problem.


  2. Your link is

    wp/v2/

    It should be:

    wc/v2/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search