Transaction rules

Create a transaction rule

Creates a transaction rule. When your user makes a transaction with their Adyen-issued card, the transaction is allowed or declined based on the conditions and outcome defined in the transaction rule. You can apply the transaction rule to several cards, such as all the cards in your platform, or to a specific card. For use cases, see examples.

post/transactionRules

Request body

aggregationLevelstring

The level at which data must be accumulated, used in rules with type velocity or maxUsage. The level must be the same or lower in hierarchy than the entityKey.

If not provided, by default, the rule will accumulate data at the paymentInstrument level.

Possible values: paymentInstrument, paymentInstrumentGroup, balanceAccount, accountHolder, balancePlatform.

descriptionstring required

Your description for the transaction rule.

endDatestring

The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, 2025-03-19T10:15:30+01:00.

If not provided, the rule will be evaluated until the rule status is set to inactive.

outcomeType'enforceSCA' | 'hardBlock' | 'scoreBased' | 'timedBlock'

The outcome that will be applied when a transaction meets the conditions of the rule.

Possible values:

  • hardBlock (default): the transaction is declined.

  • scoreBased: the transaction is assigned the score you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. This value is not allowed when requestType is bankTransfer.

  • enforceSCA: your user is prompted to verify their identity using 3D Secure authentication. If the authentication fails or times out, the transaction is declined. This value is only allowed when requestType is authentication.

overridesRulestring

The id of the transaction rule you want to override or skip for the specified entityKey.

purpose'compliance' | 'fraud' | 'internalPolicy' | 'policy' | 'system'

Specifies the reason for creating the rule.

Possible values:

  • fraud: the rule is created to regulate fraudulent activity.
  • policy: the rule is created to ensure that the transaction adheres to your business' policies. For example, if your business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to block transactions that have specific MCCs.
referencestring required

Your reference for the transaction rule.

requestType'authentication' | 'authorization' | 'bankTransfer' | 'tokenization'

Indicates the type of request to which the rule applies. If not provided, by default, this is set to authorization.

Possible values: authorization, authentication, tokenization, bankTransfer.

scoreinteger

A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when outcomeType is scoreBased. The value must be between -100 and 100.

startDatestring

The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, 2025-03-19T10:15:30+01:00.

If not provided when creating a transaction rule, the startDate is set to the date when the rule status is set to active.

status'active' | 'inactive'

The status of the transaction rule. If you provide a startDate in the request, the rule is automatically created with an active status.

Possible values: active, inactive.

type'allowList' | 'blockList' | 'bypass' | 'maxUsage' | 'velocity' required

The type of rule, which defines if a rule blocks transactions based on individual characteristics or accumulates data.

Possible values:

  • blockList: decline a transaction when the conditions are met.
  • maxUsage: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met.
  • velocity: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met.
  • bypass: bypass or skip a rule for the specified entityKey. Transactions processed to that entity are no longer evaluated by the bypassed rule. You must provide the id of the rule to bypass in overridesRule and leave the ruleRestrictions object empty.

Response

OK - the request has succeeded.

aggregationLevelstring

The level at which data must be accumulated, used in rules with type velocity or maxUsage. The level must be the same or lower in hierarchy than the entityKey.

If not provided, by default, the rule will accumulate data at the paymentInstrument level.

Possible values: paymentInstrument, paymentInstrumentGroup, balanceAccount, accountHolder, balancePlatform.

descriptionstring required

Your description for the transaction rule.

endDatestring

The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, 2025-03-19T10:15:30+01:00.

If not provided, the rule will be evaluated until the rule status is set to inactive.

idstring

The unique identifier of the transaction rule.

outcomeType'enforceSCA' | 'hardBlock' | 'scoreBased' | 'timedBlock'

The outcome that will be applied when a transaction meets the conditions of the rule.

Possible values:

  • hardBlock (default): the transaction is declined.

  • scoreBased: the transaction is assigned the score you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. This value is not allowed when requestType is bankTransfer.

  • enforceSCA: your user is prompted to verify their identity using 3D Secure authentication. If the authentication fails or times out, the transaction is declined. This value is only allowed when requestType is authentication.

overridesRulestring

The id of the transaction rule you want to override or skip for the specified entityKey.

purpose'compliance' | 'fraud' | 'internalPolicy' | 'policy' | 'system'

Specifies the reason for creating the rule.

Possible values:

  • fraud: the rule is created to regulate fraudulent activity.
  • policy: the rule is created to ensure that the transaction adheres to your business' policies. For example, if your business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to block transactions that have specific MCCs.
