Skip to content

Commit dca55c2

Browse files
committed
Resolved merge conflict in OrderService
2 parents 3791f83 + 912bf77 commit dca55c2

14 files changed

+107
-53
lines changed

Source/FikaAmazonAPI.SampleCode/Program.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
using FikaAmazonAPI.Parameter.Finance;
2727
using FikaAmazonAPI.ReportGeneration;
2828
using Microsoft.Extensions.Configuration;
29+
using FikaAmazonAPI.Parameter.CatalogItems;
2930

3031
namespace FikaAmazonAPI.SampleCode
3132
{
@@ -51,12 +52,16 @@ static async Task Main(string[] args)
5152
IsActiveLimitRate = true
5253
});
5354

54-
55-
var list3=amazonConnection.Financial.ListFinancialEvents(new ParameterListFinancialEvents()
55+
var list3 = amazonConnection.Financial.ListFinancialEvents(new ParameterListFinancialEvents()
5656
{
57-
PostedAfter=DateTime.UtcNow.AddDays(-15)
57+
PostedAfter = DateTime.UtcNow.AddDays(-15)
5858
});
5959

60+
61+
var item = amazonConnection.CatalogItem.GetCatalogItem("B00CZC5F0G");
62+
63+
64+
6065
string text = System.IO.File.ReadAllText(@"C:\Users\tareq\Downloads\Beispiel_Upload.txt");
6166

6267
var feedresultTXT = amazonConnection.Feed.SubmitFeed(text

Source/FikaAmazonAPI/FikaAmazonAPI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<Product>CSharp Amazon Sp API</Product>
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
99
<LangVersion>8.0</LangVersion>
10-
<Version>1.0.42</Version>
11-
<AssemblyVersion>1.0.42</AssemblyVersion>
12-
<FileVersion>1.0.42</FileVersion>
10+
<Version>1.0.43</Version>
11+
<AssemblyVersion>1.0.43</AssemblyVersion>
12+
<FileVersion>1.0.43</FileVersion>
1313
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1414
<PackageProjectUrl>https://github.com/abuzuhri/Amazon-SP-API-CSharp</PackageProjectUrl>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using FikaAmazonAPI.Search;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
using static FikaAmazonAPI.Utils.Constants;
6+
7+
namespace FikaAmazonAPI.Parameter.CatalogItems
8+
{
9+
public class ParameterGetCatalogItem : ParameterBased
10+
{
11+
public string ASIN { get; set; }
12+
public IList<string> MarketplaceIds { get; set; }= new List<string>();
13+
public IList<IncludedData> includedData { get; set; }
14+
public string locale { get; set; }
15+
}
16+
}

Source/FikaAmazonAPI/Services/ApiUrls.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ protected class CategoryApiUrls
448448
{
449449
private readonly static string _resourceBaseUrl = "/catalog/v0";
450450

451-
private readonly static string _202012resourceBaseUrl = "/catalog/2020-12-01/items";
451+
private readonly static string _202012resourceBaseUrl = "/catalog/2020-12-01";
452452
public static string ListCatalogItems
453453
{
454454
get => $"{_resourceBaseUrl}/items";
@@ -457,9 +457,10 @@ public static string ListCatalogCategories
457457
{
458458
get => $"{_resourceBaseUrl}/categories";
459459
}
460-
public static string GetCatalogItem(string asin) => $"{_202012resourceBaseUrl}/{asin}";
460+
public static string GetCatalogItem(string asin) => $"{_resourceBaseUrl}/items/{asin}";
461+
public static string GetCatalogItem202012(string asin) => $"{_202012resourceBaseUrl}/items/{asin}";
461462

462-
public static string SearchCatalogItems => $"{_202012resourceBaseUrl}";
463+
public static string SearchCatalogItems => $"{_202012resourceBaseUrl}/items";
463464
}
464465

465466
protected class ListingsItemsApiUrls

Source/FikaAmazonAPI/Services/CatalogItemService.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public CatalogItemService(AmazonCredential amazonCredential) : base(amazonCreden
1818
public IList<Item> ListCatalogItems(ParameterListCatalogItems parameterListCatalogItems)
1919
{
2020
if (string.IsNullOrEmpty(parameterListCatalogItems.MarketplaceId))
21-
throw new InvalidDataException("MarketplaceId is a required property and cannot be null or empty");
21+
parameterListCatalogItems.MarketplaceId = AmazonCredential.MarketPlace.ID;
2222

2323
if (
2424
string.IsNullOrEmpty(parameterListCatalogItems.Query) &&
@@ -43,15 +43,15 @@ public IList<Item> ListCatalogItems(ParameterListCatalogItems parameterListCatal
4343
return list;
4444
}
4545

46+
//[Obsolete("This method is will be deprecated in June 2022. Please use GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem) instead.")]
4647
public Item GetCatalogItem(string asin)
4748
{
48-
49-
if(string.IsNullOrEmpty(asin))
50-
throw new InvalidDataException("asin is a required property and cannot be null");
5149

50+
if (string.IsNullOrEmpty(asin))
51+
throw new InvalidDataException("asin is a required property and cannot be null");
5252

5353
var param = new List<KeyValuePair<string, string>>();
54-
param.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
54+
param.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
5555

5656
CreateAuthorizedRequest(CategoryApiUrls.GetCatalogItem(asin), RestSharp.Method.GET, param);
5757
var response = ExecuteRequest<GetCatalogItemResponse>();
@@ -62,15 +62,33 @@ public Item GetCatalogItem(string asin)
6262
return null;
6363
}
6464

65+
//public Item GetCatalogItem(ParameterGetCatalogItem parameterListCatalogItem)
66+
//{
67+
68+
// if (string.IsNullOrEmpty(parameterListCatalogItem.ASIN))
69+
// throw new InvalidDataException("asin is a required property and cannot be null");
70+
71+
// if (parameterListCatalogItem == null || parameterListCatalogItem.MarketplaceIds == null || parameterListCatalogItem.MarketplaceIds.Count == 0)
72+
// {
73+
// parameterListCatalogItem.MarketplaceIds.Add(MarketPlace.ID);
74+
// }
75+
76+
// var param = parameterListCatalogItem.getParameters();
77+
78+
// CreateAuthorizedRequest(CategoryApiUrls.GetCatalogItem202012(parameterListCatalogItem.ASIN), RestSharp.Method.GET, param);
79+
// var response = ExecuteRequest<Item>();
80+
81+
// return response;
82+
//}
6583

66-
public IList<Categories> ListCatalogCategories(string ASIN,string SellerSKU=null)
84+
public IList<Categories> ListCatalogCategories(string ASIN,string SellerSKU=null,string MarketPlaceID = null)
6785
{
6886
if (string.IsNullOrEmpty(ASIN))
6987
throw new InvalidDataException("ASIN is a required property and cannot be null or empty");
7088

7189

7290
var param = new List<KeyValuePair<string, string>>();
73-
param.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
91+
param.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlaceID ?? AmazonCredential.MarketPlace.ID));
7492
param.Add(new KeyValuePair<string, string>("ASIN", ASIN));
7593
if(!string.IsNullOrEmpty(SellerSKU))
7694
param.Add(new KeyValuePair<string, string>("SellerSKU", SellerSKU));

Source/FikaAmazonAPI/Services/FbaSmallandLightService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public FbaSmallandLightService(AmazonCredential amazonCredential) : base(amazonC
1717
public SmallAndLightEnrollment GetSmallAndLightEnrollmentBySellerSKU(string sellerSKU)
1818
{
1919
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
20-
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", MarketPlace.ID));
20+
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", AmazonCredential.MarketPlace.ID));
2121

2222
CreateAuthorizedRequest(FBASmallAndLightApiUrls.GetSmallAndLightEnrollmentBySellerSKU(sellerSKU), RestSharp.Method.GET);
2323

@@ -29,7 +29,7 @@ public SmallAndLightEnrollment GetSmallAndLightEnrollmentBySellerSKU(string sell
2929
public SmallAndLightEnrollment PutSmallAndLightEnrollmentBySellerSKU(string sellerSKU)
3030
{
3131
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
32-
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", MarketPlace.ID));
32+
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", AmazonCredential.MarketPlace.ID));
3333

3434

3535
CreateAuthorizedRequest(FBASmallAndLightApiUrls.PutSmallAndLightEnrollmentBySellerSKU(sellerSKU), RestSharp.Method.PUT, queryParameters);
@@ -42,7 +42,7 @@ public SmallAndLightEnrollment PutSmallAndLightEnrollmentBySellerSKU(string sell
4242
public bool DeleteSmallAndLightEnrollmentBySellerSKU(string sellerSKU)
4343
{
4444
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
45-
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", MarketPlace.ID));
45+
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", AmazonCredential.MarketPlace.ID));
4646

4747

4848
CreateAuthorizedRequest(FBASmallAndLightApiUrls.DeleteSmallAndLightEnrollmentBySellerSKU(sellerSKU), RestSharp.Method.DELETE, queryParameters);
@@ -57,7 +57,7 @@ public SmallAndLightEligibility GetSmallAndLightEligibilityBySellerSKU(string se
5757
{
5858

5959
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
60-
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", MarketPlace.ID));
60+
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", AmazonCredential.MarketPlace.ID));
6161

6262

6363
CreateAuthorizedRequest(FBASmallAndLightApiUrls.GetSmallAndLightEligibilityBySellerSKU(sellerSKU), RestSharp.Method.GET, queryParameters);
@@ -70,7 +70,7 @@ public SmallAndLightEligibility GetSmallAndLightEligibilityBySellerSKU(string se
7070
public List<FeePreview> GetSmallAndLightFeePreview(SmallAndLightFeePreviewRequest smallAndLightFeePreviewRequest)
7171
{
7272
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
73-
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", MarketPlace.ID));
73+
queryParameters.Add(new KeyValuePair<string, string>("marketplaceIds", AmazonCredential.MarketPlace.ID));
7474

7575
CreateAuthorizedRequest(FBASmallAndLightApiUrls.GetSmallAndLightFeePreview, RestSharp.Method.POST,postJsonObj: smallAndLightFeePreviewRequest);
7676

Source/FikaAmazonAPI/Services/FeedService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public string SubmitFeed(string XmlContentOrFilePath, FeedType feedType, List<st
169169
{
170170
FeedType = feedType.ToString(),
171171
InputFeedDocumentId = feedCreate.FeedDocumentId,
172-
MarketplaceIds = marketPlaceIds ?? new List<string> { MarketPlace.ID },
172+
MarketplaceIds = marketPlaceIds ?? new List<string> { AmazonCredential.MarketPlace.ID },
173173
FeedOptions = feedOptions
174174
};
175175

Source/FikaAmazonAPI/Services/FulFillmentInboundService.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public InboundShipmentResult CreateInboundShipment(string shipmentId, InboundShi
5353
public InboundShipmentResult GetPreorderInfo(string shipmentId)
5454
{
5555
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
56-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
56+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
5757

5858
CreateAuthorizedRequest(FulFillmentInboundApiUrls.GetPreorderInfo(shipmentId), RestSharp.Method.GET, queryParameters);
5959

@@ -65,7 +65,7 @@ public InboundShipmentResult GetPreorderInfo(string shipmentId)
6565
public ConfirmPreorderResult ConfirmPreorder(string shipmentId,DateTime NeedByDate)
6666
{
6767
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
68-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
68+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
6969
queryParameters.Add(new KeyValuePair<string, string>("NeedByDate", NeedByDate.ToString("YYYY-MM-DD")));
7070

7171
CreateAuthorizedRequest(FulFillmentInboundApiUrls.ConfirmPreorder(shipmentId), RestSharp.Method.GET, queryParameters);
@@ -88,7 +88,7 @@ public GetPrepInstructionsResult GetPrepInstructions(ParameterGetPrepInstruction
8888
public GetTransportDetailsResult GetTransportDetails(string shipmentId)
8989
{
9090
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
91-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
91+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
9292

9393
CreateAuthorizedRequest(FulFillmentInboundApiUrls.GetTransportDetails(shipmentId), RestSharp.Method.GET, queryParameters);
9494

@@ -110,7 +110,7 @@ public CommonTransportResult PutTransportDetails(string shipmentId, PutTransport
110110
public CommonTransportResult VoidTransport(string shipmentId)
111111
{
112112
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
113-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
113+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
114114

115115
CreateAuthorizedRequest(FulFillmentInboundApiUrls.VoidTransport(shipmentId), RestSharp.Method.POST, queryParameters);
116116

@@ -122,7 +122,7 @@ public CommonTransportResult VoidTransport(string shipmentId)
122122
public CommonTransportResult EstimateTransport(string shipmentId)
123123
{
124124
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
125-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
125+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
126126

127127
CreateAuthorizedRequest(FulFillmentInboundApiUrls.EstimateTransport(shipmentId), RestSharp.Method.POST, queryParameters);
128128

@@ -134,7 +134,7 @@ public CommonTransportResult EstimateTransport(string shipmentId)
134134
public CommonTransportResult ConfirmTransport(string shipmentId)
135135
{
136136
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
137-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
137+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
138138

139139
CreateAuthorizedRequest(FulFillmentInboundApiUrls.ConfirmTransport(shipmentId), RestSharp.Method.POST, queryParameters);
140140

@@ -156,7 +156,7 @@ public GetPrepInstructionsResult GetLabels(ParameterGetLabels parameterGetLabels
156156
public BillOfLadingDownloadURL GetBillOfLading(string shipmentId)
157157
{
158158
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
159-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
159+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
160160

161161
CreateAuthorizedRequest(FulFillmentInboundApiUrls.GetBillOfLading(shipmentId), RestSharp.Method.GET, queryParameters);
162162

@@ -188,7 +188,7 @@ public GetShipmentsResult GetShipmentItems(ParameterListReturnReasonCodes parame
188188
public GetShipmentItemsResult GetShipmentItemsByShipmentId(string shipmentId)
189189
{
190190
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
191-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
191+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
192192

193193
CreateAuthorizedRequest(FulFillmentInboundApiUrls.GetShipmentItemsByShipmentId(shipmentId), RestSharp.Method.GET, queryParameters);
194194

Source/FikaAmazonAPI/Services/FulFillmentOutboundService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public bool UpdateFulfillmentOrder(string sellerFulfillmentOrderId)
103103
public GetFeaturesResult GetFeatures()
104104
{
105105
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
106-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
106+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
107107

108108
CreateAuthorizedRequest(FulFillmentOutboundApiUrls.GetFeatures, RestSharp.Method.GET, queryParameters);
109109

@@ -115,7 +115,7 @@ public GetFeaturesResult GetFeatures()
115115
public GetFeatureInventoryResult GetFeatureInventory(string featureName,string nextToken)
116116
{
117117
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
118-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
118+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
119119
if(string.IsNullOrEmpty(nextToken))
120120
queryParameters.Add(new KeyValuePair<string, string>("nextToken", nextToken));
121121
if (string.IsNullOrEmpty(featureName))
@@ -131,7 +131,7 @@ public GetFeatureInventoryResult GetFeatureInventory(string featureName,string n
131131
public GetFeatureSkuResult GetFeatureSKU(string featureName,string sellerSku, string nextToken)
132132
{
133133
List<KeyValuePair<string, string>> queryParameters = new List<KeyValuePair<string, string>>();
134-
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", MarketPlace.ID));
134+
queryParameters.Add(new KeyValuePair<string, string>("MarketplaceId", AmazonCredential.MarketPlace.ID));
135135
if(string.IsNullOrEmpty(nextToken))
136136
queryParameters.Add(new KeyValuePair<string, string>("nextToken", nextToken));
137137
if (string.IsNullOrEmpty(featureName))

0 commit comments

Comments
 (0)