> ## 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.

# Create a Routing

> Creates a routing for one (account_id, payment_method) pair. Always live on success.

Creates a routing for one `(account_id, payment_method)` pair. Each routing references **connections** by their `connection_id`. Make sure your connections are created and `ACTIVE` for the requested `payment_method` *before* you call routing. Outputs that reference a decline, Merchant Advice Code or succeeded group by `group_id` need that group to exist on the account too — see [Outcome groups](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#outcome-groups).

### Body

**account\_id** `string (UUID)` *required*

The merchant account ID this routing rule applies to.

**payment\_method** `enum` *required*

E.g., `CARD`, `PIX`, `WALLET`. Immutable per routing — to route a different method, create a new routing.

**name** `string` *required*

Free-form label.

**default\_route** `object` *required*

The route used when no `condition_sets[]` matches.

**properties**

**start\_split** `object[]`

Optional. Splits the entry of the route across several steps by percentage, as `[{ "index": 1, "percentage": 45 }, { "index": 2, "percentage": 55 }]`. Percentages are integers that must sum to `100`. Omit to start every payment on step 1. See [Percentage splits](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#percentage-splits).

**steps** `object[]` *required*

Each step is either one provider attempt or an [action step](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#action-steps). `index` values are contiguous starting at 1.

**item**

**index** `integer` *required*

Step ordinal.

**provider\_id** `string`

Required on provider steps (a payment, fraud, 3DS or authentication provider) and `SMART_ROUTING` on a smart routing step; omit on an action step. Must match the provider of the connection.

**connection\_id** `UUID`

Required on provider steps; omit on action and smart routing steps. Must be `ACTIVE` and support the `payment_method`.

**fraud** `object`

Configuration of a fraud provider step: `rules`, `blocklists`, `allowlists`, `reviewlists`, `preset` (codes copied from the dashboard, kept as given) and `report_only`. Only on `FRAUD` providers. See [Provider step kinds](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#provider-step-kinds).

**network\_token\_on** `boolean`

Only on payment provider steps of a `CARD` routing. `true` pays with the network token of the card when one is available. The organization must be onboarded to network tokens and the provider must support them (`network_token_enable` on the response), otherwise `400 NETWORK_TOKEN_NOT_ONBOARDED` or `400 NETWORK_TOKEN_NOT_SUPPORTED`. See [Provider step settings](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#provider-step-settings).

**three\_d\_secure\_exemptions** `string[]`

Only on 3DS provider steps. The [SCA exemptions](https://docs.y.uno/docs/payment-features/sca-exemptions.md#allowed-values) this step may apply, e.g. `["LOW_VALUE", "TRANSACTION_RISK_ANALYSIS"]`. See [Provider step settings](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#provider-step-settings).

**smart\_routing** `object`

Makes the step a smart routing step: `type` (`COSTS` or `LATENCY`), `providers` (two to four `{ provider_id, connection_id, network_token_on }` payment providers), `no_retry_decline_types` and `no_retry_failure_causes`. Card routings only, one per route. See [Smart routing steps](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#smart-routing-steps).

**action** `enum`

Makes the step an action step: `CANCEL` rejects the payment, `CAPTURE` captures the authorization, `HOLD_FOR_REVIEW` leaves it pending manual review, `REVERT` reverts it after a fraud screening that ran after the payment. `CAPTURE` and `HOLD_FOR_REVIEW` are reached only from `APPROVED` or `SUCCEEDED_GROUP` outputs of a payment or smart routing step, `REVERT` only from the outputs of a fraud step that runs after the payment, and `CANCEL` never from an approval. An action step has no `provider_id`, `connection_id` or `output`. See [Action steps](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#action-steps).

**action\_delay** `string`

Only with `action = CAPTURE`. ISO-8601 duration between the approval and the capture, at least `PT1M` and at most `P7D` (e.g. `PT5M`, `PT3H`, `P2D`). Omit to capture as soon as the approval is processed.

**output** `object[]`

Defines how to handle each possible outcome of this step. Not allowed on an action step.

**item**

**status** `string` *required*

The outcome status that triggers this rule: `APPROVED`, `DECLINED`, `DECLINE_GROUP`, `MAC_CODE_GROUP`, `SUCCEEDED_GROUP`, `PENDING` (fraud, 3DS and authentication steps only) or `INTERNAL_ERROR`.

**group\_id** `integer`

Id of a group of the account, from [List Decline Groups](https://docs.y.uno/reference/organizations/routing/list-decline-groups.md) or [List Succeeded Groups](https://docs.y.uno/reference/organizations/routing/list-succeeded-groups.md). Required when `status` is `MAC_CODE_GROUP` or `SUCCEEDED_GROUP`; optional on `DECLINE_GROUP`; not allowed otherwise. `MAC_CODE_GROUP` takes a Merchant Advice Code group; `DECLINE_GROUP` takes a decline group or a Merchant Advice Code group (see [Outcome groups](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#outcome-groups)).

**decline\_types** `string[]`

Decline sub-statuses (e.g., `INSUFFICIENT_FUNDS`, `DECLINED_BY_BANK`). On `DECLINE_GROUP`, required unless `group_id` is sent; with `group_id`, it must equal the group's members. Not allowed on `SUCCEEDED_GROUP`.

**retry** `boolean`

`true` attempts the same provider once more when this outcome happens, before following `next`. Only on `DECLINED`, `INTERNAL_ERROR` and `DECLINE_GROUP`. Defaults to `false`. See [Retry](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#retry) for `DECLINE_GROUP` entries on a Merchant Advice Code group.

**next** `integer`

The `index` of the next step to execute. Omit if no fallback is needed. Optional next to `next_split`; if both are sent it must be the first `next_split` entry.

**next\_split** `object[]`

Splits the fallback across several steps by percentage, as `[{ "index": 2, "percentage": 70 }, { "index": 3, "percentage": 30 }]`. At least two entries, integer percentages that sum to `100`. `next` is not required with it.

**condition\_sets** `object[]`

Optional. Ordered by `sort_number` — first matching set wins.

**item**

**sort\_number** `integer` *required*

Priority of the condition set.

**name** `string` *required*

Label for the set.

**conditions** `object[]` *required*

List of [Conditions](https://docs.y.uno/reference/organizations/routing/routing-conditions.md) that must match. Besides `condition_type`, `conditional`, `values`, `key` and `currency`, a `TIME_PERIOD` condition carries its schedule fields, a `VOLUME_PAYMENTS_LIMIT` condition its `limit_by`, `payments_count` and period fields, and an `ORDER_ITEMS_AMOUNT` condition its `item_values`.

**route** `object` *required*

The steps to execute if this set matches. Same shape as `default_route`, including `start_split`, `output[].next_split` and action steps; a route made of a single `CANCEL` step rejects the matching payments.

### Response

**id** `string`

Unique identifier for the routing.

**account\_id** `string`

Unique identifier for the account.

**payment\_method** `enum`

The payment method this routing applies to (e.g., `CARD`).

**name** `string`

Label for the routing.

**default\_route** `object`

The default routing logic, in the shape described in [Retrieve a Routing](https://docs.y.uno/reference/organizations/routing/retrieve-routing.md).

**condition\_sets** `object[]`

Optional conditional logic.

**created\_at** `string`

ISO 8601 timestamp.

**updated\_at** `string`

ISO 8601 timestamp.

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl -X POST 'https://api.y.uno/v1/routing' \
  -H 'public-api-key: <YOUR_PUBLIC_KEY>' \
  -H 'private-secret-key: <YOUR_SECRET_KEY>' \
  -H 'Content-Type: application/json' \
  -H 'X-Idempotency-Key: <UUID>' \
  -d '{
    "account_id": "7825fc5e-e50a-4248-9ae8-5d3786afb0be",
    "payment_method": "CARD",
    "name": "Card routing — Stripe primary, Adyen fallback",
    "default_route": {
      "steps": [
        {
          "index": 1,
          "provider_id": "STRIPE",
          "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
          "output": [
            { "status": "DECLINE_GROUP",  "group_id": 1044, "next": 2, "retry": true },
            { "status": "MAC_CODE_GROUP", "group_id": 4542 },
            { "status": "DECLINED",       "next": 2 },
            { "status": "INTERNAL_ERROR", "next": 2 }
          ]
        },
        {
          "index": 2,
          "provider_id": "ADYEN",
          "connection_id": "b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f"
        }
      ]
    },
    "condition_sets": [
      {
        "sort_number": 1,
        "name": "Reject foreign-issued cards",
        "conditions": [
          { "condition_type": "CARD_ISSUER_COUNTRY", "conditional": "NOT_ONE_OF", "values": ["BR"] }
        ],
        "route": {
          "steps": [
            { "index": 1, "action": "CANCEL" }
          ]
        }
      },
      {
        "sort_number": 2,
        "name": "Brazil — BRL 300 to 600 via Adyen, capture after 5 minutes",
        "description": "BR card transactions between BRL 300 and 600 go to Adyen directly",
        "conditions": [
          { "condition_type": "COUNTRY", "conditional": "EQUAL",   "values": ["BR"] },
          { "condition_type": "AMOUNT",  "conditional": "BETWEEN", "values": ["300.00", "600.00"], "currency": "BRL" }
        ],
        "route": {
          "steps": [
            { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
              "output": [
                { "status": "APPROVED",        "next": 2 },
                { "status": "SUCCEEDED_GROUP", "group_id": 430 }
              ] },
            { "index": 2, "action": "CAPTURE", "action_delay": "PT5M" }
          ]
        }
      },
      {
        "sort_number": 3,
        "name": "Mexico — 45/45/10 between Adyen, Stripe and dLocal",
        "conditions": [
          { "condition_type": "COUNTRY", "conditional": "EQUAL", "values": ["MX"] }
        ],
        "route": {
          "start_split": [
            { "index": 1, "percentage": 45 },
            { "index": 2, "percentage": 45 },
            { "index": 3, "percentage": 10 }
          ],
          "steps": [
            {
              "index": 1,
              "provider_id": "ADYEN",
              "connection_id": "b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
              "output": [
                { "status": "DECLINED", "next_split": [ { "index": 2, "percentage": 70 }, { "index": 3, "percentage": 30 } ] }
              ]
            },
            { "index": 2, "provider_id": "STRIPE", "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e" },
            { "index": 3, "provider_id": "DLOCAL", "connection_id": "c3d5e6f7-2b3c-4d5e-8f6a-7b8c9d0e1f2a" }
          ]
        }
      }
    ]
  }'
```

```json 201 Created theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "id": "8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
  "account_id": "7825fc5e-e50a-4248-9ae8-5d3786afb0be",
  "payment_method": "CARD",
  "name": "Card routing — Stripe primary, Adyen fallback",
  "default_route": {
    "steps": [
      {
        "index": 1,
        "provider_id": "STRIPE",
        "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
        "output": [
          { "status": "DECLINE_GROUP",  "group_id": 1044, "group_name": "Soft declines",
            "decline_types": ["DECLINED_BY_BANK", "RESTRICTED_BY_BANK"], "next": 2, "retry": true },
          { "status": "MAC_CODE_GROUP", "group_id": 4542, "group_name": "Do not retry",
            "decline_types": ["NO_RETRY_POLICY", "NO_RETRY_SECURITY"], "retry": false },
          { "status": "DECLINED",       "next": 2, "retry": false },
          { "status": "INTERNAL_ERROR", "next": 2, "retry": false }
        ]
      },
      { "index": 2, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f", "output": [{ "status": "APPROVED", "next": null, "decline_types": null, "retry": false }, { "status": "INTERNAL_ERROR", "next": null, "decline_types": null, "retry": false }] }
    ]
  },
  "condition_sets": [
    {
      "sort_number": 1,
      "name": "Reject foreign-issued cards",
      "conditions": [
        { "condition_type": "CARD_ISSUER_COUNTRY", "conditional": "NOT_ONE_OF", "values": ["BR"] }
      ],
      "route": { "steps": [ { "index": 1, "action": "CANCEL", "output": [] } ] }
    },
    {
      "sort_number": 2,
      "name": "Brazil — BRL 300 to 600 via Adyen, capture after 5 minutes",
      "conditions": [
        { "condition_type": "COUNTRY", "conditional": "EQUAL",   "values": ["BR"] },
        { "condition_type": "AMOUNT",  "conditional": "BETWEEN", "values": ["300.00", "600.00"], "currency": "BRL" }
      ],
      "route": {
        "steps": [
          { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
            "output": [
              { "status": "APPROVED",        "next": 2, "retry": false },
              { "status": "SUCCEEDED_GROUP", "group_id": 430, "group_name": "Pending review", "retry": false }
            ] },
          { "index": 2, "action": "CAPTURE", "action_delay": "PT5M", "output": [] }
        ]
      }
    },
    { "sort_number": 3, "name": "Mexico — 45/45/10 between Adyen, Stripe and dLocal", "conditions": ["..."], "route": { "steps": ["..."] } }
  ],
  "created_at": "2026-05-12T14:30:00Z",
  "updated_at": "2026-05-12T14:30:00Z"
}
```

```json 400 — Invalid Route Configuration theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_ROUTE_CONFIGURATION",
  "messages": ["step index=2 with action=CAPTURE must be reached only from an APPROVED output of a provider step"]
}
```

```json 400 — Unknown group theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_ROUTE_CONFIGURATION",
  "messages": ["output.group_id=99 not found for account"]
}
```

```json 400 — Group of the wrong kind theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_ROUTE_CONFIGURATION",
  "messages": ["output.group_id=1044 is a DECLINE_GROUP group and cannot be used with status MAC_CODE_GROUP"]
}
```

```json 409 — Already Exists theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "ROUTING_ALREADY_EXISTS",
  "messages": ["A routing for payment_method 'CARD' already exists for this account."]
}
```

### Errors

| HTTP | `code` |
| - | - |
| `400` | `INVALID_PARAMETERS` A field is missing or has an invalid value: a step with neither `provider_id` nor `action`, a `status` or `action` outside their enums, an `action_delay` on a step that is not `CAPTURE`, a malformed `group_id`. `messages` names the offending field. |
| `400` | `INVALID_FORMAT` A field has the wrong type or format: `time_period_start_time` / `time_period_end_time` not `HH:mm:ss`, a date in `values` of a `TIME_PERIOD` condition not ISO-8601, `time_period_repeat_amount` or `sort_number` not an integer, `retry` not a boolean. `messages` names the field. |
| `400` | `INVALID_ROUTE_CONFIGURATION` Route rule violation: non-contiguous step indexes, a `next` or split branch to a missing step, a split that does not sum to 100 or leaves a step unreachable, a `CAPTURE` or `HOLD_FOR_REVIEW` step not reached only from `APPROVED`, an `action_delay` under 1 minute or above 7 days, `retry` on a status that does not support it or on a Merchant Advice Code group the stored routing does not already retry (see [Retry](https://docs.y.uno/reference/organizations/routing/routing-resource-shape.md#retry)), a `group_id` that is unknown, of another account or of the wrong kind, `decline_types` that do not match the group, a condition that breaks a rule of its `condition_type`, or a `connection_id` not found for the account and provider. `messages` explains which rule. |
| `400` | `INVALID_VOLUME_LIMIT_CURRENCY`, `INVALID_VOLUME_LIMIT_PERIOD`, `UNSUPPORTED_VOLUME_LIMIT_TIMEZONE` A `VOLUME_PAYMENTS_LIMIT` condition with an invalid currency, period or timezone. See [Volume and count limits](https://docs.y.uno/reference/organizations/routing/routing-conditions.md#volume-and-count-limits-volume_payments_limit). |
| `400` | `INVALID_PROVIDER_ID` `provider_id` has an invalid format. |
| `409` | `ROUTING_ALREADY_EXISTS` A routing already exists for this `(account, payment_method)`. Use `PATCH` to update it. |
| `401` | `NOT_AUTHENTICATED` Missing `public-api-key` or `private-secret-key` header. |
| `401` | `INVALID_CREDENTIALS` Wrong key pair, or a Dashboard **Customized API key** was used. Use an account key or organization key instead. |


## OpenAPI

````yaml openapi/organizations/routing/create-routing.json POST /routing
openapi: 3.1.0
info:
  title: Routing API - Create
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /routing:
    post:
      summary: Create a Routing
      description: Creates a routing for one (account_id, payment_method) pair.
      operationId: create-routing
      parameters:
        - name: X-Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_id
                - payment_method
                - name
                - default_route
              properties:
                account_id:
                  type: string
                  format: uuid
                  example: 7825fc5e-e50a-4248-9ae8-5d3786afb0be
                payment_method:
                  type: string
                  example: CARD
                name:
                  type: string
                  example: Card routing
                default_route:
                  type: object
                  required:
                    - steps
                  properties:
                    start_split:
                      type: array
                      description: >-
                        Splits the entry of the route across several steps by
                        percentage. Omit to start every payment on step 1.
                        Entries must sum to 100; returned only when the route
                        has a split entry.
                      items:
                        type: object
                        required:
                          - index
                          - percentage
                        properties:
                          index:
                            type: integer
                            example: 1
                          percentage:
                            type: integer
                            example: 45
                    steps:
                      type: array
                      items:
                        type: object
                        required:
                          - index
                        properties:
                          index:
                            type: integer
                            example: 1
                          provider_id:
                            type: string
                            example: STRIPE
                            description: >-
                              Required on provider steps (SMART_ROUTING on a
                              smart routing step); absent on action steps. Must
                              match the provider of the connection.
                          connection_id:
                            type: string
                            format: uuid
                            example: f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e
                            description: >-
                              Required on provider steps; absent on action and
                              smart routing steps. Must be ACTIVE and support
                              the payment_method.
                          action:
                            type: string
                            enum:
                              - CANCEL
                              - CAPTURE
                              - HOLD_FOR_REVIEW
                              - REVERT
                            description: >-
                              Makes the step an action step that ends the route:
                              CANCEL rejects the payment, CAPTURE captures the
                              authorization after action_delay, HOLD_FOR_REVIEW
                              leaves it pending manual review, REVERT reverts it
                              after a post-payment fraud screening. CAPTURE and
                              HOLD_FOR_REVIEW follow an APPROVED or
                              SUCCEEDED_GROUP output of a payment or smart
                              routing step, REVERT the outputs of a fraud step
                              that runs after the payment, CANCEL never an
                              approval. An action step has no provider_id,
                              connection_id or output.
                          action_delay:
                            type: string
                            example: PT5M
                            description: >-
                              Only with action = CAPTURE. ISO-8601 duration
                              between the approval and the capture, at least
                              PT1M and at most P7D. Omit to capture as soon as
                              the approval is processed.
                          output:
                            type: array
                            items:
                              type: object
                              required:
                                - status
                              properties:
                                status:
                                  type: string
                                  example: DECLINED
                                  description: >-
                                    APPROVED, DECLINED, DECLINE_GROUP,
                                    MAC_CODE_GROUP, SUCCEEDED_GROUP, PENDING
                                    (fraud, 3DS and authentication steps only)
                                    or INTERNAL_ERROR.
                                decline_types:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    Decline sub-statuses. On DECLINE_GROUP,
                                    required unless group_id is sent; with
                                    group_id it must equal the group's members.
                                    Not allowed on SUCCEEDED_GROUP.
                                group_id:
                                  type: integer
                                  example: 1044
                                  description: >-
                                    Id of a decline, Merchant Advice Code or
                                    succeeded group of the account (see List
                                    Decline Groups and List Succeeded Groups).
                                    Required on MAC_CODE_GROUP and
                                    SUCCEEDED_GROUP, optional on DECLINE_GROUP,
                                    not allowed otherwise. MAC_CODE_GROUP takes
                                    a Merchant Advice Code group; DECLINE_GROUP
                                    takes a decline group or a Merchant Advice
                                    Code group.
                                retry:
                                  type: boolean
                                  example: false
                                  description: >-
                                    true attempts the same provider once more
                                    when this outcome happens, before following
                                    next. Only on DECLINED, INTERNAL_ERROR and
                                    DECLINE_GROUP; on a DECLINE_GROUP entry that
                                    references a Merchant Advice Code group,
                                    only where the stored routing already
                                    retries that group on the same step, so
                                    always rejected on create. On update, an
                                    omitted retry keeps the stored value.
                                next:
                                  type: integer
                                  example: 2
                                next_split:
                                  type: array
                                  description: >-
                                    Splits the fallback across several steps by
                                    percentage: at least 2 entries whose
                                    percentages sum to 100. next is optional
                                    next to it and, when sent, must equal the
                                    first entry; responses return next = first
                                    entry alongside next_split.
                                  items:
                                    type: object
                                    required:
                                      - index
                                      - percentage
                                    properties:
                                      index:
                                        type: integer
                                        example: 2
                                      percentage:
                                        type: integer
                                        example: 70
                            description: >-
                              Per-outcome handlers of a provider step. Not
                              allowed on an action step.
                          network_token_on:
                            type: boolean
                            description: >-
                              Only on payment provider steps of a CARD routing.
                              true pays with the network token of the card when
                              one is available; requires the organization
                              onboarded to network tokens and a provider that
                              supports them (network_token_enable on the
                              response), otherwise 400
                              NETWORK_TOKEN_NOT_ONBOARDED or
                              NETWORK_TOKEN_NOT_SUPPORTED. Omitted on update
                              keeps the stored value; false turns it off.
                          three_d_secure_exemptions:
                            type: array
                            items:
                              type: string
                              enum:
                                - LOW_VALUE
                                - TRANSACTION_RISK_ANALYSIS
                                - SECURE_CORPORATE
                                - TRUSTED_BENEFICIARY
                                - RECURRING_PAYMENT
                                - STRONG_CUSTOMER_AUTHENTICATION
                                - OUT_OF_SCOPE
                            description: >-
                              Only on 3DS provider steps. The SCA exemptions
                              this step may apply. Omitted on update keeps the
                              stored list; [] clears it.
                          fraud:
                            type: object
                            description: >-
                              Configuration of a fraud provider step. Only on
                              FRAUD providers; omitted on update keeps the
                              stored configuration.
                            properties:
                              rules:
                                type: string
                                example: rule-a,rule-b
                              blocklists:
                                type: string
                              allowlists:
                                type: string
                              reviewlists:
                                type: string
                              preset:
                                type: string
                              report_only:
                                type: boolean
                                description: >-
                                  Score without acting on the result. Only on a
                                  fraud step reached from declined outputs of a
                                  payment step.
                          smart_routing:
                            type: object
                            description: >-
                              Makes the step a smart routing step (provider_id
                              SMART_ROUTING, no connection_id). Card routings
                              only, one per route.
                            required:
                              - type
                              - providers
                            properties:
                              type:
                                type: string
                                enum:
                                  - COSTS
                                  - LATENCY
                                example: LATENCY
                              providers:
                                type: array
                                minItems: 2
                                maxItems: 4
                                items:
                                  type: object
                                  required:
                                    - provider_id
                                    - connection_id
                                  properties:
                                    provider_id:
                                      type: string
                                      example: ADYEN
                                    connection_id:
                                      type: string
                                      format: uuid
                                    network_token_on:
                                      type: boolean
                              no_retry_decline_types:
                                type: array
                                items:
                                  type: string
                                description: >-
                                  Decline sub-statuses after which the next
                                  provider of the set is not tried.
                              no_retry_failure_causes:
                                type: array
                                items:
                                  type: string
                                description: >-
                                  Failure causes (for example PROVIDER_TIMEOUT)
                                  after which the next provider of the set is
                                  not tried.
                        description: >-
                          A provider attempt (provider_id + connection_id) or an
                          action step (action). index values are contiguous
                          starting at 1.
                condition_sets:
                  type: array
                  description: Optional. Ordered by sort_number, first matching set wins.
                  items:
                    type: object
                    required:
                      - sort_number
                      - name
                      - conditions
                      - route
                    properties:
                      sort_number:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: US & Canada — high value
                      description:
                        type: string
                      conditions:
                        type: array
                        items:
                          type: object
                          required:
                            - condition_type
                            - conditional
                            - values
                          properties:
                            condition_type:
                              type: string
                              example: COUNTRY
                              description: >-
                                See Routing Conditions for the catalog: COUNTRY,
                                CARD_ISSUER_COUNTRY, AMOUNT, CURRENCY,
                                CARD_TYPE, CARD_BRAND, CARD_BIN,
                                TRANSACTION_TYPE, METADATA, ADDITIONAL_FIELD,
                                ORDER_ITEMS_AMOUNT, TIME_PERIOD,
                                VOLUME_PAYMENTS_LIMIT, SUBSCRIPTION_RETRY,
                                SUBSCRIPTION_RETRY_COUNT.
                            conditional:
                              type: string
                              example: ONE_OF
                            values:
                              type: array
                              items:
                                type: string
                              example:
                                - US
                                - CA
                              description: >-
                                On CURRENCY, uppercase ISO 4217 codes (not XXX,
                                no repeats): exactly 1 with EQUAL or NOT_EQUAL,
                                1 or more with ONE_OF or NOT_ONE_OF. Empty only
                                on an AMOUNT condition with currency, which then
                                matches any amount in that currency. On
                                ORDER_ITEMS_AMOUNT, the numeric threshold for
                                the summed items: 1 value, 2 with BETWEEN.
                            key:
                              type: string
                              description: >-
                                METADATA: the metadata key. ADDITIONAL_FIELD:
                                the supported field name. ORDER_ITEMS_AMOUNT:
                                the order item field item_values is matched
                                against, sku_code (default), category or brand.
                            item_values:
                              type: array
                              items:
                                type: string
                              example:
                                - GC-50
                                - GC-100
                                - GC-200
                              description: >-
                                ORDER_ITEMS_AMOUNT only, and required on it:
                                non-empty list of order item values (exact,
                                case-sensitive) whose quantity × unit_amount is
                                added up. Rejected on any other condition_type.
                            currency:
                              type: string
                              example: USD
                              description: >-
                                ISO 4217. Required on AMOUNT, on
                                ORDER_ITEMS_AMOUNT and on VOLUME_PAYMENTS_LIMIT
                                with limit_by = VOLUME. Not sent on CURRENCY,
                                whose currencies go in values.
                            time_period_repeat_amount:
                              type: integer
                              example: 1
                              description: >-
                                TIME_PERIOD and VOLUME_PAYMENTS_LIMIT: every how
                                many units of time_period_repeat_frequency
                                (schedule), or the length of a DAILY window in
                                days, 1 to 90 (limit).
                            time_period_repeat_frequency:
                              type: string
                              enum:
                                - DAILY
                                - WEEKLY
                                - MONTHLY
                                - QUARTERLY
                                - YEARLY
                              description: >-
                                TIME_PERIOD: recurrence unit.
                                VOLUME_PAYMENTS_LIMIT: period of the limit,
                                DAILY, MONTHLY or QUARTERLY.
                            time_period_repetition_days:
                              type: array
                              items:
                                type: string
                                enum:
                                  - MONDAY
                                  - TUESDAY
                                  - WEDNESDAY
                                  - THURSDAY
                                  - FRIDAY
                                  - SATURDAY
                                  - SUNDAY
                              description: >-
                                TIME_PERIOD only. Days of the week the schedule
                                applies to; needs a frequency.
                            time_period_start_time:
                              type: string
                              example: '09:00:00'
                              description: >-
                                TIME_PERIOD only. Start of the daily time window
                                (HH:mm:ss), together with time_period_end_time.
                            time_period_end_time:
                              type: string
                              example: '18:00:00'
                              description: >-
                                TIME_PERIOD only. End of the daily time window
                                (HH:mm:ss), inclusive.
                            timezone:
                              type: string
                              example: '-03:00'
                              description: >-
                                UTC offset. TIME_PERIOD: offset the schedule is
                                read in (defaults to the offset of values[0]).
                                VOLUME_PAYMENTS_LIMIT: whole-hour offset where
                                periods start (defaults to +00:00).
                            limit_by:
                              type: string
                              enum:
                                - PAYMENTS
                                - VOLUME
                              description: >-
                                VOLUME_PAYMENTS_LIMIT only. Count payments
                                (default) or sum amounts in currency.
                            payments_count:
                              type: string
                              enum:
                                - ALL
                                - SUCCEEDED
                              description: >-
                                VOLUME_PAYMENTS_LIMIT only. Which payments count
                                toward the limit. Default ALL.
                        description: >-
                          Conditions combined with logical AND. See Routing
                          Conditions.
                      route:
                        type: object
                        description: >-
                          Same shape as default_route, including start_split,
                          output[].next_split and action steps.
            example:
              account_id: 7825fc5e-e50a-4248-9ae8-5d3786afb0be
              payment_method: GOOGLE_PAY
              name: Google Pay routing
              default_route:
                steps:
                  - index: 1
                    provider_id: ADYEN
                    connection_id: b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f
                    output:
                      - status: APPROVED
                        next: 3
                      - status: DECLINED
                        retry: false
                        next_split:
                          - index: 2
                            percentage: 70
                          - index: 4
                            percentage: 30
                  - index: 2
                    provider_id: ADYEN
                    connection_id: b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f
                    output:
                      - status: APPROVED
                        next: 3
                  - index: 3
                    action: CAPTURE
                    action_delay: PT5M
                  - index: 4
                    action: CANCEL
              condition_sets:
                - sort_number: 1
                  name: US & Canada
                  conditions:
                    - condition_type: COUNTRY
                      conditional: ONE_OF
                      values:
                        - US
                        - CA
                  route:
                    steps:
                      - index: 1
                        provider_id: ADYEN
                        connection_id: b2c4d5e6-1a2b-4c3d-8e4f-5a6b7c8d9e0f
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f
                  account_id:
                    type: string
                    example: acc-uuid
                  payment_method:
                    type: string
                    example: CARD
                  name:
                    type: string
                    example: Card routing
                  default_route:
                    type: object
                    properties:
                      start_split:
                        type: array
                        description: >-
                          Splits the entry of the route across several steps by
                          percentage. Omit to start every payment on step 1.
                          Entries must sum to 100; returned only when the route
                          has a split entry.
                        items:
                          type: object
                          required:
                            - index
                            - percentage
                          properties:
                            index:
                              type: integer
                              example: 1
                            percentage:
                              type: integer
                              example: 45
                      steps:
                        type: array
                        items:
                          type: object
                          properties:
                            index:
                              type: integer
                              example: 1
                            provider_id:
                              type: string
                              example: STRIPE
                              description: >-
                                Required on provider steps; absent on action
                                steps. Must match the provider of the
                                connection.
                            connection_id:
                              type: string
                              example: f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e
                              description: >-
                                Required on provider steps; absent on action and
                                smart routing steps. Must be ACTIVE and support
                                the payment_method.
                            provider_type:
                              type: string
                              enum:
                                - PAYMENT
                                - FRAUD
                                - THREE_D_SECURE
                                - AUTHENTICATION
                              description: >-
                                The kind the provider resolves to. Response
                                only.
                            timeout:
                              type: integer
                              example: 60
                              description: >-
                                Provider steps. Timeout in seconds of the
                                provider, from the provider catalog. Response
                                only.
                            network_token_enable:
                              type: boolean
                              description: >-
                                Payment steps. Whether network_token_on can be
                                true on this step: the organization is onboarded
                                to network tokens and the provider supports
                                them. Response only.
                            network_token_on:
                              type: boolean
                              description: >-
                                Payment steps. Whether the step pays with the
                                network token of the card when one is available.
                            three_d_secure_exemptions:
                              type: array
                              items:
                                type: string
                                enum:
                                  - LOW_VALUE
                                  - TRANSACTION_RISK_ANALYSIS
                                  - SECURE_CORPORATE
                                  - TRUSTED_BENEFICIARY
                                  - RECURRING_PAYMENT
                                  - STRONG_CUSTOMER_AUTHENTICATION
                                  - OUT_OF_SCOPE
                              description: >-
                                3DS steps. The SCA exemptions the step may
                                apply; an empty array when none.
                            action:
                              type: string
                              enum:
                                - CANCEL
                                - CAPTURE
                                - HOLD_FOR_REVIEW
                                - REVERT
                              description: >-
                                Makes the step an action step that ends the
                                route: CANCEL rejects the payment, CAPTURE
                                captures the authorization after action_delay,
                                HOLD_FOR_REVIEW leaves it pending manual review,
                                REVERT reverts it after a post-payment fraud
                                screening. CAPTURE and HOLD_FOR_REVIEW follow an
                                APPROVED or SUCCEEDED_GROUP output of a payment
                                or smart routing step, REVERT the outputs of a
                                fraud step that runs after the payment, CANCEL
                                never an approval. An action step has no
                                provider_id, connection_id or output.
                            action_delay:
                              type: string
                              example: PT5M
                              description: >-
                                Only with action = CAPTURE. ISO-8601 duration
                                between the approval and the capture, at least
                                PT1M and at most P7D. Omit to capture as soon as
                                the approval is processed.
                            output:
                              type: array
                              items:
                                type: object
                                required:
                                  - status
                                properties:
                                  status:
                                    type: string
                                    example: DECLINED
                                    description: >-
                                      APPROVED, DECLINED, DECLINE_GROUP,
                                      MAC_CODE_GROUP, SUCCEEDED_GROUP, PENDING
                                      (fraud, 3DS and authentication steps only)
                                      or INTERNAL_ERROR.
                                  decline_types:
                                    type: array
                                    items:
                                      type: string
                                    description: >-
                                      Members of the group on DECLINE_GROUP
                                      (decline sub-statuses) and MAC_CODE_GROUP
                                      (Merchant Advice Codes) outputs.
                                  group_id:
                                    type: integer
                                    example: 1044
                                    description: >-
                                      Id of the group behind a DECLINE_GROUP,
                                      MAC_CODE_GROUP or SUCCEEDED_GROUP output.
                                  group_name:
                                    type: string
                                    example: Soft declines
                                    description: >-
                                      Name of the group behind group_id. Ignored
                                      on write.
                                  retry:
                                    type: boolean
                                    example: false
                                    description: >-
                                      Whether this output retries the same
                                      provider once before following next.
                                      Always returned.
                                  next:
                                    type: integer
                                    example: 2
                                  next_split:
                                    type: array
                                    description: >-
                                      Splits the fallback across several steps
                                      by percentage: at least 2 entries whose
                                      percentages sum to 100. next is optional
                                      next to it and, when sent, must equal the
                                      first entry; responses return next = first
                                      entry alongside next_split.
                                    items:
                                      type: object
                                      required:
                                        - index
                                        - percentage
                                      properties:
                                        index:
                                          type: integer
                                          example: 2
                                        percentage:
                                          type: integer
                                          example: 70
                              description: >-
                                Per-outcome handlers. Returned as an empty array
                                on action steps.
                            fraud:
                              type: object
                              description: >-
                                Configuration of a fraud provider step, returned
                                on FRAUD steps.
                              properties:
                                rules:
                                  type: string
                                  example: rule-a,rule-b
                                blocklists:
                                  type: string
                                allowlists:
                                  type: string
                                reviewlists:
                                  type: string
                                preset:
                                  type: string
                                report_only:
                                  type: boolean
                                  description: >-
                                    Score without acting on the result. Only on
                                    a fraud step reached from declined outputs
                                    of a payment step.
                            smart_routing:
                              type: object
                              description: Returned on smart routing steps.
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - COSTS
                                    - LATENCY
                                  example: LATENCY
                                providers:
                                  type: array
                                  minItems: 2
                                  maxItems: 4
                                  items:
                                    type: object
                                    required:
                                      - provider_id
                                      - connection_id
                                    properties:
                                      provider_id:
                                        type: string
                                        example: ADYEN
                                      connection_id:
                                        type: string
                                        format: uuid
                                      network_token_on:
                                        type: boolean
                                no_retry_decline_types:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    Decline sub-statuses after which the next
                                    provider of the set is not tried.
                                no_retry_failure_causes:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    Failure causes (for example
                                    PROVIDER_TIMEOUT) after which the next
                                    provider of the set is not tried.
                  condition_sets:
                    type: array
                    items:
                      type: object
                      properties:
                        sort_number:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: High Value US
                        description:
                          type: string
                        conditions:
                          type: array
                          items:
                            type: object
                            properties:
                              condition_type:
                                type: string
                                example: COUNTRY
                                description: >-
                                  See Routing Conditions for the catalog:
                                  COUNTRY, CARD_ISSUER_COUNTRY, AMOUNT,
                                  CURRENCY, CARD_TYPE, CARD_BRAND, CARD_BIN,
                                  TRANSACTION_TYPE, METADATA, ADDITIONAL_FIELD,
                                  ORDER_ITEMS_AMOUNT, TIME_PERIOD,
                                  VOLUME_PAYMENTS_LIMIT, SUBSCRIPTION_RETRY,
                                  SUBSCRIPTION_RETRY_COUNT.
                              conditional:
                                type: string
                                example: ONE_OF
                              values:
                                type: array
                                items:
                                  type: string
                                example:
                                  - US
                                  - CA
                                description: >-
                                  On CURRENCY, uppercase ISO 4217 codes (not
                                  XXX, no repeats): exactly 1 with EQUAL or
                                  NOT_EQUAL, 1 or more with ONE_OF or
                                  NOT_ONE_OF. Empty only on an AMOUNT condition
                                  with currency, which then matches any amount
                                  in that currency. On ORDER_ITEMS_AMOUNT, the
                                  numeric threshold for the summed items: 1
                                  value, 2 with BETWEEN.
                              key:
                                type: string
                                description: >-
                                  METADATA: the metadata key. ADDITIONAL_FIELD:
                                  the supported field name. ORDER_ITEMS_AMOUNT:
                                  the order item field item_values is matched
                                  against, sku_code (default), category or
                                  brand.
                              item_values:
                                type: array
                                items:
                                  type: string
                                example:
                                  - GC-50
                                  - GC-100
                                  - GC-200
                                description: >-
                                  ORDER_ITEMS_AMOUNT only, and required on it:
                                  non-empty list of order item values (exact,
                                  case-sensitive) whose quantity × unit_amount
                                  is added up. Rejected on any other
                                  condition_type.
                              currency:
                                type: string
                                example: USD
                                description: >-
                                  ISO 4217. Required on AMOUNT, on
                                  ORDER_ITEMS_AMOUNT and on
                                  VOLUME_PAYMENTS_LIMIT with limit_by = VOLUME.
                                  Not sent on CURRENCY, whose currencies go in
                                  values.
                              time_period_repeat_amount:
                                type: integer
                                example: 1
                                description: >-
                                  TIME_PERIOD and VOLUME_PAYMENTS_LIMIT: every
                                  how many units of time_period_repeat_frequency
                                  (schedule), or the length of a DAILY window in
                                  days, 1 to 90 (limit).
                              time_period_repeat_frequency:
                                type: string
                                enum:
                                  - DAILY
                                  - WEEKLY
                                  - MONTHLY
                                  - QUARTERLY
                                  - YEARLY
                                description: >-
                                  TIME_PERIOD: recurrence unit.
                                  VOLUME_PAYMENTS_LIMIT: period of the limit,
                                  DAILY, MONTHLY or QUARTERLY.
                              time_period_repetition_days:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - MONDAY
                                    - TUESDAY
                                    - WEDNESDAY
                                    - THURSDAY
                                    - FRIDAY
                                    - SATURDAY
                                    - SUNDAY
                                description: >-
                                  TIME_PERIOD only. Days of the week the
                                  schedule applies to; needs a frequency.
                              time_period_start_time:
                                type: string
                                example: '09:00:00'
                                description: >-
                                  TIME_PERIOD only. Start of the daily time
                                  window (HH:mm:ss), together with
                                  time_period_end_time.
                              time_period_end_time:
                                type: string
                                example: '18:00:00'
                                description: >-
                                  TIME_PERIOD only. End of the daily time window
                                  (HH:mm:ss), inclusive.
                              timezone:
                                type: string
                                example: '-03:00'
                                description: >-
                                  UTC offset. TIME_PERIOD: offset the schedule
                                  is read in (defaults to the offset of
                                  values[0]). VOLUME_PAYMENTS_LIMIT: whole-hour
                                  offset where periods start (defaults to
                                  +00:00).
                              limit_by:
                                type: string
                                enum:
                                  - PAYMENTS
                                  - VOLUME
                                description: >-
                                  VOLUME_PAYMENTS_LIMIT only. Count payments
                                  (default) or sum amounts in currency.
                              payments_count:
                                type: string
                                enum:
                                  - ALL
                                  - SUCCEEDED
                                description: >-
                                  VOLUME_PAYMENTS_LIMIT only. Which payments
                                  count toward the limit. Default ALL.
                          description: >-
                            Conditions combined with logical AND. See Routing
                            Conditions.
                        route:
                          type: object
                          description: >-
                            Same shape as default_route, including start_split,
                            output[].next_split and action steps.
                  created_at:
                    type: string
                    format: date-time
                    example: '2026-05-12T14:30:00Z'
                  updated_at:
                    type: string
                    format: date-time
                    example: '2026-05-12T14:30:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_ROUTE_CONFIGURATION
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - >-
                        step index=2 with action=CAPTURE must be reached only
                        from an APPROVED output of a provider step
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NOT_AUTHENTICATED
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - Not authenticated
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_ALREADY_EXISTS
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - A routing already exists for this payment method
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````

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