> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Routing Conditions

> A condition matches against an attribute of the incoming payment.

A condition matches against an attribute of the incoming payment.

```jsonc theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "condition_type": "<ENUM>",
  "conditional":    "<OPERATOR>",
  "values":         ["..."],

  // Required only on specific condition_types — see "Special cases" below
  "key":      "<string>",   // METADATA, ADDITIONAL_FIELD and ORDER_ITEMS_AMOUNT only
  "currency": "<ISO 4217>", // AMOUNT, ORDER_ITEMS_AMOUNT, and VOLUME_PAYMENTS_LIMIT with limit_by = VOLUME; not sent on CURRENCY
  "item_values": ["..."],   // ORDER_ITEMS_AMOUNT only

  // TIME_PERIOD and VOLUME_PAYMENTS_LIMIT only — see "Schedules" and "Volume and count limits" below
  "time_period_repeat_amount":    1,
  "time_period_repeat_frequency": "WEEKLY",
  "time_period_repetition_days":  ["MONDAY", "FRIDAY"],
  "time_period_start_time":       "09:00:00",
  "time_period_end_time":         "18:00:00",
  "timezone":                     "-03:00",
  "limit_by":                     "VOLUME",
  "payments_count":               "ALL"
}
```

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_type` | Matches against | Value shape | Applicable `conditional`s | Card-only? |
| - | - | - | - | - |
| `COUNTRY` | Transaction 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_OF` | no |
| `CARD_ISSUER_COUNTRY` | Card-issuing bank's country, resolved by Yuno's BIN lookup at processing time | ISO 3166-1 alpha-2 | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF` | yes |
| `AMOUNT` | Transaction amount. Sent as `AMOUNT` with a sibling `currency` field; Yuno stores it internally as `CURRENCY_AND_AMOUNT`. With `currency` and an **empty** `values` it matches any amount in that currency (see [Special cases](#special-cases)); to match a currency with another operator or several currencies, use `CURRENCY` | Decimal as **string** (e.g. `"100.00"`); requires sibling `currency` | `EQUAL`, `GREATER_THAN`, `LESS_THAN`, `BETWEEN`; only `EQUAL` when `values` is empty | no |
| `CURRENCY` | Transaction currency, whatever the amount (see [Special cases](#special-cases)) | Uppercase ISO 4217 codes (e.g. `"USD"`, `"EUR"`); no sibling `currency` | `EQUAL`, `NOT_EQUAL` (exactly 1 value), `ONE_OF`, `NOT_ONE_OF` (1 or more values) | no |
| `CARD_TYPE` | Card funding source | `CREDIT`, `DEBIT`, `PREPAID` | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF` | yes |
| `CARD_BRAND` | Card scheme | One of the values in [Card brands](#card-brands) | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF` | yes |
| `CARD_BIN` | First 6–8 digits of the PAN | 6–8 digit numeric string | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF`, `BETWEEN` (see [Special cases](#special-cases)) | yes |
| `TRANSACTION_TYPE` | Payment intent type | `PURCHASE`, `AUTHORIZATION`, `RECURRING`, `MIT`, `CIT` | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF` | no |
| `METADATA` | `payment.metadata[<key>]` | Any string the merchant sets; requires sibling `key` | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF`, `IS`, `IS_NOT`, `GREATER_THAN`, `LESS_THAN`, `BETWEEN`, `CONTAINS` | no |
| `ADDITIONAL_FIELD` | A field of the payment request named by `key` — customer, address, order, airline or card data. See [Additional fields](#additional-fields-additional_field) | Any string; requires sibling `key` from the supported list | `EQUAL`, `NOT_EQUAL`, `ONE_OF`, `NOT_ONE_OF`, `CONTAINS` | no |
| `ORDER_ITEMS_AMOUNT` | Sum of `quantity × unit_amount` of the order items whose `key` field is in `item_values`. See [Order items amount](#order-items-amount-order_items_amount) | Decimal as **string**: one threshold, two for `BETWEEN`; requires siblings `currency` and `item_values` | `GREATER_THAN`, `LESS_THAN`, `GREATER_OR_EQUAL_THAN`, `BETWEEN` | no |
| `TIME_PERIOD` | The moment the payment is created, against a schedule. See [Schedules](#schedules-time_period) | One or two ISO-8601 date-times **with offset**: the start and, optionally, the end | `EQUAL` | no |
| `VOLUME_PAYMENTS_LIMIT` | The account's accumulated volume or payment count in the current period, including this payment. See [Volume and count limits](#volume-and-count-limits-volume_payments_limit) | Exactly one positive number as **string**: the limit | `LESS_OR_EQUAL_THAN` | no |
| `SUBSCRIPTION_RETRY` | Whether the payment is a scheduled auto-retry of a Yuno-managed subscription (`subscription_context.retry_count > 0`); set by Yuno on each attempt, never sent by you | `"true"` or `"false"` | `EQUAL` | no |
| `SUBSCRIPTION_RETRY_COUNT` | Position of the attempt in the subscription retry ladder: `0` on the first attempt of a billing cycle, `1..n` on each scheduled retry | Non-negative integer as **string** (e.g. `"3"`) | `EQUAL`, `GREATER_THAN`, `GREATER_OR_EQUAL_THAN`, `LESS_THAN`, `LESS_OR_EQUAL_THAN`, `BETWEEN`, `ONE_OF` | no |

> [!WARNING]
>
> `INSTALLMENTS` is **not** a valid standalone `condition_type` value. Sending it rejects the whole routing with `400 INVALID_ROUTE_CONFIGURATION`.

#### `conditional` operators

| Operator | Cardinality of `values[]` | Semantics | Rejected at save time |
| - | - | - | - |
| `EQUAL` | exactly 1 | `attribute == values[0]` | no |
| `NOT_EQUAL` | exactly 1 | `attribute != values[0]` | no |
| `ONE_OF` | ≥ 1 | `attribute ∈ values` | no |
| `NOT_ONE_OF` | ≥ 1 | `attribute ∉ values` | no |
| `GREATER_THAN` | exactly 1 | numeric `attribute > values[0]` | yes |
| `LESS_THAN` | exactly 1 | numeric `attribute < values[0]` | no |
| `LESS_OR_EQUAL_THAN` | exactly 1 | `VOLUME_PAYMENTS_LIMIT`: the period total including this payment is `<= values[0]`; `SUBSCRIPTION_RETRY_COUNT`: numeric `attribute <= values[0]` | yes |
| `GREATER_OR_EQUAL_THAN` | exactly 1 | numeric `attribute >= values[0]` | yes |
| `BETWEEN` | exactly 2 | inclusive on both ends | yes |
| `CONTAINS` | exactly 1 | `attribute` contains `values[0]` as a substring | yes |

> [!WARNING]
>
> There is no `NOT_BETWEEN` operator. It is not a member of the `conditional` enum, so sending it
> rejects the whole routing at deserialization — use `BETWEEN` on the complementary ranges instead.

`LESS_OR_EQUAL_THAN` is the operator of `VOLUME_PAYMENTS_LIMIT`, where it carries the limit's own
threshold semantics (the account total over a period, see below) rather than a generic comparison of
one attribute, and a plain numeric `<=` for `SUBSCRIPTION_RETRY_COUNT`. It is not meant for the other
types in the table.

`SUBSCRIPTION_RETRY` and `SUBSCRIPTION_RETRY_COUNT` read `subscription_context.retry_count`, which Yuno
attaches to payments created by its subscription engine. When it is absent (one-off payments, or
retries you trigger yourself with `POST /v1/payments`) `SUBSCRIPTION_RETRY EQUAL "false"` **matches**
(the payment counts as a first attempt) while every positive `SUBSCRIPTION_RETRY_COUNT` operator does
not match. Keep the retry branch (`SUBSCRIPTION_RETRY EQUAL "true"`) above your default route and let
first attempts fall to the default; a `EQUAL "false"` set above the default also catches every one-off
payment of the account. A retry you force with `POST /v1/subscriptions/{code}/retry` carries the last
stored count, which is `0` until a scheduled retry has run. Rules using these types are evaluated at
payment time only: the checkout and installments listings skip a set that holds only these types, and
any such set disables multi-provider installments resolution for that account and payment method; the
routing simulator always evaluates them as a first attempt.

`CONTAINS` is a substring test for `METADATA`. For `ADDITIONAL_FIELD` it compares for equality against
the values the field resolves to: on a multi-valued field, such as `order_fee_item_sku_code`, it matches
when **any** item equals `values[0]`, which is how you test "the order contains this SKU".

The **Rejected at save time** column is the value count only. A `yes` means
`POST`/`PUT` returns `400` when the count does not match, naming the condition type and operator.
A `no` means the count is not checked at save time, and what a wrong count does at evaluation
depends on the operator — do not rely on it being harmless. `TIME_PERIOD` (one or two values),
`VOLUME_PAYMENTS_LIMIT` (exactly one) and `CURRENCY` (exactly one with `EQUAL` or `NOT_EQUAL`, one or
more with `ONE_OF` or `NOT_ONE_OF`) are always checked, whatever the operator.

Where enforcement applies it is **exact**, not a minimum: a surplus value is rejected just as a
missing one is. `BETWEEN` with `["0", "60", "EUR"]` is a `400`, not a silently truncated range.

> [!NOTE]
>
> A value count already stored on a routing version is kept. If a version holds a condition whose
> count predates this check, saving that version again does not fail on it — only a newly introduced
> wrong count is rejected. This also holds for a version duplicated from such a source.

#### Card brands

`CARD_BRAND` accepts the values below. A value outside the list is rejected at save time with
`400 INVALID_CARD_BRAND`, naming the offending value. The list is validated against two internal
sources at save time, so a newly supported scheme may be accepted before it appears here.

```
ALELO                 AMERICAN_EXPRESS      ARGENCARD             ATM_CARD
AURA                  BANKCARD_INACTIVE     BELKART               BP_FUEL_CARD
CABAL                 CARNET                CARTES_BANCAIRES      CHINA_UNION_PAY
CHJONES_FUEL_CARD     CIRRUS                CMI                   CODENSA
DANKORT               DINACARD              DINERS                DISCOVER
DUET                  EBT                   EDENRED               EFTPOS
ELO                   EUROSHELL_FUEL_CARD   FUEL_CARD             GE_CAPITAL
GLOBAL_BC             HIPERCARD             HRG_STORE_CARD        HUMOCARD
JCB                   LOCAL_BRAND           LOYALTY_CARD          LUKOIL_FUEL_CARD
MAESTRO               MASTERCARD            MEEZA                 NEWDAY
NSPK_MIR              OUROCARD              PAGOBANCOMAT          PAYPAK
PAYPAL                PHH_FUEL_CARD         PRIVADAS              PRIVATE_LABEL
PROSTIR               RBS_GIFT_CARD         RED_FUEL_CARD         RED_LIQUID_FUEL_CARD
RUPAY                 SBERCARD              SODEXO                STAR_REWARDS
TARJETA_CENCOSUD      TARJETA_NARANJA       TROY                  UATP
UK_FUEL_CARD          UZCARD                VERVE                 VISA
VOYAGER               VPAY                  VR_VALE_REFEICAO      WEXCARD
YUNO                  YUNO_TEST
```

> [!WARNING]
>
> These values do not exist in the list above, so a rule carrying one never matches a payment:
>
> | Invalid value | Use instead |
> | - | - |
> | `AMEX` | `AMERICAN_EXPRESS` |
> | `AMERICAN EXPRESS` (with a space) | `AMERICAN_EXPRESS` |
> | `UNIONPAY` | `CHINA_UNION_PAY` |
> | `CB` | `CARTES_BANCAIRES` |
> | `DINERS_CLUB` | `DINERS` |
> | `DINERS CLUB INTERNATIONAL` | `DINERS` |
>
> `AMEX`, `UNIONPAY` and `CB` appeared in earlier versions of this page. The others are values that
> have been sent against the API and accepted before save-time validation existed.
>
> Existing rules holding any of these are **not** rejected on a later save — they are kept as they
> are — but they will never match a payment, so correct them.

#### Schedules: `TIME_PERIOD`

`TIME_PERIOD` matches when the payment is created inside a schedule. `values[0]` is when the schedule starts, the optional `values[1]` is when it ends, and the recurrence fields narrow it down:

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "condition_type": "TIME_PERIOD",
  "conditional": "EQUAL",
  "values": ["2026-10-01T00:00:00-03:00"],
  "time_period_repeat_amount": 1,
  "time_period_repeat_frequency": "WEEKLY",
  "time_period_repetition_days": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"],
  "time_period_start_time": "09:00:00",
  "time_period_end_time": "18:00:00",
  "timezone": "-03:00"
}
```

This set matches payments created on weekdays between 09:00 and 18:00 (UTC−3), from October 1st, 2026 onwards.

| Field | Type | Required | Meaning |
| - | - | - | - |
| `values` | string\[] | yes | One or two ISO-8601 date-times **with offset** (`2026-10-01T00:00:00-03:00`, `2026-12-31T23:59:59Z`): the start and, optionally, the end. A payment before the start or after the end never matches. |
| `timezone` | string | no | UTC offset such as `-03:00` or `+00:00`, used to read the payment time and the time window. Defaults to the offset of `values[0]`. Named zones (`America/Bogota`) are rejected. |
| `time_period_repeat_frequency` | enum | with `time_period_repeat_amount` | `DAILY`, `WEEKLY`, `MONTHLY`, `QUARTERLY`, `YEARLY`. The recurrence unit. |
| `time_period_repeat_amount` | int | with `time_period_repeat_frequency` | Every how many units, from the start date: `2` with `WEEKLY` matches every other week. Must be greater than zero. |
| `time_period_repetition_days` | enum\[] | no | Days of the week (`MONDAY` … `SUNDAY`). Only with a frequency. |
| `time_period_start_time`, `time_period_end_time` | `HH:mm:ss` | together | Time window inside each matching day, inclusive on both ends, read in `timezone`. Only with a frequency. |

Without recurrence fields the condition is a plain date range: it matches every payment between the start and the end. With a frequency, a payment matches when the whole units elapsed since the start are a multiple of `time_period_repeat_amount`, its weekday is in `time_period_repetition_days` (when set) and its time is inside the window (when set). `YEARLY` additionally requires the same month and day as the start.

Rules checked at save time, each a `400` naming the field: a value that is not an ISO-8601 date-time with offset, three or more values, a frequency without an amount or the reverse, a zero amount, a start time after the end time, a start date after the end date, one end of the time window without the other, repetition days or a time window without a frequency, a `timezone` that is not an offset, and `limit_by` or `payments_count` on a schedule. A value outside an enum or a zero amount is caught at the API edge as `INVALID_PARAMETERS`; the rest is `INVALID_ROUTE_CONFIGURATION`.

#### Volume and count limits: `VOLUME_PAYMENTS_LIMIT`

`VOLUME_PAYMENTS_LIMIT` matches while the account stays **under a limit** over a period, counting the payment being routed. Use it to send the first N payments, or the first X of volume, of a day or a month through one route and the rest elsewhere:

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "condition_type": "VOLUME_PAYMENTS_LIMIT",
  "conditional": "LESS_OR_EQUAL_THAN",
  "values": ["50000"],
  "currency": "USD",
  "limit_by": "VOLUME",
  "payments_count": "ALL",
  "time_period_repeat_amount": 1,
  "time_period_repeat_frequency": "MONTHLY",
  "timezone": "-03:00"
}
```

This set matches while the account's payments of the current calendar month, in USD and including the current one, add up to 50,000 or less.

| Field | Type | Required | Meaning |
| - | - | - | - |
| `values` | string\[] | yes | Exactly one positive number: the limit, in `currency` units for `VOLUME` or in payments for `PAYMENTS`. |
| `conditional` | enum | yes | `LESS_OR_EQUAL_THAN`: the period total **including the current payment** must be less than or equal to the limit. |
| `limit_by` | enum | no | `PAYMENTS` (count payments, default) or `VOLUME` (sum amounts). |
| `payments_count` | enum | no | Which payments count: `ALL` (default) or `SUCCEEDED` only. |
| `currency` | ISO 4217 | with `limit_by = VOLUME` | Only payments in this currency are summed, and a payment in another currency adds zero. Required and validated for `VOLUME`. |
| `time_period_repeat_frequency` | enum | no | `DAILY` (default), `MONTHLY` or `QUARTERLY`. |
| `time_period_repeat_amount` | int | no | With `DAILY`, the length of the window in days, `1` to `90`; the window covers that many days ending today, from the start of the first day. Must be `1` with `MONTHLY` and `QUARTERLY`, which cover the current calendar month or quarter. Defaults to `1`. |
| `timezone` | string | no | Whole-hour UTC offset (`-03:00`, `+00:00`) that defines where days, months and quarters start. Defaults to `+00:00`. |

Rules checked at save time: exactly one numeric value greater than zero; no `time_period_repetition_days`, `time_period_start_time` or `time_period_end_time`; a valid currency when `limit_by` is `VOLUME` (`400 INVALID_VOLUME_LIMIT_CURRENCY`); a supported period (`400 INVALID_VOLUME_LIMIT_PERIOD`); a whole-hour `timezone` (`400 UNSUPPORTED_VOLUME_LIMIT_TIMEZONE`).

> [!NOTE]
>
> Place the limit set before the route that should take the overflow. Once the limit is reached the set stops matching, so the following sets and the `default_route` receive the remaining payments of the period.

#### Additional fields: `ADDITIONAL_FIELD`

`ADDITIONAL_FIELD` matches a field of the payment request that has no condition type of its own. `key` names the field and is validated at save time; an unknown key is rejected with `400 INVALID_ROUTE_CONFIGURATION`.

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "condition_type": "ADDITIONAL_FIELD", "key": "installments", "conditional": "ONE_OF", "values": ["3", "6", "12"] }
```

