Write Employee Time Activities

If you are using the contract-based REST API to integrate MYOB Acumatica with an external system, this external system can write the time spent on the tasks of projects to MYOB Acumatica. For more information about tracking time on projects, see Employee Time Billing: General Information.

Testing of the Request

Before you test the code below, you configure your client application and the MYOB Acumatica instance to be used as follows:
  1. Deploy a new MYOB Acumatica instance with the U100 dataset. For details on deploying an instance, see To Deploy an MYOB Acumatica Instance in the Installation Guide.
  2. On the Enable/Disable Features (CS100000) form, make sure the Projects Accounting and Time Management features are enabled.
  3. If you use Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection (which is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub), make sure the collection variables have the proper values.
  4. Sign in as gibbs with the 123 password to the instance in the client application by using the tenant name (which you specified when you created the instance) and the HEADOFFICE branch.

Request

You can use the following request example to track time through the contract-based REST API.

Tip:
In the request example below, <MYOB Acumatica instance URL> is the URL of the MYOB Acumatica instance (such as https://my.acumatica.com/MyInstance). You can omit the instance name in the URL (that is, you can use https://my.acumatica.com) if the instance is installed in the root of the website.
PUT / HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/TimeEntry
Accept: application/json
Content-Type: application/json

{
  "Summary" : {"value" : "Time entry summary"},
  "Date" : {"value" : "2022-08-17T05:50:43.233" },
  "Employee" : {"value" : "EP00000026" },
  "ProjectID" : {"value" : "TOMYUM1" },
  "ProjectTaskID" : {"value" : "PHASE1" },
  "CostCode" : {"value" : "00-000" },
  "EarningType" : {"value" : "RG" },
  "TimeSpent" : {"value" : "01:30" },
  "BillableTime" : {"value" : "00:30" },
}

Usage Notes

The TimeSpent, BillableTime, and BillableOvertime fields of the TimeEntry entity have the StringValue type. These fields accept values in the following format: hh:mm, where hh is the number of hours, and mm is the number of minutes.

The TimeEntryID field has the GuidValue type; however, its value is a sequentially generated string that looks like a GUID. Therefore, the global uniqueness of the values is not guaranteed.