https://github.com/koenbeuk/azbreak.amazonmws
An alternative (modernized) Amazon MWS client targeting .NET standard.
https://github.com/koenbeuk/azbreak.amazonmws
Last synced: over 1 year ago
JSON representation
An alternative (modernized) Amazon MWS client targeting .NET standard.
- Host: GitHub
- URL: https://github.com/koenbeuk/azbreak.amazonmws
- Owner: koenbeuk
- Created: 2021-01-07T18:51:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-09T17:12:03.000Z (over 5 years ago)
- Last Synced: 2025-01-21T12:34:31.358Z (over 1 year ago)
- Language: C#
- Size: 106 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An alternative (modernized) Amazon MWS client targeting .NET standard. This library was used in a new discontinued project. It may need some work and is currently looking for maintainers.
# Getting started
```csharp
var channel = AmazonMWSChannelFactory.Create(new AmazonMWSClientOptions {
RegionEndpoint = AmazonMWSDefaultEndpoint.NorthAmerica,
SellerId = "AIXXXXXXXXX",
SecretKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
AWSAccessKeyId = "XXXXXXXXXXXXXXXXXXXX"
});
var client = channel.CreateSellersClient();
var result = await client.ListMarketplaceParticipations();
```
Or if you prefer to integrate with Dependency injeciton
```csharp
// In Startup.cs...
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddAmazonMWSClients();
services.Configure(Configuration); // default client credentials
}
// In MyController.cs
public class MyController {
private readonly IAmazonMWSOrdersClient ordersClient;
public MyController(IAmazonMWSOrdersClient ordersClient) {
this.ordersClient = ordersClient;
}
[HttpGet]
public async Task Get(CancellationToken cancellationToken) {
var ordersResponse = await ordersClient.ListOrders(new ListOrdersRequest {
MarketplaceIds = new[] { AmazonMWSDefaultMarketplace.UK },
CreatedAfter = DateTime.UtcNow.AddMonths(-3)
}, cancellationToken: cancellationToken);
ordersResponse.EnsureSuccess();
return Ok(ordersResponse.Result);
}
}
```
# Running Samples
All samples require credentials to authenticate against Amazon MWS.
The easiest way to get started is by editing the `ClientOptions` instance found in the top of the sample.
Alternatively you can use configure all projects with user secrets:
```
dotnet user-secrets set RegionEndpoint https://mws-eu.amazonservices.com
dotnet user-secrets set SellerId
dotnet user-secrets set SecretKey
dotnet user-secrets set AWSAccessKeyId
```
User secrets are shared amongst all sample projects