In ancient Greek too. They invented the thing. The Romans had a similar legal contract, but adopted the term to avoid confusion with other lending practices.
As dt_r pointed, apotheke always meant "away room" so it makes sense to think that it got the new meaning because of context: it surely was imported alongside other Greek terms about drugs.