| Area | `key` values |
| - | - |
| Installments | `installments`, `installments_source` |
| Customer | `customer_first_name`, `customer_last_name`, `email`, `gender`, `customer_date_of_birth`, `customer_nationality`, `customer_document_type`, `customer_document_number`, `phone_number`, `phone_country_code` |
| Billing address | `billing_address_line_1`, `billing_address_line_2`, `billing_address_country`, `billing_address_state`, `billing_address_city`, `billing_address_zip_code` |
| Shipping address | `shipping_address_line_1`, `shipping_address_line_2`, `shipping_address_country`, `shipping_address_state`, `shipping_address_city`, `shipping_address_zip_code` |
| Order | `order_shipping_amount`, `order_fee_amount`, and per item `order_fee_item_id`, `order_fee_item_name`, `order_fee_item_quantity`, `order_fee_item_unit_amount`, `order_fee_item_category`, `order_fee_item_brand`, `order_fee_item_sku_code`, `order_fee_item_manufacture_part_number` |
| Airline | `airline_pnr`, and per leg `airline_departure_airport`, `airline_departure_datetime`, `airline_departure_airport_timezone`, `airline_arrival_airport`, `airline_carrier_code`, `airline_flight_number`, `airline_fare_basis_code`, `airline_fare_class_code`, `airline_base_fare`, `airline_base_fare_currency`, `airline_stopover_code` |
| Airline passengers | `passenger_first_name`, `passenger_last_name`, `passenger_middle_name`, `passenger_type`, `passenger_date_of_birth`, `passenger_nationality`, `passenger_loyalty_number`, `passenger_loyalty_tier`, `passenger_document_number`, `passenger_document_type`, `passenger_country` |
| Airline ticket | `airline_ticket_number`, `airline_ticket_restricted`, `airline_ticket_total_fee_amount`, `airline_ticker_total_tax_amount` (spelled with `ticker`, which is the key the evaluator expects), `airline_ticket_total_fare_amount`, `airline_ticket_e_ticket` |
| Card | `card_scheme`, `card_issuer_name`, `card_type`, `card_category`, `card_points_mode` |

