Retailer API Documentation
GunNabber Retailer client Nuget Package
We have created a .NET client library for the GunNabber Retailer API, which simplifies the process of interacting with the API. This client library is available as a NuGet package named GunNabber.RetailerApi.Client.
The Nuget package provides a convenient way to interact with the Retailer API. It includes strongly-typed models and service abstractions for managing products and deals.
Implementing the client is straightforward:
Install via NuGet Package Manager:
dotnet add package GunNabber.RetailerApi.Client
Or via the NuGet UI in your code editor of choice.
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 and Deal Services
var productService = client.GetProductService();
var dealService = client.GetDealService();
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.
Upcis astring?(matches the API; preserves leading zeros). Includes optional shipping fields (ShippingCost,ShippingCostEstimated,WeightInPounds,LengthInInches,WidthInInches,HeightInInches). - ProductRequest: Used for creating or updating product data (same field shape as
Product). - Deal: Represents a deal or promotion.
- DealRequest: Used for creating or updating deal data.
- Response<T>: Standardized API response wrapper.
For full API field definitions and example payloads, see Endpoints and Request Models.
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)