Get PIN Key
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"terminal_id": "10000005",
"prv_key": "cxwbHl6... "
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey"
payload = {
"terminal_id": "10000005",
"prv_key": "cxwbHl6... "
}
headers = {
"x-client-id": "<x-client-id>",
"x-idempotency-key": "<x-idempotency-key>",
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({terminal_id: '10000005', prv_key: 'cxwbHl6... '})
};
fetch('https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey', 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.uqpaytech.com/api/v2/terminal/getPinKey",
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([
'terminal_id' => '10000005',
'prv_key' => 'cxwbHl6... '
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"x-client-id: <x-client-id>",
"x-idempotency-key: <x-idempotency-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.uqpaytech.com/api/v2/terminal/getPinKey"
payload := strings.NewReader("{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-auth-token", "<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.post("https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey")
.header("x-client-id", "<x-client-id>")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}"
response = http.request(request)
puts response.read_body{
"encrypt_pin_key": "4usf0C0PfalJuUMJ5CqyD7T+4l4r463G61hTwRqbQyZlH+/YANcQ4iH7akqSGvGdxVbvZOvGMaYRBZzKZmlR3hgXxDaQwfqeGtPkZg==",
"pin_key_expire": "2025-12-04T18:18:27.797116587+08:00",
"terminal_id": "10000005"
}Get PIN Key
获取已注册终端设备的 PIN 加密密钥。
POST
/
v2
/
terminal
/
getPinKey
Get PIN Key
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"terminal_id": "10000005",
"prv_key": "cxwbHl6... "
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey"
payload = {
"terminal_id": "10000005",
"prv_key": "cxwbHl6... "
}
headers = {
"x-client-id": "<x-client-id>",
"x-idempotency-key": "<x-idempotency-key>",
"x-auth-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({terminal_id: '10000005', prv_key: 'cxwbHl6... '})
};
fetch('https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey', 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.uqpaytech.com/api/v2/terminal/getPinKey",
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([
'terminal_id' => '10000005',
'prv_key' => 'cxwbHl6... '
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"x-client-id: <x-client-id>",
"x-idempotency-key: <x-idempotency-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.uqpaytech.com/api/v2/terminal/getPinKey"
payload := strings.NewReader("{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("x-auth-token", "<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.post("https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey")
.header("x-client-id", "<x-client-id>")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v2/terminal/getPinKey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"terminal_id\": \"10000005\",\n \"prv_key\": \"cxwbHl6... \"\n}"
response = http.request(request)
puts response.read_body{
"encrypt_pin_key": "4usf0C0PfalJuUMJ5CqyD7T+4l4r463G61hTwRqbQyZlH+/YANcQ4iH7akqSGvGdxVbvZOvGMaYRBZzKZmlR3hgXxDaQwfqeGtPkZg==",
"pin_key_expire": "2025-12-04T18:18:27.797116587+08:00",
"terminal_id": "10000005"
}Authorizations
UQPay 提供的登录 API Token。
Headers
UQPAY 生成的 API 客户端 ID
用于保持操作幂等性的唯一标识符(UUID),确保同一操作重复执行不会产生意外影响或重复结果。它有助于在网络错误、重试或故障时保持数据一致性。
指定代表哪个子账户发起该请求。应设置为 account_id,可通过 List Connected Accounts 获取。若省略或为空,则使用主账户执行请求。
更多信息见 Connected Accounts。
Body
application/json
Response
200 - application/json
成功获取 PIN 密钥
加密的 PIN 密钥。使用提供的 prv_key 解密。
Example:
"4usf0C0PfalJuUMJ5CqyD7T+4l4r463G61hTwRqbQyZlH+/YANcQ4iH7akqSGvGdxVbvZOvGMaYRBZzKZmlR3hgXxDaQwfqeGtPkZg=="
PIN 密钥的过期时间。
Example:
"2025-12-04T18:18:27.797116587+08:00"
终端 ID。
Example:
"10000005"
⌘I

