In this article we are going to take a closer look at the Report/PayrollCategorySummary endpoint. This endpoint returns a Payroll Category Summary report.
To generate the report, we can use the HTTP method GET from the endpoint Report/PayrollCategorySummary. Please note, we must also pass the following parameters;
- StartDate is the date that we would like to start at.
- EndDate is the date of the end of the period.
- ReportingBasis will either be Cash or Accrual.
- YearEndAdjust stats if we are including Year end Adjustments. This is a true or false value.
Example request:
https://arl2.api.myob.com/accountright/0c7fc03e-e474-42dc-9a46-2fa91694d984/Report/PayrollCategorySummary?StartDate=2021-04-01&EndDate=2021-04-30&ReportingBasis=Accrual&YearEndAdjust=true
Example response:
{
"StartDate" : "2018-07-01T00:00:00",
"EndDate" : "2018-09-30T23:59:59",
PayrollCategoryBreakdown" : [
{
"Amount" : 18653.86,
"Hours" : 0,
"PayrollCategory" : {
"UID" : "fa19205d-bf4c-415a-8458-043c072bf1df",
"Name" : "Base Salary",
"Type" : "Wage",
"URI" : "{cf_uri}/Payroll/PayrollCategory/fa19205d-bf4c-415a-8458-043c072bf1df"
}
},
{
"Amount" : 0,
"Hours" : 11.39,
"PayrollCategory" : {
"UID" : "a0156740-0d9a-4c0e-b954-2b76abce0412",
"Name" : "Sick Leave Accrual",
"Type" : "Entitlement",
"URI" : "{cf_uri}/Payroll/PayrollCategory/a0156740-0d9a-4c0e-b954-2b76abce0412"
}
}
],
"URI" : "{cf_uri}/Report/PayrollCategorySummary?StartDate=2018-07-01&EndDate=2018-09-30&ReportingBasis=Cash&YearEndAdjust=true"
}
Example error:
{
"Errors": [
{
"Name": "DatesNotFromCurrentOrPreviousPayrollYear",
"Message": "The date range is not in the current or previous payroll year",
"AdditionalDetails": "",
"ErrorCode": 60011,
"Severity": "Error",
"LearnMore": null
}
],
"Information": "Warning, error messages have not been finalised in this release and may change"
}
As the error message says, the reason for this error is the Payroll year is 2020, but we have tried to fetch data for 2021. Please note, we can only look at data from the current and previous payroll year. For more information please review articles under End of payroll year tasks.
If you have any questions, feel free to log a ticket with the Customisation & Integration Team.
Comments
0 comments
Article is closed for comments.