Skip to main content
POST
/
routing
Create a Routing
curl --request POST \
  --url https://api-sandbox.y.uno/v1/routing \
  --header 'Content-Type: application/json' \
  --header 'PRIVATE-SECRET-KEY: <api-key>' \
  --header 'PUBLIC-API-KEY: <api-key>' \
  --header 'X-Idempotency-Key: <x-idempotency-key>' \
  --data '
{
  "payment_method": "CARD",
  "name": "Card routing",
  "default_route": {
    "steps": [
      {
        "index": 1,
        "provider_id": "STRIPE",
        "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e"
      }
    ]
  }
}
'
{
  "id": "r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
  "account_code": "acc-uuid",
  "payment_method": "CARD",
  "name": "Card routing",
  "default_route": {
    "steps": [
      {
        "index": 1,
        "provider_id": "STRIPE",
        "connection_id": "f1a3c4d5-..."
      }
    ]
  },
  "condition_sets": [
    {
      "sort_number": 1,
      "name": "High Value US",
      "conditions": [
        {}
      ],
      "route": {}
    }
  ],
  "created_at": "2026-05-12T14:30:00Z",
  "updated_at": "2026-05-12T14:30:00Z",
  "warnings": [
    "MONITOR_REDISTRIBUTION_DEFERRED"
  ]
}

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.

Creates a routing for one (account_code, 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.

Body

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.
condition_sets
object[]
Optional. Ordered by sort_number — first matching set wins.

Response

id
string
Unique identifier for the routing.
account_code
string
Unique code 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.
condition_sets
object[]
Optional conditional logic.
created_at
string
ISO 8601 timestamp.
updated_at
string
ISO 8601 timestamp.
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 '{
    "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",
              "decline_types": ["DECLINED_BY_BANK", "DO_NOT_HONOR"],
              "next": 2
            },
            { "status": "TIMEOUT",        "next": 2 },
            { "status": "INTERNAL_ERROR", "next": 2 }
          ]
        },
        {
          "index": 2,
          "provider_id": "ADYEN",
          "connection_id": "b2c4d5e6-1a2b-3c4d-5e6f-7a8b9c0d1e2f"
        }
      ]
    },
    "condition_sets": [
      {
        "sort_number": 1,
        "name": "Brazil — 3 to 6 installments via Adyen",
        "description": "BR card transactions with 3–6 installments go to Adyen directly",
        "conditions": [
          { "condition_type": "COUNTRY",      "conditional": "EQUAL",   "values": ["BR"] },
          { "condition_type": "INSTALLMENTS", "conditional": "BETWEEN", "values": ["3", "6"] }
        ],
        "route": {
          "steps": [
            { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-..." }
          ]
        }
      }
    ]
  }'

Errors

HTTPcodeWhen
400ROUTING_VALIDATION_FAILEDSchema or rule violation. details names the offending field/path.
400ROUTING_PROVIDER_NOT_AVAILABLEA step references a (provider_id, connection_id) not active for the account on this payment_method.
409ROUTING_ALREADY_EXISTSA routing already exists for this (account, payment_method). Use PATCH to update it.
403INSUFFICIENT_SCOPEAPI key missing routing:write.

Authorizations

PUBLIC-API-KEY
string
header
default:<Your PUBLIC-API-KEY>
required
PRIVATE-SECRET-KEY
string
header
default:<Your PRIVATE-SECRET-KEY>
required

Headers

X-Idempotency-Key
string<uuid>
required

Body

application/json
payment_method
string
required
Example:

"CARD"

name
string
required
Example:

"Card routing"

default_route
object
required

Response

Created

id
string
Example:

"r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f"

account_code
string
Example:

"acc-uuid"

payment_method
string
Example:

"CARD"

name
string
Example:

"Card routing"

default_route
object
condition_sets
object[]
created_at
string<date-time>
Example:

"2026-05-12T14:30:00Z"

updated_at
string<date-time>
Example:

"2026-05-12T14:30:00Z"

warnings
string[]
Example:
["MONITOR_REDISTRIBUTION_DEFERRED"]