An unofficial, community-maintained .NET client library for Allegro REST API. Provides 170+ methods covering 95% of all Allegro endpoints across 35 specialized clients. Features: strongly-typed requests/responses, async/await throughout, 11 specialized exception types, built-in retry logic with exponential backoff, rate limit handling, complete XML documentation, 200+ unit tests. Supports: offers, products, orders, fulfillment, categories, images, shipping, payments, billing, messaging, disputes, returns, badges, classifieds, EU compliance (GPSR), and more. Production-ready for .NET 8.0+. Note: This SDK is not officially endorsed or supported by Allegro.
$ dotnet add package AllegroApiA modern .NET client library for the Allegro REST API. This SDK provides strongly-typed access to over 170 API endpoints across 35 specialized clients, covering 95% of the Allegro marketplace platform.
Note: This is an unofficial, community-maintained SDK. It is not officially endorsed or supported by Allegro.
Comprehensive Coverage - Access to 170+ API endpoints organized into 35 specialized clients covering offers, orders, fulfillment, shipping, payments, and more.
Developer Experience - Strongly typed requests and responses with full IntelliSense support, making integration straightforward and reducing errors.
Modern Async - All API calls use async/await patterns for efficient resource usage in high-throughput applications.
Production Ready - Includes automatic retry logic with exponential backoff, 11 specialized exception types for error handling, and extensive test coverage.
Multi-Environment - Seamlessly switch between production and sandbox environments for testing without code changes.
dotnet add package AllegroApi
using AllegroApi;
// Production environment
var client = AllegroApiClient.CreateProduction("your-access-token");
// Get categories
var categories = await client.Categories.GetCategoriesAsync();
// Search products
var products = await client.Products.SearchProductsAsync(new ProductSearchParams
{
Phrase = "laptop"
});
// Create an offer
var offer = await client.Offers.CreateProductOfferAsync(new SaleProductOfferRequestV1
{
// ... offer details
});
// Get orders
var orders = await client.Orders.GetOrdersAsync(new OrderSearchParams());
| Category | Methods | Status |
|---|---|---|
| Offer Management | 17 | ✅ Complete |
| Products | 5 | ✅ Complete |
| Categories | 4 | ✅ Complete |
| Orders | 7 | ✅ Complete |
| Fulfillment | 17 | ✅ Complete - ASN, Stock, Parcels, Tax IDs |
| Images & Attachments | 6 | ✅ Complete - Upload, Offer Attachments |
| Shipping & Delivery | 7 | ✅ Complete |
| After-Sales Services | 12 | ✅ Complete |
| Payments | 2 | ✅ Complete |
| Billing | 3 | ✅ Complete |
| Messaging | 5 | ✅ Complete |
| User Ratings | 5 | ✅ Complete |
| Disputes & Attachments | 7 | ✅ Complete - Includes binary file handling |
| Points of Service | 5 | ✅ Complete |
| Shipment Management | 13 | ✅ Complete |
| Customer Returns | 3 | ✅ Complete |
| Batch Operations | 9 | ✅ Complete |
| Listing & Discovery | 4 | ✅ Complete - Public offer search |
| Badge Campaigns | 6 | ✅ Complete |
| Classifieds | 4 | ✅ Complete |
| Advanced Features | 30+ | ✅ Variants, Tags, Bundles, Services |
| EU Compliance | 10 | ✅ Responsible Persons/Producers (GPSR) |
// Create, update, delete offers
await client.Offers.CreateProductOfferAsync(request);
await client.Offers.UpdateOfferAsync(offerId, request);
await client.Offers.DeleteOfferAsync(offerId);
// Search and filter offers
await client.Offers.SearchOffersAsync(new OfferSearchParams
{
Name = "iPhone",
PublicationStatus = new[] { "ACTIVE" }
});
// Batch operations
await client.BatchOperations.BatchPriceUpdateAsync(commands);
// Search products by EAN/phrase
var products = await client.Products.SearchProductsAsync(
new ProductSearchParams { Ean = "1234567890123" }
);
// Get category tree
var categories = await client.Categories.GetCategoriesAsync();
var params = await client.Categories.GetCategoryParametersAsync(categoryId);
// Get orders
var orders = await client.Orders.GetOrdersAsync(new OrderSearchParams
{
Status = "READY_FOR_PROCESSING"
});
// Get order details
var order = await client.Orders.GetOrderAsync(orderId);
// Update fulfillment
await client.Orders.UpdateFulfillmentStatusAsync(orderId, request);
// Upload from URL
var image = await client.Images.UploadImageFromUrlAsync(imageUrl);
// Upload from file
byte[] imageData = File.ReadAllBytes("photo.jpg");
var response = await client.Images.UploadImageAsync(imageData, "image/jpeg");
The library provides specialized exceptions for precise error handling:
try
{
var offer = await client.Offers.GetProductOfferAsync(offerId);
}
catch (AllegroNotFoundException)
{
// 404 - Resource not found
}
catch (AllegroBadRequestException ex)
{
// 400 - Validation errors
foreach (var error in ex.Errors)
{
Console.WriteLine($"{error.Path}: {error.Message}");
}
}
catch (AllegroRateLimitException ex)
{
// 429 - Rate limit exceeded
await Task.Delay(TimeSpan.FromSeconds(ex.RetryAfterSeconds));
}
catch (AllegroAuthenticationException)
{
// 401 - Invalid token
}
All Exception Types:
AllegroAuthenticationException (401)AllegroAuthorizationException (403)AllegroNotFoundException (404)AllegroBadRequestException (400)AllegroUnprocessableEntityException (422)AllegroConflictException (409)AllegroRateLimitException (429)AllegroServerException (5xx)AllegroNetworkExceptionAllegroTimeoutException// Simple setup
var client = AllegroApiClient.CreateProduction("your-token");
// Advanced configuration
var options = new AllegroApiOptions
{
AccessToken = "your-token",
BaseUrl = "https://api.allegro.pl",
TimeoutSeconds = 100,
MaxRetryAttempts = 3,
RetryDelayMilliseconds = 1000,
AcceptLanguage = "en-US" // pl-PL, en-US, uk-UA, cs-CZ, sk-SK, hu-HU
};
var client = new AllegroApiClient(options);
// With dependency injection
services.AddSingleton(new AllegroApiOptions { AccessToken = "token" });
services.AddSingleton<AllegroApiClient>();
GPL-3.0-or-later - See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ for the Allegro developer community