路由
检索路由
返回路由当前生效的配置,通过其 routing_id 识别。
GET
/
routing
/
{routing_id}
检索路由配置
curl --request GET \
--url https://api-sandbox.y.uno/v1/routing/{routing_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/routing/{routing_id}"
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'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 => "GET",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-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("GET", url, nil)
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.get("https://api-sandbox.y.uno/v1/routing/{routing_id}")
.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::Get.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
"account_id": "acc-uuid",
"payment_method": "CARD",
"name": "Card routing — Stripe primary, Adyen fallback",
"default_route": {
"start_split": [
{
"index": 1,
"percentage": 45
}
],
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-...",
"provider_type": "PAYMENT",
"timeout": 60,
"network_token_enable": true,
"network_token_on": true,
"three_d_secure_exemptions": [
"LOW_VALUE"
],
"action": "CANCEL",
"action_delay": "PT5M",
"output": [
{
"status": "DECLINED",
"decline_types": [
"<string>"
],
"group_id": 1044,
"group_name": "Soft declines",
"retry": false,
"next": 2,
"next_split": [
{
"index": 2,
"percentage": 70
}
]
}
],
"fraud": {
"rules": "rule-a,rule-b",
"blocklists": "<string>",
"allowlists": "<string>",
"reviewlists": "<string>",
"preset": "<string>",
"report_only": true
},
"smart_routing": {
"type": "LATENCY",
"providers": [
{
"provider_id": "ADYEN",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_token_on": true
}
],
"no_retry_decline_types": [
"<string>"
],
"no_retry_decline_group_ids": [
5120
],
"no_retry_failure_causes": [
"<string>"
]
}
}
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "High Value US",
"description": "<string>",
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": [
"US",
"CA"
],
"key": "<string>",
"item_values": [
"GC-50",
"GC-100",
"GC-200"
],
"currency": "USD",
"time_period_repeat_amount": 1,
"time_period_repeat_frequency": "DAILY",
"time_period_repetition_days": [
"MONDAY"
],
"time_period_start_time": "09:00:00",
"time_period_end_time": "18:00:00",
"timezone": "-03:00",
"limit_by": "PAYMENTS",
"payments_count": "ALL"
}
],
"route": {}
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-12T14:30:00Z"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "ROUTING_NOT_FOUND",
"messages": [
"Routing '...' was not found"
]
}返回路由当前生效的配置,结构与创建路由和更新路由接受的结构相同,因此您可以通过
PATCH 将结果原样发回。与请求体相比,响应还包含:
- 每个输出上的
retry(未设置时为false)。 DECLINE_GROUP、MAC_CODE_GROUP和ISO_CODE_GROUP输出上的group_id、group_name和decline_types(在ISO_CODE_GROUP上,decline_types存放该组的 ISO 8583 响应代码;请参阅 ISO 代码组);SUCCEEDED_GROUP输出上的group_id和group_name。- 操作步骤上的
action和action_delay,以及其上的output: []。 - 每个服务提供商步骤上的
provider_type和timeout,支付步骤上的network_token_enable和network_token_on,3DS 步骤上的three_d_secure_exemptions,欺诈步骤上的fraud,以及 Smart Routing 步骤上的smart_routing。 - 带有任意路由状态的
output[].status,包括仅属于 3DS 服务提供商步骤的LIABILITY_SHIFTED、LIABILITY_NOT_SHIFTED和LIABILITY_NOT_REPORTED(请参阅责任转移输出),每个状态都带有其next。 TIME_PERIOD和VOLUME_PAYMENTS_LIMIT条件的时间安排和限额字段。- 入口被拆分时的
start_split,以及备用路径被拆分时的output[].next_split;否则两者都会省略。 - 没有值的字段以
null返回(next、decline_types、key、currency);为简洁起见,下面的示例省略了这些字段。
路径参数
创建路由返回的 id。必须属于您的 API 密钥所作用的账户。
响应
默认路由逻辑。有关
steps[] 和 output[] 的每个字段,请参阅路由资源结构。curl -X GET 'https://api.y.uno/v1/routing/8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f' \
-H 'public-api-key: <YOUR_PUBLIC_KEY>' \
-H 'private-secret-key: <YOUR_SECRET_KEY>'
{
"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": "APPROVED", "next": 3, "retry": false },
{ "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-3c4d-5e6f-7a8b9c0d1e2f",
"output": [
{ "status": "APPROVED", "next": 3, "retry": false },
{ "status": "SUCCEEDED_GROUP", "group_id": 430, "group_name": "Pending review", "next": 4, "retry": false }
]
},
{ "index": 3, "action": "CAPTURE", "action_delay": "PT5M", "output": [] },
{ "index": 4, "action": "HOLD_FOR_REVIEW", "output": [] }
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "Business hours via Adyen",
"conditions": [
{ "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" }
],
"route": { "steps": [ { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-...", "output": [{ "status": "APPROVED", "next": null, "decline_types": null, "retry": false }, { "status": "INTERNAL_ERROR", "next": null, "decline_types": null, "retry": false }] } ] }
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-12T14:30:00Z"
}
{
"code": "ROUTING_NOT_FOUND",
"messages": ["Routing '...' was not found"]
}
错误
| HTTP | code | 触发时机 |
|---|---|---|
404 | ROUTING_NOT_FOUND | 未知的 routing_id,或该 id 属于其他账户。 |
401 | NOT_AUTHENTICATED | 缺少 public-api-key 或 private-secret-key 标头。 |
401 | INVALID_CREDENTIALS | 密钥对错误,或使用了 Dashboard Customized API key。请改用账户密钥或组织密钥。 |
授权
响应
OK
此页面对您有帮助吗?
⌘I
检索路由配置
curl --request GET \
--url https://api-sandbox.y.uno/v1/routing/{routing_id} \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/routing/{routing_id}"
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'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 => "GET",
CURLOPT_HTTPHEADER => [
"PRIVATE-SECRET-KEY: <api-key>",
"PUBLIC-API-KEY: <api-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("GET", url, nil)
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.get("https://api-sandbox.y.uno/v1/routing/{routing_id}")
.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::Get.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
"account_id": "acc-uuid",
"payment_method": "CARD",
"name": "Card routing — Stripe primary, Adyen fallback",
"default_route": {
"start_split": [
{
"index": 1,
"percentage": 45
}
],
"steps": [
{
"index": 1,
"provider_id": "STRIPE",
"connection_id": "f1a3c4d5-...",
"provider_type": "PAYMENT",
"timeout": 60,
"network_token_enable": true,
"network_token_on": true,
"three_d_secure_exemptions": [
"LOW_VALUE"
],
"action": "CANCEL",
"action_delay": "PT5M",
"output": [
{
"status": "DECLINED",
"decline_types": [
"<string>"
],
"group_id": 1044,
"group_name": "Soft declines",
"retry": false,
"next": 2,
"next_split": [
{
"index": 2,
"percentage": 70
}
]
}
],
"fraud": {
"rules": "rule-a,rule-b",
"blocklists": "<string>",
"allowlists": "<string>",
"reviewlists": "<string>",
"preset": "<string>",
"report_only": true
},
"smart_routing": {
"type": "LATENCY",
"providers": [
{
"provider_id": "ADYEN",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network_token_on": true
}
],
"no_retry_decline_types": [
"<string>"
],
"no_retry_decline_group_ids": [
5120
],
"no_retry_failure_causes": [
"<string>"
]
}
}
]
},
"condition_sets": [
{
"sort_number": 1,
"name": "High Value US",
"description": "<string>",
"conditions": [
{
"condition_type": "COUNTRY",
"conditional": "ONE_OF",
"values": [
"US",
"CA"
],
"key": "<string>",
"item_values": [
"GC-50",
"GC-100",
"GC-200"
],
"currency": "USD",
"time_period_repeat_amount": 1,
"time_period_repeat_frequency": "DAILY",
"time_period_repetition_days": [
"MONDAY"
],
"time_period_start_time": "09:00:00",
"time_period_end_time": "18:00:00",
"timezone": "-03:00",
"limit_by": "PAYMENTS",
"payments_count": "ALL"
}
],
"route": {}
}
],
"created_at": "2026-05-12T14:30:00Z",
"updated_at": "2026-05-12T14:30:00Z"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "ROUTING_NOT_FOUND",
"messages": [
"Routing '...' was not found"
]
}