@@ -15,7 +15,8 @@ class SageIntacctSDK:
1515 """
1616
1717 def __init__ (self , sender_id : str , sender_password : str , user_id : str ,
18- company_id : str , user_password : str , entity_id : str = None , show_private : bool = False ):
18+ company_id : str , user_password : str , entity_id : str = None , show_private : bool = False ,
19+ session_id : str = None ):
1920 """
2021 Initialize connection to Sage Intacct
2122 :param sender_id: Sage Intacct sender id
@@ -34,6 +35,7 @@ def __init__(self, sender_id: str, sender_password: str, user_id: str,
3435 self .__user_password = user_password
3536 self .__entity_id = entity_id
3637 self .__show_private = show_private
38+ self .__session_id = session_id
3739
3840 self .api_base = ApiBase ()
3941 self .contacts = Contacts ()
@@ -180,8 +182,13 @@ def update_session_id(self):
180182 """
181183 Update the session id and change it in all API objects.
182184 """
183- self .__session_id = self .api_base .get_session_id (
184- self .__user_id , self .__company_id , self .__user_password , self .__entity_id )
185+ if not self .__session_id :
186+ self .__session_id = self .api_base .get_session_id (
187+ self .__user_id ,
188+ self .__company_id ,
189+ self .__user_password ,
190+ self .__entity_id
191+ )
185192 self .api_base .set_session_id (self .__session_id )
186193 self .contacts .set_session_id (self .__session_id )
187194 self .contracts .set_session_id (self .__session_id )
0 commit comments