白标服务提供商
替换服务提供商允许列表
用请求体中的 id 替换您的组织所提供的整个服务提供商集合。
PUT
/
whitelabel
/
providers
替换服务提供商允许列表
curl --request PUT \
--url https://api-sandbox.y.uno/v1/whitelabel/providers \
--header 'Content-Type: application/json' \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--data '
{
"provider_ids": [
"STRIPE",
"ADYEN",
"YUNO_3DS"
]
}
'import requests
url = "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload = { "provider_ids": ["STRIPE", "ADYEN", "YUNO_3DS"] }
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({provider_ids: ['STRIPE', 'ADYEN', 'YUNO_3DS']})
};
fetch('https://api-sandbox.y.uno/v1/whitelabel/providers', 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/whitelabel/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'provider_ids' => [
'STRIPE',
'ADYEN',
'YUNO_3DS'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload := strings.NewReader("{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-sandbox.y.uno/v1/whitelabel/providers")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/whitelabel/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"filtered": true,
"providers": [
{
"provider_id": "STRIPE",
"allowed": true,
"has_instruction_override": true,
"name": "Acme Risk",
"instructions": [
{}
],
"setup_instructions": [
{}
],
"more_info_url": "https://docs.example.com/stripe",
"logo_url": "https://s3.amazonaws.com/whitelabel/logo.png?X-Amz-Signature=..."
}
]
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "provider_ids contains an invalid catalogue id"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "VALIDATION_ERROR",
"messages": [
"Request body is too large"
]
}用请求体中的 id 替换您的组织所提供的整个服务提供商集合。
请求体中省略的服务提供商将不再被提供。这是替换,而不是合并:若要更改部分服务提供商而无需重新声明其余服务提供商,请使用更新多个服务提供商的可见性。
移除服务提供商会保留其说明覆盖,因此将其关闭后再开启不会丢失您的文字。
请求体
您的组织所提供的完整服务提供商 id 集合。UPPER_SNAKE_CASE 目录 id(
[A-Z0-9_]),每个最多 100 个字符,最多 500 个条目。不区分大小写:会被标准化为大写。空数组是合法请求,它会清空允许列表,最终状态与清空服务提供商允许列表相同。因此,一次保存全部内容的管理界面无需为“取消勾选了最后一个服务提供商”做特殊处理。在主动启用规则下,空的
provider_ids 会使您的组织完全没有允许列表条目:它并不是“显示全部”的开关。请发送您想要提供的 id,而不是通过清空列表来扩大范围。响应
刷新后的叠加层,结构与列出白标服务提供商叠加层相同。curl -X PUT 'https://api.y.uno/v1/whitelabel/providers' \
-H 'public-api-key: <YOUR_PUBLIC_KEY>' \
-H 'private-secret-key: <YOUR_SECRET_KEY>' \
-H 'Content-Type: application/json' \
-d '{ "provider_ids": ["STRIPE", "ADYEN", "YUNO_3DS"] }'
{
"filtered": true,
"providers": [
{
"provider_id": "ADYEN",
"allowed": true,
"has_instruction_override": false
},
{
"provider_id": "STRIPE",
"allowed": true,
"has_instruction_override": true,
"more_info_url": "https://docs.example.com/stripe"
},
{
"provider_id": "YUNO_3DS",
"allowed": true,
"has_instruction_override": false,
"logo_url": "https://s3.amazonaws.com/whitelabel/logo.png?X-Amz-Signature=..."
}
]
}
{
"title": "Bad Request",
"status": 400,
"detail": "provider_ids contains an invalid catalogue id"
}
错误
| HTTP | 信封结构 | 触发时机 |
|---|---|---|
400 | problem+json | 存在未知字段、id 超过 500 个,或某个 id 不是有效的目录 id。 |
401 | NOT_AUTHENTICATED | API 密钥缺失或无效。 |
413 | — | 请求体大于 256 KB。 |
授权
请求体
application/json
要提供的服务提供商 ID 的完整集合。
此页面对您有帮助吗?
⌘I
替换服务提供商允许列表
curl --request PUT \
--url https://api-sandbox.y.uno/v1/whitelabel/providers \
--header 'Content-Type: application/json' \
--header 'PRIVATE-SECRET-KEY: <api-key>' \
--header 'PUBLIC-API-KEY: <api-key>' \
--data '
{
"provider_ids": [
"STRIPE",
"ADYEN",
"YUNO_3DS"
]
}
'import requests
url = "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload = { "provider_ids": ["STRIPE", "ADYEN", "YUNO_3DS"] }
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({provider_ids: ['STRIPE', 'ADYEN', 'YUNO_3DS']})
};
fetch('https://api-sandbox.y.uno/v1/whitelabel/providers', 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/whitelabel/providers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'provider_ids' => [
'STRIPE',
'ADYEN',
'YUNO_3DS'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload := strings.NewReader("{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("PUBLIC-API-KEY", "<api-key>")
req.Header.Add("PRIVATE-SECRET-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-sandbox.y.uno/v1/whitelabel/providers")
.header("PUBLIC-API-KEY", "<api-key>")
.header("PRIVATE-SECRET-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/whitelabel/providers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_ids\": [\n \"STRIPE\",\n \"ADYEN\",\n \"YUNO_3DS\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"filtered": true,
"providers": [
{
"provider_id": "STRIPE",
"allowed": true,
"has_instruction_override": true,
"name": "Acme Risk",
"instructions": [
{}
],
"setup_instructions": [
{}
],
"more_info_url": "https://docs.example.com/stripe",
"logo_url": "https://s3.amazonaws.com/whitelabel/logo.png?X-Amz-Signature=..."
}
]
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "provider_ids contains an invalid catalogue id"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "VALIDATION_ERROR",
"messages": [
"Request body is too large"
]
}