Skip to content
Discussion options

You must be logged in to vote

Ok, looks like something broken in the WooCommerce.NET API Client itself.

My fix was to set the version to V3 as a workaround:

var wp_api = new WooCommerceNET.RestAPI("https://my-site/wp-json/wp/v2/", "admin", "xxxx xxxx xxxx xxxx xxxx xxxx");

// Fix the version number, so we can still use Basic Authentication in Wordpress API
wp_api.GetType()
    .GetProperty(nameof(wp_api.Version), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
    .SetValue(wp_api, WooCommerceNET.APIVersion.Version3);

After that the API started working as expected. Thanks guys for the package 👍

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@fairking
Comment options

Answer selected by fairking
Comment options

You must be logged in to vote
1 reply
@richardaubin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants