Orchestrate
Processing Rules

Processing Rules

Apply conditional pricing and funding behavior based on transaction characteristics


Processing rules enable dynamic pricing and funding configuration by applying conditional overrides based on transaction characteristics like amount, payment method, card type, or card brand. Rules are evaluated by priority, and the first matching rule's settings override the default processing settings for that transaction.

Prerequisites

Before working with processing rules, it's helpful to learn about the following topics.


What are Processing Rules


Processing rules define conditional overrides for pricing and funding behavior based on transaction characteristics. When a transaction matches a rule's conditions, that rule's pricing or funding settings are applied instead of the default processing settings.

Rules are evaluated by priority (highest to lowest), and the first matching rule is applied. If no rules match, the default processing settings are used.

Common use cases

  • Tiered Pricing: Apply different rates based on transaction amount (e.g., lower rate for high-value transactions)
  • Card Brand Pricing: Set specific pricing for different card brands (Visa, Mastercard, Amex, Discover) to match interchange rates
  • Card Type Pricing: Differentiate pricing between credit, debit, and prepaid cards
  • Payment Method Pricing: Apply different rates for card vs. bank account payments
  • Instant Funding Surcharge: Add fees for instant funding transactions
  • High-Value Transaction Delays: Apply longer funding delays for high-value transactions to manage risk
  • Payment Source Pricing: Set different pricing based on transaction source (API, keyed, mobile wallets)

How Processing Rules Work


When a transaction is created, Payload evaluates all processing rules scoped to that account or profile in priority order. The evaluation follows these steps:

Identify Applicable Rules

All rules scoped to the account or profile are identified as candidates for evaluation.

Sort by Priority

Rules are sorted from highest priority (100) to lowest priority (0).

Evaluate Conditions

Starting with the highest priority rule, each rule's conditions are checked against the transaction characteristics. All conditions in a rule must match for the rule to apply.

Apply First Match

The first rule where all conditions match has its pricing and funding settings applied to the transaction. Evaluation stops after the first match.

Use Default Settings

If no rules match, the default processing settings are used for pricing and funding.

Rule Conditions


Conditions determine which transactions a rule applies to. Multiple conditions can be combined, and all specified conditions must match for the rule to apply.

Amount Conditions

Match transactions by amount using comparison operators:

OperatorDescriptionUse Case
amount.eqExactly equal to the specified amountMatch specific transaction amounts
amount.gtGreater than the specified amountApply to transactions above a threshold
amount.geGreater than or equal to the specified amountTiered pricing for high-value transactions
amount.ltLess than the specified amountApply to transactions below a threshold
amount.leLess than or equal to the specified amountTiered pricing for low-value transactions

Payment Method Conditions

Match by payment method type:

ConditionValuesDescription
payment_method_type.eqcardCredit and debit card payments
bank_accountACH and bank account payments
syntheticSynthetic account transfers

Card Conditions

Match card transactions by card brand or card type:

Card Brand:

OperatorValuesDescription
card_brand.eqvisaMatch Visa cards
mastercardMatch Mastercard cards
american_expressMatch American Express cards
discoverMatch Discover cards
card_brand.neSame as aboveExclude specific card brand

Card Type:

OperatorValuesDescription
card_type.eqcreditMatch credit cards
debitMatch debit cards
prepaidMatch prepaid cards
card_type.neSame as aboveExclude specific card type

Transaction Type Conditions

Match by transaction direction:

ConditionValuesDescription
transaction_type.eqpaymentIncoming funds (customer paying processing account)
payoutOutgoing funds (processing account paying customer)

Funding Timing Conditions

Match by funding speed:

OperatorValuesDescription
funding_timing.eqstandardStandard funding timing
instantInstant funding
rapidRapid funding
funding_timing.neSame as aboveExclude specific funding timing

Currency Conditions

Match by transaction currency:

ConditionValuesDescription
currency.eqUSDUS Dollars
CADCanadian Dollars

Source Conditions

Match by transaction source:

ConditionValuesDescription
source.eqapiAPI-initiated transactions
keyedManually keyed transactions
googlepayGoogle Pay transactions
applepayApple Pay transactions
checkCheck payments
plaidPlaid-connected transactions

Rule Pricing Configuration


When a rule matches a transaction, its pricing configuration overrides the default processing settings pricing for that transaction.

FieldDescriptionFormat / Example
pricing.trans_rate.defaultPercentage-based fee applied to transaction amount. Combined with trans_cost to calculate total fee.Decimal (e.g., 0.029 for 2.9%)
pricing.trans_cost.defaultFixed fee per transaction, added to the percentage-based fee. Total fee = (amount Ă— trans_rate) + trans_costCurrency amount (e.g., 0.30 for $0.30)
pricing.trans_fee_capMaximum fee limit for high-value transactions. Prevents excessive fees regardless of transaction amount. Must be non-zero if set.Currency amount (e.g., 25.00 caps fees at $25)
pricing.conv_fee_allocPortion of processing fee passed to customer as convenience fee. Value between 0 (processing account absorbs all fees) and 1 (all fees passed to customer). Cannot be set if card_brand is a condition.Decimal 0-1 (e.g., 0.5 for 50% pass-through)

Rule Funding Configuration


Rules can override funding delay for matching transactions.

FieldDescriptionFormat / Example
funding.delay.defaultNumber of days to delay funding after transaction settlement. Overrides the processing settings funding delay. Used for risk management on specific transaction types.Integer 0-10 (e.g., 5 for 5-day delay)

Common use cases:

  • Longer delay for high-value transactions
  • Immediate funding (0 days) for trusted payment sources
  • Extended delay for new account transactions

Processing Rule Examples


Processing rules are configured administratively and cannot be created or modified through the API. Below are examples of common rule configurations to illustrate how rules work.

Tiered pricing based on amount

Lower rates for high-value transactions:

// Example rule configuration (admin-configured)
{
    scope: {
        type: "account",
        object_id: "acct_processing123"
    },
    priority: 90,
    conditions: {
        amount: {
            ge: 1000.00
        }
    },
    pricing: {
        trans_rate: {
            default: 0.020  // 2.0% for large transactions
        },
        trans_cost: {
            default: 0.30
        }
    }
}

Card brand specific pricing

Different rates for each card brand to match interchange:

// Example Visa rule (admin-configured)
{
    priority: 80,
    conditions: {
        card_brand: {
            eq: "visa"
        }
    },
    pricing: {
        trans_rate: {
            default: 0.0275  // 2.75% for Visa
        },
        trans_cost: {
            default: 0.10
        }
    }
}
 
// Example Amex rule (admin-configured)
{
    priority: 80,
    conditions: {
        card_brand: {
            eq: "american_express"
        }
    },
    pricing: {
        trans_rate: {
            default: 0.0349  // 3.49% for Amex
        },
        trans_cost: {
            default: 0.10
        }
    }
}

Payment method based pricing

Lower rates for bank account payments:

// Example bank account rule (admin-configured)
{
    priority: 85,
    conditions: {
        payment_method_type: {
            eq: "bank_account"
        }
    },
    pricing: {
        trans_rate: {
            default: 0.008  // 0.8% for bank accounts
        },
        trans_cost: {
            default: 0.25
        },
        trans_fee_cap: 5.00
    }
}

Funding delay by amount

Longer funding delays for high-value transactions:

// Example funding delay rule (admin-configured)
{
    priority: 95,
    conditions: {
        amount: {
            ge: 5000.00
        }
    },
    funding: {
        delay: {
            default: 5  // 5 day delay for transactions >= $5000
        }
    }
}

Rule Priority and Evaluation Order


Priority determines the order in which rules are evaluated. Higher priority numbers are evaluated first.

Setting Priority

  • Priority range: 0 to 100
  • Higher numbers = higher priority
  • First matching rule wins

Priority Guidelines

  • 90-100: Highly specific rules (multiple conditions, narrow scope)
  • 70-89: Card brand or card type rules
  • 50-69: Payment method type rules
  • 30-49: Amount-based tiered pricing
  • 0-29: Broad fallback rules

Example Priority Strategy

// Priority 95: Very specific - High-value Amex
{
    priority: 95,
    conditions: {
        amount: { ge: 1000.00 },
        card_brand: { eq: "american_express" }
    }
}
 
// Priority 80: Card brand specific
{
    priority: 80,
    conditions: {
        card_brand: { eq: "visa" }
    }
}
 
// Priority 50: Payment method type
{
    priority: 50,
    conditions: {
        payment_method_type: { eq: "bank_account" }
    }
}
 
// Priority 30: Amount-based
{
    priority: 30,
    conditions: {
        amount: { ge: 500.00 }
    }
}

Rule Scope


Rules can be scoped at the profile level or account level.

Account-Level Rules

Apply to a specific processing account:

scope: {
    type: "account",
    object_id: "acct_processing123"
}

Profile-Level Rules

Apply to all accounts within a profile:

scope: {
    type: "profile",
    object_id: "acct_profile456"
}

Viewing Processing Rules


You can query processing rules to understand which rules are configured for an account and how they will affect transaction pricing and funding.

Query Rules for an Account

Retrieve all rules scoped to a specific account:

import payload
 
pl = payload.Session("secret_key_3bW9...", api_version="v2")
 
# Query rules for a specific account
rules = pl.ProcessingRule.filter_by(
    scope={
        "object_id": "acct_processing123",
        "type": "account",
    }
).all()
 
# Sort by priority to see evaluation order
rules.sort(key=lambda r: r.priority, reverse=True)
 
# Display rule details
for rule in rules:
    print(f"Priority {rule.priority}:", rule.conditions)
    print(f"Pricing:", rule.pricing)
    print(f"Funding:", rule.funding)
    print("---")

This example queries all processing rules for a specific account and displays them sorted by priority. The output shows each rule's conditions, pricing overrides, and funding configuration.

Get a Specific Rule

