Evolvit.WooNetCore
0.1.0-alpha.3
Prefix Reserved
This is a prerelease version of Evolvit.WooNetCore.
dotnet add package Evolvit.WooNetCore --version 0.1.0-alpha.3
NuGet\Install-Package Evolvit.WooNetCore -Version 0.1.0-alpha.3
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="Evolvit.WooNetCore" Version="0.1.0-alpha.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Evolvit.WooNetCore" Version="0.1.0-alpha.3" />
<PackageReference Include="Evolvit.WooNetCore" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Evolvit.WooNetCore --version 0.1.0-alpha.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Evolvit.WooNetCore, 0.1.0-alpha.3"
#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.
#:package Evolvit.WooNetCore@0.1.0-alpha.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Evolvit.WooNetCore&version=0.1.0-alpha.3&prerelease
#tool nuget:?package=Evolvit.WooNetCore&version=0.1.0-alpha.3&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WooNetCore
A .NET library for the WooCommerce REST API. This library provides a simple and intuitive way to interact with the WooCommerce API from your .NET applications.
Features
- Simple authentication using WooCommerce API keys
- Support for WooCommerce REST API v3
- Asynchronous API methods for modern .NET applications
- Strongly-typed models for WooCommerce resources
- Comprehensive error handling
- Built on top of RestSharp for reliable HTTP communications
Supported Resources
- Customers
- Products (including variations)
- Orders
Installation
Package Manager
Install-Package Evolvit.WooNetCore
.NET CLI
dotnet add package Evolvit.WooNetCore
Usage
Authentication
// Initialize the WooCommerce client
var client = new WCClient(
consumerKey: "your_consumer_key",
consumerSecret: "your_consumer_secret",
url: "https://your-store.com/wp-json/wc/v3"
);
Working with Customers
// Get all customers
var customers = await client.Customer.GetAll();
// Get a specific customer
var customer = await client.Customer.Get("123");
// Create a new customer
var newCustomer = new Customer
{
Email = "john.doe@example.com",
FirstName = "John",
LastName = "Doe"
};
var createResult = await client.Customer.Create(newCustomer);
// Update a customer
var updateParams = new
{
FirstName = "Johnny"
};
var updateResult = await client.Customer.Update("123", updateParams);
// Delete a customer
var deleteResult = await client.Customer.Delete("123");
Working with Products
// Get all products
var products = await client.Product.GetAll();
// Get a specific product
var product = await client.Product.Get("456");
// Create a new product
var newProduct = new Product
{
Name = "Product Name",
Type = "simple",
RegularPrice = "19.99"
};
var createResult = await client.Product.Create(newProduct);
Working with Orders
// Get all orders
var orders = await client.Order.GetAll();
// Get a specific order
var order = await client.Order.Get("789");
// Update an order
var updateParams = new
{
Status = "completed"
};
var updateResult = await client.Order.Update("789", updateParams);
Error Handling
All API methods return an ApiResult<T>
object that contains:
Result
: The deserialized response when successfulError
: Error information when the request failsStatusCode
: The HTTP status code of the response
var result = await client.Product.Get("123");
if (result.StatusCode == System.Net.HttpStatusCode.OK)
{
// Success - use result.Result
var product = result.Result;
Console.WriteLine($"Product name: {product.Name}");
}
else
{
// Error - use result.Error
Console.WriteLine($"Error: {result.Error.Message}");
}
Requirements
- .NET 9.0 or higher
- WooCommerce site with REST API enabled
- API credentials with appropriate permissions
License
This project is maintained by Evolvit Solutions AB.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- RestSharp (>= 112.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.0-alpha.3 | 142 | 3/19/2025 |