Check what is the cause of the issue in the SN duplicate entries, Upon the investigation, some orders were not tagged as 0 value which means the orders are not new and it's already processed. the column name in the stn_orders table is_new_order_from_mgt with tagging value of 0 or 1 (1 if new, 0 is done/processed)  in affiliate database.