PSA REST API Developer Reference

Timecards

Enables you to get timecard details.

Request Keys

The following keys are available to use for the timecard to payroll integration.

  1. StartDate - Start date of the date range for timecards. You must only use this key in the initial request.
  2. EndDate - End date of the date range for timecards. You must only use this key in the initial request.
  3. CorrelationIds - List of unique worker IDs in the HCM system. You must only use this key in the initial request.
  4. BatchLimit - Maximum number of resources we can send timecards for in a single response. You must only use this key in the initial request. If no value is specified in the request, the default BatchLimit value of 120 applies.
  5. TimecardTransmissionId - Salesforce ID of the Timecard Transmission object. This parameter is optional. If it is not included in a request, the request will be treated as an initial request.
You must use the date format YYYY-MM-DD, such as 2018-04-24.

Response Keys

The following keys are used in the response.
  1. NextPageRequest - Used to get the next chunk of timecard details for a transmission.
  2. TimecardTransmissionId - Salesforce ID of the Timecard Transmission object. If this key exists in the POST response, a further request is required to get the timecards for another resource. If this key is not present in the POST response, no further request is needed.
  3. Timecards - The list of returned timecards that fall within the specified date range.
  4. CorrelationId - Unique worker ID from the HCM system.
  5. EarningsCode - Name of the earnings code, for example, VAC.
  6. TimeEntryDetails - The list of all timecard dates with values for a given date range, grouped by project.
  7. TimeEntryDate - Timecard date, using ISO-8601 format YYYY-MM-DD.
  8. Hours - Number of approved hours in the timecard date in Number(2, 2) format.
  9. Message - The message returned when an error occurs in a processing request.

POST

URI /services/apexrest/pse/v1.0/timecards/*
Description Gets the timecard details.

Sample Code


//POST Request 1
[{
    "StartDate": "2018-03-30",
    "EndDate": "2018-04-03",
    "BatchLimit":"3",
    "CorrelationIds" : ["111991", "111992", "111993", "111994", "111995"]
}]

//POST Response 1
HTTP/1.1 200 OK

[{
    "NextPageRequest": {
        "TimecardTransmissionId": "005f4000000YHKJ"
    },
    "Timecards": [{
        "CorrelationId": "111991",
        "EarningsCode": "REG",
        "TimeEntryDetails": [{
            "TimeEntryDate": "2018-03-30",
            "Hours": "8.00"
        }]
    }, {
        "CorrelationId": "111992",
        "EarningsCode": "REG",
        "TimeEntryDetails": [{
            "TimeEntryDate": "2018-04-02",
            "Hours": "7.00"
        }, {
            "TimeEntryDate": "2018-04-03",
            "Hours": "6.43"
        }]
    }, {
        "CorrelationId": "111993",
        "EarningsCode": "REG",
        "TimeEntryDetails": [{
            "TimeEntryDate": "2018-04-03",
            "Hours": "8.00"
        }]
    }]
}]

//POST Request 2
[{
    "TimecardTransmissionId": "005f4000000YHKJ"
}]

//POST Response 2
HTTP/1.1 200 OK

[{
    "NextPageRequest": {},
    "Timecards": [{
        "CorrelationId": "111994",
        "EarningsCode": "REG",
        "TimeEntryDetails": [{
            "TimeEntryDate": "2018-03-30",
            "Hours": "8.00"
        }]
    }, {
        "CorrelationId": "111995",
        "EarningsCode": "REG",
        "TimeEntryDetails": [{
            "TimeEntryDate": "2018-04-02",
            "Hours": "7.00"
        }, {
            "TimeEntryDate": "2018-04-03",
            "Hours": "6.43"
        }]
    }]
}]

//POST Request 3
[{
    "StartDate": "2018-03-30",
    "EndDate": "2018-04-03",
    "BatchLimit":"4",
    "CorrelationIds" : [""]
}]

//POST Response 3
HTTP/1.1 400 Bad Request

{
    "Message": "The CorrelationIds key must contain a value."
}
© Copyright 2009–2019 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.