创建 POS 收款(带金额的加密货币二维码)
curl --request POST \
--url https://api.qbank.cl/platform/v1/pos/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"amount": "25",
"crypto": "tron:usdt",
"reference": "TICKET-0451",
"expires_in": 900,
"idempotency_key": "pos-0451-1"
}
'import requests
url = "https://api.qbank.cl/platform/v1/pos/charges"
payload = {
"merchant_id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"amount": "25",
"crypto": "tron:usdt",
"reference": "TICKET-0451",
"expires_in": 900,
"idempotency_key": "pos-0451-1"
}
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({
merchant_id: 'd2875683-fc80-4c7b-876a-fb585d7c6982',
amount: '25',
crypto: 'tron:usdt',
reference: 'TICKET-0451',
expires_in: 900,
idempotency_key: 'pos-0451-1'
})
};
fetch('https://api.qbank.cl/platform/v1/pos/charges', 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/pos/charges",
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([
'merchant_id' => 'd2875683-fc80-4c7b-876a-fb585d7c6982',
'amount' => '25',
'crypto' => 'tron:usdt',
'reference' => 'TICKET-0451',
'expires_in' => 900,
'idempotency_key' => 'pos-0451-1'
]),
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/pos/charges"
payload := strings.NewReader("{\n \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\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/pos/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/pos/charges")
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 \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\n}"
response = http.request(request)
puts response.read_body{
"charge_id": "66773a3a-9911-4482-ae3c-09a481aba018",
"payin_id": "bd3d88ca-af9c-4c05-a6f8-0982a2d187d5",
"account_id": "5138e8dd-64bd-43ef-aafe-8d9ef23bec9e",
"status": "pending",
"amount": "25",
"settlement_asset": "USDT",
"crypto": "tron:usdt",
"chain": "tron",
"asset": "USDT",
"address": "TC5SToDEigQtie7Crf9et7ui7zDsvdDHeG",
"due": "25.000000",
"received": "0.000000",
"qr_payload": "TC5SToDEigQtie7Crf9et7ui7zDsvdDHeG",
"qr_png_base64": "iVBORw0KGgo...",
"merchant": {
"id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"name": "La Terraza Restaurant",
"external_ref": "resto-001"
},
"reference": "TICKET-0451",
"expires_at": "2026-07-17T19:55:00Z",
"receipt_url": "https://api.qbank.cl/platform/v1/payins/bd3d88ca-af9c-4c05-a6f8-0982a2d187d5/receipt",
"created_at": "2026-07-17T19:40:00Z",
"updated_at": "2026-07-17T19:40:00Z"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "merchant_disabled",
"message": "this merchant is disabled; re-enable it before charging"
}{
"error": "pricing_unavailable",
"message": "crypto pricing is temporarily unavailable"
}创建 POS 收款(带金额的加密货币二维码)
为商户创建带金额的加密货币二维码收款。契约与通用收款链接一致:amount + settlement_asset(缺省时用账户默认值);顾客支付的应付额在创建时按二维码的加密货币报价(付款人承担兑换 — 你收到精确的目标金额)。响应携带专属充值地址、裸地址二维码(qr_payload + qr_png_base64)和冻结的应付额,POS 可直接使用。idempotency_key 必填:重试返回同一笔收款与同一地址。
POST
/
v1
/
pos
/
charges
创建 POS 收款(带金额的加密货币二维码)
curl --request POST \
--url https://api.qbank.cl/platform/v1/pos/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"amount": "25",
"crypto": "tron:usdt",
"reference": "TICKET-0451",
"expires_in": 900,
"idempotency_key": "pos-0451-1"
}
'import requests
url = "https://api.qbank.cl/platform/v1/pos/charges"
payload = {
"merchant_id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"amount": "25",
"crypto": "tron:usdt",
"reference": "TICKET-0451",
"expires_in": 900,
"idempotency_key": "pos-0451-1"
}
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({
merchant_id: 'd2875683-fc80-4c7b-876a-fb585d7c6982',
amount: '25',
crypto: 'tron:usdt',
reference: 'TICKET-0451',
expires_in: 900,
idempotency_key: 'pos-0451-1'
})
};
fetch('https://api.qbank.cl/platform/v1/pos/charges', 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/pos/charges",
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([
'merchant_id' => 'd2875683-fc80-4c7b-876a-fb585d7c6982',
'amount' => '25',
'crypto' => 'tron:usdt',
'reference' => 'TICKET-0451',
'expires_in' => 900,
'idempotency_key' => 'pos-0451-1'
]),
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/pos/charges"
payload := strings.NewReader("{\n \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\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/pos/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/pos/charges")
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 \"merchant_id\": \"d2875683-fc80-4c7b-876a-fb585d7c6982\",\n \"amount\": \"25\",\n \"crypto\": \"tron:usdt\",\n \"reference\": \"TICKET-0451\",\n \"expires_in\": 900,\n \"idempotency_key\": \"pos-0451-1\"\n}"
response = http.request(request)
puts response.read_body{
"charge_id": "66773a3a-9911-4482-ae3c-09a481aba018",
"payin_id": "bd3d88ca-af9c-4c05-a6f8-0982a2d187d5",
"account_id": "5138e8dd-64bd-43ef-aafe-8d9ef23bec9e",
"status": "pending",
"amount": "25",
"settlement_asset": "USDT",
"crypto": "tron:usdt",
"chain": "tron",
"asset": "USDT",
"address": "TC5SToDEigQtie7Crf9et7ui7zDsvdDHeG",
"due": "25.000000",
"received": "0.000000",
"qr_payload": "TC5SToDEigQtie7Crf9et7ui7zDsvdDHeG",
"qr_png_base64": "iVBORw0KGgo...",
"merchant": {
"id": "d2875683-fc80-4c7b-876a-fb585d7c6982",
"name": "La Terraza Restaurant",
"external_ref": "resto-001"
},
"reference": "TICKET-0451",
"expires_at": "2026-07-17T19:55:00Z",
"receipt_url": "https://api.qbank.cl/platform/v1/payins/bd3d88ca-af9c-4c05-a6f8-0982a2d187d5/receipt",
"created_at": "2026-07-17T19:40:00Z",
"updated_at": "2026-07-17T19:40:00Z"
}{
"error": "unauthorized",
"message": "invalid or missing credentials"
}{
"error": "merchant_disabled",
"message": "this merchant is disabled; re-enable it before charging"
}{
"error": "pricing_unavailable",
"message": "crypto pricing is temporarily unavailable"
}授权
会话 JWT(来自注册/登录)或 API key(pk_...)。
也接受 X-API-Key: <token> 作为替代请求头。
请求体
application/json
响应
Created
可用选项:
pending, paid, expired Show child attributes
Show child attributes
Show child attributes
Show child attributes
最后修改于 2026年7月18日
⌘I