Routing Conditions

A condition matches against an attribute of the incoming payment.

{
  "condition_type": "<ENUM>",
  "conditional":    "<OPERATOR>",
  "values":         ["..."],

  // Required only on specific condition_types — see "Special cases" below
  "key":      "<string>",   // METADATA only
  "currency": "<ISO 4217>"  // AMOUNT only
}

Conditions inside the same condition_sets[].conditions[] are combined with logical AND. For OR semantics, split into multiple condition sets ordered by sort_number.

condition_type catalog

condition_typeMatches againstValue shapeApplicable conditionalsCard-only?
COUNTRYTransaction country — the top-level country field you submit in POST /v1/payments (never the card)ISO 3166-1 alpha-2 (e.g. "US", "BR")EQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFno
CARD_ISSUER_COUNTRYCard-issuing bank’s country, resolved by WHITELABEL’s BIN lookup at processing timeISO 3166-1 alpha-2EQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFyes
AMOUNTTransaction amount. Sent as AMOUNT with a sibling currency field; WHITELABEL stores it internally as CURRENCY_AND_AMOUNTDecimal as string (e.g. "100.00"); requires sibling currencyEQUAL, NOT_EQUAL, GREATER_THAN, LESS_THAN, BETWEEN, NOT_BETWEENno
CARD_TYPECard funding sourceCREDIT, DEBIT, PREPAIDEQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFyes
CARD_BRANDCard schemeVISA, MASTERCARD, AMEX, ELO, HIPERCARD, DINERS, DISCOVER, JCB, UNIONPAY, MAESTRO, CBEQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFyes
CARD_BINFirst 6–8 digits of the PAN6–8 digit numeric stringEQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFyes
TRANSACTION_TYPEPayment intent typePURCHASE, AUTHORIZATION, RECURRING, MIT, CITEQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFno
METADATApayment.metadata[<key>]Any string the merchant sets; requires sibling keyEQUAL, NOT_EQUAL, ONE_OF, NOT_ONE_OFno

CURRENCY and INSTALLMENTS are not valid standalone condition_type values. Sending either one rejects the whole routing with 400 INVALID_ROUTE_CONFIGURATION. To filter by currency, use AMOUNT with the sibling currency field.

conditional operators

OperatorCardinality of values[]Semantics
EQUALexactly 1attribute == values[0]
NOT_EQUALexactly 1attribute != values[0]
ONE_OF≥ 1attribute ∈ values
NOT_ONE_OF≥ 1attribute ∉ values
GREATER_THANexactly 1numeric attribute > values[0]
LESS_THANexactly 1numeric attribute < values[0]
BETWEENexactly 2inclusive on both ends
NOT_BETWEENexactly 2inverse of BETWEEN

Special cases

  • AMOUNT requires currency. Comparisons are FX-naive; only payments whose currency matches the rule’s currency are evaluated.
  • METADATA requires key. Compares payment.metadata[key]. If the key is absent on the payment, the condition does not match — absence is not equality.
  • Card-only condition types (CARD_ISSUER_COUNTRY, CARD_TYPE, CARD_BRAND, CARD_BIN) are only valid when payment_method = "CARD".
  • COUNTRY vs CARD_ISSUER_COUNTRY. The two are sourced independently: COUNTRY matches the transaction country your backend submits in the payment request, while CARD_ISSUER_COUNTRY matches the issuer country WHITELABEL’s own BIN lookup derives from the card number. The same payment can be COUNTRY = US and CARD_ISSUER_COUNTRY = GB at once. The BIN lookup runs before a provider is selected, is identical in sandbox and production, and reflects real-world BIN-registry data — never the processor’s view of the card.
  • Numeric values are submitted as strings to match the values: string[] schema. WHITELABEL parses them based on the condition_type.

Testing CARD_ISSUER_COUNTRY rules in sandbox

Provider test-card countries are simulator metadata

The “country” a payment provider documents for its test cards exists only inside that provider’s own test environment — it is simulator metadata attached to the PAN, not a property of the number itself. WHITELABEL’s BIN lookup resolves the real-world registry entry instead, so a test card’s documented country and its resolved card_data.country_code in WHITELABEL usually differ.

Two examples with Stripe’s test cards:

Test cardDocumented by the provider asResolves in WHITELABEL asWhy
4242 4242 4242 4242USGB (issuer: Stripe Payments UK)BIN 424242 is registered to Stripe Payments UK Ltd in the actual Visa registry
4000 0019 6000 0008CyprusUSAny 4000 00... Stripe test card resolves the same 400000 registry record, which is a US-registered range, regardless of the country the last digits encode

To verify a CARD_ISSUER_COUNTRY rule end-to-end today, work with resolved values rather than documented ones — the lookup is deterministic:

  1. Run one sandbox payment with a candidate test card.
  2. Read card_data.country_code from the payment (payment details in the dashboard, or the Retrieve Payment response).
  3. Build the rule against that value. For example, 4242 4242 4242 4242 is a dependable GB card end-to-end.

The same caveat applies to every BIN-derived condition (CARD_TYPE, CARD_BRAND), though country is where provider test-card documentation diverges most often.