创建授权同意链接
curl --request POST \
--url https://api.qbank.cl/platform/v1/qscore/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "CL",
"doc_id": "12.345.678-5",
"purpose": "credit_evaluation",
"email": "maria@example.com",
"expires_in_days": 7,
"idempotency_key": "consent-2026-08-09-001"
}
'import requests
url = "https://api.qbank.cl/platform/v1/qscore/consents"
payload = {
"country": "CL",
"doc_id": "12.345.678-5",
"purpose": "credit_evaluation",
"email": "maria@example.com",
"expires_in_days": 7,
"idempotency_key": "consent-2026-08-09-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'CL',
doc_id: '12.345.678-5',
purpose: 'credit_evaluation',
email: 'maria@example.com',
expires_in_days: 7,
idempotency_key: 'consent-2026-08-09-001'
})
};
fetch('https://api.qbank.cl/platform/v1/qscore/consents', 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.qbank.cl/platform/v1/qscore/consents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'CL',
'doc_id' => '12.345.678-5',
'purpose' => 'credit_evaluation',
'email' => 'maria@example.com',
'expires_in_days' => 7,
'idempotency_key' => 'consent-2026-08-09-001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.qbank.cl/platform/v1/qscore/consents"
payload := strings.NewReader("{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.qbank.cl/platform/v1/qscore/consents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/qscore/consents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}"
response = http.request(request)
puts response.read_body{
"consent_id": "c1a2b3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"subject_id": "7e8f9a0b-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
"channel": "link",
"status": "pending",
"purpose": "credit_evaluation",
"consent_url": "https://business.cbpayapp.com/consent/cns_4f9a2b7c1d8e4a0f9b3c6d5e8a7f1c2d",
"email": "maria@example.com",
"created_at": "2026-08-09T15:00:00Z",
"updated_at": "2026-08-09T15:00:00Z",
"expires_at": "2026-08-16T15:00:00Z",
"idempotency_hit": true
}{
"consent_id": "c1a2b3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"subject_id": "7e8f9a0b-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
"channel": "link",
"status": "pending",
"purpose": "credit_evaluation",
"consent_url": "https://business.cbpayapp.com/consent/cns_4f9a2b7c1d8e4a0f9b3c6d5e8a7f1c2d",
"email": "maria@example.com",
"created_at": "2026-08-09T15:00:00Z",
"updated_at": "2026-08-09T15:00:00Z",
"expires_at": "2026-08-16T15:00:00Z"
}创建授权同意链接
为主体创建授权链接(Destacame 式授权同意流程):您将获得可分享的 consent_url;若传入 email,平台会通过品牌化邮件将链接发送给持有人。持有人打开公开页面, 通过开放金融连接其银行并授权;已授予的授权会在其 Qscore 报告中解锁主体的正向银行数据。 country 和 doc_id 用于识别持有人(证件号会校验校验位);省略 subject_type 时将从证件推断。依据数据保护法 purpose 为必填,此处不允许 self_access(持有人的 自助报告在 POST /v1/qscore/my-report)。expires_in_days 默认为 7(最大 30)。 幂等为强制要求:使用相同 idempotency_key 重试会返回原授权并带 idempotency_hit: true,绝不重复创建链接或重复发送邮件。
POST
/
v1
/
qscore
/
consents
创建授权同意链接
curl --request POST \
--url https://api.qbank.cl/platform/v1/qscore/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"country": "CL",
"doc_id": "12.345.678-5",
"purpose": "credit_evaluation",
"email": "maria@example.com",
"expires_in_days": 7,
"idempotency_key": "consent-2026-08-09-001"
}
'import requests
url = "https://api.qbank.cl/platform/v1/qscore/consents"
payload = {
"country": "CL",
"doc_id": "12.345.678-5",
"purpose": "credit_evaluation",
"email": "maria@example.com",
"expires_in_days": 7,
"idempotency_key": "consent-2026-08-09-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country: 'CL',
doc_id: '12.345.678-5',
purpose: 'credit_evaluation',
email: 'maria@example.com',
expires_in_days: 7,
idempotency_key: 'consent-2026-08-09-001'
})
};
fetch('https://api.qbank.cl/platform/v1/qscore/consents', 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.qbank.cl/platform/v1/qscore/consents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'country' => 'CL',
'doc_id' => '12.345.678-5',
'purpose' => 'credit_evaluation',
'email' => 'maria@example.com',
'expires_in_days' => 7,
'idempotency_key' => 'consent-2026-08-09-001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.qbank.cl/platform/v1/qscore/consents"
payload := strings.NewReader("{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.qbank.cl/platform/v1/qscore/consents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/qscore/consents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"country\": \"CL\",\n \"doc_id\": \"12.345.678-5\",\n \"purpose\": \"credit_evaluation\",\n \"email\": \"maria@example.com\",\n \"expires_in_days\": 7,\n \"idempotency_key\": \"consent-2026-08-09-001\"\n}"
response = http.request(request)
puts response.read_body{
"consent_id": "c1a2b3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"subject_id": "7e8f9a0b-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
"channel": "link",
"status": "pending",
"purpose": "credit_evaluation",
"consent_url": "https://business.cbpayapp.com/consent/cns_4f9a2b7c1d8e4a0f9b3c6d5e8a7f1c2d",
"email": "maria@example.com",
"created_at": "2026-08-09T15:00:00Z",
"updated_at": "2026-08-09T15:00:00Z",
"expires_at": "2026-08-16T15:00:00Z",
"idempotency_hit": true
}{
"consent_id": "c1a2b3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"subject_id": "7e8f9a0b-1c2d-4e3f-8a9b-0c1d2e3f4a5b",
"channel": "link",
"status": "pending",
"purpose": "credit_evaluation",
"consent_url": "https://business.cbpayapp.com/consent/cns_4f9a2b7c1d8e4a0f9b3c6d5e8a7f1c2d",
"email": "maria@example.com",
"created_at": "2026-08-09T15:00:00Z",
"updated_at": "2026-08-09T15:00:00Z",
"expires_at": "2026-08-16T15:00:00Z"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
响应
幂等重放——返回原授权,带 idempotency_hit: true。
最后修改于 2026年8月22日
⌘I