From 116818d9fe0f041cc195de9e08ad0c795d3740d9 Mon Sep 17 00:00:00 2001 From: sethua1 Date: Mon, 12 Aug 2024 08:45:42 -0700 Subject: [PATCH] Update time.md & remove timeentry.md as moving towards V3 time activity. --- docs/schema-entities/timeentry.md | 664 ------------------------------ docs/use-cases/time.md | 183 ++++++-- 2 files changed, 147 insertions(+), 700 deletions(-) delete mode 100644 docs/schema-entities/timeentry.md diff --git a/docs/schema-entities/timeentry.md b/docs/schema-entities/timeentry.md deleted file mode 100644 index e686f8b..0000000 --- a/docs/schema-entities/timeentry.md +++ /dev/null @@ -1,664 +0,0 @@ ---- -layout: default -title: Time Entry -nav_order: 1 -parent: Schema Entities ---- - -## Time Entry - -The APIs related to the Time Entry allow you to track & manage time entries for Employee/Vendor Contractor(1099) against the customer/project. -The Time Entry API supports create, read, update and delete operations. - -### Operations for Time Entry - -- [Read](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#query-time-entry) - Query (POST) -- [Create](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) - Mutation (POST) -- [Update](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#update-time-entry) - Mutation (POST) -- [Delete](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#delete-time-entry) - Mutation (POST) - -### Endpoint - -- For production apps: https://qb.api.intuit.com/graphql - -### Time Entry Fields - -| Field | Type | Required | Description | -|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------| -| startDate | Date! | yes | The date on which this time entry begin. | -| duration | Int! | yes | The number of seconds recorded by this time entry. | -| timeFor | [TimeTracking_TrackTimeForInput](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#timetracking_tracktimeforinput)! | yes | The ID and type whose time is recorded for on this time entry. | -| timeAgainst | [TimeTracking_TrackTimeAgainstInput](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#timetracking_tracktimeagainstinput) | no | The ID and type of entity that this time entry is tracking time against. | -| notes | String | no | Notes associated with this time entry (2048 character limit). | -| classId | ID | no | The ID of the class that this time entry is tracking time against. | -| employeeCompensationId | ID | no | The ID of the Payroll_EmployeeCompensation that this time entry is tracking time against. | -| serviceItemId | ID | no | The ID of the Service Item(Product/Services) that applies to this time entry. | -| billable | Boolean | no | Whether the time is billable. | - -### Input Variables: - -### TimeTracking_TrackTimeForInput - -``` -""" -Input arguments whose time is being tracked -""" -input TimeTracking_TrackTimeForInput { - """ - The ID of the entity - """ - id: ID! - - """ - The entity type that is being tracked. If not set defaults to Employee - """ - entityType: TimeTracking_TimeTrackForType! = EMPLOYEE -} -``` - -### TimeTracking_TimeTrackForType - -``` -""" -Indicates the type for which time is being tracked -NOTE: This list may be extended in the future and is used as input only. -""" -enum TimeTracking_TimeTrackForType { - """ - The ID references an WorkerManagement_Employee - """ - EMPLOYEE - - """ - The ID references a Commerce_Vendor - """ - VENDOR -} -``` - -### TimeTracking_TrackTimeAgainstInput -``` -""" -Input arguments for the entity that is being tracked against -""" -input TimeTracking_TrackTimeAgainstInput { - """ - The ID of the entity (e.g. customer, project) - """ - id: ID! - - """ - The entity type that is being tracked against - """ - entityType: TimeTracking_TrackTimeAgainstType! -} -``` - -### TimeTracking_TrackTimeAgainstType -``` -""" -Indicates the type of the entity being tracked against. (`[CUSTOMER, PROJECT]`). -""" -enum TimeTracking_TrackTimeAgainstType { - """ - The ID references a Customer - """ - CUSTOMER - - """ - The ID references a Project - """ - PROJECT -} -``` - -### Query Time Entry - -Read Time Entries: -``` -query readMinimalTimeSheet ( - $after: String, - $first: Int, - $filter: TimeTracking_TimeEntryInputFilter, - $orderBy: [TimeTracking_TimeEntryOrderBy] -) { - timeTrackingTimeEntries( - after: $after, - first: $first, - filter: $filter, - orderBy: $orderBy - ) - { - edges { - node { - id - duration - entryMethod - startDate - entryMethod - startTime - endTime - duration - notes - employeeCompensation { - id - } - billable - } - } - pageInfo { - hasNextPage - hasPreviousPage - startCursor - endCursor - } - } -} -``` - -Variables: - -``` -{ -"after":null, -"first":1, - "filter": { - "ids":[119043230] - }, - "orderBy": ["START_ASC"] - } - -``` - -Response: -``` -{ - "data": { - "timeTrackingTimeEntries": { - "edges": [ - { - "node": { - "id": "119043230", - "duration": 28800, - "entryMethod": "DURATION", - "startDate": "2024-07-22", - "startTime": null, - "endTime": null, - "notes": "", - "employeeCompensation": { - "id": "623972114" - }, - "billable": true - } - } - ], - "pageInfo": { - "hasNextPage": false, - "hasPreviousPage": false, - "startCursor": "djI6OjE6OjE6OnsiaWRzIjpbIjExOTA0MzIzMCJdfTo6W1sic3RhcnQiLCJBU0MiXSxbInN0YXJ0IiwiREVTQyJdLFsiZW5kIiwiQVNDIl0sWyJlbmQiLCJERVNDIl0sWyJkdXJhdGlvbiIsIkFTQyJdLFsiZHVyYXRpb24iLCJERVNDIl1d", - "endCursor": "djI6OjE6OjE6OnsiaWRzIjpbIjExOTA0MzIzMCJdfTo6W1sic3RhcnQiLCJBU0MiXSxbInN0YXJ0IiwiREVTQyJdLFsiZW5kIiwiQVNDIl0sWyJlbmQiLCJERVNDIl0sWyJkdXJhdGlvbiIsIkFTQyJdLFsiZHVyYXRpb24iLCJERVNDIl1d" - } - } - } -} -``` - -### Filter support: - -### TimeTracking_TimeEntryInputFilter - -``` -""" -Input filter arguments for a timeTrackingTimeEntries query -""" -input TimeTracking_TimeEntryInputFilter { - """ - A list of time entry IDs to filter by. Example: "ids": [123, 456, 789] - """ - ids: [ID!] - - """ - The time against entities to filter by - """ - timeAgainst: TimeTracking_TimeAgainstFilter - - """ - Specify whether to limit your query on time entries with a date falling in a date range - """ - dateRange: TimeTracking_DatePeriod -} -``` - -### TimeTracking_TimeAgainstFilter -``` -""" -Input filter arguments for the timeTrackingTimeEntries query to filter by the time against entities -""" -input TimeTracking_TimeAgainstFilter { - """ - A list of project IDs to filter by. Example: "ids": [123, 456, 789] - """ - projectIds: [ID!] - - """ - A list of customer IDs to filter by. Example: "ids": [123, 456, 789] - """ - customerIds: [ID!] -} - -``` - -### TimeTracking_DatePeriod - -``` -""" -Period of time represented by two dates (e.g. 2015-03-05 through 2015-03-11) -""" -input TimeTracking_DatePeriod { - beginDate: Date! - endDate: Date! -} -``` - -### Sample Filter -``` -{ -"after":null, -"first":1, - "filter": { - "dateRange": {"beginDate": "2024-06-01", "endDate": "2024-06-30" - } - }, - "orderBy": ["START_ASC"] - } -``` - -### TimeTracking_TimeEntryOrderBy - -``` - -""" -Indicates the order of the timeTrackingTimeEntries query results -""" -enum TimeTracking_TimeEntryOrderBy { - """ - Order query results by the start date/time of the time entry in ascending fashion - """ - START_ASC - - """ - Order query results by the start date/time of the time entry in descending fashion - """ - START_DESC - - """ - Order query results by the end date/time of the time entry in ascending fashion - """ - END_ASC - - """ - Order query results by the end date/time of the time entry in descending fashion - """ - END_DESC - - """ - Order query results by the time entry duration in ascending fashion - """ - DURATION_ASC - - """ - Order query results by the time entry duration in descending fashion - """ - DURATION_DESC -} - -``` - -### Create Time Entry - -Mutation: - -``` -mutation createTimeEntryByDuration ($input: TimeTracking_CreateTimeEntryByDurationInput!) { - timeTrackingCreateTimeEntryByDuration(input: $input) { - ... on TimeTracking_CreateTimeEntryByDurationPayload { - successCode - timeEntry { - id - meta { - updatedAt - } - timeFor { - ... on WorkerManagement_Employee { - id - } - } - entryMethod - startDate - startTime - endTime - notes - serviceItem { - id - } - employeeCompensation { - id - } - billable - } - } - ... on TimeTracking_CreateTimeEntryByDurationError { - errorCode - } - } -} -``` - -Required fields: - -- startDate - The date on which this time entry begins. -- duration - The number of seconds recorded by this time entry -- timeFor - The ID and type whose time is recorded for on this time entry [EMPLOYEE, VENDOR] - -### TimeTracking_CreateTimeEntryByDurationInput - -``` -""" -Input arguments for creating a duration based time entry -""" -input TimeTracking_CreateTimeEntryByDurationInput { - """ - The date on which this time entry begins - """ - startDate: Date! - - """ - The number of seconds recorded by this time entry - """ - duration: Int! - - """ - The ID and type whose time is recorded for on this time entry - """ - timeFor: TimeTracking_TrackTimeForInput! - - """ - The ID and type of entity that this time entry is tracking time against. - """ - timeAgainst: TimeTracking_TrackTimeAgainstInput - - """ - Notes associated with this time entry (2048 character limit) - """ - notes: String - - """ - The ID of the AppFoundations_CustomDimensionValue that this time entry is tracking time against. - """ - classId: ID - - """ - The ID of the Payroll_EmployeeCompensation that this time entry is tracking time against. - """ - employeeCompensationId: ID - - """ - The ID of the Service Item Commerce_ProductVariant that applies to this time entry - """ - serviceItemId: ID - - """ - Whether the time is billable - """ - billable: Boolean -} - -``` - -Sample Variables: -``` - { - "input": { - "timeFor": { "id": 4, - "entityType": "EMPLOYEE" - } , - "startDate": "2024-07-29", - "duration": 28800, - "timeAgainst": { - "id": 411939876, - "entityType": "PROJECT" - }, - "employeeCompensationId": 623972114, - "serviceItemId": 1, - "billable": true, - "notes": "test note vendor timeentry with project" - } - } - -``` - -Sample response: -``` -{ - "data": { - "timeTrackingCreateTimeEntryByDuration": { - "successCode": "SUCCESS", - "timeEntry": { - "id": "122533318", - "meta": { - "updatedAt": "2024-07-29T21:42:25.000Z" - }, - "timeFor": { - "id": "4" - }, - "entryMethod": "DURATION", - "startDate": "2024-07-29", - "startTime": null, - "endTime": null, - "notes": "test note vendor timeentry with project", - "serviceItem": { - "id": "1" - }, - "employeeCompensation": { - "id": "623972114" - }, - "billable": true - } - } - } -} - -``` - -### Update Time Entry - -Mutation: - -``` -mutation updateTimesheetByDuration ($input: TimeTracking_UpdateTimeEntryByDurationInput!) { - timeTrackingUpdateTimeEntryByDuration (input: $input) { - ... on TimeTracking_UpdateTimeEntryByDurationPayload { - successCode - timeEntry { - id - startDate - duration - billable - serviceItem { - id - } - classValue { - id - } - employeeCompensation { - id - } - } - } - ... on TimeTracking_UpdateTimeEntryByDurationError { - errorCode - } - } - } - -``` -Required field: - -- id: ID of an time entry - -Variables: -``` - { - "input": { - "id": 122533318, - "duration": 28800, - "serviceItemId": 1, - "employeeCompensationId": 623972114, - "timeAgainst": { - "id": 411939876, - "entityType": "PROJECT" - } , - "billable": true, - "notes": "update notes as time with employeeCompensation for employee" - } -} - - -``` - -Response: -``` -{ - "data": { - "timeTrackingUpdateTimeEntryByDuration": { - "successCode": "SUCCESS", - "timeEntry": { - "id": "122533318", - "startDate": "2024-07-29", - "duration": 28800, - "billable": true, - "serviceItem": { - "id": "1" - }, - "classValue": null, - "employeeCompensation": { - "id": "623972114" - } - } - } - } -} -``` - -### TimeTracking_UpdateTimeEntryByDurationInput - -``` -""" -Input arguments for updating a duration based time entry -""" -input TimeTracking_UpdateTimeEntryByDurationInput { - """ - The ID of the time entry to be updated. - """ - id: ID! - - """ - The date on which this time entry begins - """ - startDate: Date - - """ - The total number of seconds to record for this time entry - """ - duration: Int - - """ - The ID and type of entity that this time entry is tracking time against. - """ - timeAgainst: TimeTracking_TrackTimeAgainstInput - - """ - Notes associated with this time entry (2048 character limit) - """ - notes: String - - """ - The ID of the AppFoundations_CustomDimensionValue that this time entry is tracking time against. - """ - classId: ID - - """ - The ID of the Payroll_EmployeeCompensation that this time entry is tracking time against. - """ - employeeCompensationId: ID - - """ - The ID of the Service Item Commerce_ProductVariant that applies to this time entry - """ - serviceItemId: ID - - """ - Whether the time is billable - """ - billable: Boolean -} -``` -### Delete Time Entry - -Mutation: - -``` -mutation timeTrackingDeleteTimesheet($input: TimeTracking_DeleteTimeEntryInput!) { - timeTrackingDeleteTimeEntry (input: $input) { - ...on TimeTracking_DeleteTimeEntryPayload { - successCode - deletedTimeEntryId - } - ... on TimeTracking_DeleteTimeEntryError { - errorCode - } - } - } - -``` -Required field: - -- id: ID of an time entry - -Variables: -``` -{ - "input": { - "id": 119043230 - } -} -``` - -Response: -``` -{ - "data": { - "timeTrackingDeleteTimeEntry": { - "successCode": "SUCCESS", - "deletedTimeEntryId": "119043230" - } - } - } -} -``` - -### TimeTracking_DeleteTimeEntryInput - -``` -""" -Input arguments for deleting a time entry -""" -input TimeTracking_DeleteTimeEntryInput { -input TimeTracking_DeleteTimeEntryInput { - """ - The ID of the time entry to be deleted. - """ - id: ID! -} - -``` \ No newline at end of file diff --git a/docs/use-cases/time.md b/docs/use-cases/time.md index abbbdfd..7dca294 100644 --- a/docs/use-cases/time.md +++ b/docs/use-cases/time.md @@ -22,23 +22,21 @@ This page outlines - ![](/intuit-api/assets/images/Time.png) -### Operations for Time Entry +### Operations for Time Activity -- [Read](../../schema-entities/timeentry/#query-time-entry) - Query (POST) -- [Create](../../schema-entities/timeentry/#create-time-entry) - Mutation (POST) -- [Update](../../schema-entities/timeentry/#update-time-entry) - Mutation (POST) -- [Delete](../../schema-entities/timeentry/#delete-time-entry) - Mutation (POST) +- [Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#query-a-timeactivity-object) +- [Create](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) +- [Update](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#full-update-a-timeactivity-object) +- [Delete](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#delete-a-timeactivity-object) -### API schema for Time entity +### API schema for Time Activity -- [Time API schema](../../schema-entities/timeentry/) +- [Time Activity Object](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#the-timeactivity-object) ### Scopes - payroll.compensation.read : Allows access to read Pay types (i.e. compensation) [Compensation data can only be queried for customers using QuickBooks Payroll] - project-management.project : Allows access to read and write projects data -- time-tracking.time-entry : Allows access to read and write timesheet data -- time-tracking.time-entry.read : Allows access to read timesheet data - com.intuit.quickbooks.accounting: For V3 Accounting REST API access [For Read only use cases] @@ -71,62 +69,175 @@ Sample name value pair response for reference: } ``` -### Use Case 1: Create Timesheet with paytype and link it to a Project +### Use Case 1: Create Time Activity with pay type and link it to a Project This use case is applicable for the customers who are enrolled to **QuickBooks Payroll** and have the **Projects enabled** in QuickBooks Online. -##### Use [Create Time Entry(Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) GraphQL API to create time entry by +##### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by -- Fetch `employee->id` from [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `timeFor -> { id, entityType:"EMPLOYEE""}` time entry object. -- Use the above `employee->id` to fetch required `compensation ->id` from [Read EmployeeCompensation(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/employeeCompensation/#sample-query-body) GraphQL API & set it in `employeeCompensationId` in time entry object. -- Fetch `project -> Id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL API to read `project -> id` & set it in `timeAgainst->{id, entityType:"PROJECT""}` time entry object. -- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in `serviceItemId` time entry object +- Fetching `employee->Id` by calling [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `EmployeeRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` field as `Employee`. +- Filter by the `employee->Id` from above step to fetch the list of employee compensation Ids `compensation ->id` from [Read EmployeeCompensation(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/employeeCompensation/#sample-query-body) GraphQL Query + & set it in `PayrollItemRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `project -> id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL Query to read `project -> id` & set it in `ProjectRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `Customer -> id` from [V3 Accounting Customer Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#query-a-customer) (optional) & set it in `CustomerRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. -### Use Case 2: Create Time entry with paytype +##### Sample request payload: + +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Employee", + "EmployeeRef": { "value": "1" }, + "PayrollItemRef": { + "value": "626270109" + }, + "CustomerRef": { + "value": "2" + }, + "ProjectRef": { + "value":"416296152" + }, + "ItemRef": { "value": "1" }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:DailyWork" + } + +``` + +### Use Case 2: Create Time Activity with pay type This use case is applicable for the customers who are enrolled to **QuickBooks Payroll** and **do not** have the **Projects** enabled in QuickBooks Online. -##### Use [Create Time Entry(Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) GraphQL API to create time entry by +##### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by + +- Fetch `employee->id` from [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `EmployeeRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` field as `Employee`. +- Fetching `compensation ->id` from [Read EmployeeCompensation(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/employeeCompensation/#sample-query-body) GraphQL API & set it in `PayrollItemRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. + +##### Sample request payload: -- Fetch `employee->id` from [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `timeFor -> { id, entityType:"EMPLOYEE""}` time entry object. -- Fetching `compensation ->id` from [Read EmployeeCompensation(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/employeeCompensation/#sample-query-body) GraphQL API & set it in `employeeCompensationId` in time entry object. +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Employee", + "EmployeeRef": { "value": "1" }, + "PayrollItemRef": { + "value": "626270109" + }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:TimeOff" + } +``` -### Use Case 3: Create Time Entry and link to projects +### Use Case 3: Create Time Activity and link to projects This use case is applicable for the customers who are **not** enrolled to **QuickBooks Payroll** and have the **Projects enabled** in QuickBooks Online. -##### Use [Create Time Entry(Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) GraphQL API to create time entry by +##### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by + +- Fetch `employee->Id` by calling [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `EmployeeRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` field as `Employee`. +- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in `ItemRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `project -> Id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL API to read `project -> id` & set it in `ProjectRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `Customer -> id` from [V3 Accounting Customer Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#query-a-customer) (optional) & set it in `CustomerRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. + +##### Sample request payload: -- Fetching required `employee->id` from [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `timeFor -> { id, entityType:"EMPLOYEE""}` time entry object. -- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in `serviceItemId` time entry object. -- Fetch `project -> Id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL API to read `project -> id` & set it in `timeAgainst->{id, entityType:"PROJECT""}` time entry object. +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Employee", + "EmployeeRef": { "value": "1" }, + "ItemRef": { "value": "1" }, + "CustomerRef": { + "value": "2" + }, + "ProjectRef": { + "value":"416296152" + }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:DailyWork" + } + +``` ### Use Case 4: Create Time Entry for employee This use case is applicable for the customers who are **not** enrolled to **QuickBooks Payroll** and do **not** have the **Projects enabled** in QuickBooks Online. -#### Use [Create Time Entry(Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) by +#### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by -- Fetch `employee->id` from [V3 Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set `timeFor -> { id, entityType:"EMPLOYEE""}` time entry object -- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item)& set it in `serviceItemId` time entry object +- Read `employee->Id` by calling [V3 Accounting Employee Query](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/employee#query-an-employee) & set it in `EmployeeRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` as `Employee`. +- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in `ItemRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +##### Sample request payload: -### Use Case 5: Create Time Entry for contractor +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Employee", + "EmployeeRef": { "value": "1" }, + "ItemRef": { "value": "1" }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:DailyWork" + } + +``` + +### Use Case 5: Create Time Activity for contractor This use case is applicable to track time for contractors and for the customers who do **not** have the **Projects enabled** in QuickBooks Online. -#### Use [Create Time Entry (Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) by -- Fetch `Vendor -> Id` from [V3 Accounting Vendor Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor#query-a-vendor) & set it in `timeFor -> { id, entityType:"VENDOR""}` time entry object. -- Fetch `Customer -> id` from [V3 Accounting Customer Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#query-a-customer) (optional) & set it in `timeAgainst ->{ id, entityType:"CUSTOMER"}` time entry object. -- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) (optional) to set `serviceItemId` time entry object. +#### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by +- Fetch `Vendor -> Id` from [V3 Accounting Vendor Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor#query-a-vendor) & set it in `VendorRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` as `Vendor`. +- Fetch `Item->id` from [V3 Accounting Query Item API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item) & set it in `ItemRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. + +##### Sample request payload: + +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Vendor", + "VendorRef": { "value": "5" }, + "ItemRef": { "value": "1" }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:DailyWork" + } -### Use Case 6: Create Time Entry for contractor and link it to projects +``` + +### Use Case 6: Create Time Activity for contractor and link it to projects This use case is applicable to track time for **contractors** and for customers who have the **Projects enabled** in QuickBooks Online. -#### Use [Create Time Entry (Mutation)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/timeentry/#create-time-entry) by +#### Use [V3 Create TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#create-a-timeactivity-object) API to create time activity by + +- Fetch `Vendor -> Id` from [V3 Accounting Vendor Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor#query-a-vendor) & set it in `VendorRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object with `NameOf` as `Vendor`. +- Fetch `project -> Id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL API to read `project -> id` & set it in `ProjectRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. +- Fetch `Customer -> id` from [V3 Accounting Customer Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#query-a-customer) (optional) & set it in `CustomerRef` in the [TimeActivity](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity) object. -- Fetch `Vendor -> Id` from [V3 Accounting Vendor Query API](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/vendor#query-a-vendor) & set it in `timeFor -> { id, entityType:"VENDOR""}` time entry object. -- Fetch `project -> Id` from [Read Project(Query)](https://intuitdeveloper.github.io/intuit-api/docs/schema-entities/project/#read-project) GraphQL API to read `project -> id` & set it in `timeAgainst->{id, entityType:"PROJECT""}` time entry object. +##### Sample request payload: +``` + { + "TxnDate": "2024-08-01T12:00:00Z", + "NameOf": "Vendor", + "VendorRef": { "value": "5" }, + "CustomerRef": { + "value": "2" + }, + "ProjectRef": { + "value":"416296152" + }, + "ItemRef": { "value": "1" }, + "Hours": 8, + "Minutes": 0, + "Description": "Construction:DailyWork" + } + +``` ### Appendix