AugusteVN.Modules.Commerce.Api
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AugusteVN.Modules.Commerce.Api --version 1.0.1
NuGet\Install-Package AugusteVN.Modules.Commerce.Api -Version 1.0.1
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="AugusteVN.Modules.Commerce.Api" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AugusteVN.Modules.Commerce.Api" Version="1.0.1" />
<PackageReference Include="AugusteVN.Modules.Commerce.Api" />
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 AugusteVN.Modules.Commerce.Api --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AugusteVN.Modules.Commerce.Api, 1.0.1"
#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 AugusteVN.Modules.Commerce.Api@1.0.1
#: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=AugusteVN.Modules.Commerce.Api&version=1.0.1
#tool nuget:?package=AugusteVN.Modules.Commerce.Api&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AugusteVN.Modules.Commerce.Api
Minimal API endpoints for products and shop orders with authorization, validation, and Azure Service Bus integration.
Part of the AugusteVN Modules collection.
Extension Methods
AddCommerceApi
Registers Commerce API services into the DI container.
public static void AddCommerceApi(this IServiceCollection services, IConfiguration configuration)
What it registers:
| Service | Lifetime | Description |
|---|---|---|
Validators from _Shared assembly |
Transient | FluentValidation validators for all request DTOs |
ServiceBusConfig |
Options | Bound from configuration for Azure Service Bus |
ISenderClient / SenderClient |
Singleton | Azure Service Bus message sender |
BlobStorageConfig |
Options | Bound from configuration for Azure Blob Storage |
IBlobStorageClient / BlobStorageClient |
Scoped | Azure Blob Storage client for SAS URL generation |
MapCommerceEndpoints
Maps all Commerce API endpoint groups to the route builder.
public static void MapCommerceEndpoints(this IEndpointRouteBuilder routeBuilder)
Delegates to MapProductsEndpoints() and MapShopOrdersEndpoints(), which register each endpoint with an ApiExceptionFilter.
API Routes
Products (/Products)
| Method | Route | Handler | Auth | Description |
|---|---|---|---|---|
GET |
/Products/ |
GetProductsAsync |
— | Paginated product listing with SAS URLs for authorized digital downloads |
GET |
/Products/{Slug} |
GetProductForSlugAsync |
Validation filter | Single product by URL slug with SAS URL for authorized digital downloads |
GET |
/Products/LeadMagnet |
GetLeadMagnetAsync |
— | Retrieve the active lead magnet product |
PUT |
/Products/ |
UpsertProductAsync |
ManageCommerce |
Create or update a product |
ShopOrders (/ShopOrders)
| Method | Route | Handler | Auth | Description |
|---|---|---|---|---|
POST |
/ShopOrders/ |
CreateShopOrderAsync |
Validation filter | Create a new shop order, calculate totals, publish Service Bus message for free/lead-magnet orders |
GET |
/ShopOrders/ |
GetShopOrdersAsync |
ManageCommerce |
Paginated listing of all shop orders |
GET |
/ShopOrders/{Id} |
GetShopOrderByIdAsync |
Authorization | Retrieve a single shop order by ID |
GET |
/ShopOrders/Me |
GetShopOrdersForUserAsync |
Authorization | Paginated listing of shop orders for the authenticated user |
PUT |
/ShopOrders/Status |
UpdateShopOrderStatusAsync |
ManageCommerce |
Update the status of an existing shop order |
Endpoint Filters
| Filter | Usage |
|---|---|
ApiExceptionFilter |
Global exception handler applied to all endpoint groups, logging errors and returning Problem responses |
EndpointValidationFilter<T> |
Per-endpoint FluentValidation filter for request validation |
Registration
// Program.cs
builder.Services.AddCommerceApi(builder.Configuration);
app.MapCommerceEndpoints();
Installation
dotnet add package AugusteVN.Modules.Commerce.Api
Dependencies
- AugusteVN.Modules.Commerce._Shared
- AugusteVN.Modules.Commerce.Features
- AugusteVN.Modules.Commerce.Database
AugusteVN.Azure.ServiceBusAugusteVN.Azure.BlobStorageAugusteVN.Api.EndpointFiltersAugusteVN.CQRS.Extensions
Links
- Commerce module overview
- Commerce._Shared
- Commerce.Database
- Commerce.Features
- Commerce.Templates
- Commerce._Shared.Spa
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- AugusteVN.Api.Auth.Extensions (>= 1.1.0)
- AugusteVN.Api.EndpointFilters (>= 1.1.0)
- AugusteVN.Azure.BlobStorage (>= 1.1.0)
- AugusteVN.Azure.ServiceBus (>= 1.2.0)
- AugusteVN.CQRS.Extensions (>= 1.1.0)
- AugusteVN.Modules.Commerce._Shared (>= 1.0.1)
- AugusteVN.Modules.Commerce.Features (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.