Rules

🚧

Preview

If you are interested in early access to this feature please contact [email protected]!

This page explains the available rules for Paymongo Fraud Detector (FD), helping you automate fraud prevention decisions for your transactions.

Automatic Rules (Default)

  • Auto Review by Risk Level:
    Transactions with a risk_level of medium or high are automatically placed into review. Example:
    review if risk_level: 'high'
    review if risk_level: 'medium'

Custom Rules

You can create custom rules to allow, block, or review transactions based on specific conditions.
Custom rules can be created and managed via the Paymongo Fraud Dashboard web interface or through the REST API. Each rule has an execution order: rules with lower order numbers are evaluated first.

Logical Operators

Paymongo FD supports combining multiple rule attributes in a single custom rule using logical operators:

  • AND: All conditions in the rule must be met for the action to be triggered.
  • OR: At least one of the conditions in the rule must be met for the action to be triggered.

When creating a rule, you can specify whether conditions are combined using "AND" or "OR" logic, providing flexibility to tailor rules for your business needs.

Example using AND:

block if risk_score_gte: 700 AND card_country_id: 'US'

This rule blocks transactions only if both the risk score is greater than or equal to 700 and the card country is US.

Example using OR:

review if card_country_id: 'NG' OR billing_country_id: 'NG'

This rule places a transaction into review if either the card country or the billing country is Nigeria.

Example without logical operator (single condition):

block if card_country_id: 'US'

This rule blocks transactions if the card country is US. Only one condition is used, so no logical operator is required.

Custom Rule Actions

  • Allow Rule: If a transaction matches an allow rule, it will proceed without further risk review, unless overridden by a higher-priority block rule.
  • Block Rule: If a transaction matches a block rule, it will be automatically declined.
  • Review Rule: If a transaction matches a review rule, it will be placed under manual review for further investigation.

Available Custom Rule Conditions

Rule NameDescriptionExample Condition
risk_score_gteRisk score is greater than or equal toblock if risk_score_gte: 700
risk_score_lteRisk score is less than or equal toallow if risk_score_lte: 399
card_country_idCard’s country code (2-letter ISO)block if card_country_id: 'US'
billing_country_idCustomer’s billing country code (2-letter ISO)block if billing_country_id: 'PH'
payment_amount_gtePayment amount is greater than or equal to (in currency units)review if payment_amount_gte: 10000
payment_amount_ltePayment amount is less than or equal to (in currency units)allow if payment_amount_lte: 100
ip_addressMatches the exact IP addressblock if ip_address: '123.45.67.89'
ip_address_cidrMatches IP address in CIDR formatblock if ip_address_cidr: '123.45.67.0/24'
billing_emailMatches the billing email addressblock if billing_email: '[email protected]'

Rule Examples

Using AND:

  1. Block transactions with risk score greater than or equal to 700 and card country is Nigeria:

    block if risk_score_gte: 700 AND card_country_id: 'NG'
  2. Review transactions with payment amount greater than or equal to 10,000 and billing country is PH:

    review if payment_amount_gte: 10000 AND billing_country_id: 'PH'

Using OR:

  1. Block transactions if the card country is US or the billing country is US:

    block if card_country_id: 'US' OR billing_country_id: 'US'
  2. Allow transactions with risk score less than or equal to 399 or payment amount less than or equal to 100:

    allow if risk_score_lte: 399 OR payment_amount_lte: 100

Without logical operator (single condition):

  1. Block transactions if the billing country is PH:
    block if billing_country_id: 'PH'

Note: Rules are prioritized by their order. The lowest order number is evaluated first. You can combine multiple conditions using "AND" or "OR" to create more targeted rules, or use a single condition without a logical operator.

Managing Rules

  • You can create, edit, and reorder rules in the Paymongo FD Dashboard web interface or programmatically via REST API.
  • When creating a custom rule, select your desired logical operator ("AND" or "OR") to combine conditions, or use a single condition for simple rules.
  • Rules only apply to future transactions; existing processed payments are unaffected.
  • Regularly review your rules and adjust them to fit your evolving business needs.