EasyPost/easypost-ruby

multiple easypost accounts

Closed this issue · 1 comments

EasyPost.api_key = 'cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi'

seems its settung api_key globally, is there a possibility to set api key for each call?
I have multiple companies with each of their own easypost account, don't want to use one company's api in other one

@Faisal-nfl yes, simply assign each company's API key dynamically to a variable and swap it based on who's using your platform.

company_api_key = '123' # fill this from a database or however you plan to do that
EasyPost.api_key = company_api_key