Skip to content

Commit 60920c3

Browse files
authored
Merge branch 'main' into main
2 parents 60f4bc1 + b212fc2 commit 60920c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+11429
-202
lines changed

Others/Youtube/YoutubeSideOrder.ai

Lines changed: 6365 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Amazon Selling Partner API C# [![Build status](https://dev.azure.com/FikaAmazonSpAPI/Amazon-SP-API-CSharp/_apis/build/status/Amazon-SP-API-CSharp)](https://dev.azure.com/FikaAmazonSpAPI/Amazon-SP-API-CSharp/_build/latest?definitionId=4) [![NuGet](https://img.shields.io/nuget/v/CSharpAmazonSpAPI.svg)](https://www.nuget.org/packages/CSharpAmazonSpAPI/)
1+
# Amazon Selling Partner API C# [![Build status](https://dev.azure.com/FikaAmazonSpAPI/Amazon-SP-API-CSharp/_apis/build/status/Amazon-SP-API-CSharp)](https://dev.azure.com/FikaAmazonSpAPI/Amazon-SP-API-CSharp/_build/latest?definitionId=4) [![NuGet](https://img.shields.io/nuget/v/CSharpAmazonSpAPI.svg)](https://www.nuget.org/packages/CSharpAmazonSpAPI/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
22

33

44
This is an API Binding in .Net C# for the new Amazon Selling Partner API.
55

