# faults contains list of failed operations and associated errors Review results for batch operation: # successes is a list of objects that were successfully updated Results = batch_delete(payments, qb=client) Payments = Payment.filter(TxnDate=date.today()) Results = batch_update(customers, qb=client)īatch delete a list of objects (only entities that support delete can use batch delete): from quickbooks.batch import batch_delete Results = batch_create(customers, qb=client)īatch update a list of objects: from quickbooks.batch import batch_update Operations in a single request (See Intuit Batch Operations Guide forīatch create a list of objects: from quickbooks.batch import batch_create The batch operation enables an application to perform multiple Get single object by Id and update: customer = Customer.get(1, qb=client)Ĭustomer.CompanyName = "New Test Company Name" Get record count (do not include the "WHERE"): customer_count = unt("Active = True AND CompanyName LIKE 'S%'", qb=client) Supported SQL statements): customers = Customer.query("SELECT * FROM Customer WHERE Active = True", qb=client)įiltering a list with a custom query with paging: customers = Customer.query("SELECT * FROM Customer WHERE Active = True STARTPOSITION 1 MAXRESULTS 25", qb=client) List with custom Where Clause and paging: customers = Customer.where("CompanyName LIKE 'S%'", start_position=1, max_results=25, qb=client)įiltering a list with a custom query (See Intuit developer guide for List with custom Where and ordering customers = Customer.where("Active = True AND CompanyName LIKE 'S%'", order_by='DisplayName', qb=client) List with custom Where Clause (do not include the "WHERE"): customers = Customer.where("Active = True AND CompanyName LIKE 'S%'", qb=client) List Filtered by values in list: customer_names = Ĭustomers = Customer.choose(customer_names, field="DisplayName", qb=client) # Order customers by FamilyName then by GivenNameĬustomers = Customer.all(order_by='FamilyName, GivenName', qb=client)įiltered list of objects with paging: customers = Customer.filter(start_position=1, max_results=25, Active=True, FamilyName="Smith", qb=client) Invoices = Invoice.filter(CustomerRef='100', order_by='TxnDate DESC', qb=client) Invoices = Invoice.filter(CustomerRef='100', order_by='TxnDate', qb=client) (See Intuit developer guide for details)įiltered list of objects: customers = Customer.filter(Active=True, FamilyName="Smith", qb=client)įiltered list of objects with ordering: # Get customer invoices ordered by TxnDate If the result size is not specified, the default Note: The maximum number of entities that can be returned in a If you need to access a minor version (See Minor versions forĭetails) pass in minorversion when setting up the client: client = QuickBooks( Then create a QuickBooks client object passing in the AuthClient, refresh token, and company id: from quickbooks import QuickBooks from intuitlib.client import AuthClientĪccess_token='ACCESS_TOKEN', # If you do not pass this in, the Quickbooks client will call refresh and get a new access token. Set up an AuthClient passing in your CLIENT_ID and CLIENT_SECRET. Installation pip install python-quickbooksįollow the OAuth 2.0 Guide for installation and to get connected to QuickBooks API. You can find additional examples of usage in Integration tests folder.įor information about contributing, see the Contributing Page. Make sure toĬhange it to whatever framework/method you’re using. These instructions were written for a Django application. A Python 3 library for accessing the Quickbooks API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |