CSharpAmazonSpAPI 1.0.14
See the version list below for details.
dotnet add package CSharpAmazonSpAPI --version 1.0.14
NuGet\Install-Package CSharpAmazonSpAPI -Version 1.0.14
<PackageReference Include="CSharpAmazonSpAPI" Version="1.0.14" />
paket add CSharpAmazonSpAPI --version 1.0.14
#r "nuget: CSharpAmazonSpAPI, 1.0.14"
// Install CSharpAmazonSpAPI as a Cake Addin #addin nuget:?package=CSharpAmazonSpAPI&version=1.0.14 // Install CSharpAmazonSpAPI as a Cake Tool #tool nuget:?package=CSharpAmazonSpAPI&version=1.0.14
Amazon Selling Partner API C#
This is an API Binding in .Net C# for the new Amazon Selling Partner API.
This library is based on the output of swagger-codegen with the OpenAPI files provided by Amazon and has been modified by the contributors.
The purpose of this package is to have an easy way of getting started with the Amazon Selling Partner API.
Requirements
- AWSSDK.SecurityToken
- AWSSDK.SQS
- Microsoft.CSharp
- Newtonsoft.Json
- RestSharp
- System.ComponentModel.Annotations
- System.Reflection
Tasks
- OrdersV0
- Reports
- FinancesV0
- Feeds for feedType for step to call feed read doc
- Uploads
- shipmentInvoicingV0
- Shippings
- CatalogItemsV0
- FBAInventory
- FBASmallAndLight
- FBAInboundEligibility
- FulFillmentInbound
- FulFillmentOutbound
- MerchantFulFillment
- Messaging
- Notifications for configration read doc
- ProductFeesV0
- ProductPricingV0
- Sales
- Sellers
- Services
- Solicitations
- Token for doc PII NOT TESTED
Installation
Install-Package CSharpAmazonSpAPI
Keys
Name | Description |
---|---|
AccessKey | AWS USER ACCESS KEY |
SecretKey | AWS USER SECRET KEY |
RoleArn | AWS IAM Role ARN (needs permission to “Assume Role” STS) |
Region | Marketplace region |
ClientId | Your amazon app id |
ClientSecret | Your amazon app secret |
For more information about keys please check Amazon Selling Partner Api developer guide.
Usage
Configration
AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = "AKIAXXXXXXXXXXXXXXX",
SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RoleArn = "arn:aws:iam::XXXXXXXXXXXXX:role/XXXXXXXXXXXX",
ClientId = "amzn1.application-XXX-client.XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
ClientSecret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
RefreshToken= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
});
Order Lsit ,For more orders sample please check Here.
var orders= amazonConnection.Orders.ListOrders();
Order Lsit with parameter
ParameterOrderList serachOrderList = new ParameterOrderList();
serachOrderList.CreatedAfter = DateTime.UtcNow.AddHours(-24);
serachOrderList.OrderStatuses = new List<OrderStatuses>();
serachOrderList.OrderStatuses.Add(OrderStatuses.Unshipped);
serachOrderList.MarketplaceIds = new List<string> { MarketPlace.UnitedArabEmirates.ID };
var orders = amazonConnection.Orders.GetOrders(serachOrderList);
Report Lsit ,For more report sample please check Here.
var parameters = new ParameterReportList();
parameters.pageSize = 100;
parameters.reportTypes = new List<ReportTypes>();
parameters.reportTypes.Add(ReportTypes.GET_AFN_INVENTORY_DATA);
parameters.marketplaceIds = new List<string>();
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
var reports=amazonConnection.Reports.GetReports(parameters);
Custom Report
var parameters = new ParameterCreateReportSpecification();
parameters.reportType = ReportTypes.GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL;
parameters.dataStartTime = DateTime.UtcNow.AddDays(-30);
parameters.dataEndTime = DateTime.UtcNow.AddDays(-10);
parameters.marketplaceIds = new MarketplaceIds();
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
parameters.reportOptions = new AmazonSpApiSDK.Models.Reports.ReportOptions();
var report= amazonConnection.Reports.CreateReport(parameters);
Report GET_MERCHANT_LISTINGS_ALL_DATA sample
var parameters = new ParameterCreateReportSpecification();
parameters.reportType = ReportTypes.GET_MERCHANT_LISTINGS_ALL_DATA;
parameters.marketplaceIds = new MarketplaceIds();
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
parameters.reportOptions = new FikaAmazonAPI.AmazonSpApiSDK.Models.Reports.ReportOptions();
var reportId = amazonConnection.Reports.CreateReport(parameters);
var filePath = string.Empty;
string ReportDocumentId = string.Empty;
while (string.IsNullOrEmpty(ReportDocumentId))
{
Thread.Sleep(1000 * 60);
var reportData = amazonConnection.Reports.GetReport(reportId);
if (!string.IsNullOrEmpty(reportData.ReportDocumentId))
{
filePath = amazonConnection.Reports.GetReportFile(reportData.ReportDocumentId);
break;
}
}
//filePath for report
Product Pricing ,For more Pricing sample please check Here.
var data = amazonConnection.ProductPricing.GetPricing(new Parameter.ProductPricing.ParameterGetPricing()
{
MarketplaceId = MarketPlace.UnitedArabEmirates.ID,
Asins = new string[] { "B00CZC5F0G" }
});
Product Competitive Price
var data = amazonConnection.ProductPricing.GetCompetitivePricing(new Parameter.ProductPricing.ParameterGetCompetitivePricing()
{
MarketplaceId = MarketPlace.UnitedArabEmirates.ID,
Asins = new string[] { "B00CZC5F0G" },
});
Notifications Create Destination,For more Notifications sample please check Here.
//EventBridge
var data = amazonConnection.Notification.CreateDestination(new AmazonSpApiSDK.Models.Notifications.CreateDestinationRequest()
{
Name = "CompanyName",
ResourceSpecification = new AmazonSpApiSDK.Models.Notifications.DestinationResourceSpecification()
{
EventBridge = new AmazonSpApiSDK.Models.Notifications.EventBridgeResourceSpecification("us-east-2", "999999999")
}
});
//SQS
var dataSqs = amazonConnection.Notification.CreateDestination(new AmazonSpApiSDK.Models.Notifications.CreateDestinationRequest()
{
Name = "CompanyName_AE",
ResourceSpecification = new AmazonSpApiSDK.Models.Notifications.DestinationResourceSpecification
{
Sqs = new AmazonSpApiSDK.Models.Notifications.SqsResource("arn:aws:sqs:us-east-2:9999999999999:NAME")
}
});
Notifications read messages
var SQL_URL = "https://sqs.us-east-2.amazonaws.com/9999999999999/IUSER_SQS";
ParameterMessageReceiver param = new ParameterMessageReceiver(Environment.GetEnvironmentVariable("AccessKey"), Environment.GetEnvironmentVariable("SecretKey"), SQL_URL, Amazon.RegionEndpoint.USEast2);
CustomMessageReceiver messageReceiver = new CustomMessageReceiver();
amazonConnection.Notification.StartReceivingNotificationMessages(param, messageReceiver);
public class CustomMessageReceiver : IMessageReceiver
{
public void ErrorCatch(Exception ex)
{
//Your code here
}
public void NewMessageRevicedTriger(NotificationMessageResponce message)
{
//Your Code here
}
}
Feed Submit
Here Full sample for submit feed to change price and generate XML and get final report for result same as in doc. Notes: not all feed type finished as its big work and effort but all classes are partial for easy change and you can generate xml outside and use our library for get data , now we support only sumit existed product , change quantity and change price
ConstructFeedService createDocument = new ConstructFeedService("A3J37AJU4O9RHK", "1.02");
var list = new List<PriceMessage>();
list.Add(new PriceMessage()
{
SKU = "8201031206122...",
StandardPrice = new StandardPrice()
{
currency = BaseCurrencyCode.AED.ToString(),
Value = (201.0522M).ToString("0.00")
}
});
createDocument.AddPriceMessage(list);
var xml = createDocument.GetXML();
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_PRODUCT_PRICING_DATA);
Thread.Sleep(1000*30);
var feedOutput=amazonConnection.Feed.GetFeed(feedID);
var outPut=amazonConnection.Feed.GetFeedDocument(feedOutput.ResultFeedDocumentId);
var reportOutpit = outPut.Url;
Q & A
If you have questions, please ask in GitHub discussions
ToDo
- Improve documentation
Notes
If you are looking for a complete Feedback solution, you might want to consider giving Soon.se a shot.
Support & Consultation
We offer consultation on everything SP-API related. Book your meeting here:
Thanks
Thanks go out to everybody who worked on this package.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- AWSSDK.SecurityToken (>= 3.7.1.55)
- AWSSDK.SQS (>= 3.7.0.57)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.1)
- RestSharp (>= 106.12.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Reflection (>= 4.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CSharpAmazonSpAPI:
Package | Downloads |
---|---|
BizDoc.Infrastructure.Amazon
Amazon for BizDoc |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.7.33 | 191 | 12/16/2024 | |
1.7.32 | 510 | 12/5/2024 | |
1.7.31 | 1,423 | 11/15/2024 | |
1.7.30 | 1,053 | 11/4/2024 | |
1.7.29 | 724 | 10/18/2024 | |
1.7.28 | 713 | 10/4/2024 | |
1.7.27 | 1,098 | 9/25/2024 | |
1.7.26 | 224 | 9/23/2024 | |
1.7.24 | 913 | 9/11/2024 | |
1.7.23 | 271 | 9/6/2024 | |
1.7.22 | 2,647 | 7/13/2024 | |
1.7.21 | 159 | 7/10/2024 | |
1.7.20 | 102 | 7/10/2024 | |
1.7.19 | 105 | 7/10/2024 | |
1.7.18 | 9,203 | 4/22/2024 | |
1.7.17 | 2,786 | 3/11/2024 | |
1.7.16 | 156 | 3/10/2024 | |
1.7.15 | 285 | 3/6/2024 | |
1.7.14 | 559 | 3/3/2024 | |
1.7.13 | 3,656 | 2/1/2024 | |
1.7.12 | 348 | 1/29/2024 | |
1.7.11 | 973 | 1/16/2024 | |
1.7.10 | 1,656 | 12/30/2023 | |
1.7.9 | 1,201 | 12/11/2023 | |
1.7.8 | 11,268 | 10/26/2023 | |
1.7.7 | 363 | 10/24/2023 | |
1.7.5 | 1,019 | 10/13/2023 | |
1.7.4 | 588 | 10/8/2023 | |
1.7.3 | 937 | 9/21/2023 | |
1.7.2 | 906 | 8/30/2023 | |
1.7.1 | 2,892 | 8/9/2023 | |
1.6.11 | 8,879 | 7/3/2023 | |
1.6.9 | 419 | 7/3/2023 | |
1.6.8 | 1,374 | 6/24/2023 | |
1.6.7 | 773 | 6/17/2023 | |
1.6.6 | 4,366 | 5/18/2023 | |
1.6.5 | 1,860 | 5/7/2023 | |
1.6.4 | 4,616 | 4/20/2023 | |
1.6.3 | 340 | 4/18/2023 | |
1.6.2 | 8,546 | 3/24/2023 | |
1.6.1 | 523 | 3/18/2023 | |
1.6.0 | 739 | 3/18/2023 | |
1.5.35 | 932 | 3/14/2023 | |
1.5.34 | 263 | 3/14/2023 | |
1.5.33 | 2,140 | 2/10/2023 | |
1.5.32 | 1,726 | 1/24/2023 | |
1.5.31 | 816 | 1/11/2023 | |
1.5.30 | 1,907 | 1/3/2023 | |
1.5.29 | 391 | 12/28/2022 | |
1.5.28 | 413 | 12/23/2022 | |
1.5.27 | 460 | 12/18/2022 | |
1.5.26 | 705 | 12/13/2022 | |
1.5.25 | 3,150 | 12/11/2022 | |
1.5.24 | 569 | 12/2/2022 | |
1.5.23 | 411 | 12/1/2022 | |
1.5.22 | 398 | 12/1/2022 | |
1.5.21 | 877 | 11/27/2022 | |
1.5.20 | 379 | 11/26/2022 | |
1.5.19 | 420 | 11/23/2022 | |
1.5.18 | 601 | 11/22/2022 | |
1.5.17 | 377 | 11/21/2022 | |
1.5.16 | 413 | 11/17/2022 | |
1.5.15 | 706 | 11/16/2022 | |
1.5.14 | 391 | 11/16/2022 | |
1.5.13 | 369 | 11/16/2022 | |
1.5.12 | 853 | 11/7/2022 | |
1.5.11 | 422 | 11/7/2022 | |
1.5.10 | 427 | 11/6/2022 | |
1.5.9 | 457 | 11/6/2022 | |
1.5.8 | 416 | 11/3/2022 | |
1.5.7 | 469 | 11/2/2022 | |
1.5.6 | 472 | 11/1/2022 | |
1.5.5 | 2,025 | 10/24/2022 | |
1.5.4 | 430 | 10/24/2022 | |
1.5.3 | 501 | 10/23/2022 | |
1.5.2 | 994 | 10/19/2022 | |
1.5.1 | 509 | 10/18/2022 | |
1.5.0 | 1,035 | 10/18/2022 | |
1.5.0-alpha1 | 155 | 10/7/2022 | |
1.4.32 | 6,199 | 10/6/2022 | |
1.4.31 | 613 | 10/5/2022 | |
1.4.30 | 1,771 | 9/22/2022 | |
1.4.29 | 528 | 9/22/2022 | |
1.4.28 | 737 | 9/17/2022 | |
1.4.27 | 572 | 9/12/2022 | |
1.4.26 | 634 | 9/6/2022 | |
1.4.25 | 509 | 9/4/2022 | |
1.4.24 | 490 | 9/2/2022 | |
1.4.23 | 1,210 | 8/18/2022 | |
1.4.22 | 1,647 | 8/16/2022 | |
1.4.21 | 557 | 8/15/2022 | |
1.4.20 | 3,123 | 8/14/2022 | |
1.4.19 | 2,468 | 8/12/2022 | |
1.4.18 | 513 | 8/11/2022 | |
1.4.17 | 6,715 | 8/8/2022 | |
1.4.16 | 506 | 8/8/2022 | |
1.4.15 | 582 | 8/5/2022 | |
1.4.14 | 810 | 8/4/2022 | |
1.4.13 | 703 | 7/29/2022 | |
1.4.12 | 491 | 7/29/2022 | |
1.4.11 | 519 | 7/29/2022 | |
1.4.10 | 584 | 7/27/2022 | |
1.4.9 | 491 | 7/27/2022 | |
1.4.8 | 791 | 7/27/2022 | |
1.4.7 | 721 | 7/26/2022 | |
1.4.6 | 605 | 7/24/2022 | |
1.4.5 | 675 | 7/18/2022 | |
1.4.4 | 620 | 7/14/2022 | |
1.4.3 | 1,389 | 7/13/2022 | |
1.4.2 | 565 | 7/11/2022 | |
1.4.1 | 2,229 | 7/3/2022 | |
1.4.0 | 522 | 6/30/2022 | |
1.3.21 | 513 | 6/30/2022 | |
1.3.20 | 555 | 6/29/2022 | |
1.3.19 | 528 | 6/28/2022 | |
1.3.18 | 521 | 6/27/2022 | |
1.3.17 | 482 | 6/27/2022 | |
1.3.16 | 3,327 | 6/14/2022 | |
1.3.15 | 507 | 6/14/2022 | |
1.3.14 | 653 | 6/11/2022 | |
1.3.13 | 1,282 | 6/3/2022 | |
1.3.12 | 558 | 5/31/2022 | |
1.3.11 | 519 | 5/28/2022 | |
1.3.10 | 1,677 | 5/19/2022 | |
1.3.9 | 754 | 5/14/2022 | |
1.3.8 | 597 | 5/10/2022 | |
1.3.7 | 506 | 5/10/2022 | |
1.3.5 | 1,120 | 5/5/2022 | |
1.3.4 | 533 | 5/2/2022 | |
1.3.3 | 789 | 4/29/2022 | |
1.3.2 | 701 | 4/15/2022 | |
1.3.1 | 509 | 4/15/2022 | |
1.3.0 | 3,569 | 3/17/2022 | |
1.2.10 | 962 | 3/16/2022 | |
1.2.9 | 835 | 3/12/2022 | |
1.2.8 | 516 | 3/12/2022 | |
1.2.7 | 1,632 | 3/10/2022 | |
1.2.6 | 819 | 3/7/2022 | |
1.2.5 | 527 | 3/5/2022 | |
1.2.4 | 542 | 3/4/2022 | |
1.2.3 | 571 | 3/4/2022 | |
1.2.2 | 537 | 3/2/2022 | |
1.2.1 | 568 | 3/1/2022 | |
1.2.0 | 525 | 2/26/2022 | |
1.1.5 | 618 | 2/20/2022 | |
1.1.4 | 506 | 2/18/2022 | |
1.1.3 | 506 | 2/18/2022 | |
1.1.2 | 772 | 2/17/2022 | |
1.1.0 | 669 | 2/14/2022 | |
1.1.0-beta | 197 | 2/14/2022 | |
1.1.0-alpha.5 | 125 | 2/12/2022 | |
1.1.0-alpha.4 | 124 | 2/12/2022 | |
1.1.0-alpha.3 | 121 | 2/12/2022 | |
1.1.0-alpha.2 | 121 | 2/12/2022 | |
1.1.0-alpha.1 | 130 | 2/12/2022 | |
1.0.45.3-alpha | 173 | 2/12/2022 | |
1.0.45.2-alpha | 212 | 2/12/2022 | |
1.0.45.1-alpha | 183 | 2/12/2022 | |
1.0.45-alpha.4 | 120 | 2/12/2022 | |
1.0.45-alpha | 193 | 2/12/2022 | |
1.0.44 | 676 | 2/9/2022 | |
1.0.43 | 526 | 2/2/2022 | |
1.0.42 | 530 | 1/27/2022 | |
1.0.41 | 516 | 1/22/2022 | |
1.0.40 | 508 | 1/22/2022 | |
1.0.39 | 479 | 1/22/2022 | |
1.0.38 | 531 | 1/20/2022 | |
1.0.37 | 679 | 1/17/2022 | |
1.0.36 | 537 | 1/16/2022 | |
1.0.35 | 523 | 1/15/2022 | |
1.0.34 | 524 | 1/12/2022 | |
1.0.33 | 531 | 1/11/2022 | |
1.0.32 | 367 | 1/10/2022 | |
1.0.31 | 439 | 1/9/2022 | |
1.0.30 | 324 | 1/9/2022 | |
1.0.29 | 371 | 1/6/2022 | |
1.0.28 | 398 | 1/5/2022 | |
1.0.27 | 355 | 1/4/2022 | |
1.0.26 | 312 | 1/4/2022 | |
1.0.25 | 360 | 1/1/2022 | |
1.0.24 | 687 | 12/31/2021 | |
1.0.23 | 331 | 12/31/2021 | |
1.0.22 | 399 | 12/23/2021 | |
1.0.21 | 372 | 12/21/2021 | |
1.0.20 | 375 | 12/18/2021 | |
1.0.18 | 407 | 12/6/2021 | |
1.0.17 | 2,986 | 11/25/2021 | |
1.0.16 | 368 | 11/23/2021 | |
1.0.15 | 355 | 11/23/2021 | |
1.0.14 | 1,614 | 11/19/2021 | |
1.0.13 | 591 | 10/23/2021 | |
1.0.12 | 396 | 10/14/2021 | |
1.0.11 | 407 | 10/11/2021 | |
1.0.10 | 445 | 10/3/2021 | |
1.0.9 | 737 | 9/25/2021 | |
1.0.8 | 660 | 9/25/2021 | |
1.0.7 | 524 | 9/25/2021 | |
1.0.6 | 434 | 9/24/2021 | |
1.0.5 | 544 | 9/20/2021 | |
1.0.4 | 480 | 9/18/2021 | |
1.0.3 | 440 | 9/18/2021 | |
1.0.2 | 513 | 9/17/2021 | |
1.0.1 | 533 | 9/2/2021 | |
1.0.0 | 568 | 8/17/2021 |