GunNabber.RetailerApi.Client
1.1.3
dotnet add package GunNabber.RetailerApi.Client --version 1.1.3
NuGet\Install-Package GunNabber.RetailerApi.Client -Version 1.1.3
<PackageReference Include="GunNabber.RetailerApi.Client" Version="1.1.3" />
<PackageVersion Include="GunNabber.RetailerApi.Client" Version="1.1.3" />
<PackageReference Include="GunNabber.RetailerApi.Client" />
paket add GunNabber.RetailerApi.Client --version 1.1.3
#r "nuget: GunNabber.RetailerApi.Client, 1.1.3"
#:package GunNabber.RetailerApi.Client@1.1.3
#addin nuget:?package=GunNabber.RetailerApi.Client&version=1.1.3
#tool nuget:?package=GunNabber.RetailerApi.Client&version=1.1.3
GunNabber.RetailerApi.Client
A .NET client library for seamless integration with the GunNabber Retailer API. This package provides strongly-typed models and service abstractions to manage products, handle requests, and interact with the GunNabber retailer ecosystem.
Features
- Easy-to-use client for the GunNabber Retailer API
- Strongly-typed models for products and requests
- Standardized API response handling
- Extensible service interfaces for product management
Installation
Install via NuGet Package Manager:
dotnet add package GunNabber.RetailerApi.Client
Or via the NuGet UI in your code editor of choice.
Getting Started
1. Configure API Client Options
var options = new ApiClientOptions
{
ApiKey = "your-api-key",
ApiVersion = "1"
};
2. Initialize the Client
var client = new GunNabberClient(options);
3. Access Product Services
var productService = client.GetProductService();
4. Fetch Products
var response = await productService.GetProductsAsync();
if (response.IsSuccess)
{
var products = response.Data;
// Use products
}
else
{
Console.WriteLine($"Error: {response.ErrorMessage}");
}
Models
- Product: Represents a product in the retailer system.
- ProductRequest: Used for creating or updating product data.
- Deal: Represents a deal or promotion associated with a product.
- DealRequest: Used for creating or updating deal data.
- Response<T>: Standardized API response wrapper.
API Response Handling
All service methods return a Response<T> object, which includes:
- Data: The result data (if successful)
- StatusCode: HTTP status code
- Headers: Response headers
- RawContent: Raw response content
- IsSuccess: Indicates if the request was successful
- ErrorMessage and Errors: Error details (if any)
Retailer verification (live product writes)
Live API keys (pk_api_ / ak_api_) require the retailer account to be Verified before creating or updating products. If the retailer is not verified, add/update product calls return:
- HTTP 403 Forbidden
response.IsSuccess→falseresponse.StatusCode→HttpStatusCode.Forbiddenresponse.ErrorMessage→"Retailer account must be verified before submitting live products or enabling feeds."
response.Errors is typically empty for this case — the API returns the message in the Problem Details title, not as a structured validation error list.
Test API keys (pk_test_ / ak_test_) bypass verification and can still be used during onboarding.
var response = await productService.AddProduct(productRequest);
if (!response.IsSuccess)
{
if (response.StatusCode == System.Net.HttpStatusCode.Forbidden)
{
// Retailer is not verified (or otherwise forbidden)
Console.WriteLine(response.ErrorMessage);
return;
}
Console.WriteLine($"Error: {response.ErrorMessage}");
}
Release Notes
1.1.3
- Breaking change:
Product.UpcandProductRequest.Upcchanged frominttostring?to match the Retailer API (preserves leading zeros and non-numeric UPC values).- Update any code that assigns or compares
Upcas an integer. For example, changeUpc = 123456789012toUpc = "123456789012". - If you read
Upcinto anintvariable, switch that tostring?(or parse it only when needed).
- Update any code that assigns or compares
- Added shipping fields to product models:
ShippingCost,ShippingCostEstimated,WeightInPounds,LengthInInches,WidthInInches,HeightInInches
1.1.2
- Local packaging of the UPC string alignment and shipping field updates (use 1.1.3 from nuget.org)
1.1.1
- Documented retailer verification requirements for live product create/update
- Clarified HTTP 403 Forbidden handling when a retailer account is not verified
- Clarified that test API keys (
pk_test_/ak_test_) bypass verification during onboarding
1.1.0
- Added deal management support (
DealService/IDealService) - Added
DealandDealRequestmodels
1.0.0
- First stable release
- Product create, read, update, and delete via
ProductService - Standardized
Response<T>API response wrapper with Problem Details error handling - Package icon and license metadata
0.1.x
- Initial prerelease client for GunNabber Retailer API product operations
| 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. |
-
net10.0
- ErrorOr (>= 2.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.
1.1.3: BREAKING — Product.Upc / ProductRequest.Upc changed from int to string? (update callers that assign/compare Upc as int). Also adds shipping dimension fields to product models.
1.1.2: Local packaging of UPC string alignment and shipping fields (superseded by 1.1.3 for nuget.org).
1.1.1: Document retailer verification for live product writes (HTTP 403 when unverified); clarify test API key bypass.
1.1.0: Add deal management support (DealService, Deal, DealRequest).
1.0.0: First stable release with product CRUD and Response<T> error handling.