Payroll Approval

Payroll Approval Flow

Payroll approval flow is an optional feature activated in the company. It enables users within the company to review and approve a payroll run before it is processed and completed.

To check the status of payroll approval flow in a company, use the following endpoint GET payroll-approval/settings. This endpoint will return the following information about the status of payroll approval flow in a company:

  • Whether the payroll approval flow is currently activated in the company.
  • Whether the payroll approval flow auto-completion is active.
  • Number of minimum users required to approve.
  • List of users and their roles in the payroll approval flow.

Roles

Users can be assigned as reviewers with particular roles:

NameIDDescription
Optional1User approval is optional, and the payroll can be run without their approval
Required2User approval is required, and the payroll can not be run without their approval

Activation

To activate or deactivate payroll approval flow in the company, use the following endpoint PATCH payroll-approval

Adding or Removing Approvers

To add a user as a payroll approver, use the following endpoint POST payroll-approval.

To remove a user as a payroll approver, use the following endpoint DELETE payroll-approval.

Minimum Number of Approvers

A minimum number of approvers can also be added so that the payroll run can only be completed (automatically or otherwise) if at least the specified approvers have approved the payroll run. This number can not be less than the number of required approvers and can not be more than the total number of approvers.

To update the minimum number of approvers, use the following endpoint PATCH payroll-approval/settings.

Auto-completion

When payroll approval flow auto-completion is turned ON, and the payroll approval requirements have been met, the payroll run will be completed automatically.

The flow is different whether this setting is turned ON or OFF, however, before running a payroll regardless of this setting, the user still needs to go through SMS verification at least once.

To activate or deactivate auto-completion in the company, use the following endpoint PATCH payroll-approval/autocomplete.

SMS Verification

To request an SMS verification code, use the endpoint.

https://{{env_url}}/api/verification

Where the env_url will be the API URL of the environment here.

Payroll Approval Flow in Payroll

Once the payroll approval flow is set up in the company, the payroll approval flow for each payroll starts at the ControlFinished payroll status. If the company has a payroll approval flow active, the flow deviates from the non-approval flow here , and a request for approval needs to be sent.

Sending and Canceling Approval Request

The Auto-complete setting is OFF

For approval, use the following endpoint POST approval. In the JSON body, provide a list of all approver GUIDs as the approvers are set up in the company.

This endpoint also notifies the approvers that they need to review this payroll.

To cancel an approval request use the following endpoint PATCH approval/cancel In the body the comment is required, a user input reason why the request was cancelled.

The Auto-complete setting is ON

To send a request for approval, use the following endpoint POST approval/autocomplete . In the JSON body, provide a list of all approver GUIDs as the approvers are set up in the company and an SMS verification code.

This endpoint also notifies the approvers that they need to review this payroll.

To cancel an approval request use the following endpoint PATCH approval/cancel In the body the comment is required, a user input reason why the request was cancelled.

Reviewer actions

A payroll reviewer can either approve or reject the payroll

NameIDDescription
Pending0Reviewer has not approved or rejected the payroll
Approved1Reviewer has approved the payroll
Rejected2Reviewer has rejected the payroll

Reviewer Approval or Rejection

To get the current state of the payroll approval for a particular payroll, use the following endpoint GET approval/settings. The following information is returned

  • Information about the user that sent the request for approval
  • List of reviewers: their information, role, actions when they were taken and their comment
  • Whether the payroll approval flow is activated
  • Whether the payroll approval flow auto-completion is active
  • Number of minimum users required to approve

To approve or reject a payroll, use the following endpoint PATCH approval. To reject a payroll only the comment is required however, to approve a payroll a comment and SMS verification is required.

Running the Payroll

The Auto-complete setting is OFF

  • If all requirements are met in the payroll approval flow to complete the payroll, use the following endpoint POST run , and SMS verification is required.
  • If all requirements are not met in the payroll approval flow, the user can complete the payroll with a comment using the following endpoint POST approval/run/override . A comment and SMS verification is required.

The Auto-complete setting is ON

  • The payroll will be completed automatically if all requirements are met in the payroll approval flow (right after the last reviewer approves).
  • If all requirements are not met in the payroll approval flow, the user can complete the payroll using the following endpoint POST approval/run/override . A comment and SMS verification is required.