Skip to content

Commit

Permalink
feat: add get query for purchases (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishabh17 authored Nov 15, 2024
1 parent 72a4c47 commit 147f951
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions qbosdk/apis/purchases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='qbosdk',
version='0.18.1',
version='0.19.0',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Python SDK for accessing Quickbooks Online APIs',
Expand Down

0 comments on commit 147f951

Please sign in to comment.