EntityApproval Policy

Create

POST
https://api.mercoa.com/entity/:entityId/approval-policy

Create an invoice approval policy associated with an entity

Path parameters

entityId
string

Request

This endpoint expects an object.
trigger
list of unions

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
union
upstreamPolicyId
string

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 return an object.
id
string
trigger
list of unions
rule
union
upstreamPolicyId
string
POST
/entity/:entityId/approval-policy
curl -X POST https://api.mercoa.com/entity/:entityId/approval-policy \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"trigger": [
{
"type": "amount",
"amount": 1,
"currency": "AED"
}
],
"rule": {
"type": "approver",
"identifierList": {
"type": "rolesList",
"value": [
"string"
]
},
"numApprovers": 0
},
"upstreamPolicyId": "string"
}'
Response
{
"id": "string",
"trigger": [
{
"type": "amount",
"amount": 1,
"currency": "AED"
}
],
"rule": {
"type": "approver",
"identifierList": {
"type": "rolesList",
"value": [
"string"
]
},
"numApprovers": 0
},
"upstreamPolicyId": "string"
}