https://github.com/brandon689/woocommerceblazorapi
New .NET 8.0 ecommerce API and Blazor Admin Panel
https://github.com/brandon689/woocommerceblazorapi
api-client dotnet8 ecommerce headless-wordpress restful-api woocommerce woocommerce-api wordpress wordpress-api
Last synced: 5 months ago
JSON representation
New .NET 8.0 ecommerce API and Blazor Admin Panel
- Host: GitHub
- URL: https://github.com/brandon689/woocommerceblazorapi
- Owner: Brandon689
- License: mit
- Created: 2023-12-30T22:54:18.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T02:42:24.000Z (almost 2 years ago)
- Last Synced: 2025-08-25T04:26:42.972Z (5 months ago)
- Topics: api-client, dotnet8, ecommerce, headless-wordpress, restful-api, woocommerce, woocommerce-api, wordpress, wordpress-api
- Language: C#
- Homepage:
- Size: 196 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# WooCommerceAPI
## Introduction
WooCommerce .NET Api and Blazor Server Admin Panel for ecommerce developers.
## Note
It is recommended that you utilize a dockerized WordPress dev environment for testing.
Here is the needed instructions to get started, just install Docker and then follow along:
https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/wordpress/
* Basic Auth is not supported by WooCommerce over HTTP, therefore use OAuth.
## Swagger
There is now a ASP.NET core server with Swagger Docs
## endpoints done
- Create product (simple, variable, metadata)
- Batch create product attribute / variations
- Upload media (wordpress)
- List all products
- Update a product
- Update product variations
- Get product variations
- Get an order
- List all orders
- Update a media item
## Next
- Delete a product
- Delete product variations
- Create a product category
- List all product categories
- Update an order
## Hello World
```csharp
using WooCommerceAPI.Clients.WooCommerces;
using WooCommerceAPI.Models.Configurations;
using WooCommerceAPI.Models.Services.Foundations.Products;
using dotenv.net;
DotEnv.Load(options: new DotEnvOptions(envFilePaths: new[] { "../../../.env" }));
var wooCommerceConfigurations = new WooCommerceConfigurations
{
ApiKey = Environment.GetEnvironmentVariable("WC_CONSUMER_KEY"),
ApiSecret = Environment.GetEnvironmentVariable("WC_CONSUMER_SECRET"),
ApiUrl = Environment.GetEnvironmentVariable("WC_STORE_URL")
};
var wooCommerceClient = new WooCommerceClient(wooCommerceConfigurations, true);
ProductAttribute[] a = new ProductAttribute[3];
var inputProduct = new Product
{
Request = new ProductRequest
{
Name = "name 5",
Type = "simple",
RegularPrice = "10",
//Attributes = a
}
};
Product result = await wooCommerceClient.Products.SendProductAsync(inputProduct);
Console.WriteLine(result.Response.Name);
```
## Acknowledgements
Thanks to [hassanhabib](https://github.com/hassanhabib) for the coding Standard.