“Credit Memo not created. Cannot refund line item [Amazon SKU: XXXXXX, Amazon Order Item Code: XXXXXXXXX]. Please bill this line in NetSuite before importing its refund. Settlement details: Settlement Id# XXXXX, Amazon MFN Order# XXX-XXXXXXX-XXXXXXX.” error.
Solution : When the NetSuite Settlement Transaction to NetSuite Refund Add flow is run to sync the refund transactions with NetSuite, you may have received the “Credit Memo not created. Cannot refund line item [Amazon SKU: XXXXXX, Amazon Order Item Code: XXXXXXXXX]. Please bill this line in NetSuite before importing its refund. Settlement details: Settlement Id# XXXXX, Amazon MFN Order# XXX-XXXXXXX-XXXXXXX.” error. This is due to an error faced at Amazon end with respect to the order item API where the order item IDs updated for the returned transaction item lines differ from the order item IDs associated with the transaction item lines when the order was created. As the incorrect order item IDs are updated, the records are not updated and the “Credit Memo not created. Cannot refund line item” error is received.
A sample of how a refund transaction is displayed in NetSuite with the incorrect order item IDs updated for the transaction line items is shown below:

In this sample, you can see that the Exported to IO checkbox is checked. However, the record is not exported to IO as the incorrect order item IDs have been assigned to the transaction line items of the refund transaction. The Error Code and Error Message fields display this information.
To overcome this issue and to ensure that the correct order item IDs are reflected for the returned items, you need to run the Amazon – NetSuite refund errors custom flow. This will ensure that the correct order item ID is mapped for the returned items.
Do not retry the “Credit Memo not created. Cannot refund line item” errors received while running the NetSuite Settlement Transaction to NetSuite Refund Add flow for the first time. Resolve those errors, run the Amazon – NetSuite refund errors custom flow, and then run the NetSuite Settlement Transaction to NetSuite Refund Add flow again. This will ensure that the refund transactions are synced successfully with NetSuite.