From e4c4ab690b3c2e1c79a407d836248d1e03dee9c5 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Fri, 15 Nov 2024 12:57:51 +0530 Subject: [PATCH] feat: add get query for purchases --- qbosdk/apis/purchases.py | 9 +++++++++ setup.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/qbosdk/apis/purchases.py b/qbosdk/apis/purchases.py index 59d79e7..82a4f2e 100644 --- a/qbosdk/apis/purchases.py +++ b/qbosdk/apis/purchases.py @@ -11,6 +11,7 @@ class Purchases(ApiBase): GET_PURCHASES = '/query?query=select * from Purchase STARTPOSITION {0} MAXRESULTS 1000' POST_PURCHASE = '/purchase?minorversion=38' DELETE_PURCHASE = '/purchase?operation=delete' + GET_PURCHASE_BY_ID = "/query?query=select * from Purchase where Id = \'{0}\'" def get(self): """ @@ -45,3 +46,11 @@ def delete(self, purchase_id: str): 'SyncToken': '1' } return self._post_request(data, Purchases.DELETE_PURCHASE) + + def get_by_id(self, purchase_id: str): + """ + Get Purchase by Id + :param purchase_id: Purchase Id + :return: Dict in Purchase schema + """ + return self._query(self.GET_PURCHASE_BY_ID.format(purchase_id)) diff --git a/setup.py b/setup.py index ca13f6c..c8afca0 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='qbosdk', - version='0.18.1', + version='0.19.0', author='Shwetabh Kumar', author_email='shwetabh.kumar@fyle.in', description='Python SDK for accessing Quickbooks Online APIs',