Concepts

Approval Policies

API Reference

Approval Policies enable your users to set up an approval process for managing and paying any invoice they receive.

Creating Approval Policies

To create an Approval Policy:

  1. Create users within an entity and optionally assign them roles.
  2. Create the Approval Policy rule

Creating Approval Policy rules

Approval Policies can be created using the API or through the admin dashboard by clicking on the Approval Policy tab within an entity.

Approval Policies consist a trigger for the policy and a list of users that need to approve the invoice. You can stack multiple Approval Policies on top of each other.

Approval Policy Triggers

The “Trigger” field allows you to select what conditions will trigger this approval policy.

You can select the following to trigger an approval policy:

  • Invoice Amounts (greater than)
  • Invoice Metadata
  • Invoice Vendors

Number of Approvers

Each approval policy can have a different number of approvers. You can set the number of approvers needed for each approval policy by using the “Number of Approvers” field.

Approval Policy Rules

The “Approval Policy Rules” field allows you to select which users will be the approvers for this approval policy. You can select users based on their roles or by their userIDs. Roles are useful when you want any user with a specific role to be able to approve an invoice. UserIDs are useful when you want to specify exactly which users can approve an invoice.

Example Approval Policy

In this example, we will create an approval policy that will trigger when an invoice is received and the invoice amount is greater than $100. We will set the number of approvers to 2 and we will let anyone with the “Controller” role or “Admin” role approve the invoice.

1curl -X POST \
2 --url "https://api.mercoa.com/entity/:entityId/approval-policy" \
3 --header "Content-Type: application/json" \
4 --header "Authorization: Bearer <token>" \
5 --header "Accept: application/json" \
6 --data '
7{
8 "trigger": [
9 {
10 "type": "amount",
11 "amount": 100,
12 "currency": "USD"
13 }
14 ],
15 "rule": {
16 "type": "approver",
17 "numApprovers": 2,
18 "identifierList": {
19 "type": "rolesList",
20 "value": [
21 "Controller",
22 "Admin"
23 ]
24 }
25 },
26 "upstreamPolicyId": "root"
27}
28 '

Auto-Assign Approvers

Approval policies can be set to automatically assign approvers when a user submits an invoice for approval. If the approval rule is set to userList and the number of approvers needed is equal to the number of users that are available to approve will automatically assign those users.

Example

1curl -X POST \
2 --url "https://api.mercoa.com/entity/:entityId/approval-policy" \
3 --header "Content-Type: application/json" \
4 --header "Authorization: Bearer <token>" \
5 --header "Accept: application/json" \
6 --data '
7{
8 "trigger": [],
9 "rule": {
10 "type": "approver",
11 "numApprovers": 2,
12 "identifierList": {
13 "type": "userList",
14 "value": [
15 "user_123456",
16 "user_098787"
17 ]
18 }
19 },
20 "upstreamPolicyId": "root"
21}
22 '