Posting payCategoryId to timesheets


#1

One little known feature with importing timesheets via the API is the ability to set the payCategoryId directly on the timesheets.

This is a little different to the timesheet UI in that within the timesheet UI, you can only select a WorkType and there is no access to pay categories.

So suppose I have the following timesheet request that I’m posting to /api/v2/business/{businessId}/timesheet/bulk

{
    "fromDate": "2013-06-01",
    "toDate": "2013-06-30",
    "approved": true,
    "employeeIdType": "External",
    "workTypeIdType": "Standard",
    "timesheets": {
        "1": [
            {
                "startTime": "2013-06-11T10:00:00",
                "endTime": "2013-06-11T13:00:00",
                "units": null,
                "workTypeId": null,
                "locationId": null,
                "comments": null,
                "breaks": [],
                "rate": null,
                "leaveCategoryId": null,
                "payCategoryId": 100,
                "classificationId": null
            }
        ]
    }
}

I’ve specified a payCategoryId of 100 on the timesheet in the timesheets array which means when it’s imported into the pay run, it will be allocated to the payCategory that corresponds to Id of 100.

One other note - the workTypeIdType still sets whether the payCategoryId is an external or standard Id.