白标服务提供商
更新多个服务提供商的可见性
在一个请求中开启或关闭指定的服务提供商,其他所有服务提供商保持不变。
PATCH
/
whitelabel
/
providers
更新多个服务提供商的可见性
curl --request PATCH \
--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 '
{
"providers": [
{
"provider_id": "STRIPE",
"visible": true
}
]
}
'import requests
url = "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload = { "providers": [
{
"provider_id": "STRIPE",
"visible": True
}
] }
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({providers: [{provider_id: 'STRIPE', visible: true}]})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'provider_id' => 'STRIPE',
'visible' => true
]
]
]),
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 \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("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 \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\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::Patch.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\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_id must appear at most once per request; repeated: STRIPE"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "VALIDATION_ERROR",
"messages": [
"Request body is too large"
]
}在一个请求中开启或关闭指定的服务提供商。只有您列出的服务提供商会受到影响:其他每个服务提供商都保持原有状态,这正是它与替换服务提供商允许列表的区别。
此操作是幂等的,关闭服务提供商会保留其说明覆盖。
整个请求会在写入第一行之前完成校验:重复的
provider_id 会导致什么都不更改,而不是只完成您请求的一半。请求体
响应
刷新后的叠加层,结构与列出白标服务提供商叠加层相同。curl -X PATCH '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 '{
"providers": [
{ "provider_id": "STRIPE", "visible": true },
{ "provider_id": "DLOCAL", "visible": false }
]
}'
{
"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"
}
]
}
{
"title": "Bad Request",
"status": 400,
"detail": "provider_id must appear at most once per request; repeated: STRIPE"
}
错误
| HTTP | 信封结构 | 触发时机 |
|---|---|---|
400 | problem+json | 某个 provider_id 出现多次、某个 id 不是有效的目录 id、条目超过 500 个,或存在未知字段。 |
401 | NOT_AUTHENTICATED | API 密钥缺失或无效。 |
413 | — | 请求体大于 256 KB。 |
授权
请求体
application/json
可见性发生变化的服务提供商。
此页面对您有帮助吗?
⌘I
更新多个服务提供商的可见性
curl --request PATCH \
--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 '
{
"providers": [
{
"provider_id": "STRIPE",
"visible": true
}
]
}
'import requests
url = "https://api-sandbox.y.uno/v1/whitelabel/providers"
payload = { "providers": [
{
"provider_id": "STRIPE",
"visible": True
}
] }
headers = {
"PUBLIC-API-KEY": "<api-key>",
"PRIVATE-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'PUBLIC-API-KEY': '<api-key>',
'PRIVATE-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({providers: [{provider_id: 'STRIPE', visible: true}]})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'providers' => [
[
'provider_id' => 'STRIPE',
'visible' => true
]
]
]),
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 \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("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 \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\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::Patch.new(url)
request["PUBLIC-API-KEY"] = '<api-key>'
request["PRIVATE-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providers\": [\n {\n \"provider_id\": \"STRIPE\",\n \"visible\": true\n }\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_id must appear at most once per request; repeated: STRIPE"
}{
"code": "NOT_AUTHENTICATED",
"messages": [
"Not authenticated"
]
}{
"code": "VALIDATION_ERROR",
"messages": [
"Request body is too large"
]
}