adding the loop for multiple merchant_ids