CSharpAmazonSpAPI 1.6.5
See the version list below for details.
dotnet add package CSharpAmazonSpAPI --version 1.6.5
NuGet\Install-Package CSharpAmazonSpAPI -Version 1.6.5
<PackageReference Include="CSharpAmazonSpAPI" Version="1.6.5" />
paket add CSharpAmazonSpAPI --version 1.6.5
#r "nuget: CSharpAmazonSpAPI, 1.6.5"
// Install CSharpAmazonSpAPI as a Cake Addin #addin nuget:?package=CSharpAmazonSpAPI&version=1.6.5 // Install CSharpAmazonSpAPI as a Cake Tool #tool nuget:?package=CSharpAmazonSpAPI&version=1.6.5
☕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 (Models) 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 using C#, you can watch this 📷 Youtube 📣 video for easy start your project
Requirements
- AWSSDK.SecurityToken
- AWSSDK.SQS
- Microsoft.CSharp
- Newtonsoft.Json
- RestSharp
- System.ComponentModel.Annotations
- System.Reflection
Installation
Install-Package CSharpAmazonSpAPI
Tasks
Seller
- OrdersV0
- Reports
- FinancesV0
- Feeds Use Case Guide feedType
- ListingsItems Use Case Guide
- Restrictions Use Case Guide
- ProductTypes Use Case Guide
- Uploads Use Case Guide
- shipmentInvoicingV0
- Shippings
- CatalogItemsV0
- CatalogItemsV20220401
- FBAInventory
- FBASmallAndLight
- FBAInboundEligibility
- FulFillmentInbound
- FulFillmentOutbound
- MerchantFulFillment
- Messaging
- Notifications Use Case Guide
- ProductFeesV0
- ProductPricingV0
- Sales
- Sellers
- Services
- Solicitations
- Token Use Case Guide
- Authorization
- Easy Ship
- A+ Content
Vendor
- VendorDirectFulfillmentInventoryV1
- VendorDirectFulfillmentOrdersV1
- VendorDirectFulfillmentPaymentsV1
- VendorDirectFulfillmentShippingV1
- VendorDirectFulfillmentTransactionsV1
- VendorOrders
- vendorInvoices
- VendorShipments
- VendorTransactionStatus
Keys
To get all keys needed you need to follow this step Creating and configuring IAM policies and entities and then you need to Registering your Application then Authorizing Selling Partner API applications
⚠️ Use role ARN created in step 5 when you register your application: and dont use IAM user
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 List of Marketplaces |
ClientId | Your amazon app id |
ClientSecret | Your amazon app secret |
RefreshToken | Check how to get RefreshToken |
For more information about keys please check New Amazon doc for create keys Developer , If you are not registered as developer please Register to be able to create application.
Usage
Please be aware there has been a change to the Orders.GetOrderAddress() method please reference the new sample code for more details.
Configuration
You can configure a connection like so please see Here for the relevant code file.
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",
MarketPlace = MarketPlace.UnitedArabEmirates, //MarketPlace.GetMarketPlaceByID("A2VIGQ35RCS4UG")
});
or
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",
MarketPlaceID = "A2VIGQ35RCS4UG"
});
Configuration using a proxy
Please see here for the relevant code file.
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", MarketPlaceID = "A2VIGQ35RCS4UG", ProxyAddress = "http(s)://xxx.xxx.xxx.xxx:xxxx", });
- Assign your proxy address to the ProxyAddress Property and you'll be able to use a proxy account.
This is not required and will operate normally without the ProxyAddress being set.
Order List, For more orders sample please check Here.
ParameterOrderList serachOrderList = new ParameterOrderList();
serachOrderList.CreatedAfter = DateTime.UtcNow.AddMinutes(-600000);
serachOrderList.OrderStatuses = new List<OrderStatuses>();
serachOrderList.OrderStatuses.Add(OrderStatuses.Canceled);
var orders = amazonConnection.Orders.GetOrders(serachOrderList);
Order List 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);
Order List with parameter including PII data Simple
var parameterOrderList = new ParameterOrderList
{
CreatedAfter = DateTime.UtcNow.AddHours(-24),
OrderStatuses = new List<OrderStatuses> { OrderStatuses.Unshipped },
MarketplaceIds = new List<string> { MarketPlace.UnitedArabEmirates.ID },
IsNeedRestrictedDataToken = true
};
var orders = _amazonConnection.Orders.GetOrders(parameterOrderList);
Order List with parameter including PII data Advance (if you want to get specific data Elements object only)
var parameterOrderList = new ParameterOrderList
{
CreatedAfter = DateTime.UtcNow.AddHours(-24),
OrderStatuses = new List<OrderStatuses> { OrderStatuses.Unshipped },
MarketplaceIds = new List<string> { MarketPlace.UnitedArabEmirates.ID },
IsNeedRestrictedDataToken = true,
RestrictedDataTokenRequest = new CreateRestrictedDataTokenRequest
{
restrictedResources = new List<RestrictedResource>
{
new RestrictedResource
{
method = Method.GET.ToString(),
path = ApiUrls.OrdersApiUrls.Orders,
dataElements = new List<string> { "buyerInfo", "shippingAddress" }
}
}
}
};
var orders = _amazonConnection.Orders.GetOrders(parameterOrderList);
Order List data from Sandbox
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",
Environment=Environments.Sandbox
});
var orders = amazonConnection.Orders.GetOrders
(
new FikaAmazonAPI.Parameter.Order.ParameterOrderList
{
TestCase = Constants.TestCase200
}
);
Report List, 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);
Get Report with PII
//use this method automatically know if the report are RDT or not
var data2 = amazonConnection.Reports.CreateReportAndDownloadFile(ReportTypes.GET_EASYSHIP_DOCUMENTS, startDate, null, null);
// OR USE this method to get the document and pass parameter isRestrictedReport = true in case the report will return PII data
var data = amazonConnection.Reports.GetReportDocument("50039018869997",true);
Report Manager 🚀🧑🚀✨
Easy way to get the report you need and convert the file return from amazon to class or list, this feature only ready for some reports as its will take much times to finish for All report type ....
ReportManager reportManager = new ReportManager(amazonConnection);
var products = reportManager.GetProducts(); //GET_MERCHANT_LISTINGS_ALL_DATA
var inventoryAging = reportManager.GetInventoryAging(); //GET_FBA_INVENTORY_AGED_DATA
var ordersByDate = reportManager.GetOrdersByOrderDate(90); //GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL
var ordersByLastUpdate = reportManager.GetOrdersByLastUpdate(90); //GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL
var settlementOrder = reportManager.GetSettlementOrder(90); //GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2
var returnMFNOrder = reportManager.GetReturnMFNOrder(90); //GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE
var returnFBAOrder = reportManager.GetReturnFBAOrder(90); //GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA
var reimbursementsOrder = reportManager.GetReimbursementsOrder(180); //GET_FBA_REIMBURSEMENTS_DATA
var feedbacks = reportManager.GetFeedbackFromDays(180); //GET_SELLER_FEEDBACK_DATA
var LedgerDetails = reportManager.GetLedgerDetailAsync(10); //GET_LEDGER_DETAIL_VIEW_DATA
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 GetCatalogItem Version 2022-04-01
var data = await amazonConnection.CatalogItem.GetCatalogItem202204Async(
new Parameter.CatalogItems.ParameterGetCatalogItem
{
ASIN = "B00JK2YANC",
includedData = new[] { IncludedData.attributes,
IncludedData.salesRanks,
IncludedData.summaries,
IncludedData.productTypes,
IncludedData.relationships,
IncludedData.dimensions,
IncludedData.identifiers,
IncludedData.images }
});
Product SearchCatalogItems Version 2022-04-01
var data = await amazonConnection.CatalogItem.SearchCatalogItems202204Async(
new Parameter.CatalogItems.ParameterSearchCatalogItems202204
{
keywords = new[] { "vitamin c" },
includedData = new[] { IncludedData.attributes,
IncludedData.salesRanks,
IncludedData.summaries,
IncludedData.productTypes,
IncludedData.relationships,
IncludedData.dimensions,
IncludedData.identifiers,
IncludedData.images }
});
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" },
});
GetFeaturedOfferExpectedPriceBatch
var priceDemo = new ProductPricingSample(amazonConnection);
await priceDemo.GetFeaturedOfferExpectedPriceBatch();
Notifications Create Destination, For more Notifications sample please check Here.
//EventBridge
var data = amazonConnection.Notification.CreateDestination(
new Notifications.CreateDestinationRequest()
{
Name = "CompanyName",
ResourceSpecification = new Notifications.DestinationResourceSpecification()
{
EventBridge = new Notifications.EventBridgeResourceSpecification("us-east-2", "999999999")
}
});
//SQS
var dataSqs = amazonConnection.Notification.CreateDestination(
new Notifications.CreateDestinationRequest()
{
Name = "CompanyName_AE",
ResourceSpecification = new Notifications.DestinationResourceSpecification
{
Sqs = new Notifications.SqsResource("arn:aws:sqs:us-east-2:9999999999999:NAME")
}
});
Notifications Create Subscription, For more Notifications sample please check Here.
//SQS
var result = amazonConnection.Notification.CreateSubscription(
new ParameterCreateSubscription()
{
destinationId = "xxxxxxxxxxxxxxx", // take this from CreateDestination or GetDestinations response
notificationType = NotificationType.ANY_OFFER_CHANGED, // or B2B_ANY_OFFER_CHANGED for B2B prices
payloadVersion = "1.0"
});
Notifications read messages
var SQS_URL = "https://sqs.us-east-2.amazonaws.com/9999999999999/IUSER_SQS";
ParameterMessageReceiver param = new ParameterMessageReceiver(
Environment.GetEnvironmentVariable("AccessKey"),
Environment.GetEnvironmentVariable("SecretKey"),
SQS_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 it's big work and effort but all classes are partial for easy change and you can generate XML outside and use our library to get data, now we support only submit existing product, change quantity and change price , I list most of XSD here Source\FikaAmazonAPI\ConstructFeed\xsd its will help you easy generate class and add it in your app to generate final feed xml.
Feed Submit for change price , For more Feed sample please check Here.
ConstructFeedService createDocument = new ConstructFeedService("{SellerID}", "1.02");
var list = new List<PriceMessage>();
list.Add(new PriceMessage()
{
SKU = "8201031206122...",
StandardPrice = new StandardPrice()
{
currency = amazonConnection.GetCurrentMarketplace.CurrencyCode.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;
var processingReport = amazonConnection.Feed.GetFeedDocumentProcessingReport(outPut.Url);
Feed Submit for change Quantity
ConstructFeedService createDocument = new ConstructFeedService("{SellerID}", "1.02");
var list = new List<InventoryMessage>();
list.Add(new InventoryMessage()
{
SKU = "82010312061.22...",
Quantity = 2,
FulfillmentLatency = "11",
});
createDocument.AddInventoryMessage(list);
var xml = createDocument.GetXML();
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_INVENTORY_AVAILABILITY_DATA);
Thread.Sleep(1000*30);
var feedOutput=amazonConnection.Feed.GetFeed(feedID);
var outPut=amazonConnection.Feed.GetFeedDocument(feedOutput.ResultFeedDocumentId);
var reportOutpit = outPut.Url;
var processingReport = amazonConnection.Feed.GetFeedDocumentProcessingReport(outPut.Url);
Feed Submit for change ProdcutImage
public void SubmitFeedProductImage()
{
ConstructFeedService createDocument = new ConstructFeedService("A3J37AJU4O9RHK", "1.02");
var list = new List<ProductImageMessage>();
list.Add(new ProductImageMessage()
{
SKU = "8201031206122...",
ImageLocation = "http://xxxx.com/1.jpeg",
ImageType = ImageType.Main
}) ;
createDocument.AddProductImageMessage(list);
var xml = createDocument.GetXML();
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_PRODUCT_IMAGE_DATA);
}
Feed Submit for change FULFILLMENT DATA (add tracking number for shipment)
ConstructFeedService createDocument = new ConstructFeedService("{sellerId}", "1.02");
var list = new List<OrderFulfillmentMessage>();
list.Add(new OrderFulfillmentMessage()
{
AmazonOrderID = "{orderId}",
FulfillmentDate = DateTime.Now.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK"),
FulfillmentData = new FulfillmentData()
{
CarrierName = "Correos Express",
ShippingMethod = "ePaq",
ShipperTrackingNumber = "{trackingNumber}"
}
});
createDocument.AddOrderFulfillmentMessage(list);
var xml = createDocument.GetXML();
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_ORDER_FULFILLMENT_DATA);
Feed Submit for change Order Adjustments
public void SubmitFeedOrderAdjustment()
{
ConstructFeedService createDocument = new ConstructFeedService("A3J37AJU4O9RHK", "1.02");
var list = new List<OrderAdjustmentMessage>();
list.Add(new OrderAdjustmentMessage()
{
AmazonOrderID = "AMZ1234567890123",
ActionType = AdjustmentActionType.Refund,
AdjustedItem = new List<AdjustedItem>() {
new AdjustedItem() {
AmazonOrderItemCode = "52986411826454",
AdjustmentReason = AdjustmentReason.CustomerCancel,
DirectPaymentAdjustments = new List<DirectPaymentAdjustments>()
{
new DirectPaymentAdjustments()
{
Component = new List<DirectPaymentAdjustmentsComponent>()
{
new DirectPaymentAdjustmentsComponent() {
DirectPaymentType = "Credit Card Refund",
Amount = new CurrencyAmount() {
Value = 10.50M,
currency = amazonConnection.GetCurrentMarketplace.CurrencyCode
}
}
}
}
}
}
}
});
createDocument.AddOrderAdjustmentMessage(list);
var xml = createDocument.GetXML();
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_PAYMENT_ADJUSTMENT_DATA);
}
Usage Plans and Rate Limits in the Selling Partner API
Please read this doc to get all information about this limitation https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/usage-plans-rate-limits/Usage-Plans-and-Rate-Limits.md
we calc waiting time by read x-amzn-RateLimit-Limit header
int sleepTime = (int)((1 / header["x-amzn-RateLimit-Limit"] ) * 1000);
You can also disable libary from handelling limitaion by set IsActiveLimitRate=false in AmazonCredential
var amazonConnection = new AmazonConnection(new AmazonCredential()
{
.
.
IsActiveLimitRate=false
});
Enable debug mode
You can also enable log for all http request and response you can set IsDebugMode=true in AmazonCredential
var amazonConnection = new AmazonConnection(new AmazonCredential()
{
.
.
IsDebugMode = true
});
Get restrictions before try to add new lists
var result = amazonConnection.Restrictions.GetListingsRestrictions(
new Parameter.Restrictions.ParameterGetListingsRestrictions
{
asin = "AAAAAAAAAA",
sellerId = "AXXXXXXXXXXXX"
});
Create shipment operation from MerchantFulfillment
ShipmentRequestDetails shipmentRequestDetails = new ShipmentRequestDetails()
{
AmazonOrderId = "999-9999-999999",
ItemList = new ItemList()
{
new FikaAmazonAPI.AmazonSpApiSDK.Models.MerchantFulfillment.Item()
{
OrderItemId = "52986411826454",
Quantity = 1
}
},
ShipFromAddress = new Address()
{
AddressLine1 = "300 St",
City = "City",
PostalCode = "48123",
Email = "[mail@yahoo.com](mailto:mail@yahoo.com)",
Phone = "999999999",
StateOrProvinceCode = "MI",
CountryCode = "US",
Name = "FirstName LastName"
},
PackageDimensions = new PackageDimensions()
{
Height = 10,
Width = 10,
Length = 10,
Unit = UnitOfLength.Inches
},
Weight = new Weight()
{
Value = 10,
Unit = UnitOfWeight.Oz
},
ShippingServiceOptions = new ShippingServiceOptions()
{
DeliveryExperience = DeliveryExperienceType.NoTracking,
CarrierWillPickUp = false,
CarrierWillPickUpOption = CarrierWillPickUpOption.ShipperWillDropOff
}
};
var shipmentRequest = new CreateShipmentRequest(
shipmentRequestDetails,
shippingServiceId: "UPS_PTP_2ND_DAY_AIR",
shippingServiceOfferId: "WHgxtyn6qjGGaC");
var shipmentResponse = amazonConnection.MerchantFulfillment.CreateShipment(shipmentRequest);
ProductTypes SearchDefinitions
var list = amazonConnection.ProductType.SearchDefinitionsProductTypes(
new Parameter.ProductTypes.SearchDefinitionsProductTypesParameter()
{
keywords = new List<string> { String.Empty },
});
ProductTypes GetDefinitions
var def = amazonConnection.ProductType.GetDefinitionsProductType(
new Parameter.ProductTypes.GetDefinitionsProductTypeParameter()
{
productType = "PRODUCT",
requirements = RequirementsEnum.LISTING,
locale = AmazonSpApiSDK.Models.ProductTypes.LocaleEnum.en_US
});
Sales Performance Sample
DateTime queryStart = DateTime.UtcNow.AddDays(-11).Date;
DateTime queryEnd = DateTime.UtcNow;
var parameters = new ParameterGetOrderMetrics();
parameters.marketplaceIds = new MarketplaceIds();
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
parameters.interval = queryStart.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture) + "Z--" + queryEnd.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture) + "Z";
parameters.granularity = Constants.GranularityEnum.Day;
parameters.firstDayOfWeek = Constants.FirstDayOfWeek.monday;
var sales = amazonConnection.Sales.GetOrderMetrics(parameters);
Q & A
If you have questions, please ask in GitHub discussions
ToDo
- Improve documentation
Useful links
Selling Partner API
Amazon MWS to SP-API Migration Guide
SP-API models
Using Postman for Selling Partner API models
Test Project with pure C# code
Sample Code
Creating And Configuring AWS
Contributing
- Fork it (https://github.com/abuzuhri/Amazon-SP-API-CSharp/fork)
- Clone it (
git clone https://github.com/{YOUR_USERNAME}/Amazon-SP-API-CSharp
) - Create your feature branch (
git checkout -b your_branch_name
) - Commit your changes (
git commit -m 'Description of a commit'
) - Push to the branch (
git push origin your_branch_name
) - Create a new Pull Request
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.100.52)
- AWSSDK.SQS (>= 3.7.100.52)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.2)
- RestSharp (>= 108.0.3)
- RestSharp.Serializers.NewtonsoftJson (>= 108.0.3)
- StandardSocketsHttpHandler (>= 2.2.0.4)
- System.Collections (>= 4.3.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.31 | 0 | 11/15/2024 | |
1.7.30 | 475 | 11/4/2024 | |
1.7.29 | 629 | 10/18/2024 | |
1.7.28 | 628 | 10/4/2024 | |
1.7.27 | 784 | 9/25/2024 | |
1.7.26 | 216 | 9/23/2024 | |
1.7.24 | 769 | 9/11/2024 | |
1.7.23 | 258 | 9/6/2024 | |
1.7.22 | 2,387 | 7/13/2024 | |
1.7.21 | 149 | 7/10/2024 | |
1.7.20 | 92 | 7/10/2024 | |
1.7.19 | 95 | 7/10/2024 | |
1.7.18 | 7,872 | 4/22/2024 | |
1.7.17 | 2,436 | 3/11/2024 | |
1.7.16 | 151 | 3/10/2024 | |
1.7.15 | 279 | 3/6/2024 | |
1.7.14 | 541 | 3/3/2024 | |
1.7.13 | 3,460 | 2/1/2024 | |
1.7.12 | 341 | 1/29/2024 | |
1.7.11 | 944 | 1/16/2024 | |
1.7.10 | 1,588 | 12/30/2023 | |
1.7.9 | 1,144 | 12/11/2023 | |
1.7.8 | 9,815 | 10/26/2023 | |
1.7.7 | 358 | 10/24/2023 | |
1.7.5 | 990 | 10/13/2023 | |
1.7.4 | 580 | 10/8/2023 | |
1.7.3 | 894 | 9/21/2023 | |
1.7.2 | 898 | 8/30/2023 | |
1.7.1 | 2,814 | 8/9/2023 | |
1.6.11 | 8,523 | 7/3/2023 | |
1.6.9 | 413 | 7/3/2023 | |
1.6.8 | 1,319 | 6/24/2023 | |
1.6.7 | 757 | 6/17/2023 | |
1.6.6 | 4,351 | 5/18/2023 | |
1.6.5 | 1,852 | 5/7/2023 | |
1.6.4 | 4,559 | 4/20/2023 | |
1.6.3 | 332 | 4/18/2023 | |
1.6.2 | 8,134 | 3/24/2023 | |
1.6.1 | 506 | 3/18/2023 | |
1.6.0 | 733 | 3/18/2023 | |
1.5.35 | 923 | 3/14/2023 | |
1.5.34 | 257 | 3/14/2023 | |
1.5.33 | 2,126 | 2/10/2023 | |
1.5.32 | 1,682 | 1/24/2023 | |
1.5.31 | 777 | 1/11/2023 | |
1.5.30 | 1,872 | 1/3/2023 | |
1.5.29 | 385 | 12/28/2022 | |
1.5.28 | 407 | 12/23/2022 | |
1.5.27 | 451 | 12/18/2022 | |
1.5.26 | 695 | 12/13/2022 | |
1.5.25 | 3,025 | 12/11/2022 | |
1.5.24 | 563 | 12/2/2022 | |
1.5.23 | 405 | 12/1/2022 | |
1.5.22 | 392 | 12/1/2022 | |
1.5.21 | 844 | 11/27/2022 | |
1.5.20 | 373 | 11/26/2022 | |
1.5.19 | 412 | 11/23/2022 | |
1.5.18 | 595 | 11/22/2022 | |
1.5.17 | 371 | 11/21/2022 | |
1.5.16 | 407 | 11/17/2022 | |
1.5.15 | 700 | 11/16/2022 | |
1.5.14 | 383 | 11/16/2022 | |
1.5.13 | 363 | 11/16/2022 | |
1.5.12 | 846 | 11/7/2022 | |
1.5.11 | 415 | 11/7/2022 | |
1.5.10 | 421 | 11/6/2022 | |
1.5.9 | 449 | 11/6/2022 | |
1.5.8 | 410 | 11/3/2022 | |
1.5.7 | 461 | 11/2/2022 | |
1.5.6 | 466 | 11/1/2022 | |
1.5.5 | 2,010 | 10/24/2022 | |
1.5.4 | 424 | 10/24/2022 | |
1.5.3 | 494 | 10/23/2022 | |
1.5.2 | 963 | 10/19/2022 | |
1.5.1 | 503 | 10/18/2022 | |
1.5.0 | 1,024 | 10/18/2022 | |
1.5.0-alpha1 | 151 | 10/7/2022 | |
1.4.32 | 6,055 | 10/6/2022 | |
1.4.31 | 607 | 10/5/2022 | |
1.4.30 | 1,699 | 9/22/2022 | |
1.4.29 | 519 | 9/22/2022 | |
1.4.28 | 728 | 9/17/2022 | |
1.4.27 | 561 | 9/12/2022 | |
1.4.26 | 624 | 9/6/2022 | |
1.4.25 | 503 | 9/4/2022 | |
1.4.24 | 484 | 9/2/2022 | |
1.4.23 | 1,201 | 8/18/2022 | |
1.4.22 | 1,641 | 8/16/2022 | |
1.4.21 | 551 | 8/15/2022 | |
1.4.20 | 2,735 | 8/14/2022 | |
1.4.19 | 2,456 | 8/12/2022 | |
1.4.18 | 507 | 8/11/2022 | |
1.4.17 | 6,621 | 8/8/2022 | |
1.4.16 | 500 | 8/8/2022 | |
1.4.15 | 575 | 8/5/2022 | |
1.4.14 | 802 | 8/4/2022 | |
1.4.13 | 697 | 7/29/2022 | |
1.4.12 | 479 | 7/29/2022 | |
1.4.11 | 508 | 7/29/2022 | |
1.4.10 | 575 | 7/27/2022 | |
1.4.9 | 485 | 7/27/2022 | |
1.4.8 | 773 | 7/27/2022 | |
1.4.7 | 713 | 7/26/2022 | |
1.4.6 | 595 | 7/24/2022 | |
1.4.5 | 663 | 7/18/2022 | |
1.4.4 | 614 | 7/14/2022 | |
1.4.3 | 1,370 | 7/13/2022 | |
1.4.2 | 555 | 7/11/2022 | |
1.4.1 | 2,178 | 7/3/2022 | |
1.4.0 | 516 | 6/30/2022 | |
1.3.21 | 507 | 6/30/2022 | |
1.3.20 | 549 | 6/29/2022 | |
1.3.19 | 520 | 6/28/2022 | |
1.3.18 | 513 | 6/27/2022 | |
1.3.17 | 476 | 6/27/2022 | |
1.3.16 | 3,136 | 6/14/2022 | |
1.3.15 | 501 | 6/14/2022 | |
1.3.14 | 645 | 6/11/2022 | |
1.3.13 | 1,274 | 6/3/2022 | |
1.3.12 | 550 | 5/31/2022 | |
1.3.11 | 513 | 5/28/2022 | |
1.3.10 | 1,671 | 5/19/2022 | |
1.3.9 | 748 | 5/14/2022 | |
1.3.8 | 591 | 5/10/2022 | |
1.3.7 | 500 | 5/10/2022 | |
1.3.5 | 1,111 | 5/5/2022 | |
1.3.4 | 527 | 5/2/2022 | |
1.3.3 | 783 | 4/29/2022 | |
1.3.2 | 693 | 4/15/2022 | |
1.3.1 | 503 | 4/15/2022 | |
1.3.0 | 3,563 | 3/17/2022 | |
1.2.10 | 956 | 3/16/2022 | |
1.2.9 | 829 | 3/12/2022 | |
1.2.8 | 510 | 3/12/2022 | |
1.2.7 | 1,626 | 3/10/2022 | |
1.2.6 | 813 | 3/7/2022 | |
1.2.5 | 521 | 3/5/2022 | |
1.2.4 | 536 | 3/4/2022 | |
1.2.3 | 564 | 3/4/2022 | |
1.2.2 | 531 | 3/2/2022 | |
1.2.1 | 562 | 3/1/2022 | |
1.2.0 | 519 | 2/26/2022 | |
1.1.5 | 604 | 2/20/2022 | |
1.1.4 | 499 | 2/18/2022 | |
1.1.3 | 500 | 2/18/2022 | |
1.1.2 | 764 | 2/17/2022 | |
1.1.0 | 659 | 2/14/2022 | |
1.1.0-beta | 193 | 2/14/2022 | |
1.1.0-alpha.5 | 121 | 2/12/2022 | |
1.1.0-alpha.4 | 120 | 2/12/2022 | |
1.1.0-alpha.3 | 117 | 2/12/2022 | |
1.1.0-alpha.2 | 117 | 2/12/2022 | |
1.1.0-alpha.1 | 124 | 2/12/2022 | |
1.0.45.3-alpha | 170 | 2/12/2022 | |
1.0.45.2-alpha | 208 | 2/12/2022 | |
1.0.45.1-alpha | 179 | 2/12/2022 | |
1.0.45-alpha.4 | 116 | 2/12/2022 | |
1.0.45-alpha | 187 | 2/12/2022 | |
1.0.44 | 670 | 2/9/2022 | |
1.0.43 | 520 | 2/2/2022 | |
1.0.42 | 524 | 1/27/2022 | |
1.0.41 | 510 | 1/22/2022 | |
1.0.40 | 502 | 1/22/2022 | |
1.0.39 | 473 | 1/22/2022 | |
1.0.38 | 525 | 1/20/2022 | |
1.0.37 | 673 | 1/17/2022 | |
1.0.36 | 531 | 1/16/2022 | |
1.0.35 | 517 | 1/15/2022 | |
1.0.34 | 518 | 1/12/2022 | |
1.0.33 | 525 | 1/11/2022 | |
1.0.32 | 359 | 1/10/2022 | |
1.0.31 | 433 | 1/9/2022 | |
1.0.30 | 318 | 1/9/2022 | |
1.0.29 | 365 | 1/6/2022 | |
1.0.28 | 386 | 1/5/2022 | |
1.0.27 | 349 | 1/4/2022 | |
1.0.26 | 306 | 1/4/2022 | |
1.0.25 | 354 | 1/1/2022 | |
1.0.24 | 678 | 12/31/2021 | |
1.0.23 | 325 | 12/31/2021 | |
1.0.22 | 393 | 12/23/2021 | |
1.0.21 | 365 | 12/21/2021 | |
1.0.20 | 369 | 12/18/2021 | |
1.0.18 | 401 | 12/6/2021 | |
1.0.17 | 2,980 | 11/25/2021 | |
1.0.16 | 362 | 11/23/2021 | |
1.0.15 | 349 | 11/23/2021 | |
1.0.14 | 1,608 | 11/19/2021 | |
1.0.13 | 585 | 10/23/2021 | |
1.0.12 | 390 | 10/14/2021 | |
1.0.11 | 401 | 10/11/2021 | |
1.0.10 | 435 | 10/3/2021 | |
1.0.9 | 731 | 9/25/2021 | |
1.0.8 | 654 | 9/25/2021 | |
1.0.7 | 518 | 9/25/2021 | |
1.0.6 | 426 | 9/24/2021 | |
1.0.5 | 538 | 9/20/2021 | |
1.0.4 | 474 | 9/18/2021 | |
1.0.3 | 434 | 9/18/2021 | |
1.0.2 | 501 | 9/17/2021 | |
1.0.1 | 527 | 9/2/2021 | |
1.0.0 | 561 | 8/17/2021 |