You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've made a unit-test for sandbox environment where I fetch orders and orderItems from Amazon. I then create a XML to send an orderAcknowledgement submit feed. However here I receive the following error:
Message:
Test method Nayan.Interface.Amazon.Business.Integrationtests.AmazonSellerApi.AmazonApiTests.Test threw exception:
FikaAmazonAPI.AmazonSpApiSDK.Models.Exceptions.AmazonException: Amazon Api didn't respond with Okay, see exception for more details
Sadly, there is no exception with more details provided.
I will drop the code below without sharing sensitive data. If anyone has similar issues, please let me know how to resolve them.
I for one believe i'm missing something in the XML constructed so that Amazon knows this is a sandbox orderAcknowledgement, but your guess is as good as mine.
Thanks in advance. If more information is required please do not hesitate to ask.
_amazonConnection = new AmazonConnection(new AmazonCredential()
{
AccessKey = "YourKey",
SecretKey = "YourSecretKey",
RoleArn = "YourRoleArn",
ClientId = "YourClientId",
ClientSecret = "YourClientSecret",
RefreshToken = "YourRefreshToken",
MarketPlaceID = "YourMarketPlace",
Environment = Environments.Sandbox,
IsDebugMode = true,
SellerID = "YourSellerId"
});
ParameterOrderList sandboxParameters = new()
{
TestCase = TestCase200
};
var orders = _amazonConnection.Orders.GetOrders(sandboxParameters);
ParameterGetOrder parameterGetOrder = new()
{
TestCase = TestCase200
};
var orderItems = _amazonConnection.Orders.GetOrderItems(parameterGetOrder.TestCase);
var orderAcknowledgementItems = new List<OrderAcknowledgementItem>();
foreach (var orderItem in orderItems)
{
orderAcknowledgementItems.Add(new OrderAcknowledgementItem()
{
AmazonOrderItemCode = orderItem.OrderItemId,
MerchantOrderItemID = "our orderItem reference"
});
}
ConstructFeedService createDocument = new ConstructFeedService("A2YQFYAETBR5O7", "1.01");
var list = new List<OrderAcknowledgementMessage>();
list.Add(new OrderAcknowledgementMessage()
{
AmazonOrderID = orders[0].AmazonOrderId,
MerchantOrderID = "our order reference",
StatusCode = OrderAcknowledgementStatusCode.Success,
Item = orderAcknowledgementItems
});
createDocument.AddOrderAcknowledgementMessage(list);
var xml = createDocument.GetXML();
var result = _amazonConnection.Feed.SubmitFeed(xml, FeedType.POST_ORDER_ACKNOWLEDGEMENT_DATA);
result.Should().NotBeNullOrEmpty();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey,
I've made a unit-test for sandbox environment where I fetch orders and orderItems from Amazon. I then create a XML to send an orderAcknowledgement submit feed. However here I receive the following error:
Message:
Test method Nayan.Interface.Amazon.Business.Integrationtests.AmazonSellerApi.AmazonApiTests.Test threw exception:
FikaAmazonAPI.AmazonSpApiSDK.Models.Exceptions.AmazonException: Amazon Api didn't respond with Okay, see exception for more details
Sadly, there is no exception with more details provided.
I will drop the code below without sharing sensitive data. If anyone has similar issues, please let me know how to resolve them.
I for one believe i'm missing something in the XML constructed so that Amazon knows this is a sandbox orderAcknowledgement, but your guess is as good as mine.
Thanks in advance. If more information is required please do not hesitate to ask.
Beta Was this translation helpful? Give feedback.
All reactions