创建 webhook 订阅
curl --request POST \
--url https://api.qbank.cl/platform/v1/webhooks/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"secret": "a-strong-shared-secret-123"
}
'import requests
url = "https://api.qbank.cl/platform/v1/webhooks/subscriptions"
payload = {
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"secret": "a-strong-shared-secret-123"
}
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({
event_type: 'payout_status_changed',
callback_url: 'https://api.myapp.com/webhooks/cbpay',
secret: 'a-strong-shared-secret-123'
})
};
fetch('https://api.qbank.cl/platform/v1/webhooks/subscriptions', 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/webhooks/subscriptions",
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([
'event_type' => 'payout_status_changed',
'callback_url' => 'https://api.myapp.com/webhooks/cbpay',
'secret' => 'a-strong-shared-secret-123'
]),
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/webhooks/subscriptions"
payload := strings.NewReader("{\n \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\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/webhooks/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/webhooks/subscriptions")
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 \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8e7f6a5b-4c3d-2e1f-0a9b-8c7d6e5f4a3b",
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"status": "active",
"created_at": "2026-07-07T12:00:00Z",
"secret_stored": true
}{
"error": "invalid_json",
"message": "request body is not valid JSON: unknown field"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "forbidden",
"message": "credentials required"
}创建 webhook 订阅
订阅一个 HTTPS 回调以接收调用账户的事件。
投递均带签名:X-Webhook-Signature = hex(HMAC-SHA256(secret, timestamp + "." + body)),时间戳在 X-Webhook-Timestamp。最多重试 5 次,间隔递增。
POST
/
v1
/
webhooks
/
subscriptions
创建 webhook 订阅
curl --request POST \
--url https://api.qbank.cl/platform/v1/webhooks/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"secret": "a-strong-shared-secret-123"
}
'import requests
url = "https://api.qbank.cl/platform/v1/webhooks/subscriptions"
payload = {
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"secret": "a-strong-shared-secret-123"
}
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({
event_type: 'payout_status_changed',
callback_url: 'https://api.myapp.com/webhooks/cbpay',
secret: 'a-strong-shared-secret-123'
})
};
fetch('https://api.qbank.cl/platform/v1/webhooks/subscriptions', 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/webhooks/subscriptions",
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([
'event_type' => 'payout_status_changed',
'callback_url' => 'https://api.myapp.com/webhooks/cbpay',
'secret' => 'a-strong-shared-secret-123'
]),
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/webhooks/subscriptions"
payload := strings.NewReader("{\n \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\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/webhooks/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/webhooks/subscriptions")
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 \"event_type\": \"payout_status_changed\",\n \"callback_url\": \"https://api.myapp.com/webhooks/cbpay\",\n \"secret\": \"a-strong-shared-secret-123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8e7f6a5b-4c3d-2e1f-0a9b-8c7d6e5f4a3b",
"event_type": "payout_status_changed",
"callback_url": "https://api.myapp.com/webhooks/cbpay",
"status": "active",
"created_at": "2026-07-07T12:00:00Z",
"secret_stored": true
}{
"error": "invalid_json",
"message": "request body is not valid JSON: unknown field"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "forbidden",
"message": "credentials required"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
请求体
application/json
可用选项:
payin_credited, payin_expired, payout_status_changed, transfer_received, crypto_deposit_credited, crypto_deposit_held, crypto_deposit_alert, crypto_withdrawal_status_changed, banking_customer_status_changed, banking_operation_status_changed, aml_screening_updated, kyc_verification_status_changed, kyb_verification_status_changed, kyc_link_completed, kyb_link_completed, kyc_document_validated, kyb_document_validated, kyc_liveness_completed, wallet_deposit_received, wallet_send_status_changed, wallet_key_exported, * 仅限 HTTPS;localhost 与私有 IP 会被拒绝。
Minimum string length:
16最后修改于 2026年7月18日
⌘I