Skip to content

Commit f69249c

Browse files
committed
add more sample
1 parent 876ea85 commit f69249c

File tree

8 files changed

+14344
-13887
lines changed

8 files changed

+14344
-13887
lines changed

Others/icon/icon.ai

Lines changed: 14222 additions & 13871 deletions
Large diffs are not rendered by default.

Others/icon/icon.jpg

-30.7 KB
Loading

Source/FikaAmazonAPI.Sample/FeedsSample.cs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void SubmitFeedInventory()
6969
{
7070
SKU = "8201031206122...",
7171
Quantity = 2,
72-
FulfillmentLatency = "12"
72+
FulfillmentLatency = "11",
7373
});
7474
createDocument.AddInventoryMessage(list);
7575
var xml = createDocument.GetXML();
@@ -78,7 +78,34 @@ public void SubmitFeedInventory()
7878

7979
}
8080

81-
81+
/// <summary>
82+
/// UnderTest
83+
/// </summary>
84+
//public void SubmitFeedMaxOrderQuantity()
85+
//{
86+
// ConstructFeedService createDocument = new ConstructFeedService("A3J37AJU4O9RHK", "1.02");
87+
88+
// var list = new List<ProductMessage>();
89+
// list.Add(new ProductMessage()
90+
// {
91+
// SKU = "8201031206122...",
92+
// StandardProductID = new ConstructFeed.Messages.StandardProductID()
93+
// {
94+
// Type = "ASIN",
95+
// Value= "B08CDYB2DC"
96+
// },
97+
// DescriptionData = new DescriptionData()
98+
// {
99+
// MaxOrderQuantity=2,
100+
// Title= "REBUNE RE-2061-1Hot Air Styler Hair Styler 1000 Watts 3 In 1"
101+
// }
102+
// });
103+
// createDocument.AddProductMessage(list,OperationType.Update);
104+
// var xml = createDocument.GetXML();
105+
106+
// var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_PRODUCT_DATA);
107+
108+
//}
82109
public void SubmitFeedPRICING()
83110
{
84111

Source/FikaAmazonAPI.Sample/Program.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,30 @@ static async Task Main(string[] args)
4444

4545
}) ;
4646

47-
var order2s = amazonConnection.VendorDirectFulfillmentOrders.GetOrder("UNrSh9H8R");
47+
ReportsSample reportsSample = new ReportsSample(amazonConnection);
48+
reportsSample.GetReportGET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATEs();
49+
reportsSample.CreateReport_GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE();
4850

51+
FeedsSample feedsSample = new FeedsSample(amazonConnection);
52+
//feedsSample.SubmitFeedInventory();
4953

50-
var orderData=amazonConnection.Orders.GetOrder(new ParameterGetOrder()
51-
{
52-
OrderId = "404-6678802-8633900"
53-
});
54+
55+
amazonConnection.ProductFee.GetMyFeesEstimateForSKU("SKU1 + SKU2-FBA",
56+
new AmazonSpApiSDK.Models.ProductFees.FeesEstimateRequest()
57+
{
58+
Identifier = "00001",
59+
IsAmazonFulfilled = true,
60+
MarketplaceId = MarketPlace.UnitedArabEmirates.ID,
61+
PriceToEstimateFees = new AmazonSpApiSDK.Models.ProductFees.PriceToEstimateFees(new AmazonSpApiSDK.Models.ProductFees.MoneyType("AED", 200))
62+
});
63+
64+
//var order2s = amazonConnection.VendorDirectFulfillmentOrders.GetOrder("UNrSh9H8R");
65+
66+
67+
//var orderData=amazonConnection.Orders.GetOrder(new ParameterGetOrder()
68+
//{
69+
// OrderId = "404-6678802-8633900"
70+
//});
5471

5572

5673

Source/FikaAmazonAPI.Sample/ReportsSample.cs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,17 @@ public void GetReports()
3131
amazonConnection.Reports.GetReports(parameters);
3232
}
3333

34-
34+
public void GetReportGET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATEs()
35+
{
36+
var parameters = new ParameterReportList();
37+
parameters.pageSize = 100;
38+
parameters.reportTypes = new List<ReportTypes>();
39+
parameters.reportTypes.Add(ReportTypes.GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE);
40+
parameters.marketplaceIds = new List<string>();
41+
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
42+
var reports=amazonConnection.Reports.GetReports(parameters);
43+
}
44+
3545
public void CreateReport()
3646
{
3747

@@ -125,6 +135,7 @@ public string CreateReport_GET_MERCHANT_LISTINGS_ALL_DATA()
125135

126136
parameters.reportOptions = new FikaAmazonAPI.AmazonSpApiSDK.Models.Reports.ReportOptions();
127137

138+
128139
var reportId = amazonConnection.Reports.CreateReport(parameters);
129140
var filePath = string.Empty;
130141
string ReportDocumentId = string.Empty;
@@ -143,6 +154,42 @@ public string CreateReport_GET_MERCHANT_LISTINGS_ALL_DATA()
143154
return filePath;
144155
}
145156

