Skip to content

Commit 911edbf

Browse files
committed
fix #299
1 parent 089d81a commit 911edbf

File tree

6 files changed

+295
-168
lines changed

6 files changed

+295
-168
lines changed

Source/FikaAmazonAPI.SampleCode/FeedsSample.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,44 @@ public void SubmitFeedOrderAdjustment()
238238

239239
var feedID = amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_PAYMENT_ADJUSTMENT_DATA);
240240
}
241+
242+
public void CartonContentsRequestFeed()
243+
{
244+
ConstructFeedService createDocument2 = new ConstructFeedService("{SellerID}", "1.02");
245+
246+
var list22 = new List<CartonContentsRequest>();
247+
list22.Add(new CartonContentsRequest()
248+
{
249+
ShipmentId = "FBA123456",
250+
Carton = new List<Carton> {
251+
new Carton() {
252+
CartonId="1",
253+
Item=new List<CartonItem>(){
254+
new CartonItem() {
255+
QuantityInCase=1,
256+
QuantityShipped=1,
257+
SKU="7004"
258+
}
259+
}
260+
},
261+
new Carton() {
262+
CartonId="2",
263+
Item=new List<CartonItem>(){
264+
new CartonItem() {
265+
QuantityInCase=12,
266+
QuantityShipped=12,
267+
SKU="4051"
268+
}
269+
}
270+
}
271+
}
272+
});
273+
274+
createDocument2.AddCartonContentsRequest(list22);
275+
276+
var xml222 = createDocument2.GetXML();
277+
278+
var feedID = amazonConnection.Feed.SubmitFeed(xml222, FeedType.POST_FBA_INBOUND_CARTON_CONTENTS);
279+
}
241280
}
242281
}

Source/FikaAmazonAPI.SampleCode/Program.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,40 @@ static async Task Main(string[] args)
3939
});
4040

4141

42+
ConstructFeedService createDocument2 = new ConstructFeedService("{SellerID}", "1.02");
43+
44+
var list22 = new List<CartonContentsRequest>();
45+
list22.Add(new CartonContentsRequest()
46+
{
47+
ShipmentId = "FBA123456",
48+
Carton = new List<Carton> {
49+
new Carton() {
50+
CartonId="1",
51+
Item=new List<CartonItem>(){
52+
new CartonItem() {
53+
QuantityInCase=1,
54+
QuantityShipped=1,
55+
SKU="7004"
56+
}
57+
}
58+
},
59+
new Carton() {
60+
CartonId="2",
61+
Item=new List<CartonItem>(){
62+
new CartonItem() {
63+
QuantityInCase=12,
64+
QuantityShipped=12,
65+
SKU="4051"
66+
}
67+
}
68+
}
69+
}
70+
});
71+
72+
createDocument2.AddCartonContentsRequest(list22);
73+
74+
var xml222 = createDocument2.GetXML();
75+
4276
var data22 = await amazonConnection.CatalogItem.SearchCatalogItems202204Async(
4377
new Parameter.CatalogItems.ParameterSearchCatalogItems202204
4478
{

Source/FikaAmazonAPI/ConstructFeed/BaseMessage.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class BaseMessage
1111
public OperationType OperationType { get; set; }
1212

1313
public PriceMessage Price { get; set; }
14-
14+
1515
public InventoryMessage Inventory { get; set; }
1616
public ProductMessage Product { get; set; }
1717

@@ -28,6 +28,7 @@ public class BaseMessage
2828
public FulfillmentCenterMessage FulfillmentCenter { get; set; }
2929
public FulfillmentOrderRequestMessage FulfillmentOrderRequest { get; set; }
3030
public FulfillmentOrderCancellationRequestMessage FulfillmentOrderCancellationRequest { get; set; }
31+
public CartonContentsRequest CartonContentsRequest { get; set; }
3132
public ImageMessage Image { get; set; }
3233
public LocalMessage Local { get; set; }
3334
public InvoiceConfirmationMessage InvoiceConfirmation { get; set; }
@@ -67,8 +68,8 @@ public class BaseMessage
6768
[XmlIgnore]
6869
public bool InventorySpecified { get { return Inventory != null; } }
6970
[XmlIgnore]
70-
public bool PriceSpecified{ get { return Price != null; }}
71-
71+
public bool PriceSpecified { get { return Price != null; } }
72+
7273
[XmlIgnore] public bool AmazonAppSpecified { get { return AmazonApp != null; } }
7374
[XmlIgnore] public bool CatPILSpecified { get { return CatPIL != null; } }
7475
[XmlIgnore] public bool AutoPartsItemSpecified { get { return AutoPartsItem != null; } }
@@ -81,6 +82,7 @@ public class BaseMessage
8182
[XmlIgnore] public bool FulfillmentCenterSpecified { get { return FulfillmentCenter != null; } }
8283
[XmlIgnore] public bool FulfillmentOrderRequestSpecified { get { return FulfillmentOrderRequest != null; } }
8384
[XmlIgnore] public bool FulfillmentOrderCancellationRequestSpecified { get { return FulfillmentOrderCancellationRequest != null; } }
85+
[XmlIgnore] public bool CartonContentsRequestSpecified { get { return CartonContentsRequest != null; } }
8486
[XmlIgnore] public bool ImageSpecified { get { return Image != null; } }
8587
[XmlIgnore] public bool LocalSpecified { get { return Local != null; } }
8688
[XmlIgnore] public bool InvoiceConfirmationSpecified { get { return InvoiceConfirmation != null; } }

0 commit comments

Comments
 (0)