1
- using FikaAmazonAPI . Parameter . Order ;
1
+ using FikaAmazonAPI . Parameter . ListingItem ;
2
2
using Microsoft . Extensions . Configuration ;
3
3
using static FikaAmazonAPI . Utils . Constants ;
4
4
@@ -24,19 +24,109 @@ static async Task Main(string[] args)
24
24
ClientSecret = config . GetSection ( "FikaAmazonAPI:ClientSecret" ) . Value ,
25
25
RefreshToken = config . GetSection ( "FikaAmazonAPI:RefreshToken" ) . Value ,
26
26
MarketPlaceID = config . GetSection ( "FikaAmazonAPI:MarketPlaceID" ) . Value ,
27
+ SellerID = config . GetSection ( "FikaAmazonAPI:SellerId" ) . Value ,
27
28
IsDebugMode = true
28
29
} ) ;
29
30
31
+ var search = amazonConnection . ProductType . SearchDefinitionsProductTypes ( new Parameter . ProductTypes . SearchDefinitionsProductTypesParameter
32
+ {
33
+ keywords = new [ ] { "pet" }
34
+ } ) ;
35
+
36
+ var def = amazonConnection . ProductType . GetDefinitionsProductType (
37
+ new Parameter . ProductTypes . GetDefinitionsProductTypeParameter ( )
38
+ {
39
+ productType = search . ProductTypes ? . FirstOrDefault ( ) ? . Name ?? "" ,
40
+ locale = AmazonSpApiSDK . Models . ProductTypes . LocaleEnum . en_US ,
41
+
42
+ } ) ;
43
+
44
+
45
+ var x = amazonConnection . CatalogItem . GetCatalogItem202204 ( new FikaAmazonAPI . Parameter . CatalogItems . ParameterGetCatalogItem ( )
46
+ {
47
+ ASIN = "B01I3JW7PK" ,
48
+ includedData = new List < IncludedData > {
49
+ IncludedData . summaries ,
50
+ IncludedData . identifiers ,
51
+ IncludedData . summaries ,
52
+ IncludedData . productTypes ,
53
+ IncludedData . dimensions ,
54
+ IncludedData . images ,
55
+ IncludedData . relationships ,
56
+ IncludedData . attributes //,
57
+
58
+ }
59
+ } ) ;
60
+ x . Attributes . Remove ( "street_date" ) ;
61
+ x . Attributes . Add ( "storage_instructions" , new [ ] { new {
62
+ value = "not applicable" //, unit="Hertz"
63
+
64
+ } } ) ;
65
+ x . Attributes . Add ( "number_of_boxes" , new [ ] { new {
66
+ value = 1 //, unit="Hertz"
67
+
68
+ } } ) ;
30
69
31
- ParameterOrderList serachOrderList = new ParameterOrderList ( ) ;
32
- serachOrderList . CreatedAfter = DateTime . UtcNow . AddMinutes ( - 6000 ) ;
70
+ x . Attributes . Add ( "country_of_origin" , new [ ] { new {
71
+ value = "UK" //, unit="Hertz"
33
72
34
- serachOrderList . OrderStatuses = new List < OrderStatuses > ( ) ;
35
- serachOrderList . OrderStatuses . Add ( OrderStatuses . Shipped ) ;
73
+ } } ) ;
36
74
37
- serachOrderList . AmazonOrderIds = new List < string > ( ) ;
75
+ x . Attributes . Add ( "use_by_recommendation" , new [ ] { new {
76
+ value = "not applicable" //, unit="Hertz"
38
77
39
- var orders = amazonConnection . Orders . GetOrders ( serachOrderList ) ;
78
+ } } ) ;
79
+
80
+ x . Attributes . Add ( "product_description" , new [ ] { new {
81
+ value = "" //, unit="Hertz"
82
+
83
+ } } ) ;
84
+ x . Attributes . Add ( "purchasable_offer" , new object [ ] {
85
+ new {
86
+ currency = amazonConnection . GetCurrentMarketplace . CurrencyCode ,
87
+ our_price = new [ ]
88
+ { new {
89
+ schedule = new [ ]
90
+ { new {
91
+ value_with_tax = 59.99M
92
+ }
93
+ } }
94
+ }
95
+ }
96
+ } ) ;
97
+
98
+ x . Attributes . Add ( "fulfillment_availability" ,
99
+ new object [ ] { new { fulfillment_channel_code = "DEFAULT" ,
100
+ quantity = 10 } } ) ;
101
+ //x.Attributes["vat_level"] = new[] { new {
102
+ // value ="registration_not_required"//, unit="Hertz"
103
+
104
+ // }};
105
+ x . Attributes . Add ( "condition_type" , new [ ] { new {
106
+ value = "new_new" //, unit="Hertz"
107
+
108
+ } } ) ;
109
+ x . Attributes . Remove ( "variation_theme" ) ;
110
+ x . Attributes . Remove ( "generic_keyword" ) ; x . Attributes . Remove ( "vat_level" ) ;
111
+
112
+
113
+
114
+ // var r = new object[] { new{ value = DateTime.Now } };
115
+ // x.Attributes.Add("street_date", System.Text.Json.JsonSerializer.Serialize( new[] { new { value = DateTime.Now } }));//= System.Text.Json.JsonSerializer.Serialize(r);
116
+ var putrequest = new ListingsItemPutRequest ( )
117
+ {
118
+ attributes = x . Attributes ,
119
+ productType = def . ProductType ,
120
+ requirements = Requirements . LISTING
121
+ } ;
122
+
123
+ var y = amazonConnection . ListingsItem . PutListingsItem (
124
+ new ParameterPutListingItem ( )
125
+ {
126
+ listingsItemPutRequest = putrequest ,
127
+ sku = "71683-001" ,
128
+ sellerId = amazonConnection . GetCurrentSellerID
129
+ } ) ;
40
130
41
131
42
132
0 commit comments