66
This library is based on the output of [swagger-codegen](https://app.swaggerhub.com/home) with the [OpenAPI files provided by Amazon](https://github.com/amzn/selling-partner-api-models/tree/main/models) and has been modified by the contributors.
77

8-
The purpose of this package is to have an easy way of getting started with the Amazon Selling Partner API.
8+
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](https://www.youtube.com/watch?v=1gZJBCoMr70) video for easy start your project
99

1010
---
1111
### Requirements
@@ -21,6 +21,8 @@ The purpose of this package is to have an easy way of getting started with the A
2121

2222
---
2323
### Tasks
24+
#### Seller
25+
2426
- [x] [OrdersV0](https://github.com/amzn/selling-partner-api-docs/blob/main/references/orders-api/ordersV0.md)
2527
- [x] [Reports](https://github.com/amzn/selling-partner-api-docs/blob/main/references/reports-api/reports_2020-09-04.md)
2628
- [x] [FinancesV0](https://github.com/amzn/selling-partner-api-docs/blob/main/references/finances-api/financesV0.md)
@@ -36,7 +38,7 @@ The purpose of this package is to have an easy way of getting started with the A
3638
- [x] [FulFillmentOutbound](https://github.com/amzn/selling-partner-api-docs/tree/main/references/fulfillment-outbound-api)
3739
- [x] [MerchantFulFillment](https://github.com/amzn/selling-partner-api-docs/blob/main/references/merchant-fulfillment-api/merchantFulfillmentV0.md)
3840
- [x] [Messaging](https://github.com/amzn/selling-partner-api-docs/blob/main/references/messaging-api/messaging.md)
39-
- [x] [Notifications](https://github.com/amzn/selling-partner-api-docs/blob/main/references/notifications-api/notifications.md) for configration read [doc](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/notifications-api-use-case-guide/notifications-use-case-guide-v1.md)
41+
- [x] [Notifications](https://github.com/amzn/selling-partner-api-docs/blob/main/references/notifications-api/notifications.md) for configuration read [doc](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/notifications-api-use-case-guide/notifications-use-case-guide-v1.md)
4042
- [x] [ProductFeesV0](https://github.com/amzn/selling-partner-api-docs/blob/main/references/product-fees-api/productFeesV0.md)
4143
- [x] [ProductPricingV0](https://github.com/amzn/selling-partner-api-docs/blob/main/references/product-pricing-api/productPricingV0.md)
4244
- [x] [Sales](https://github.com/amzn/selling-partner-api-docs/blob/main/references/sales-api/sales.md)
@@ -45,6 +47,17 @@ The purpose of this package is to have an easy way of getting started with the A
4547
- [x] [Solicitations](https://github.com/amzn/selling-partner-api-docs/blob/main/references/solicitations-api/solicitations.md)
4648
- [x] [Token](https://github.com/amzn/selling-partner-api-docs/blob/main/references/tokens-api/tokens_2021-03-01.md) for [doc PII](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/tokens-api-use-case-guide/tokens-API-use-case-guide-2021-03-01.md) NOT TESTED
4749

50+
#### Vendor
51+
- [ ] [VendorOrders](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-orders-api/vendorOrders.md)
52+
- [ ] [VendorDirectFulfillmentInventoryV1](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-direct-fulfillment-inventory-api/vendorDirectFulfillmentInventoryV1.md)
53+
- [x] [VendorDirectFulfillmentOrdersV1](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-direct-fulfillment-orders-api/vendorDirectFulfillmentOrdersV1.md)
54+
- [ ] [VendorDirectFulfillmentPaymentsV1](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-direct-fulfillment-payments-api/vendorDirectFulfillmentPaymentsV1.md)
55+
- [ ] [VendorDirectFulfillmentShippingV1](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-direct-fulfillment-shipping-api/vendorDirectFulfillmentShippingV1.md)
56+
- [ ] [VendorDirectFulfillmentTransactionsV1](https://github.com/amzn/selling-partner-api-docs/tree/main/references/vendor-direct-fulfillment-transactions-api)
57+
- [ ] [vendorInvoices](https://github.com/amzn/selling-partner-api-docs/blob/main/references/vendor-invoices-api/vendorInvoices.md)
58+
- [ ] [VendorShipments](https://github.com/amzn/selling-partner-api-docs/tree/main/references/vendor-shipments-api)
59+
- [ ] [VendorTransactionStatus](https://github.com/amzn/selling-partner-api-docs/tree/main/references/vendor-transaction-status-api)
60+
4861

4962

5063
---
@@ -64,13 +77,15 @@ Install-Package CSharpAmazonSpAPI
6477
| Region | Marketplace region |
6578
| ClientId | Your amazon app id |
6679
| ClientSecret | Your amazon app secret |
80+
| RefreshToken | Check how to get [RefreshToken](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md#Self-authorization) |
81+
6782

68-
For more information about keys please check [Amazon Selling Partner Api developer guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md).
83+
For more information about keys please check [Amazon Selling Partner API developer guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md) , If you are not registered as developer please [Register](https://developer.amazonservices.com/) to be able to create application.
6984

7085
---
7186
## Usage
7287

73-
### Configration
88+
### Configuration
7489
```CSharp
7590
AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
7691
{
@@ -84,14 +99,18 @@ For more information about keys please check [Amazon Selling Partner Api develop
8499

85100
```
86101

87-
### Order Lsit ,For more orders sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Reports.cs).
102+
### Order List, For more orders sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Reports.cs).
88103
```CSharp
89-
var orders= amazonConnection.Orders.ListOrders();
104+
ParameterOrderList serachOrderList = new ParameterOrderList();
105+
serachOrderList.CreatedAfter = DateTime.UtcNow.AddMinutes(-600000);
106+
serachOrderList.OrderStatuses = new List<OrderStatuses>();
107+
serachOrderList.OrderStatuses.Add(OrderStatuses.Canceled);
108+
var orders = amazonConnection.Orders.GetOrders(serachOrderList);
90109

91110
```
92111

93112

94-
### Order Lsit with parameter
113+
### Order List with parameter
95114
```CSharp
96115
ParameterOrderList serachOrderList = new ParameterOrderList();
97116
serachOrderList.CreatedAfter = DateTime.UtcNow.AddHours(-24);
@@ -103,7 +122,7 @@ For more information about keys please check [Amazon Selling Partner Api develop
103122

104123
```
105124

106-
### Report Lsit ,For more report sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Orders.cs).
125+
### Report List, For more report sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Orders.cs).
107126
```CSharp
108127
var parameters = new ParameterReportList();
109128
parameters.pageSize = 100;
@@ -156,7 +175,7 @@ For more information about keys please check [Amazon Selling Partner Api develop
156175
//filePath for report
157176
```
158177

159-
### Product Pricing ,For more Pricing sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/ProductPricing.cs).
178+
### Product Pricing, For more Pricing sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/ProductPricing.cs).
160179
```CSharp
161180

162181
var data = amazonConnection.ProductPricing.GetPricing(new Parameter.ProductPricing.ParameterGetPricing()
@@ -179,7 +198,7 @@ var data = amazonConnection.ProductPricing.GetCompetitivePricing(new Parameter.P
179198
```
180199

181200

182-
### Notifications Create Destination,For more Notifications sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Notifications.cs).
201+
### Notifications Create Destination, For more Notifications sample please check [Here](https://github.com/abuzuhri/Amazon-SP-API-CSharp/blob/main/Source/FikaAmazonAPI.Test/Notifications.cs).
183202
```CSharp
184203

185204
//EventBridge
@@ -232,8 +251,8 @@ var data = amazonConnection.ProductPricing.GetCompetitivePricing(new Parameter.P
232251
```
233252

234253
### Feed Submit
235-
Here Full sample for submit feed to change price and generate XML and get final report for result same as in [doc](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/feeds-api-use-case-guide/feeds-api-use-case-guide_2021-06-30.md).
236-
Notes: not all [feed type](https://github.com/amzn/selling-partner-api-docs/blob/main/references/feeds-api/feedtype-values.md) 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
254+
Here full sample for submit feed to change price and generate XML and get final report for result same as in [doc](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/feeds-api-use-case-guide/feeds-api-use-case-guide_2021-06-30.md).
255+
Notes: not all [feed type](https://github.com/amzn/selling-partner-api-docs/blob/main/references/feeds-api/feedtype-values.md) 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
237256
```CSharp
238257
ConstructFeedService createDocument = new ConstructFeedService("A3J37AJU4O9RHK", "1.02");
239258

Source/FikaAmazonAPI.Sample/FikaAmazonAPI.Sample.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<Reference Include="System.Data" />
6565
<Reference Include="System.Net.Http" />
6666
<Reference Include="System.Xml" />
67-
<Reference Include="XSerializer, Version=0.1.0.0, Culture=neutral, PublicKeyToken=9ab97cfaa8f0c80a, processorArchitecture=MSIL">
68-
<HintPath>..\..\packages\XSerializer.0.4.4\lib\net40\XSerializer.dll</HintPath>
69-
</Reference>
7067
</ItemGroup>
7168
<ItemGroup>
7269
<Compile Include="CatalogItemsSample.cs" />
@@ -83,6 +80,7 @@
8380
<Compile Include="ReportsSample.cs" />
8481
<Compile Include="SolicitationsSample.cs" />
8582
<Compile Include="TokenSample.cs" />
83+
<Compile Include="VendorDirectFulfillmentOrderSample.cs" />
8684
</ItemGroup>
8785
<ItemGroup>
8886
<None Include="App.config" />

Source/FikaAmazonAPI.Sample/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static async Task Main(string[] args)
3030
{
3131

3232

33+
3334
AmazonConnection amazonConnection = new AmazonConnection(new AmazonCredential()
3435
{
3536
AccessKey = Environment.GetEnvironmentVariable("AccessKey"),
@@ -43,8 +44,15 @@ static async Task Main(string[] args)
4344

4445
}) ;
4546

47+
var order2s = amazonConnection.VendorDirectFulfillmentOrders.GetOrder("UNrSh9H8R");
48+
49+
50+
var orderData=amazonConnection.Orders.GetOrder(new ParameterGetOrder()
51+
{
52+
OrderId = "404-6678802-8633900"
53+
});
54+
4655

47-
4856

4957
while (true)
5058
{
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace FikaAmazonAPI.Sample
8+
{
9+
public class VendorDirectFulfillmentOrderSample
10+
{
11+
12+
}
13+
}

Source/FikaAmazonAPI/AmazonConnection.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class AmazonConnection
3939
public TokenService Tokens => this._Tokens ?? throw _NoCredentials;
4040
public FulFillmentInboundService FulFillmentInbound => this._FulFillmentInbound ?? throw _NoCredentials;
4141
public FulFillmentOutboundService FulFillmentOutbound => this._FulFillmentOutbound ?? throw _NoCredentials;
42+
public VendorDirectFulfillmentOrderService VendorDirectFulfillmentOrders => this._VendorDirectFulfillmentOrders ?? throw _NoCredentials;
4243

4344

4445

@@ -71,6 +72,7 @@ public class AmazonConnection
7172
private TokenService _Tokens { get; set; }
7273
private FulFillmentInboundService _FulFillmentInbound { get; set; }
7374
private FulFillmentOutboundService _FulFillmentOutbound { get; set; }
75+
private VendorDirectFulfillmentOrderService _VendorDirectFulfillmentOrders { get; set; }
7476

7577
private UnauthorizedAccessException _NoCredentials = new UnauthorizedAccessException($"Error, you cannot make calls to Amazon without credentials!");
7678

@@ -120,6 +122,7 @@ private void Init(AmazonCredential Credentials)
120122
this._Tokens= new TokenService(this.Credentials);
121123
this._FulFillmentInbound= new FulFillmentInboundService(this.Credentials);
122124
this._FulFillmentOutbound= new FulFillmentOutboundService(this.Credentials);
125+
this._VendorDirectFulfillmentOrders = new VendorDirectFulfillmentOrderService(this.Credentials);
123126
}
124127
}
125128
}

Source/FikaAmazonAPI/AmazonCredential.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ public AmazonCredential()
2828
{
2929
CacheTokenData = new CacheTokenData();
3030
}
31-
public AmazonCredential(string AccessKey, string SecretKey, string RoleArn, string ClientId, string ClientSecret)
31+
public AmazonCredential(string AccessKey, string SecretKey, string RoleArn, string ClientId, string ClientSecret,string RefreshToken)
3232
{
3333
this.AccessKey = AccessKey;
3434
this.SecretKey = SecretKey;
3535
this.RoleArn = RoleArn;
3636
this.ClientId = ClientId;
3737
this.ClientSecret = ClientSecret;
3838
this.RefreshToken = RefreshToken;
39+
CacheTokenData = new CacheTokenData();
3940
}
4041

4142
public TokenResponse GetToken(TokenDataType tokenDataType)

0 commit comments

Comments
 (0)