Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed Input #9

Open
kevinvenclovas opened this issue Jul 3, 2019 · 2 comments
Open

Malformed Input #9

kevinvenclovas opened this issue Jul 3, 2019 · 2 comments

Comments

@kevinvenclovas
Copy link

kevinvenclovas commented Jul 3, 2019

Hello, i try to use the GetMyFeesEstimate API and get every time a Malformed error. The critical line is the Amount = 12.99M with 13 it works fine but i need the exect value.

FeesEstimateRequestList feesEstimateRequestList = new FeesEstimateRequestList()
            {
                FeesEstimateRequest = new List<FeesEstimateRequest>()
                {
                    new FeesEstimateRequest()
                    {
                        MarketplaceId = "A1PA6795UKMFR9",
                        IdType = "ASIN",
                        IdValue = "B07P91KLRM",
                        IsAmazonFulfilled = false,
                        Identifier = "request1",
                        PriceToEstimateFees = new PriceToEstimateFees()
                        {
                            ListingPrice = new MoneyType()
                            {
                                Amount = 12.99M,
                                CurrencyCode = "EUR",
                            },
                        }
                    }
                }
            };
@kevinvenclovas kevinvenclovas changed the title Malformed string Malformed Input Jul 3, 2019
@claytondus
Copy link
Owner

claytondus commented Dec 24, 2019

I don't have an EUR account, but I was just able to complete this request:

FeesEstimateRequest = new List<FeesEstimateRequest>()
                {
                    new FeesEstimateRequest()
                    {
                        MarketplaceId = "ATVPDKIKX0DER",
                        IdType = "ASIN",
                        IdValue = "B016W63ZYS",
                        IsAmazonFulfilled = false,
                        Identifier = "request1",
                        PriceToEstimateFees = new PriceToEstimateFees()
                        {
                            ListingPrice = new MoneyType()
                            {
                                Amount = 12.99M,
                                CurrencyCode = "USD",
                            },
                        }
                    }
                }
<GetMyFeesEstimateResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01"><GetMyFeesEstimateResult><FeesEstimateResultList><FeesEstimateResult><Status>Success</Status><FeesEstimateIdentifier><MarketplaceId>ATVPDKIKX0DER</MarketplaceId><SellerId>A2EIAUMHCIBDMM</SellerId><IdType>ASIN</IdType><IdValue>B016W63ZYS</IdValue><IsAmazonFulfilled>False</IsAmazonFulfilled><PriceToEstimateFees><ListingPrice><CurrencyCode>USD</CurrencyCode>*<Amount>12.99</Amount>*</ListingPrice></PriceToEstimateFees><SellerInputIdentifier>request1</SellerInputIdentifier></FeesEstimateIdentifier><FeesEstimate><TimeOfFeesEstimation>12/24/2019 17:31:52</TimeOfFeesEstimation><TotalFeesEstimate><CurrencyCode>USD</CurrencyCode><Amount>3.75</Amount></TotalFeesEstimate><FeeDetailList><FeeDetail><FeeType>ReferralFee</FeeType><FeeAmount><CurrencyCode>USD</CurrencyCode><Amount>1.95</Amount></FeeAmount><FeePromotion><CurrencyCode>USD</CurrencyCode><Amount>0.00</Amount></FeePromotion><FinalFee><CurrencyCode>USD</CurrencyCode><Amount>1.95</Amount></FinalFee></FeeDetail><FeeDetail><FeeType>VariableClosingFee</FeeType><FeeAmount><CurrencyCode>USD</CurrencyCode><Amount>1.80</Amount></FeeAmount><FeePromotion><CurrencyCode>USD</CurrencyCode><Amount>0.00</Amount></FeePromotion><FinalFee><CurrencyCode>USD</CurrencyCode><Amount>1.80</Amount></FinalFee></FeeDetail><FeeDetail><FeeType>PerItemFee</FeeType><FeeAmount><CurrencyCode>USD</CurrencyCode><Amount>0.00</Amount></FeeAmount><FeePromotion><CurrencyCode>USD</CurrencyCode><Amount>0.00</Amount></FeePromotion><FinalFee><CurrencyCode>USD</CurrencyCode><Amount>0.00</Amount></FinalFee></FeeDetail></FeeDetailList></FeesEstimate></FeesEstimateResult></FeesEstimateResultList></GetMyFeesEstimateResult><ResponseMetadata><RequestId>5ccfb172-de7f-48d7-8607-8f3856db9d6f</RequestId></ResponseMetadata></GetMyFeesEstimateResponse>

@kevinvenclovas
Copy link
Author

Hi,
now i got the issue after come back again.

You need to recode the WriteFragmentTo in the Claytondus.AmazonMWS.Products.Model.MoneyType class.
With the german localization the ".ToString" function convert the decimal "Amount" -> 12.99M to 12,99 but amazon need the dot version 12.99 .

So you need to change :
writer.Write("Amount", _amount);

to

writer.Write("Amount", _amount?.ToString(CultureInfo.InvariantCulture));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants