Problem: The following error may appear for the Order FBA or MFN flow. It occurs when an item has no price associated with it in the Amazon order. This can occur when an item has to be reshipped by Amazon, but the customer is not being charged.
Solution: Add the following mapping to the Order FBA flow to set the amount of the item to $0. This will allow these orders to be imported into NetSuite.
#if $.OrderItem[*].ItemPrice.Amount$.OrderItem[*].ItemPrice.Amountelse}}0{{/if
Comments
Hello,
I got this error on the Amazon MFN flow, so I tried using this formula, but it failed again.
This was on an Amazon 'replacement' shipment. There is no data in the field on the retry data for {{OrderItem[*].ItemPrice.Amount}}, so the flow gave this error:
"Failed to add Amazon Order# 111-2111118-2111111. Could not compile handle bar \"{{#if $.OrderItem.[0].ItemPrice. Amount}}{{$.OrderItem[*]. ItemPrice.Amount}} {{else}}0{{/if}}\" because \"Parse error on line 1:\n...mPrice. Amount}}{{$.OrderItem[*]. ItemPr\n-----------------------^\nExpecting 'ID', got 'INVALID'\" .Please correct and retry"
What can I do in this scenario?
For item amount:
{{#if $.OrderItem[*].ItemPrice.Amount}}{{$.OrderItem[*].ItemPrice.Amount}}{{else}}0{{/if}}
For item rate:
{{#if $.OrderItem[*].ItemPrice.Amount}}{{divide $.OrderItem[*].ItemPrice.Amount $.OrderItem[*].QuantityOrdered}}{{else}}0{{/if}}
Andrew, did you figure it out? Currently having the same issue with MFN replacement order.
Hello Andrew, Jeffery Hill, and Justin Bodin
Thank you for writing to us. Our team has verified the handlebar expression again, it works fine.
Can you confirm if you're mapping "Items : Rate" for the replacement orders. We are assuming that Amazon is not sending the node QuantityOrdered and hence getting the Undefined result.
Please create a Zendesk ticket and provide your account details and reply back with the ticket ID here. The team would like to review your account to resolve the error.
Please let us know if you're looking for further information.
Please update the article, as the the text for the mapping has extra spaces in it that throws out errors.
Amount}}{{$.OrderItem[*]. ItemPrice.Amount}} {{else}}0{{/if}}
{{#if $.OrderItem[*].ItemPrice.
should be:
{{#if $.OrderItem[*].ItemPrice.Amount}}{{$.OrderItem[*].ItemPrice.Amount}} {{else}}0{{/if}}
The incorrect space is between "ItemPrice." and "Amount" in this first section and "OrderItem[*]." and "ItemPrice.Amount" in the second section.
I was having the issue with MFN replacement orders, and this cleared the errors.
Hey Adam Ashworth good catch! This actually fixed the error for me as well!
Please sign in to leave a comment.