157+
public string CreateReport_GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE()
158+
{
159+
160+
var parameters = new ParameterCreateReportSpecification();
161+
parameters.reportType = ReportTypes.GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE;
162+
163+
parameters.marketplaceIds = new MarketplaceIds();
164+
parameters.marketplaceIds.Add(MarketPlace.UnitedArabEmirates.ID);
165+
166+
167+
parameters.reportOptions = new FikaAmazonAPI.AmazonSpApiSDK.Models.Reports.ReportOptions();
168+
169+
parameters.dataStartTime = DateTime.UtcNow.AddDays(-50);
170+
parameters.dataEndTime = DateTime.UtcNow.AddDays(-1);
171+
172+
var reportId = amazonConnection.Reports.CreateReport(parameters);
173+
var filePath = string.Empty;
174+
string ReportDocumentId = string.Empty;
175+
176+
while (string.IsNullOrEmpty(ReportDocumentId))
177+
{
178+
var reportData = amazonConnection.Reports.GetReport(reportId);
179+
if (!string.IsNullOrEmpty(reportData.ReportDocumentId))
180+
{
181+
filePath = amazonConnection.Reports.GetReportFile(reportData.ReportDocumentId);
182+
break;
183+
}
184+
if(reportData.ProcessingStatus== AmazonSpApiSDK.Models.Reports.Report.ProcessingStatusEnum.FATAL)
185+
{
186+
throw new Exception("Error with Generate report");
187+
}
188+
else Thread.Sleep(1000 * 60);
189+
}
190+
191+
return filePath;
192+
}
146193

147194
public void GetReportFile()
148195
{

Source/FikaAmazonAPI/AmazonSpApiSDK/Models/ProductFees/FeesEstimateRequest.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public partial class FeesEstimateRequest : IEquatable<FeesEstimateRequest>, IVal
2828
/// Initializes a new instance of the <see cref="FeesEstimateRequest" /> class.
2929
/// </summary>
3030
[JsonConstructorAttribute]
31-
protected FeesEstimateRequest() { }
31+
public FeesEstimateRequest() { }
3232
/// <summary>
3333
/// Initializes a new instance of the <see cref="FeesEstimateRequest" /> class.
3434
/// </summary>
3535
/// <param name="MarketplaceId">A marketplace identifier. (required).</param>
3636
/// <param name="IsAmazonFulfilled">When true, the offer is fulfilled by Amazon..</param>
3737
/// <param name="PriceToEstimateFees">The product price that the fee estimate is based on. (required).</param>
3838
/// <param name="Identifier">The product price on which the fee estimate is based. (required).</param>
39-
public FeesEstimateRequest(string MarketplaceId = default(string), bool? IsAmazonFulfilled = default(bool?), PriceToEstimateFees PriceToEstimateFees = default(PriceToEstimateFees), string Identifier = default(string))
39+
public FeesEstimateRequest(string MarketplaceId, bool? IsAmazonFulfilled = default(bool?), PriceToEstimateFees PriceToEstimateFees = default(PriceToEstimateFees), string Identifier = default(string))
4040
{
4141
// to ensure "MarketplaceId" is required (not null)
4242
if (MarketplaceId == null)
@@ -67,12 +67,11 @@ protected FeesEstimateRequest() { }
6767
}
6868
this.IsAmazonFulfilled = IsAmazonFulfilled;
6969
}
70-
71-
/// <summary>
72-
/// A marketplace identifier.
73-
/// </summary>
74-
/// <value>A marketplace identifier.</value>
75-
[DataMember(Name = "MarketplaceId", EmitDefaultValue = false)]
70+
/// <summary>
71+
/// A marketplace identifier.
72+
/// </summary>
73+
/// <value>A marketplace identifier.</value>
74+
[DataMember(Name = "MarketplaceId", EmitDefaultValue = false)]
7675
public string MarketplaceId { get; set; }
7776

7877
/// <summary>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace FikaAmazonAPI.ConstructFeed.Messages
6+
{
7+
public partial class DescriptionData
8+
{
9+
public string Title { get; set; }
10+
public int? MaxAggregateShipQuantity { get; set; }
11+
public int? MaxOrderQuantity { get; set; }
12+
13+
14+
}
15+
}

Source/FikaAmazonAPI/ConstructFeed/Messages/ProductMessage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public partial class ProductMessage
99
public string SKU { get; set; }
1010

1111
public StandardProductID StandardProductID { get; set; }
12+
public DescriptionData DescriptionData { get; set; }
1213

1314
public Condition Condition { get; set; }
1415
}

0 commit comments

Comments
 (0)