referencestring required

Your reference for the transaction rule.

requestType'authentication' | 'authorization' | 'bankTransfer' | 'tokenization'

Indicates the type of request to which the rule applies. If not provided, by default, this is set to authorization.

Possible values: authorization, authentication, tokenization, bankTransfer.

scoreinteger

A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when outcomeType is scoreBased. The value must be between -100 and 100.

startDatestring

The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, 2025-03-19T10:15:30+01:00.

If not provided when creating a transaction rule, the startDate is set to the date when the rule status is set to active.

status'active' | 'inactive'

The status of the transaction rule. If you provide a startDate in the request, the rule is automatically created with an active status.

Possible values: active, inactive.

type'allowList' | 'blockList' | 'bypass' | 'maxUsage' | 'velocity' required

The type of rule, which defines if a rule blocks transactions based on individual characteristics or accumulates data.

Possible values:

  • blockList: decline a transaction when the conditions are met.
  • maxUsage: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met.
  • velocity: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met.
  • bypass: bypass or skip a rule for the specified entityKey. Transactions processed to that entity are no longer evaluated by the bypassed rule. You must provide the id of the rule to bypass in overridesRule and leave the ruleRestrictions object empty.

Changes

Changed in 15 of the 51 revisions of this API.21735

  • v28761ac1a9aab13See the full diff
    • added the new bypass enum value to the type response property for the response status 200

      response-property-enum-value-added

    • added the new optional request property overridesRule

      new-optional-request-property

    • added the new bypass enum value to the request property type

      request-property-enum-value-added

    • added the optional property overridesRule to the response with the 200 status

      response-optional-property-added

    • added the new optional request property purpose

      new-optional-request-property

    • added the optional property purpose to the response with the 200 status

      response-optional-property-added

  • v2dd6159049c9521See the full diff
    • the ruleRestrictions/totalAmount/value/currency response property's maxLength was unset from 3 for the response status 200

      response-property-max-length-unset

    • the ruleRestrictions/totalAmount/value/currency response property's minLength was decreased from 3 to 0 for the response status 200

      response-property-min-length-decreased

    • the ruleRestrictions/totalAmount/value/currency request property's minLength was decreased from 3 to 0

      request-property-min-length-decreased

    • added the new optional request property ruleRestrictions/walletProviderDeviceType

      new-optional-request-property

    • added the optional property ruleRestrictions/walletProviderDeviceType to the response with the 200 status

      response-optional-property-added

    • added the new optional request property ruleRestrictions/walletProviderAccountScore

      new-optional-request-property

    • added the new optional request property ruleRestrictions/walletProviderDeviceScore

      new-optional-request-property

    • added the optional property ruleRestrictions/walletProviderAccountScore to the response with the 200 status

      response-optional-property-added

    • added the optional property ruleRestrictions/walletProviderDeviceScore to the response with the 200 status

      response-optional-property-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • v2e69e67d2e69211See the full diff
    • added the new bic enum value to the ruleRestrictions/counterpartyBank/value/items/identificationType response property for the response status 200

      response-property-enum-value-added

    • added the new bic enum value to the request property ruleRestrictions/counterpartyBank/value/items/identificationType

      request-property-enum-value-added

  • v27ab1c2b70cc422See the full diff
    • removed the request property ruleRestrictions/priority

      request-property-removed

    • removed the optional property ruleRestrictions/priority from the response with the 200 status

      response-optional-property-removed

    • added the new optional request property ruleRestrictions/tokenRequestors

      new-optional-request-property

    • added the optional property ruleRestrictions/tokenRequestors to the response with the 200 status

      response-optional-property-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property ruleRestrictions/priority

      new-optional-request-property

    • added the optional property ruleRestrictions/priority to the response with the 200 status

      response-optional-property-added

    • added the new optional request property ruleRestrictions/counterpartyTypes

      new-optional-request-property

    • added the new optional request property ruleRestrictions/sourceAccountTypes

      new-optional-request-property

    • added the optional property ruleRestrictions/counterpartyTypes to the response with the 200 status

      response-optional-property-added

    • added the optional property ruleRestrictions/sourceAccountTypes to the response with the 200 status

      response-optional-property-added

    • added the new optional request property ruleRestrictions/matchingValues

      new-optional-request-property

    • added the optional property ruleRestrictions/matchingValues to the response with the 200 status

      response-optional-property-added