{"title":"Create and manage rules","category":"default","creationDate":1571779440,"content":"<p>After you determine your business' requirements for evaluating and declining suspicious payout requests, you can use the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Configuration API<\/a> to create and manage transaction rules that automatically evaluate every external payout. This page explains how to:<\/p>\n<ul>\n<li><a href=\"#create-a-transaction-rule\">Create a transaction rule<\/a><\/li>\n<li><a href=\"#view-transaction-rules\">View existing transaction rules<\/a><\/li>\n<li><a href=\"#override-an-existing-transaction-rule\">Override existing transaction rules<\/a><\/li>\n<li><a href=\"#update-a-transaction-rule\">Update a transaction rule<\/a>\n<\/li>\n<\/ul>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Adyen Payouts<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/api-credentials\/roles\/\">API credential roles<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have access to the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/overview\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Configuration API<\/a> with following role: <ul><li markdown=\"1\"><strong>Bank Manage TransactionRules role<\/strong><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/pt\/development-resources\/webhooks\">Webhooks<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Subscribe to the following webhook(s): <ul><li markdown=\"1\"><a href=\"\/pt\/payouts\/payout-service\/pay-out-to-bank-accounts\/payout-webhooks\/\">\n  <strong>Transfer webhooks<\/strong>\n<\/a><\/li><li markdown=\"1\"><a href=\"\/pt\/payouts\/payout-service\/transfer-transactions\/transaction-webhooks\/\">\n  <strong>Transaction webhooks<\/strong>\n<\/a><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\">Transaction rules are not supported for <a href=\"\/pt\/payouts\/payout-service\/internal-fund-transfers\/\">internal transfers<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin: <ul><li markdown=\"1\">Make sure you are familiar with <a href=\"\/pt\/payouts\/payout-service\/transaction-rules\">how transaction rules work<\/a><\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Create a transaction rule<\/h2>\n<p>When you have defined your business logic and requirements, turn your requirements into a transaction rule.<\/p>\n<ol>\n<li>\n<p>Make a POST <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/balanceplatform\/latest\/post\/transactionRules\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transactionRules<\/a> request, specifying the following parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-aggregationLevel\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">aggregationLevel<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>The <a href=\"\/pt\/payouts\/payout-service\/transaction-rules#accumulate-data\">level at which the data is accumulated<\/a> when selecting the velocity rule type. You can only set this to <strong>balanceAccount<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-description\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">description<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>Your description for the rule. Maximum length: 300 characters. This reference is displayed in the <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-entityKey\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">entityKey<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>An object that contains the ID and type of resource to which you want to apply the rule.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-interval\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">interval<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>The time period or duration when you want to apply the rule.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-outcomeType\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">outcomeType<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>The outcome that is applied if the transfer meets the conditions of the rule. Set this to <strong>hardBlock<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-reference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">reference<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>Your reference for the rule. Maximum length: 150 characters. This description is displayed in the <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-requestType\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">requestType<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>The type of transfer to which you want to apply the rule. Set this to <strong>bankTransfer<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-ruleRestrictions\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ruleRestrictions<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>An object that contains a combination of values and operations that a  must meet in order to be accepted or declined.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">type<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/user\/pages\/reuse\/image-library\/01.icons\/required\/required.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td>The type of rule that determines what data to analyze. <ul><li markdown=\"1\"><strong>blockList<\/strong>: decline a transfer if it meets specific conditions.<\/li><li markdown=\"1\"><strong>velocity<\/strong>: decline a transaction if a set amount of accumulated previous transactions have met the specified conditions. Adyen only considers previous transactions within a specified time interval and aggregation level.<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-startDate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">startDate<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>Specifies a date and time in the future when the rule must be evaluated. For example, <strong>2022-02-25T07:00:00+01:00<\/strong>. When you specify a start date, the rule is created with a <code>status<\/code> set to <strong>active<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-endDate\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">endDate<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>Specifies a date and time in the future when the rule evaluation must stop. For example, <strong>2022-12-18T10:15:30+01:00<\/strong>. If not provided, the rule is evaluated until the <code>status<\/code> is set to <strong>inactive<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-status\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">status<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td>Set to <strong>active<\/strong> if you want to start evaluating the rule. When you set the status to active, we automatically set the <code>startDate<\/code> to the current time.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Let's take the following requirement for example:<\/p>\n<ul>\n<li>Set a hard-block limit for a daily maximum transfer amount of EUR&nbsp;500K.<\/li>\n<\/ul>\n<p>Here is an example of how to create a transaction rule for the requirement above.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Create transaction rule'\" :id=\"'create-transaction-rule-request-payouts'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/transactionRules \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n    \\&quot;description\\&quot;: \\&quot;{hint:Human-readable rule description}Daily limit for bank transfers{\\\/hint}\\&quot;,\\n    \\&quot;entityKey\\&quot;: {\\n        \\&quot;entityReference\\&quot;: \\&quot;YOUR_BALANCE_PLATFORM\\&quot;,\\n        \\&quot;entityType\\&quot;: \\&quot;balancePlatform\\&quot;\\n    },\\n    \\&quot;interval\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;daily\\&quot;\\n    },\\n    \\&quot;outcomeType\\&quot;: \\&quot;hardBlock\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;{hint:Your unique identifier for this resource}YOUR_REFERENCE{\\\/hint}\\&quot;,\\n    \\&quot;requestType\\&quot;: \\&quot;bankTransfer\\&quot;,\\n    \\&quot;ruleRestrictions\\&quot;: {\\n        \\&quot;totalAmount\\&quot;: {\\n            \\&quot;operation\\&quot;: \\&quot;greaterThan\\&quot;,\\n            \\&quot;value\\&quot;: {\\n                \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n                \\&quot;value\\&quot;: 50000000\\n            }\\n        },\\n        \\&quot;sourceAccountTypes\\&quot;: {\\n            \\&quot;operation\\&quot;: \\&quot;anyMatch\\&quot;,\\n            \\&quot;value\\&quot;: [\\n                \\&quot;balanceAccount\\&quot;\\n            ]\\n        }\\n    },\\n    \\&quot;status\\&quot;: \\&quot;active\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;velocity\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Note the response, which contains the new <span translate=\"no\"><strong>transactionRule<\/strong><\/span> resource, identified by its unique <code>id<\/code>. If anyone in your team tries to pay out more than EUR&nbsp;500K over a day, those payouts will be blocked.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'create-transaction-rule-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n \\\"description\\\": \\\"Daily limit for bank transfers\\\",\\n \\\"entityKey\\\": {\\n     \\\"entityReference\\\": \\\"YOUR_BALANCE_PLATFORM\\\",\\n     \\\"entityType\\\": \\\"balancePlatform\\\"\\n },\\n \\\"interval\\\": {\\n     \\\"type\\\": \\\"daily\\\"\\n },\\n \\\"outcomeType\\\": \\\"hardBlock\\\",\\n \\\"reference\\\": \\\"YOUR_REFERENCE\\\",\\n \\\"requestType\\\": \\\"bankTransfer\\\",\\n \\\"ruleRestrictions\\\": {\\n     \\\"totalAmount\\\": {\\n         \\\"operation\\\": \\\"greaterThan\\\",\\n         \\\"value\\\": {\\n             \\\"currency\\\": \\\"EUR\\\",\\n             \\\"value\\\": 50000000\\n         }\\n     },\\n     \\\"sourceAccountTypes\\\": {\\n         \\\"operation\\\": \\\"anyMatch\\\",\\n         \\\"value\\\": [\\n             \\\"balanceAccount\\\"\\n         ]\\n     }\\n },\\n \\\"startDate\\\": \\\"2023-09-20T00:00:00+01:00\\\",\\n \\\"status\\\": \\\"active\\\",\\n \\\"type\\\": \\\"velocity\\\",\\n \\\"id\\\": \\\"TR00000000000000000000001\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>View transaction rules<\/h2>\n<p>To view the transaction rules you have created, use the following API requests:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Purpose<\/th>\n<th style=\"text-align: left;\">Endpoint<\/th>\n<th style=\"text-align: left;\">Path parameter<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Get the details of a specific rule<\/td>\n<td style=\"text-align: left;\">GET <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/balanceplatform\/latest\/get\/transactionRules\/{transactionRuleId}\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transactionRules\/{id}<\/a><\/td>\n<td style=\"text-align: left;\">Specify the <code>id<\/code> of the transaction rule in the path.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Get a list of all transaction rules configured on a balance account<\/td>\n<td style=\"text-align: left;\">GET&nbsp; <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/2\/get\/balanceAccounts\/(id)\/transactionRules\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/balanceAccounts\/{id}\/transactionRules<\/a><\/td>\n<td style=\"text-align: left;\">Specify the <code>id<\/code> of the balance account in the path.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Get a list of all transaction rules configured for an account holder<\/td>\n<td style=\"text-align: left;\">GET&nbsp; <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/2\/get\/accountHolders\/(id)\/transactionRules\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/accountHolders\/{id}\/transactionRules<\/a><\/td>\n<td style=\"text-align: left;\">Specify the <code>id<\/code> of the account holder in the path.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Get a list of all transaction rules configured on your balance platform<\/td>\n<td style=\"text-align: left;\">GET&nbsp; <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/2\/get\/balancePlatforms\/(id)\/transactionRules\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/balancePlatforms\/{id}\/transactionRules<\/a><\/td>\n<td style=\"text-align: left;\">Specify the <code>id<\/code> of the balance platform in the path.<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Override an existing transaction rule<\/h2>\n<p>When you have multiple transaction rules, Adyen applies these rules based on the existing <a href=\"\/pt\/payouts\/payout-service\/transaction-rules#hierarchy-for-transaction-rules\">rule hierarchy<\/a>. To override this hierarchy for a specific resource or entity, you can create a new rule for that entity that overrides an existing rule with a higher hierarchical ranking.<\/p>\n<p>To create a transaction rule that overrides an existing rule for a specific entity:<\/p>\n<ol>\n<li>\n<p>Make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transactionRules<\/a> request. In addition to other parameters required to <a href=\"#create-a-transaction-rule\">create a rule<\/a>, specify the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: left;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-entityKey\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">entityKey<\/a><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">An object that contains the ID and <a href=\"\/pt\/issuing\/authorisation\/transaction-rules#entity\">type<\/a> of entity for which you want to override a rule.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-ruleRestrictions\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ruleRestrictions<\/a><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The new rule restrictions you want to apply to the entity.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>overridesRule<\/code><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The ID of the transaction rule you want to override for the entity.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the <a href=\"#create-transaction-rule-request-payouts\">previous example<\/a>, we created a transaction rule that sets a maximum daily  limit of EUR 500K for all balance accounts. Now, let's override this rule to allow a higher limit of EUR 800K for just one balance account.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Override a transaction rule'\" :id=\"'override-transaction-rule-request-payouts'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/transactionRules \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n    \\&quot;description\\&quot;: \\&quot;{hint:Human-readable rule description}Allow higher daily payout limit of EUR 800K for BA00000000000000000000001{\\\/hint}\\&quot;,\\n    \\&quot;entityKey\\&quot;: {\\n        \\&quot;entityReference\\&quot;: \\&quot;BA00000000000000000000001\\&quot;,\\n        \\&quot;entityType\\&quot;: \\&quot;balanceAccount\\&quot;\\n    },\\n    \\&quot;interval\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;daily\\&quot;\\n    },\\n    \\&quot;outcomeType\\&quot;: \\&quot;hardBlock\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;{hint:Your unique identifier for this resource}YOUR_REFERENCE{\\\/hint}\\&quot;,\\n    \\&quot;requestType\\&quot;: \\&quot;bankTransfer\\&quot;,\\n    \\&quot;ruleRestrictions\\&quot;: {\\n        \\&quot;totalAmount\\&quot;: {\\n            \\&quot;operation\\&quot;: \\&quot;greaterThan\\&quot;,\\n            \\&quot;value\\&quot;: {\\n                \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n                \\&quot;value\\&quot;: 80000000\\n            }\\n        },\\n        \\&quot;sourceAccountTypes\\&quot;: {\\n            \\&quot;operation\\&quot;: \\&quot;anyMatch\\&quot;,\\n            \\&quot;value\\&quot;: [\\n                \\&quot;balanceAccount\\&quot;\\n            ]\\n        }\\n    },\\n    \\&quot;status\\&quot;: \\&quot;active\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;velocity\\&quot;,\\n    \\&quot;overridesRule\\&quot;: \\&quot;TR00000000000000000000001\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Note the response, which contains the new <span translate=\"no\"><strong>transactionRule<\/strong><\/span> resource, identified by its unique <code>id<\/code>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'override-transaction-rule-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n \\\"description\\\": \\\"Allow higher daily payout limit of EUR 800K for BA00000000000000000000001\\\",\\n \\\"entityKey\\\": {\\n     \\\"entityReference\\\": \\\"BA00000000000000000000001\\\",\\n     \\\"entityType\\\": \\\"balanceAccount\\\"\\n },\\n \\\"interval\\\": {\\n     \\\"type\\\": \\\"daily\\\"\\n },\\n \\\"outcomeType\\\": \\\"hardBlock\\\",\\n \\\"reference\\\": \\\"YOUR_REFERENCE\\\",\\n \\\"requestType\\\": \\\"bankTransfer\\\",\\n \\\"ruleRestrictions\\\": {\\n     \\\"totalAmount\\\": {\\n         \\\"operation\\\": \\\"greaterThan\\\",\\n         \\\"value\\\": {\\n             \\\"currency\\\": \\\"EUR\\\",\\n             \\\"value\\\": 80000000\\n         }\\n     },\\n     \\\"sourceAccountTypes\\\": {\\n         \\\"operation\\\": \\\"anyMatch\\\",\\n         \\\"value\\\": [\\n             \\\"balanceAccount\\\"\\n         ]\\n     }\\n },\\n \\\"startDate\\\": \\\"2023-09-20T00:00:00+01:00\\\",\\n \\\"status\\\": \\\"active\\\",\\n \\\"type\\\": \\\"velocity\\\",\\n \\\"overridesRule\\\": \\\"TR00000000000000000000001\\\",\\n \\\"id\\\": \\\"TR00000000000000000000002\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h3>Skip a transaction rule<\/h3>\n<p>You can override a rule by skipping it entirely for specific entities. This means that the rule no longer applies to that entity. To skip a transaction rule for an entity:<\/p>\n<ol>\n<li>\n<p>Make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transactionRules<\/a> request. In addition to other parameters required to <a href=\"#create-a-transaction-rule\">create a rule<\/a>, specify the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: left;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-entityKey\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">entityKey<\/a><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">An object that contains the ID and type of entity for which you want to skip a rule.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-ruleRestrictions\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ruleRestrictions<\/a><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Leave this empty.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/balanceplatform\/latest\/post\/transactionRules#request-type\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">type<\/a><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The rule type. Set this to <strong>bypass<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>overridesRule<\/code><\/td>\n<td style=\"text-align: left;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The ID of the transaction rule you want to skip for the entity.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the <a href=\"#create-transaction-rule-request-payouts\">previous example<\/a>, we created a transaction rule that sets a maximum daily  limit of EUR 500K for all balance accounts. Now, let's skip this rule for just one balance account, so that it has no maximum daily transfer limit.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Skip a transaction rule'\" :id=\"'skip-transaction-rule-request-payouts'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/transactionRules \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X POST \\\\\\n-d '{\\n    \\&quot;description\\&quot;: \\&quot;{hint:Human-readable rule description}Skip payout limit for BA00000000000000000000001{\\\/hint}\\&quot;,\\n    \\&quot;entityKey\\&quot;: {\\n        \\&quot;entityReference\\&quot;: \\&quot;BA00000000000000000000001\\&quot;,\\n        \\&quot;entityType\\&quot;: \\&quot;balanceAccount\\&quot;\\n    },\\n    \\&quot;reference\\&quot;: \\&quot;{hint:Your unique identifier for this resource}YOUR_REFERENCE{\\\/hint}\\&quot;,\\n    \\&quot;requestType\\&quot;: \\&quot;bankTransfer\\&quot;,\\n    \\&quot;ruleRestrictions\\&quot;: {},\\n    \\&quot;status\\&quot;: \\&quot;active\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;bypass\\&quot;,\\n    \\&quot;overridesRule\\&quot;: \\&quot;TR00000000000000000000001\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Note the response, which contains the new <span translate=\"no\"><strong>transactionRule<\/strong><\/span> resource, identified by its unique <code>id<\/code>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'skip-transaction-rule-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n \\\"description\\\": \\\"Skip payout limit of EUR 500K for BA00000000000000000000001\\\",\\n \\\"entityKey\\\": {\\n     \\\"entityReference\\\": \\\"BA00000000000000000000001\\\",\\n     \\\"entityType\\\": \\\"balanceAccount\\\"\\n },\\n \\\"reference\\\": \\\"YOUR_REFERENCE\\\",\\n \\\"requestType\\\": \\\"bankTransfer\\\",\\n \\\"ruleRestrictions\\\": {},\\n \\\"status\\\": \\\"active\\\",\\n \\\"type\\\": \\\"bypass\\\",\\n \\\"overridesRule\\\": \\\"TR00000000000000000000001\\\",\\n \\\"id\\\": \\\"TR00000000000000000000002\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Update a transaction rule<\/h2>\n<p>To update a transaction rule:<\/p>\n<ol>\n<li>\n<p>Make a PATCH <a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/balanceplatform\/latest\/patch\/transactionRules\/{transactionRuleId}\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/transactionRules\/{id}<\/a> request, specifying the <code>id<\/code> in the path. In the request body, specify the parameters and rule restrictions you want to update.<\/p>\n<p>You can activate or deactivate a transaction rule by updating the value for <code>status<\/code>:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Possible value<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>active<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">Activate the transaction rule<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>inactive<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">Deactivate the transaction rule<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the <a href=\"#create-transaction-rule-request-payouts\">previous example<\/a>, we created a transaction rule that sets a maximum daily payout limit of EUR 500,000 for all balance accounts in your balance platform. Now, let's update the transaction rule to increase the daily limit to EUR 800,000.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Update a transaction rule'\" :id=\"'update-transaction-rule-request-payouts'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/transactionRules\\\/TR00000000000000000000001 \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X PATCH \\\\\\n-d '{\\n    \\&quot;totalAmount\\&quot;: {\\n        \\&quot;operation\\&quot;: \\&quot;greaterThan\\&quot;,\\n        \\&quot;value\\&quot;: {\\n            \\&quot;currency\\&quot;: \\&quot;EUR\\&quot;,\\n            \\&quot;value\\&quot;: 80000000\\n        }\\n    }\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>The response returns the updated transaction rule.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'update-transaction-rule-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n \\\"description\\\": \\\"Daily limit for bank transfers\\\",\\n \\\"entityKey\\\": {\\n     \\\"entityReference\\\": \\\"YOUR_BALANCE_PLATFORM\\\",\\n     \\\"entityType\\\": \\\"balancePlatform\\\"\\n },\\n \\\"interval\\\": {\\n     \\\"type\\\": \\\"daily\\\"\\n },\\n \\\"outcomeType\\\": \\\"hardBlock\\\",\\n \\\"reference\\\": \\\"YOUR_REFERENCE\\\",\\n \\\"requestType\\\": \\\"bankTransfer\\\",\\n \\\"ruleRestrictions\\\": {\\n     \\\"totalAmount\\\": {\\n         \\\"operation\\\": \\\"greaterThan\\\",\\n         \\\"value\\\": {\\n             \\\"currency\\\": \\\"EUR\\\",\\n             \\\"value\\\": 80000000\\n         }\\n     }\\n },\\n \\\"startDate\\\": \\\"2023-09-20T00:00:00+01:00\\\",\\n \\\"status\\\": \\\"active\\\",\\n \\\"type\\\": \\\"velocity\\\",\\n \\\"id\\\": \\\"TR00000000000000000000001\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h2>See also<\/h2>\n<ul>\n<li><a href=\"\/pt\/payouts\/payout-service\/transfer-transactions\">Track transactions<\/a><\/li>\n<li><a href=\"\/pt\/payouts\/payout-service\/view-transfers-details\">View transfer details<\/a><\/li>\n<\/ul>","url":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/transaction-rules\/create-and-manage","articleFields":{"description":"Use transaction rules to automatically approve or decline an outgoing transfer from balance accounts.","feedback_component":true,"last_edit_on":"31-05-2021 18:10","parameters":{"directoryPath":"\/payouts\/payout-service","model":"balance platform"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/transaction-rules\/create-and-manage","title":"Create and manage rules","content":"After you determine your business' requirements for evaluating and declining suspicious payout requests, you can use the  Configuration API to create and manage transaction rules that automatically evaluate every external payout. This page explains how to:\n\nCreate a transaction rule\nView existing transaction rules\nOverride existing transaction rules\nUpdate a transaction rule\n\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nAdyen Payouts\n\n\nAPI credential roles\nMake sure that you have access to the  Configuration API with following role: Bank Manage TransactionRules role\n\n\nWebhooks\nSubscribe to the following webhook(s): \n  Transfer webhooks\n\n  Transaction webhooks\n\n\n\nLimitations\nTransaction rules are not supported for internal transfers.\n\n\nSetup steps\nBefore you begin: Make sure you are familiar with how transaction rules work\n\n\n\nCreate a transaction rule\nWhen you have defined your business logic and requirements, turn your requirements into a transaction rule.\n\n\nMake a POST \/transactionRules request, specifying the following parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n aggregationLevel\n\nThe level at which the data is accumulated when selecting the velocity rule type. You can only set this to balanceAccount.\n\n\n description\n\nYour description for the rule. Maximum length: 300 characters. This reference is displayed in the Customer Area.\n\n\n entityKey\n\nAn object that contains the ID and type of resource to which you want to apply the rule.\n\n\n interval\n\nThe time period or duration when you want to apply the rule.\n\n\n outcomeType\n\nThe outcome that is applied if the transfer meets the conditions of the rule. Set this to hardBlock.\n\n\n reference\n\nYour reference for the rule. Maximum length: 150 characters. This description is displayed in the Customer Area.\n\n\n requestType\n\nThe type of transfer to which you want to apply the rule. Set this to bankTransfer.\n\n\n ruleRestrictions\n\nAn object that contains a combination of values and operations that a  must meet in order to be accepted or declined.\n\n\n type\n\nThe type of rule that determines what data to analyze. blockList: decline a transfer if it meets specific conditions.velocity: decline a transaction if a set amount of accumulated previous transactions have met the specified conditions. Adyen only considers previous transactions within a specified time interval and aggregation level.\n\n\n startDate\n\nSpecifies a date and time in the future when the rule must be evaluated. For example, 2022-02-25T07:00:00+01:00. When you specify a start date, the rule is created with a status set to active.\n\n\n endDate\n\nSpecifies a date and time in the future when the rule evaluation must stop. For example, 2022-12-18T10:15:30+01:00. If not provided, the rule is evaluated until the status is set to inactive.\n\n\n status\n\nSet to active if you want to start evaluating the rule. When you set the status to active, we automatically set the startDate to the current time.\n\n\n\nLet's take the following requirement for example:\n\nSet a hard-block limit for a daily maximum transfer amount of EUR&nbsp;500K.\n\nHere is an example of how to create a transaction rule for the requirement above.\n\n\n\n\n\nNote the response, which contains the new transactionRule resource, identified by its unique id. If anyone in your team tries to pay out more than EUR&nbsp;500K over a day, those payouts will be blocked.\n\n\n\n\n\nView transaction rules\nTo view the transaction rules you have created, use the following API requests:\n\n\n\nPurpose\nEndpoint\nPath parameter\n\n\n\n\nGet the details of a specific rule\nGET \/transactionRules\/{id}\nSpecify the id of the transaction rule in the path.\n\n\nGet a list of all transaction rules configured on a balance account\nGET&nbsp; \/balanceAccounts\/{id}\/transactionRules\nSpecify the id of the balance account in the path.\n\n\nGet a list of all transaction rules configured for an account holder\nGET&nbsp; \/accountHolders\/{id}\/transactionRules\nSpecify the id of the account holder in the path.\n\n\nGet a list of all transaction rules configured on your balance platform\nGET&nbsp; \/balancePlatforms\/{id}\/transactionRules\nSpecify the id of the balance platform in the path.\n\n\n\n\nOverride an existing transaction rule\nWhen you have multiple transaction rules, Adyen applies these rules based on the existing rule hierarchy. To override this hierarchy for a specific resource or entity, you can create a new rule for that entity that overrides an existing rule with a higher hierarchical ranking.\nTo create a transaction rule that overrides an existing rule for a specific entity:\n\n\nMake a POST  \/transactionRules request. In addition to other parameters required to create a rule, specify the following:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n entityKey\n\nAn object that contains the ID and type of entity for which you want to override a rule.\n\n\n ruleRestrictions\n\nThe new rule restrictions you want to apply to the entity.\n\n\noverridesRule\n\nThe ID of the transaction rule you want to override for the entity.\n\n\n\nIn the previous example, we created a transaction rule that sets a maximum daily  limit of EUR 500K for all balance accounts. Now, let's override this rule to allow a higher limit of EUR 800K for just one balance account.\n\n\n\n\n\nNote the response, which contains the new transactionRule resource, identified by its unique id.\n\n\n\n\n\nSkip a transaction rule\nYou can override a rule by skipping it entirely for specific entities. This means that the rule no longer applies to that entity. To skip a transaction rule for an entity:\n\n\nMake a POST  \/transactionRules request. In addition to other parameters required to create a rule, specify the following:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n entityKey\n\nAn object that contains the ID and type of entity for which you want to skip a rule.\n\n\n ruleRestrictions\n\nLeave this empty.\n\n\n type\n\nThe rule type. Set this to bypass.\n\n\noverridesRule\n\nThe ID of the transaction rule you want to skip for the entity.\n\n\n\nIn the previous example, we created a transaction rule that sets a maximum daily  limit of EUR 500K for all balance accounts. Now, let's skip this rule for just one balance account, so that it has no maximum daily transfer limit.\n\n\n\n\n\nNote the response, which contains the new transactionRule resource, identified by its unique id.\n\n\n\n\n\nUpdate a transaction rule\nTo update a transaction rule:\n\n\nMake a PATCH \/transactionRules\/{id} request, specifying the id in the path. In the request body, specify the parameters and rule restrictions you want to update.\nYou can activate or deactivate a transaction rule by updating the value for status:\n\n\n\nPossible value\nDescription\n\n\n\n\nactive\nActivate the transaction rule\n\n\ninactive\nDeactivate the transaction rule\n\n\n\nIn the previous example, we created a transaction rule that sets a maximum daily payout limit of EUR 500,000 for all balance accounts in your balance platform. Now, let's update the transaction rule to increase the daily limit to EUR 800,000.\n\n\n\n\n\nThe response returns the updated transaction rule.\n\n\n\n\n\nSee also\n\nTrack transactions\nView transfer details\n","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Adyen Payouts","lvl2":"Payouts and Payments","lvl3":"Use transaction rules","lvl4":"Create and manage rules"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payouts","lvl2":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service","lvl3":"https:\/\/docs.adyen.com\/pt\/payouts\/payout-service\/transaction-rules","lvl4":"\/pt\/payouts\/payout-service\/transaction-rules\/create-and-manage"},"levels":5,"category":"","category_color":"","tags":["Create","manage","rules"]}}
