Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add get query for purchases #31

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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