Retrieve details of a specific rule by ID:

rule = pl.ProcessingRule.get("prule_abc123")
 
print("Rule conditions:", rule.conditions)
print("Rule pricing:", rule.pricing)
print("Rule priority:", rule.priority)

Schema Reference

The following fields define processing rule configuration:

ProcessingRule Schema

Complete configuration object for conditional processing overrides:

scope
object
The scope defining where this processing rule applies. Combines a scope type (such as profile or account) with the specific object ID to determine which transactions this rule affects.
object_id
string
The ID of the object (account or profile) to which this rule is scoped. Must correspond to the entity specified by the scope type. (ID prefix: acct)
Pattern: ^acct_[A-Za-z0-9]+$
type
enum[string]
The scope type defining where this rule applies. Determines the level at which the processing rule takes effect (e.g., profile-level or account-level).
Values: profile, account
priority
integer (int64)
Priority value determining rule evaluation order. Rules are evaluated from highest to lowest priority (100 to 0). When multiple rules match a transaction, the highest priority rule is applied. Must be between 0 and 100.
conditions
object
Conditions that determine when this rule applies to a transaction. Multiple conditions can be combined, and all specified conditions must match for the rule to be applied. Use conditions to create targeted pricing rules, funding delays, or processing behavior based on transaction characteristics.
amount
object
Match transactions by amount. Supports equality, greater than, less than, and range operators. Useful for tiered pricing or setting different fees for high-value transactions.
eq
number (double)
No description
ge
number (double)
No description
gt
number (double)
No description
le
number (double)
No description
lt
number (double)
No description
card_brand
object
Match transactions by card brand (Visa, Mastercard, Amex, Discover, etc.). Use to apply brand-specific pricing or block/allow specific card brands.
eq
enum[string]
No description
Values: visa, mastercard, american_express, discover
ne
enum[string]
No description
Values: visa, mastercard, american_express, discover
card_type
object
Match transactions by card type (credit, debit, or prepaid). Use to apply different pricing for different card types or exclude certain card types from processing.
eq
enum[string]
No description
Values: credit, debit, prepaid
ne
enum[string]
No description
Values: credit, debit, prepaid
currency
object
Match transactions by currency (e.g., USD, CAD). Use to apply currency-specific pricing or processing rules.
eq
enum[string]
No description
Values: USD, CAD
funding_timing
object
Match transactions by funding timing (immediate or delayed). Use to differentiate pricing between instant and standard funding options.
eq
enum[string]
No description
Values: standard, instant, rapid
ne
enum[string]
No description
Values: standard, instant, rapid
payment_method_type
object
Match transactions by payment method type. Supports "bank_account", "card", or "synthetic". Use to apply different pricing or settings based on how the customer pays.
eq
enum[string]
No description
Values: bank_account, card, synthetic
source
object
Match transactions by their source type (e.g., web, mobile, API). Use to apply different rules based on where the transaction originated.
eq
enum[string]
No description
Values: api, keyed, googlepay, applepay, check, plaid
transaction_type
object
Match by transaction type: "payment" (incoming funds) or "payout" (outgoing funds). Use to apply different rules for money flowing in versus out.
eq
enum[string]
No description
Values: payment, payout
pricing
object
Pricing configuration to apply when this rule matches a transaction. Includes percentage-based rates, fixed costs, fee caps, and convenience fee allocation. These settings override default processing settings for matching transactions.
conv_fee_alloc
number (double)
Convenience fee allocation percentage. Determines what portion of the processing fee is passed to the customer as a convenience fee. Cannot be set if card_brand is a condition.
trans_cost
object
Transaction cost configuration for this rule. Defines the fixed fee charged per transaction regardless of amount.
default
number (double)
Default fixed cost per transaction when this rule matches. Expressed in the transaction currency (e.g., 0.30 for $0.30 per transaction).
trans_fee_cap
number (double)
Maximum fee cap for transactions matching this rule. Limits the total fee charged on high-value transactions. Must be non-zero if set.
trans_rate
object
Transaction rate configuration for this rule. Defines the percentage-based fee charged on transaction amounts.
default
number (double)
Default transaction percentage rate to apply when this rule matches. Expressed as a percentage (e.g., .029 for 2.9%).
funding
object
Funding configuration to apply when this rule matches a transaction. Defines when funds are made available to the processing account after transaction capture. These settings override default processing settings for matching transactions.
delay
object
Funding delay configuration for this rule. Controls the timing of fund disbursement for matching transactions.
default
integer (int64)
Default funding delay in days when this rule matches. Specifies how many days after transaction capture before funds are disbursed to the processing account.

Next Steps

Understand default settings, monitor rule application, and analyze transaction pricing


Configure Processing Settings

Set up processing settings to define default pricing and configuration that rules will override for matching transactions.

Configure Automated Funding

Set up automated funding to understand how funding delays configured in rules affect fund disbursement timing.

Monitor Transaction Fees

Track transaction fees and rule performance to optimize pricing strategies and identify opportunities for rule refinement.