Payroll Simulation Request Headers
The BrightPay API can be switched into simulation mode to return predictable data for testing purposes. In this mode the BrightPay API does not request data from the database but instead returns mocked data. This can help with scenario testing (especially around the turn of the financial year).
To switch the API into simulation mode headers can be added to the request as below:
SimulationMode
Should be set to true or false.
If set to "true" the Payroll API is switched into simulation mode.
GetEmployers, GetEmployerHourlyRates, GetEmployees, CreateEmployeeHourlyPayments
SimulationScenario
Should be set to SCENARIO1, SCENARIO2, SCENARIO3 or SCENARIO4.
Returns data for various testing scenarios that are described in the section Payroll Simulation Scenarios
GetEmployers, GetEmployerHourlyRates, GetEmployees
SimulationModeDate
Should be set to a date.
This allows you to simulate dates at various points in the year by telling the API to behave as if the SimulationModeDate is the actual date. This is useful for end of financial year testing.
GetEmployers, GetEmployerHourlyRates, GetEmployees
SimulationForcedError
Should be set to true or false.
This forces a handled error to occur. An issue has occurred, the API understands the issue and returns a response with a meaningful error code.
GetEmployerHourlyRates, CreateEmployeeHourlyPayments
SimulationForcedException
Should be set to true or false.
This forces an unhandled error to occur. An issue has occurred, the API responds with a general error code and an errorId.
GetEmployerHourlyRates, CreateEmployeeHourlyPayments
For example, to return simulation data add the following http headers to your requests
SimulationMode = true
SimulationScenario= "Scenario1" (or "Scenario2", "Scenario4", "Scenario5")
SimulationModeDate= for example
01/02/2025 for data connected to BrightPay 24/25
01/04/2025 for data connected to BrightPay 24/25 and 25/26
01/08/2024 for data connected to BrightPay 25/26
Last updated