Makadara Chief Magistrate Heston Nyaga allowed detectives to continue holding the suspects for further investigations to be carried out.
The investigating officer Patrick Mathenge stated in an affidavit that on May 29, they were tipped that some foreigners had locked themselves up in an M-Pesa shop in Kiamaiko.
The M-Pesa shop attendant escaped during the arrest.
Five of the suspects were found with passports while the other two did not have any identification documents.
The court ordered that the suspects be held at Muthaiga Police Station until Wednesday.