Error Responses
Example of a Standard Validation\Logic Error Message
The following is an example of a response from the Payroll API reflecting a validation or logic error. The response will be a BadRequest: HttpCode 400 (unless there is a Conflict: HttpCode 409). The response includes a list of apiErrors (although usually only one apiError is returned). Each apiError includes an error code along with an errorHint. The errorHint describes the issue in a straightforward language.
Suggested error message to display to the User
Your request has failed. The Bright system has returned the error message: The user account you are connecting with does not have access to the Employer.
Example of an Unrecoverable Error Message
If the Payroll API has an unrecoverable\exception error then it will return a message as below. This response will be a BadRequest (HttpCode 400). Note the errorId value can help the support team to determine the issue and so should be displayed to the user.
Suggested error message to display to the User
Your request has failed. The Bright system has returned the error message(s)
An error has occurred. Please try again later. If the issue persists please contact support with your Error Id. Error id: 83ce3515-f1b2-48f0-95de-6d0d325efc12
End Of Financial Year
Therefore, around the turn of the financial year the Payroll API may try to perform an action on both financial years, possibly leading to two error messages.
End Of Financial Year: Errors Retrieving Data
For this reason when trying to retrieve data via the Payroll API (around the change of the financial year) the Payroll API will attempt to contact the BrightPay application for the previous and next financial year. As long as the Payroll API gets data from one BrightPay application it will return a success message. If requests to both applications fail then the API will likely return multiple apiErrors (one for each year).
Suggested error message to display to the User
Your request has failed. The Bright system has returned the error message(s)
Financial year 24/25: The user account you are connecting with does not have access to the Employer.
Financial year 25/26: The user account you are connecting with does not have access to the Employer.
End Of Financial Year: Errors Uploading Data
When uploading data there is more chance of validation issues (in both years) as the logic and validation is more complex. An example error message is shown below:
Suggested error message to display to the User
If displaying an error message to the User it is best to display the year and error hint.
Your request has failed. The Bright system has returned the error message(s)
Financial year 24/25: The request to create hourly payments likely has an error. There is no pay period or payslip available for the dates supplied please check the request is passing correct values.
Financial year 25/26: The payslip connected to the dates you have supplied is not the current payslip, only the current open payslip can have payments added to it. Please fix the issues in BrightPay (such as finalising the previous payslip) or adjust the data you are submitting. Note the earliest date supplied in the request was 22/04/24 which identified a payslip with dates between 21/04/24 and 27/04/24 inclusively.
Last updated