EntityApproval Policy

Create

POST
Create an invoice approval policy associated with an entity

Path parameters

entityIdstringRequired

Request

This endpoint expects an object.
trigger
list of unionsRequired
List of triggers that will cause this policy to be evaluated. If no triggers are provided, the policy will be evaluated for all invoices.
rule
unionRequired
upstreamPolicyId
stringRequired
The policy ID of the previous approval policy in the chain of policies. Use 'root' if no upstreamPolicyId is intended to be set.

Response

This endpoint returns an object
id
string
trigger
list of unions
rule
union
upstreamPolicyId
string
POST
1curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/approval-policy \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "trigger": [
6 {
7 "type": "amount",
8 "amount": 100,
9 "currency": "USD"
10 }
11 ],
12 "rule": {
13 "type": "approver",
14 "identifierList": {
15 "type": "rolesList",
16 "value": [
17 "Admin",
18 "Controller"
19 ]
20 },
21 "numApprovers": 2
22 },
23 "upstreamPolicyId": "root"
24}'
200Successful
1{
2 "id": "apvl_8545a84e-a45f-41bf-bdf1-33b42a55812c",
3 "trigger": [
4 {
5 "type": "amount",
6 "amount": 100,
7 "currency": "USD"
8 }
9 ],
10 "rule": {
11 "type": "approver",
12 "identifierList": {
13 "type": "rolesList",
14 "value": [
15 "Admin",
16 "Controller"
17 ]
18 },
19 "numApprovers": 2
20 },
21 "upstreamPolicyId": "root"
22}