For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
      • GETSearch entities
      • POSTCreate entity
      • GETGet entity
      • POSTUpdate entity
      • DELDelete entity
      • POSTAccept Terms of Service
      • POSTInitiate KYB
      • POSTGenerate JWT Token
      • GETGenerate Onboarding Link
      • POSTSend Onboarding Email
      • GETEvents
        • GETGet All
        • POSTCreate
        • GETGet
        • POSTUpdate
        • DELDelete
        • GETGet History
        • POSTRestore
Logo
Sign inBook a demo
API ReferenceEntityApproval Policy

Create

POST
https://api.mercoa.com/entity/:entityId/approval-policy
POST
/entity/:entityId/approval-policy
$curl -X POST https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/approval-policy \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "trigger": [],
> "rule": {
> "type": "approver",
> "identifierList": {
> "type": "userList",
> "value": [
> "usr_8545a84e-a45f-41bf-bdf1-33b42a55812c",
> "usr_21661ac1-a2a8-4465-a6c0-64474ba8181d"
> ]
> },
> "numApprovers": 2
> },
> "upstreamPolicyId": "root"
>}'
1{
2 "id": "apvl_21661ac1-a2a8-4465-a6c0-64474ba8181d",
3 "trigger": [],
4 "rule": {
5 "type": "approver",
6 "identifierList": {
7 "type": "userList",
8 "value": [
9 "usr_8545a84e-a45f-41bf-bdf1-33b42a55812c",
10 "usr_21661ac1-a2a8-4465-a6c0-64474ba8181d"
11 ]
12 },
13 "numApprovers": 2
14 },
15 "upstreamPolicyId": "root",
16 "createdAt": "2024-01-01T00:00:00Z",
17 "updatedAt": "2024-01-02T00:00:00Z"
18}
Create an invoice approval policy associated with an entity
Was this page helpful?
Previous

Get

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

entityIdstringRequired
Entity ID or Entity ForeignID

Request

This endpoint expects an object.
triggerlist of objectsRequired
List of triggers that will cause this policy to be evaluated. If no triggers are provided, the policy will be evaluated for all invoices.
ruleobjectRequired
upstreamPolicyIdstringRequired
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.
idstring
triggerlist of objects
ruleobject
upstreamPolicyIdstring
createdAtdatetime
updatedAtdatetime

Errors

400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
409
Conflict
500
Internal Server Error
501
Unimplemented