SP API C# Sdk ListFinancialEvents error
Hello,
I am using C# SDK to make SP API List Financial Events call (https://developer-docs.amazon.com/sp-api-blog/docs/automate-your-sp-api-calls-using-the-c-sdk). Starting 07/26/2023 I started seeing an error when I call ListFinancialEvents. This is the error I am getting:
'Error converting value 26 to type 'IO.Swagger.Model.BigDecimal'. Path 'payload.FinancialEvents.ShipmentEventList[0].ShipmentItemList[0].ItemChargeList[0].ChargeAmount.CurrencyAmount', line 49, position 189.'
This is the request:
LWAAuthorizationCredentials lwaAuthorizationCredentials = new LWAAuthorizationCredentials
{
ClientId = "amzn1.application-oa2-client.******************",
ClientSecret = "***********************************",
RefreshToken = "Atzr|***********************************",
Endpoint = new Uri("https://api.amazon.com/auth/o2/token")
};
AWSAuthenticationCredentials awsAuthenticationCredentials = new AWSAuthenticationCredentials
{
AccessKeyId = "*********************",
SecretKey = "***********************",
Region = "us-east-1"
};
var today = DateTime.Now.Date;
var maxResultsPerPage = 56;
var financialEventGroupStartedBefore = today.AddDays(-1);
var financialEventGroupStartedAfter = today.AddDays(-2);
DefaultApi defaultApi = new DefaultApi.Builder()
.SetAWSAuthenticationCredentials(awsAuthenticationCredentials)
.SetLWAAuthorizationCredentials(lwaAuthorizationCredentials)
.Build();
var result = defaultApi.ListFinancialEvents(maxResultsPerPage, financialEventGroupStartedAfter, financialEventGroupStartedBefore, null);
It was working just fine before. I never saw this error. Can you please help?
Thanks,
Asma
SP API C# Sdk ListFinancialEvents error
Hello,
I am using C# SDK to make SP API List Financial Events call (https://developer-docs.amazon.com/sp-api-blog/docs/automate-your-sp-api-calls-using-the-c-sdk). Starting 07/26/2023 I started seeing an error when I call ListFinancialEvents. This is the error I am getting:
'Error converting value 26 to type 'IO.Swagger.Model.BigDecimal'. Path 'payload.FinancialEvents.ShipmentEventList[0].ShipmentItemList[0].ItemChargeList[0].ChargeAmount.CurrencyAmount', line 49, position 189.'
This is the request:
LWAAuthorizationCredentials lwaAuthorizationCredentials = new LWAAuthorizationCredentials
{
ClientId = "amzn1.application-oa2-client.******************",
ClientSecret = "***********************************",
RefreshToken = "Atzr|***********************************",
Endpoint = new Uri("https://api.amazon.com/auth/o2/token")
};
AWSAuthenticationCredentials awsAuthenticationCredentials = new AWSAuthenticationCredentials
{
AccessKeyId = "*********************",
SecretKey = "***********************",
Region = "us-east-1"
};
var today = DateTime.Now.Date;
var maxResultsPerPage = 56;
var financialEventGroupStartedBefore = today.AddDays(-1);
var financialEventGroupStartedAfter = today.AddDays(-2);
DefaultApi defaultApi = new DefaultApi.Builder()
.SetAWSAuthenticationCredentials(awsAuthenticationCredentials)
.SetLWAAuthorizationCredentials(lwaAuthorizationCredentials)
.Build();
var result = defaultApi.ListFinancialEvents(maxResultsPerPage, financialEventGroupStartedAfter, financialEventGroupStartedBefore, null);
It was working just fine before. I never saw this error. Can you please help?
Thanks,
Asma
1 resposta
Seller_v95qqMBLFluEx
The error message has alrdy told you the problem, you have conversion error.