Quickbooks Time
Overview
Quickbooks Time is a time tracking and scheduling tool that integrates with Quickbooks Online. This integration allows you to pull time tracking data from Quickbooks Time into Parsons.
Note
- Authentication
You need to generate a Quickbooks Time API token to use this integration. See the Quickbooks Time API documentation
Quickstart
In order to instantiate the Quickbooks Time class, you need to pass in your Quickbooks Time API token as an environment variable “QB_AUTH_TOKEN” or pass it in as a parameter called token=”your_token”.
Example 1
from parsons import QuickBooksTime
# instantiate the quickbooks class
qb = QuickBooksTime(token="your_token")
#Timesheets Table
timesheets_tbl = qb.get_timesheets(start_date="2024-01-01")
This example shows how to get timesheets for a given date range.
API
- class parsons.QuickBooksTime(token=None)[source]
Instantiate the QuickBooksTime class.
- Args:
- token: str
A valid QuickBooksTime Auth Token. Not required if
QB_AUTH_TOKEN
env variable set. [Find instructions to create yours here](https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0) # noqa: E501[QuickBooksTime API Documentation](https://tsheetsteam.github.io/api_docs/#introduction)
- qb_get_request(end_point: str, querystring=None)[source]
This function handles the pagination of the request
- get_groups(ids=None, active=None, manager_ids=None, name=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /groups endpoint of the QuickBooksTime Time API. All Args are optional.
- Args:
- ids: Int
Comma separated list of one or more group ids you’d like to filter on.
- active: String
‘yes’, ‘no’, or ‘both’. Default is ‘yes’.
- manager_ids: Int
Comma separated list of one or more manager ids you’d like to filter on.
- name: String
Comma separated list of one or more group names you’d like to filter on.
- modified_before: String
Only groups modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm)
- modified_since: String
Only groups modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm)
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve.
- Returns:
Parsons Table
- get_jobcodes(ids=None, parent_ids=None, name=None, type=None, active=None, customfields=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /jobcodes endpoint of the QuickBooksTime Time API.
- Args:
- ids: Int
Comma separated list of one or more jobcode ids you’d like to filter on. Only jobcodes with an id set to one of these values will be returned. If omitted, all jobcodes matching other specified filters are returned.
- parent_ids: Int
Default is -1 (meaning all jobcodes will be returned regardless of parent_id). Comma separated list of one or more jobcode parent_ids you’d like to filter on. Only jobcodes with a parent_id set to one of these values will be returned. Additionally you can use 0 to get only the top-level jobcodes.
Then get the id of any results with has_children=yes and feed that in as the value of parent_ids for your next request to get the 2nd level of jobcodes, and so on, to traverse an entire tree of jobcodes. Use -1 to return all jobcodes regardless of parent_id. This is especially useful when combined with the modified_since filter. When parent_ids is -1, you’ll have the jobcode records needed to trace each result back to it’s top level parent in the supplemental_data section of the response.
- name: String
will be interpreted as a wild card.
Starts matching from the beginning of the string.
- type: String
Indicates jobcode type. One of ‘regular’, ‘pto’, ‘paid_break’, ‘unpaid_break’, or ‘all’. Default is ‘regular’.
- active: String
‘yes’, ‘no’, or ‘both’. Default is ‘yes’. If a jobcode is active, it is available for selection during time entry.
- customfields: Boolean
true or false. If true, custom fields for this jobcode will be returned. If false, the customfields object will be omitted.
- modified_before: String
Only jobcodes modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- modified_since: String
Only jobcodes modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
Parsons Table
- get_timesheets(ids=None, jobcode_ids=None, payroll_ids=None, user_ids=None, group_ids=None, end_date=None, on_the_clock=None, jobcode_type=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1, start_date='1900-01-01')[source]
This function allows you to call the /timesheets endpoint of the QuickBooksTime Time API.
- Params:
- ids: Int
required (unless modified_before, modified_since, or start_date are set) Comma separated list of one or more timesheet ids you’d like to filter on. Only timesheets with an id set to one of these values will be returned. If omitted, all timesheets matching other specified filters are returned.
- start_date: String
required (unless modified_before, modified_since, or ids is set) YYYY-MM-DD formatted date. Any timesheets with a date falling on or after this date will be returned.
- end_date: String
YYYY-MM-DD formatted date. Any timesheets with a date falling on or before this date will be returned.
- jobcode_ids: Int
A comma-separated string of jobcode ids. Only time recorded against these jobcodes or one of their children will be returned.
- payroll_ids: Int
A comma-separated string of payroll ids. Only time recorded against users with these payroll ids will be returned.
- user_ids: Int
A comma-separated list of user ids. Only timesheets linked to these users will be returned.
- group_ids: Int
A comma-separated list of group ids. Only timesheets linked to users from these groups will be returned.
- on_the_clock: String
‘yes’, ‘no’, or ‘both’. Default is ‘no’. If a timesheet is on_the_clock, it means the user is currently working (has not clocked out yet).
- jobcode_type: String
‘regular’, ‘pto’, ‘paid_break’, ‘unpaid_break’, or ‘all’. Default is ‘all’. Only timesheets linked to a jobcode of the given type are returned.
- modified_before: String
required (unless modified_since, ids, or start_date are set) Only timesheets modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- modified_since: String
required (unless modified_before, ids, or start_date are set) Only timesheets modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
Parsons Table
- get_users(ids=None, not_ids=None, employee_numbers=None, usernames=None, group_ids=None, not_group_ids=None, payroll_ids=None, active=None, first_name=None, last_name=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /users endpoint of the QuickBooksTime Time API.
- Args:
- ids: Int
Comma separated list of one or more user ids you’d like to filter on.
- not_ids: Int
Comma separated list of one or more user ids you’d like to filter on. Specifically, the user ids you’d like to exclude.
- employee_numbers: Int
Comma separated list of one or more employee numbers you’d like to filter on.
- usernames: Str
Comma separated list of one or more usernames you’d like to filter on.
- group_ids: Int
Comma separated list of one or more group ids you’d like to filter on.
- not_group_ids: Int
Comma separated list of one or more group ids you’d like to filter on. Specifically, the group ids you’d like to exclude.
- payroll_ids: String
A comma-separated string of payroll ids. Only users with these payroll ids will be returned.
- active: String
‘yes’, ‘no’, or ‘both’. Default is ‘yes’.
- first_name: String
will be interpreted as a wild card.
Starts matching from the beginning of the string.
- last_name: String
will be interpreted as a wild card.
Starts matching from the beginning of the string.
- modified_before: String
Only users modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- modified_since: String
Only users modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
Parsons Table See Parsons Table for output options.
- get_schedule_calendars_list(ids=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /schedule_calendars endpoint of the QuickBooksTime Time API.
- Args:
- ids: Int
Comma separated list of one or more schedule calendar ids you’d like to filter on. Only schedule calendars with an id set to one of these values will be returned.
- modified_before: String
Only schedule calendars modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- modified_since: String
required (unless ids, modified_before, or start are set) Only schedule calendars modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
List of integers of schedules calendar ids. Needed for calling the /schedule_events endpoint
- get_schedule_events(ids=None, users_ids=None, schedule_calendar_ids=None, jobcode_ids=None, start='1970-01-01T00:00:00+00:00', end=None, active_users=None, active=None, draft=None, team_events=None, modified_before=None, modified_since=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /schedule_events endpoint of the QuickBooksTime Time API.
- Args:
- ids: Int
required (unless modified_before, modified_since, or start are set) Comma separated list of one or more schedule event ids you’d like to filter on. Only schedule events with an id set to one of these values will be returned.
- users_ids: Int
Comma-separated list of one or more user ids to retrieve schedule events for.
- schedule_calendar_ids: Int
Required. Comma separated list of one or more schedule calendar ids you’d like to filter on. Only schedule events with a schedule calendar id set to one of these values will be returned.
- jobcode_ids: Int
A comma-separated string of jobcode ids. Only schedule events with these jobcodes will be returned.
- start: String
required (unless ids, modified_before, or modified_since are set) Only schedule events starting on or after this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- end: String
Only schedule events ending on or before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- active: String
‘yes’, ‘no’ or ‘both’. Default is ‘both’. Only schedule events whose active state match the requested filter will be returned.
- active_users: Int
‘0’, ‘-1’ or ‘1’ . Default is ‘1’. Only schedule events whose users are active will be returned by default. 0 will return events for inactive users. -1 will return events for active and inactive users.
- draft: String
‘yes’, ‘no’ or ‘both’. Default is ‘no’. Only schedule events whose draft state match the requested filter will be returned.
- team_events: String
‘base’ or ‘instance’. Default is ‘instance’. If ‘instance’ is specified, events that are assigned to multiple users will be returned as individual single events for each assigned user. If ‘base’ is specified, events that are assigned to multiple users will be returned as one combined event for all assignees.
- modified_before: String
required (unless ids, modified_since, or start are set) Only schedule events modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- modified_since: String
required (unless ids, modified_before, or start are set) Only schedule events modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm).
- supplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
Parsons Table See Parsons Table for output options.
- get_geolocations(ids=None, modified_before=None, modified_since=None, user_ids=None, group_ids=None, supplemental_data=None, limit=None, page=1)[source]
This function allows you to call the /geolocations endpoint of the QuickBooksTime Time API.
- Args:
- ids: Int
Comma separated list of one or more geolocation ids you’d like to filter on. Only geolocations with an id set to one of these values will be returned. Required (unless modified_before, modified_since is set)
- modified_before: String
Only geolocations modified before this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm). Required (unless ids or modified_since is set)
- modified_since: String
Only geolocations modified since this date/time will be returned, in ISO 8601 format (YYYY-MM-DDThh:mm:ss±hh:mm). Required (unless ids or modified_before is set)
- user_ids: Int
Comma separated list of one or more user ids you’d like to filter on. Only geolocations with a user id set to one of these values will be returned.
- group_ids: Int
Comma separated list of one or more group ids you’d like to filter on. Only geolocations with a group id set to one of these values will be returned.
- suplemental_data: String
‘yes’ or ‘no’. Default is ‘yes’. Indicates whether supplemental data should be returned.
- limit: Int
Represents how many results you’d like to retrieve per request (page). Default is 200. Max is 200.
- page: Int
Represents the page of results you’d like to retrieve. Default is 1.
- Returns:
Parsons Table See Parsons Table for output options.