---
title: "Create"
method: POST
path: "/entity/{entityId}/approval-policy"
tags: ["entity > approval-policy"]
---

# Create

`POST /entity/{entityId}/approval-policy`

## Request

- Base URL: `https://api.mercoa.com`
- URL: `https://api.mercoa.com/entity/{entityId}/approval-policy`
- Auth: HTTP bearer

Create an invoice approval policy associated with an entity

## Path parameters

- `entityId` string, required

## Request body

- EntityTypesApprovalPolicyRequest
  - `trigger` EntityTypesTrigger[], required: List of triggers that will cause this policy to be evaluated. If no triggers are provided, the policy will be evaluated for all invoices.
    - union
      - object
        - `type` 'amount', required: Discriminator value: amount
        - `amount` number, double, required
        - `currency` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'CNY' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL', required
        - `comparison` 'eq' | 'gt' | 'gte' | 'lt' | 'lte'
      - object
        - `type` 'vendor', required: Discriminator value: vendor
        - `vendorIds` EntityTypesEntityId[], required
      - object
        - `type` 'metadata', required: Discriminator value: metadata
        - `key` string, required: The metadata key to match
        - `value` string[], required: The metadata value the invoice must have to trigger this policy
      - object: A catchall trigger will trigger if no other triggers match.
        - `type` 'catchall', required: Discriminator value: catchall
  - `rule` union, required
    - object: A rule that will assign approvers to an invoice.
      - `type` 'approver', required: Discriminator value: approver
      - `numApprovers` integer, required: Number of approvals required to approve an invoice
      - `identifierList` union, required
        - object: List of entity user roles that should be used to determine approvers
          - `type` 'rolesList', required: Discriminator value: rolesList
          - `value` string[], required
        - object: List of entity user IDs that should be used to determine approvers
          - `type` 'userList', required: Discriminator value: userList
          - `value` EntityTypesEntityUserId[], required
      - `autoAssign` boolean: If true, the policy will automatically assign approvers to the invoice. If more than one approver is eligible, the policy will assign all eligible approvers to the invoice.
    - object: A rule that will automatically approve an invoice, regardless of any other rules that were triggered.
      - `type` 'automatic', required: Discriminator value: automatic
  - `upstreamPolicyId` string, required

## Response `200`

Response with status 200

- EntityTypesApprovalPolicyResponse
  - `id` string, required
  - `trigger` EntityTypesTrigger[], required
    - union
      - object
        - `type` 'amount', required: Discriminator value: amount
        - `amount` number, double, required
        - `currency` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'CNY' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL', required
        - `comparison` 'eq' | 'gt' | 'gte' | 'lt' | 'lte'
      - object
        - `type` 'vendor', required: Discriminator value: vendor
        - `vendorIds` EntityTypesEntityId[], required
      - object
        - `type` 'metadata', required: Discriminator value: metadata
        - `key` string, required: The metadata key to match
        - `value` string[], required: The metadata value the invoice must have to trigger this policy
      - object: A catchall trigger will trigger if no other triggers match.
        - `type` 'catchall', required: Discriminator value: catchall
  - `rule` union, required
    - object: A rule that will assign approvers to an invoice.
      - `type` 'approver', required: Discriminator value: approver
      - `numApprovers` integer, required: Number of approvals required to approve an invoice
      - `identifierList` union, required
        - object: List of entity user roles that should be used to determine approvers
          - `type` 'rolesList', required: Discriminator value: rolesList
          - `value` string[], required
        - object: List of entity user IDs that should be used to determine approvers
          - `type` 'userList', required: Discriminator value: userList
          - `value` EntityTypesEntityUserId[], required
      - `autoAssign` boolean: If true, the policy will automatically assign approvers to the invoice. If more than one approver is eligible, the policy will assign all eligible approvers to the invoice.
    - object: A rule that will automatically approve an invoice, regardless of any other rules that were triggered.
      - `type` 'automatic', required: Discriminator value: automatic
  - `upstreamPolicyId` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: Error response with status 400
- `401`: Error response with status 401
- `403`: Error response with status 403
- `404`: Error response with status 404
- `409`: Error response with status 409
- `500`: Error response with status 500
- `501`: Error response with status 501

---

[API](https://skmtc.dev/mercoa/apis/mercoa-2.md) - [All operations](https://skmtc.dev/mercoa/apis/mercoa-2/llms.txt) - [OpenAPI document](https://skmtc.dev/mercoa/apis/mercoa-2/revisions/00a8e403ae18?raw)
