File tree Expand file tree Collapse file tree 8 files changed +52
-18
lines changed
AmazonSpApiSDK/Models/Token Expand file tree Collapse file tree 8 files changed +52
-18
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,35 @@ For more information about keys please check [Amazon Selling Partner Api develop
127
127
var report = amazonConnection .Reports .CreateReport (parameters );
128
128
```
129
129
130
+
131
+ ### Report GET_MERCHANT_LISTINGS_ALL_DATA sample
132
+ ``` CSharp
133
+ var parameters = new ParameterCreateReportSpecification ();
134
+ parameters .reportType = ReportTypes .GET_MERCHANT_LISTINGS_ALL_DATA ;
135
+
136
+ parameters .marketplaceIds = new MarketplaceIds ();
137
+ parameters .marketplaceIds .Add (MarketPlace .UnitedArabEmirates .ID );
138
+
139
+ parameters .reportOptions = new FikaAmazonAPI .AmazonSpApiSDK .Models .Reports .ReportOptions ();
140
+
141
+ var reportId = amazonConnection .Reports .CreateReport (parameters );
142
+ var filePath = string .Empty ;
143
+ string ReportDocumentId = string .Empty ;
144
+
145
+ while (string .IsNullOrEmpty (ReportDocumentId ))
146
+ {
147
+ Thread .Sleep (1000 * 60 );
148
+ var reportData = amazonConnection .Reports .GetReport (reportId );
149
+ if (! string .IsNullOrEmpty (reportData .ReportDocumentId ))
150
+ {
151
+ filePath = amazonConnection .Reports .GetReportFile (reportData .ReportDocumentId );
152
+ break ;
153
+ }
154
+ }
155
+
156
+ // filePath for report
157
+ ```
158
+
130
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 ) .
131
160
``` CSharp
132
161
Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ static async Task Main(string[] args)
39
39
ClientSecret = Environment . GetEnvironmentVariable ( "ClientSecret" ) ,
40
40
RefreshToken = Environment . GetEnvironmentVariable ( "RefreshToken" ) ,
41
41
MarketPlace = MarketPlace . UnitedArabEmirates ,
42
- IsActiveLimitRate = true
42
+ IsActiveLimitRate = true ,
43
+ Environment = Environments . Production
43
44
44
- } ) ;
45
+ } ) ;
45
46
46
47
47
48
var data4 = amazonConnection . ProductPricing . GetItemOffers ( new Parameter . ProductPricing . ParameterGetItemOffers ( )
Original file line number Diff line number Diff line change 1
1
using FikaAmazonAPI . AmazonSpApiSDK . Models . Token ;
2
+ using FikaAmazonAPI . AmazonSpApiSDK . Services ;
2
3
using FikaAmazonAPI . Utils ;
3
4
using System ;
4
5
using System . Collections . Generic ;
5
6
using System . Text ;
6
7
using static FikaAmazonAPI . AmazonSpApiSDK . Models . Token . CacheTokenData ;
8
+ using static FikaAmazonAPI . Utils . Constants ;
7
9
8
10
namespace FikaAmazonAPI
9
11
{
@@ -18,6 +20,8 @@ public class AmazonCredential
18
20
public MarketPlace MarketPlace { get ; set ; }
19
21
private CacheTokenData CacheTokenData { get ; set ; }
20
22
public bool IsActiveLimitRate { get ; set ; } = true ;
23
+ public Environments Environment { get ; set ; } = Environments . Production ;
24
+
21
25
22
26
23
27
public AmazonCredential ( )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public class CacheTokenData
13
13
14
14
public AWSAuthenticationTokenData GetAWSAuthenticationTokenData ( )
15
15
{
16
- if ( AWSAuthenticationTokenData != null && AWSAuthenticationTokenData . Expiration > DateTime . Now )
16
+ if ( AWSAuthenticationTokenData != null && AWSAuthenticationTokenData . Expiration > DateTime . Now . Date . AddSeconds ( - 10 ) )
17
17
return AWSAuthenticationTokenData ;
18
18
else return null ;
19
19
}
Original file line number Diff line number Diff line change 8
8
<Product >CSharp Amazon Sp API</Product >
9
9
<GeneratePackageOnBuild >true</GeneratePackageOnBuild >
10
10
<LangVersion >8.0</LangVersion >
11
- <Version >1.0.10 </Version >
12
- <AssemblyVersion >1.0.1.10 </AssemblyVersion >
13
- <FileVersion >1.0.1.10 </FileVersion >
11
+ <Version >1.0.12 </Version >
12
+ <AssemblyVersion >1.0.1.12 </AssemblyVersion >
13
+ <FileVersion >1.0.1.12 </FileVersion >
14
14
<PackageRequireLicenseAcceptance >true</PackageRequireLicenseAcceptance >
15
15
<PackageProjectUrl >https://github.com/abuzuhri/Amazon-SP-API-CSharp</PackageProjectUrl >
16
16
<PackageLicenseExpression >MIT</PackageLicenseExpression >
17
17
<RepositoryUrl >https://github.com/abuzuhri/Amazon-SP-API-CSharp</RepositoryUrl >
18
18
<PackageReadmeFile >README.md</PackageReadmeFile >
19
+ <PackageTags >Amazon SP-API MWS Amazon-SP-API Amazon Selling</PackageTags >
20
+ <PackageReleaseNotes ></PackageReleaseNotes >
21
+ <NeutralLanguage >en-US</NeutralLanguage >
22
+ <Description >.Net C# library for the new Amazon Selling Partner API</Description >
19
23
20
24
</PropertyGroup >
21
25
<ItemGroup >
Original file line number Diff line number Diff line change 2
2
3
3
namespace FikaAmazonAPI . AmazonSpApiSDK . Services
4
4
{
5
-
6
- public static class EnvironemntManager
7
- {
8
- public static Environments Environemnt { get ; set ; } = Environments . Production ;
9
- public enum Environments
10
- {
11
- Sandbox , Production
12
- }
13
- }
14
-
15
5
public class ApiUrls
16
6
{
17
7
Original file line number Diff line number Diff line change 16
16
using FikaAmazonAPI . Search ;
17
17
using System . Linq ;
18
18
using System . Threading ;
19
+ using static FikaAmazonAPI . Utils . Constants ;
19
20
20
21
namespace FikaAmazonAPI . Services
21
22
{
@@ -35,7 +36,7 @@ protected string ApiBaseUrl
35
36
{
36
37
get
37
38
{
38
- return EnvironemntManager . Environemnt == EnvironemntManager . Environments . Sandbox ? AmazonSandboxUrl : AmazonProductionUrl ;
39
+ return AmazonCredential . Environment == Environments . Sandbox ? AmazonSandboxUrl : AmazonProductionUrl ;
39
40
}
40
41
}
41
42
Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ public class Constants
11
11
{
12
12
public readonly static string AmazonToeknEndPoint = "https://api.amazon.com/auth/o2/token" ;
13
13
public readonly static string DateISO8601Format = "yyyy-MM-ddTHH:mm:ss.fffZ" ;
14
-
14
+
15
+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
16
+ public enum Environments
17
+ {
18
+ Sandbox , Production
19
+ }
15
20
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
16
21
public enum GranularityEnum {
17
22
Hour ,
You can’t perform that action at this time.
0 commit comments