Table of contents

    Overview

    Timesheets can be used to track shifts, allowances and cost allocations. To call this endpoint, use one of the URLs from the following table:

    URL GET PUT POST DELETE
    https://api.mypcorp.com/timesheet
    https://api.mypcorp.com/timesheet/{TimesheetGuid}

    Get

    The following table illustrates which fields can be included when receiving a GET response.

    NB: Nested properties are hidden by default. To expand all nested properties, add a query parameter $expand=* to the URL.

    NB: Here is an example query for filtering by nested list of objects: $filter=Allowances/any(x: x/ApprovalStatus/Status eq ‘Approved’)

    Timesheet
    Field Description
    TimesheetGuid
    Guid (Identifier)
    Timesheet id.
    StartDateTime
    datetime
    Start date time of timesheet.
    EndDateTime
    string
    End date time of timesheet.
    Staff
    object
    The staff member associated to this timesheet.
    Shift
    object
    The shift that is associated with this timesheet.
    ApprovalStatus
    object
    The approval status of this timesheet.
    Allowances
    object
    List of allowances associated to this timesheet.
    CostAllocations
    object
    List of cost allocations associated to this timesheet.
    Shift
    Field Description
    StartDate
    datetime
    Start date of shift.
    EndDate
    datetime
    End date of shift.
    CostCentre
    string
    Cost centre code.
    ApprovalStatus
    Field Description
    Status
    string
    The approval status.
    ApproveDate
    datetime
    When the approval status was modified.
    ApprovedByStaffGuid
    Guid
    Id of the staff member who changed the approval status.
    Allowance
    Field Description
    AllowanceGuid
    Guid (Identifier)
    Id of the allowance.
    Amount
    decimal
    The allowance amount.
    Category
    string
    The allowance category.
    Code
    string
    Unique code that identifies allowance.
    ApprovalStatus
    object
    The approval status of this allowance.
    CostAllocation
    Field Description
    CostAllocationGuid
    Guid (Identifier)
    Id of the cost allocation.
    StartDate
    datetime
    Start date of cost allocation.
    EndDate
    datetime
    End date of cost allocation.
    Hours
    double
    How many hours have been assigned.
    Multiplier
    double
    A multiplier to be applied.
    PayRatePerHour
    decimal
    Hourly rate.
    PayRateCode
    string
    Unique code for the hourly rate or multiplier.
    CostCentre
    string
    Name of the cost centre.
    CostCentreCode
    string
    Unique code for the cost centre.

    Example JSON response format:

    {
      "@odata.context": "https://api.mypcorp.com/$metadata#Timesheet(Allowances(),CostAllocations())",
      "value": [
        {
          "TimesheetGuid": "2786d8a4-5380-4309-bb7d-57bc8a29d63e",
          "StartDateTime": "2021-02-04T02:00:00+10:00",
          "EndDateTime": "2021-02-04T03:00:00+10:00",
          "Staff": {
            "StaffGuid": "03f27516-04b2-eb11-b82b-08626626e1a4",
            "FirstName": "Bruce",
            "LastName": "Wayne",
            "UniqueCode": "AC65512345",
            "ArchiveDate": null
          },
          "Shift": {
            "StartDate": "2021-02-04T02:00:00+10:00",
            "EndDate": "2021-02-04T03:00:00+10:00",
            "CostCentre": "QLD"
          },
          "ApprovalStatus": {
            "Status": "Approved",
            "ApproveDate": "2021-02-04T11:31:05.083+10:00",
            "ApprovedByStaffGuid": "ed18d2d8-99c4-4fcc-835a-fe35d4ae5320"
          },
          "Allowances": [
            {
              "AllowanceGuid": "e1fe23db-704b-4e7b-828c-d6c5e36dc7a6",
              "Amount": 2.3500,
              "Category": "First Aid Allowance",
              "Code": "ABC 123",
              "ApprovalStatus": {
                "Status": "Approved",
                "ApproveDate": "2021-02-04T11:31:00.000+10:00",
                "ApprovedByStaffGuid": "ed18d2d8-99c4-4fcc-835a-fe35d4ae5320"
              }
            }
          ],
          "CostAllocations": [
            {
              "CostAllocationGuid": "d8b50783-75cc-46ae-b07c-58ac7dab8fbf",
              "StartDate": "2021-02-04T02:00:00+10:00",
              "EndDate": "2021-02-04T03:00:00+10:00",
              "Hours": 4.5,
              "Multiplier": 2.5,
              "PayRatePerHour": 40.5,
              "PayRateCode": "ABC 1.3",
              "CostCentre": "QLD",
              "CostCentreCode": "QLD"
            }
          ]
        }
      ]
    }

    Previous article Next article