Routing
Update a Routing
Replaces the routing’s full configuration.
PATCH
/
routing
/
{routing_id}
Update a Routing
curl --request PATCH \
--url https://api-sandbox.y.uno/v1/routing/{routing_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Idempotency-Key: <x-idempotency-key>'import requests
url = "https://api-sandbox.y.uno/v1/routing/{routing_id}"
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/routing/{routing_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/routing/{routing_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/routing/{routing_id}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-sandbox.y.uno/v1/routing/{routing_id}")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/routing/{routing_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
"account_id": "acc-uuid",
"payment_method": "CARD",
"name": "Updated Card routing v2",
"default_route": {
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-..."
}
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "Updated Card routing",
"conditions": [
{}
],
"route": {}
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-12T14:30:00Z"
}{
"type": "validation_error",
"code": "ROUTING_VALIDATION_FAILED",
"message": "Validation failed for update"
}{
"type": "not_found",
"code": "ROUTING_NOT_FOUND",
"message": "Routing '...' was not found"
}{
"type": "conflict",
"code": "ROUTING_VERSION_CONFLICT",
"message": "Another concurrent PATCH won the publish race"
}Replaces the routing’s full configuration. The body has the same shape as Create a Routing — the new
default_route and condition_sets[] entirely supersede the previous live state. There is no field-level merge.
account_id and payment_method are sticky to the routing_id — they’re set at creation and cannot be changed by PATCH.
Path Parameters
string
required
The id returned by Create a Routing.
Body
string
required
Free-form label.
object
required
The route used when no
condition_sets[] matches.Show properties
Show properties
object[]
required
Each step is one provider attempt.
index values are contiguous starting at 1.Show item
Show item
integer
required
Step ordinal.
string
required
Must match the provider of the connection.
UUID
required
Must be
ACTIVE and support the payment_method.object[]
Defines how to handle each possible outcome of this step.
Show item
Show item
string
required
The outcome status that triggers this rule (e.g.,
APPROVED, DECLINED, DECLINE_GROUP, TIMEOUT, INTERNAL_ERROR).string[]
Required when
status is DECLINE_GROUP. Specifies which decline subtypes trigger this rule (e.g., INSUFFICIENT_FUNDS, DECLINED_BY_BANK).integer
The
index of the next step to execute. Omit if no fallback is needed.object[]
Optional. Ordered by
sort_number — first matching set wins.Show item
Show item
integer
required
Priority of the condition set.
string
required
Label for the set.
object[]
required
List of Conditions that must match.
object
required
The steps to execute if this set matches.
Response
string
Unique identifier for the routing.
string
Unique identifier for the account.
enum
The payment method this routing applies to (e.g.,
CARD).string
Label for the routing.
object
The default routing logic.
object[]
Optional conditional logic.
string
ISO 8601 timestamp.
string
ISO 8601 timestamp.
curl -X PATCH 'https://api.y.uno/v1/routing/r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f' \
-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 v2 — adds BR installments rule",
"default_route": {
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
"output": [
{ "status": "DECLINED", "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-..." }
]
}
}
]
}'
{
"id": "r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
"account_id": "acc-uuid",
"payment_method": "CARD",
"name": "Card routing v2 — adds BR installments rule",
"default_route": {
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
"output": [ { "status": "DECLINED", "next": 2 } ]
},
{ "index": 2, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-..." }
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "Brazil — 3 to 6 installments via Adyen",
"conditions": [
{ "condition_type": "COUNTRY", "conditional": "EQUAL", "values": ["BR"] }
],
"route": { "steps": ["..."] }
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-13T09:18:42Z"
}
{
"type": "validation_error",
"code": "ROUTING_PAYMENT_METHOD_IMMUTABLE",
"message": "payment_method cannot be changed on an existing routing",
"details": {
"routing_id": "r_...",
"current_payment_method": "CARD",
"received_payment_method": "PIX"
}
}
Errors
| HTTP | code |
|---|---|
404 | ROUTING_NOT_FOUNDUnknown routing_id, or id belongs to a different account. |
400 | ROUTING_VALIDATION_FAILEDSchema or rule violation. |
400 | ROUTING_PROVIDER_NOT_AVAILABLEA step references an inactive/unknown connection. |
400 | ROUTING_PAYMENT_METHOD_IMMUTABLEBody’s payment_method doesn’t match the routing’s payment_method. |
409 | ROUTING_VERSION_CONFLICTAnother concurrent PATCH won the publish race. |
403 | INSUFFICIENT_SCOPEAPI key missing routing:write. |
Authorizations
Headers
Path Parameters
Response
OK
Example:
"r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f"
Example:
"acc-uuid"
Example:
"CARD"
Example:
"Updated Card routing v2"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"2026-05-12T14:30:00Z"
Example:
"2026-05-12T14:30:00Z"
Was this page helpful?
Previous
Report StatusExplains the report lifecycle statuses from generation through download or expiration.
Next
⌘I
Update a Routing
curl --request PATCH \
--url https://api-sandbox.y.uno/v1/routing/{routing_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--header 'X-Idempotency-Key: <x-idempotency-key>'import requests
url = "https://api-sandbox.y.uno/v1/routing/{routing_id}"
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.patch(url, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/routing/{routing_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/routing/{routing_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-key>",
"X-Idempotency-Key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/routing/{routing_id}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-sandbox.y.uno/v1/routing/{routing_id}")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/routing/{routing_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
"account_id": "acc-uuid",
"payment_method": "CARD",
"name": "Updated Card routing v2",
"default_route": {
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-..."
}
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "Updated Card routing",
"conditions": [
{}
],
"route": {}
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-12T14:30:00Z"
}{
"type": "validation_error",
"code": "ROUTING_VALIDATION_FAILED",
"message": "Validation failed for update"
}{
"type": "not_found",
"code": "ROUTING_NOT_FOUND",
"message": "Routing '...' was not found"
}{
"type": "conflict",
"code": "ROUTING_VERSION_CONFLICT",
"message": "Another concurrent PATCH won the publish race"
}