All values are compared as strings; `email` is compared case-insensitively. On a multi-valued field (order items, airline legs, passengers) every item must satisfy the operator, except `CONTAINS`, which matches when any item equals `values[0]`. A field absent from the payment never matches, with one exception: the numeric keys (`installments`, the amounts and quantities) resolve to the string `"null"` when absent, so a `NOT_EQUAL` or `NOT_ONE_OF` on them matches payments that do not carry the field.

#### Order items amount: `ORDER_ITEMS_AMOUNT`

`ORDER_ITEMS_AMOUNT` adds up `quantity × unit_amount` of the items in `additional_data.order.items[]` whose `key` field is in `item_values`, and compares the total with `values` in `currency`. Use it to route by how much of the basket belongs to a list of products:

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "condition_type": "ORDER_ITEMS_AMOUNT",
  "key": "sku_code",
  "item_values": ["GC-50", "GC-100", "GC-200"],
  "currency": "BRL",
  "conditional": "GREATER_THAN",
  "values": ["500"]
}
```

This condition matches a BRL payment whose items with SKU `GC-50`, `GC-100` or `GC-200` add up to more than 500. A basket of `GC-50` ×1 (50), `GC-100` ×1 (100), `GC-200` ×2 (unit amount 200) and a 1,950 item with another SKU totals 550 and matches; a basket of that 1,950 item and `GC-50` totals 50 and does not.

| Field | Type | Required | Meaning |
| - | - | - | - |
| `key` | string | no | The item field compared with `item_values`: `sku_code` (default), `category` or `brand`. Another value is rejected. |
| `item_values` | string\[] | yes | One or more values of that field. Matching is exact and case-sensitive. Sending `item_values` on any other `condition_type` is rejected. |
| `currency` | ISO 4217 | yes | Currency of the threshold. A payment in another currency, or without a currency, never matches. |
| `conditional` | enum | yes | `GREATER_THAN`, `LESS_THAN`, `GREATER_OR_EQUAL_THAN` or `BETWEEN`. |
| `values` | string\[] | yes | The numeric threshold: exactly one value, two for `BETWEEN`. |

`unit_amount` is read as the price of one unit in the payment currency; the total is rounded to 2 decimals. A payment with no order items, with no item in the list, or whose items do not carry the `key` field totals `0`, so `LESS_THAN` and `GREATER_OR_EQUAL_THAN 0` match such a payment. Responses return the condition in the same shape, with `key` always set, so it can be sent back on update unchanged.

Rules checked at save time, each a `400 INVALID_ROUTE_CONFIGURATION`: a missing `currency` or one that is not ISO 4217, a missing or empty `item_values`, an unsupported `key`, another operator, a value count other than the one above, a non-numeric value, and schedule or limit fields.

The condition is evaluated at payment time only: order items are not known when the checkout lists payment methods, so that listing and the installments listing ignore it, and the payment evaluates it.

#### Special cases

* **`AMOUNT` requires `currency`.** Comparisons are FX-naive; only payments whose currency matches the rule's `currency` are evaluated.
* **`AMOUNT` with an empty `values` list is a currency-only condition**: `{ "condition_type": "AMOUNT", "conditional": "EQUAL", "values": [], "currency": "BRL" }` matches every payment in BRL, whatever the amount. Only `EQUAL` is accepted in that form; another operator is rejected with `400 INVALID_ROUTE_CONFIGURATION`. Responses return it in this same shape. To exclude a currency or match several, use `CURRENCY`.
* **`CURRENCY` matches the payment currency alone**: `{ "condition_type": "CURRENCY", "conditional": "NOT_EQUAL", "values": ["USD"] }` matches every payment not in USD, and `{ "condition_type": "CURRENCY", "conditional": "ONE_OF", "values": ["EUR", "GBP"] }` every payment in EUR or GBP. The currencies go in `values`: `EQUAL` and `NOT_EQUAL` take exactly 1, `ONE_OF` and `NOT_ONE_OF` 1 or more. Each value is an uppercase ISO 4217 code other than `XXX`, and no code may repeat; do not send `currency` or `key` on this type. Like `AMOUNT`, it is valid for every payment method. Anything else is rejected with `400 INVALID_ROUTE_CONFIGURATION`. Responses return `NOT_EQUAL`, `ONE_OF` and `NOT_ONE_OF` exactly as sent, so the retrieved condition can be sent back on update unchanged. `CURRENCY` with `EQUAL` is stored as the currency-only `AMOUNT` above and comes back in that form, `{ "condition_type": "AMOUNT", "conditional": "EQUAL", "values": [], "currency": "USD" }`; both forms are accepted on create and update.
* **`METADATA` requires `key`.** Compares `payment.metadata[key]`. If the key is absent on the payment (or the payment has no `metadata`), the condition does **not** match, whatever the operator. This includes the negative operators: a payment without the key does **not** match `NOT_EQUAL` or `NOT_ONE_OF` either. See the note below for how to route payments that don't carry the key.
* **`ADDITIONAL_FIELD` requires `key`** from the [supported list](#additional-fields-additional_field); `METADATA` keys are free-form, `ADDITIONAL_FIELD` keys are not.
* **`ORDER_ITEMS_AMOUNT` requires `currency` and a non-empty `item_values`**, and `item_values` is accepted on no other `condition_type`. See [Order items amount](#order-items-amount-order_items_amount).
* **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 Yuno'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.
* **Not to be confused with Communications Campaigns.** That product has its own rule engine, where `AMOUNT_AND_CURRENCY` with `BETWEEN` takes three values `["min", "max", "currency"]`. Routing's `AMOUNT` takes **two** values plus a sibling `currency`, and a third value is rejected.
* **`CARD_BIN` with `BETWEEN`** expresses an issuer range and is validated more strictly than the generic two-value rule: exactly two values, both the same length, that length either 6 or 8, all digits, and the first less than or equal to the second. Anything else is `400 INVALID_ROUTE_CONFIGURATION` — so `["411111", "41111111"]` (mismatched lengths) and `["500000", "400000"]` (descending) are both rejected. Unlike every other condition type, a stored `CARD_BIN BETWEEN` is **not** grandfathered: a version holding a malformed one is rejected on every subsequent save until it is corrected.
* **Schedule and limit fields belong to `TIME_PERIOD` and `VOLUME_PAYMENTS_LIMIT` only.** Any of them on another `condition_type` is rejected with `400 INVALID_ROUTE_CONFIGURATION`.
* **Numeric values are submitted as strings** to match the `values: string[]` schema. Yuno parses them based on the `condition_type`.

> [!NOTE]
>
> **Routing payments that don't carry a metadata key**
>
> Because a missing key never matches, a rule such as `METADATA` `QA` `NOT_EQUAL` `"true"` skips every payment that has no `QA` key. To split traffic by the presence of a key, match the payments that **do** carry it, and let everything else fall through:
>
> 1. Put a condition set with `METADATA` `QA` `EQUAL` `"true"` first (lower `sort_number`).
> 2. Put the condition set for all other payments after it, **without** a `METADATA` condition on `QA`.
>
> Payments with `QA = "true"` match the first set; payments without the key, or with any other value, reach the second.

#### Testing `CARD_ISSUER_COUNTRY` rules in sandbox

> [!WARNING]
>
> **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. Yuno'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 Yuno usually differ.

Two examples with Stripe's test cards:

| Test card | Documented by the provider as | Resolves in Yuno as | Why |
| - | - | - | - |
| `4242 4242 4242 4242` | US | `GB` (issuer: Stripe Payments UK) | BIN `424242` is registered to Stripe Payments UK Ltd in the actual Visa registry |
| `4000 0019 6000 0008` | Cyprus | `US` | Any `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](https://docs.y.uno/reference/payments/retrieve-payment-by-id) 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.