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/:entityId/approval-policy \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "trigger": [
6 {
7 "type": "amount",
8 "amount": 1,
9 "currency": "AED"
10 }
11 ],
12 "rule": {
13 "type": "approver",
14 "identifierList": {
15 "type": "rolesList",
16 "value": [
17 "string"
18 ]
19 },
20 "numApprovers": 0
21 },
22 "upstreamPolicyId": "string"
23}'
200
Successful
1{
2 "id": "string",
3 "trigger": [
4 {
5 "type": "amount",
6 "amount": 1,
7 "currency": "AED"
8 }
9 ],
10 "rule": {
11 "type": "approver",
12 "identifierList": {
13 "type": "rolesList",
14 "value": [
15 "string"
16 ]
17 },
18 "numApprovers": 0
19 },
20 "upstreamPolicyId": "string"
21}