WooCommerceNET 0.8.6

dotnet add package WooCommerceNET --version 0.8.6                
NuGet\Install-Package WooCommerceNET -Version 0.8.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WooCommerceNET" Version="0.8.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WooCommerceNET --version 0.8.6                
#r "nuget: WooCommerceNET, 0.8.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WooCommerceNET as a Cake Addin
#addin nuget:?package=WooCommerceNET&version=0.8.6

// Install WooCommerceNET as a Cake Tool
#tool nuget:?package=WooCommerceNET&version=0.8.6                

WooCommerce.NET

A Brief Intro

WooCommerce.NET is a .NET library for calling WooCommerce/WordPress REST API with OAuth/JWT in .NET applications.

NuGet

If this project has been helpful for you and you want to support it, please consider Buying me a coffee:coffee:

For priority paid support/consulting service, customized REST API implementation and plugins REST API implementation, please email to James (me:sunglasses:)

Usage (WooCommerce REST API)

<details open> <summary>Click to expand/collapse details...</summary>

using WooCommerceNET.WooCommerce.v3;
using WooCommerceNET.WooCommerce.v3.Extension;

RestAPI rest = new RestAPI("http://www.yourstore.co.nz/wp-json/wc/v3/", "<WooCommerce Key>", "<WooCommerce Secret");
WCObject wc = new WCObject(rest);

//Use below code for WCObject only if you would like to have different CultureInfo
WCObject wc = new WCObject(rest, CultureInfo.GetCultureInfo("de-DE"));

//Get all products
var products = await wc.Product.GetAll();

//Add new product
Product p = new Product()
            {
                name = "test product 8",
                title = "test product 8",
                description = "test product 8",
                price = 8.0M
            };
await wc.Product.Add(p);

//Update products with new values
await wc.Product.Update(128, new Product { name = "test 9" });

//Update products with Null values
await wc.Product.UpdateWithNull(128, new { name = "test 9", weight = "", date_on_sale_from = "", date_on_sale_to = "" });

//Delete product
await wc.Product.Delete(128);

//Use parameters
var p = await wc.Product.GetAll(new Dictionary<string, string>() {
                { "include", "10, 11, 12, 13, 14, 15" },
                { "per_page", "15" } });


//Batch add/update/delete
CustomerBatch cb = new CustomerBatch();

List<Customer> create = new List<Customer>();
create.Add(new Customer()
{
    first_name = "first",
    last_name = "last",
    email = "first@lastsss.com",
    username = "firstnlast",
    password = "12345"
});

List<Customer> update = new List<Customer>();
update.Add(new Customer()
{
    id = 4,
    last_name = "xu2"
});

List<int> delete = new List<int>() { 8 };
cb.create = create;
cb.update = update;
cb.delete = delete;

var c = await wc.Customer.UpdateRange(cb);

</details>

Usage (WordPress REST API - JWT/OAuth Authentication)

<details> <summary>Click to expand/collapse details...</summary>


//using JWT
RestAPI rest = new RestAPI("http://www.yourstore.co.nz/wp-json/jwt-auth/v1/token", "<UserName>", "<Password>");

//using OAuth
RestAPI rest = new RestAPI("http://www.yourstore.co.nz/wp-json/wp/v2/", "<Client_Key>", "<Client_Secret>");
rest.oauth_token = "<OAuth_Token>";
rest.oauth_token_secret = "<OAuth_Token_Secret>";

WPObject wp = new WPObject(rest);

//Get all posts
var posts = await wp.Post.GetAll();

//Add a post
var p = new Posts()
{
    title = "abc",
    content = "<h1>abc</h1>"
};

await wp.Post.Add(p);

//Update post with new values
await wp.Post.Update(123, new { title = "new post" });

//Delete a post
await wp.Post.Delete(123);

//Upload an image
await wp.Media.Add("imagename.jpg", @"C:\path\to\image\file.jpg");

//Create a new user
await wp.Users.Add(new Users()
{
    first_name = "test",
    last_name = "test",
    name = "test",
    username = "test123",
    email = "test123@gmail.com",
    password = "test@12345"
});

</details>

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on WooCommerceNET:

Package Downloads
QuickerDrivingTest-ClassLibrary

Package Description

fm.WooCommerceNET.Subscriptions

Extends WooCommerceNET with support for retrieving WooCommerce Subscriptions for a user.

NineDigit.WooCommerce

WooCommerce API client.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.8.6 401,182 3/29/2023
0.8.5 20,730 1/4/2023
0.8.4 100,164 11/20/2021
0.8.3 66,757 3/17/2021
0.8.2 119,754 4/28/2020
0.8.1 7,164 3/4/2020
0.8.0 12,083 11/4/2019
0.7.9 3,274 9/29/2019
0.7.8 7,798 7/30/2019
0.7.7 6,459 4/2/2019
0.7.6-beta 1,198 11/19/2018
0.7.5 5,982 6/9/2018
0.7.4 3,166 1/25/2018
0.7.3 16,758 1/7/2018
0.7.2 4,475 7/22/2017
0.7.1 7,092 5/20/2017
0.7.0 1,548 5/17/2017
0.6.1 5,778 12/15/2016
0.5.6-beta 1,381 11/6/2016
0.5.5 2,194 10/22/2016
0.5.3-beta 1,343 9/27/2016
0.5.2 2,004 9/23/2016
0.4.3 2,126 5/13/2016
0.4.1 2,019 4/14/2016

WooCommerce.NET is a .NET library for calling WooCommerce/WordPress REST API in .NET applications.

GitHub: https://github.com/XiaoFaye/WooCommerce.NET
Changes Doc: https://github.com/XiaoFaye/WooCommerce.NET/blob/master/Changes.md

* v0.8.6 update
 1. Fix manage_stock property deserializing issue in Project object. #722
 2. Add Culture object in WCObject constructor to resolve format issue. #731
 3. Allow accessing WordPress plugin REST API with WooCommerce secret and key.