Set or Reset Virtual Card PIN
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"card_id": "630be6bd-2652-4faa-9f3d-2c51cee0b820",
"type": "SET",
"pin": "1234",
"old_pin": "5678"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin"
payload = {
"card_id": "630be6bd-2652-4faa-9f3d-2c51cee0b820",
"type": "SET",
"pin": "1234",
"old_pin": "5678"
}
headers = {
"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-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
card_id: '630be6bd-2652-4faa-9f3d-2c51cee0b820',
type: 'SET',
pin: '1234',
old_pin: '5678'
})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin', 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/v1/issuing/cards/manage/pin",
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([
'card_id' => '630be6bd-2652-4faa-9f3d-2c51cee0b820',
'type' => 'SET',
'pin' => '1234',
'old_pin' => '5678'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"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/v1/issuing/cards/manage/pin"
payload := strings.NewReader("{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/v1/issuing/cards/manage/pin")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}"
response = http.request(request)
puts response.read_body{
"card_id": "c0cef051-29c5-4796-b86a-cd5b684bfad7",
"card_order_id": "c0cef051-29c5-4796-b86a-cd5ee34bfad7",
"create_time": "2024-03-21T17:17:32+08:00"
}Card PIN
Set or Reset Virtual Card PIN
仅 Business Mastercard
在 Standard 虚拟卡 上设置或重置 PIN 码。
type: SET—— 首次设置 PIN 码。若卡片已有 PIN 码则失败,此时请改用RESET。type: RESET—— 修改 PIN 码。请求必须携带old_pin,且需与卡片当前的 PIN 码一致。
无忘记 PIN 流程。
RESET始终要求通过old_pin提供当前 PIN 码。若当前 PIN 码遗失,则无法通过本接口重置——请联系 UQPAY 协助。
仅适用于 Standard 虚拟卡。 此接口不适用于实体卡——实体卡 PIN 码请使用 重置卡片 PIN 码 管理。
异步处理
同步响应仅确认请求已受理,并返回 PIN 操作订单(card_id、card_order_id、create_time)。使用相同 x-idempotency-key 的重复请求返回相同结果,不会重复处理。一张卡片同一时间只能有一笔进行中的 PIN 操作——在一笔操作仍在处理时再提交 SET / RESET 请求会被拒绝。
POST
/
v1
/
issuing
/
cards
/
manage
/
pin
Set or Reset Virtual Card PIN
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"card_id": "630be6bd-2652-4faa-9f3d-2c51cee0b820",
"type": "SET",
"pin": "1234",
"old_pin": "5678"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin"
payload = {
"card_id": "630be6bd-2652-4faa-9f3d-2c51cee0b820",
"type": "SET",
"pin": "1234",
"old_pin": "5678"
}
headers = {
"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-idempotency-key': '<x-idempotency-key>',
'x-auth-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
card_id: '630be6bd-2652-4faa-9f3d-2c51cee0b820',
type: 'SET',
pin: '1234',
old_pin: '5678'
})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin', 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/v1/issuing/cards/manage/pin",
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([
'card_id' => '630be6bd-2652-4faa-9f3d-2c51cee0b820',
'type' => 'SET',
'pin' => '1234',
'old_pin' => '5678'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-auth-token: <api-key>",
"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/v1/issuing/cards/manage/pin"
payload := strings.NewReader("{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/v1/issuing/cards/manage/pin")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/manage/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["x-auth-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_id\": \"630be6bd-2652-4faa-9f3d-2c51cee0b820\",\n \"type\": \"SET\",\n \"pin\": \"1234\",\n \"old_pin\": \"5678\"\n}"
response = http.request(request)
puts response.read_body{
"card_id": "c0cef051-29c5-4796-b86a-cd5b684bfad7",
"card_order_id": "c0cef051-29c5-4796-b86a-cd5ee34bfad7",
"create_time": "2024-03-21T17:17:32+08:00"
}授权
由 UQPAY 提供的登录 API Token。
请求头
指定代表哪个子账户发起请求。应设置为 account_id,该值可通过 List Connected Accounts 接口获取。若省略或为空,则请求以主账户身份执行。
更多信息参见 关联账户。
用于维持操作幂等性的唯一标识符(UUID),确保同一操作的重复执行不会产生意外影响或重复。它有助于在网络错误、重试或失败的情况下保持数据一致性。
请求体
application/json
卡片的唯一标识符。必须是 Standard 虚拟卡。
示例:
"630be6bd-2652-4faa-9f3d-2c51cee0b820"
要执行的 PIN 操作。
SET- 首次设置卡片 PIN 码。若卡片已有 PIN 码则被拒绝。RESET- 修改卡片 PIN 码。需要old_pin。
可用选项:
SET, RESET 示例:
"SET"
卡片的新 PIN 码。必须恰好为 4 位数字。
Required string length:
4Pattern:
^\d{4}$示例:
"1234"
卡片当前的 PIN 码。当 type 为 RESET 时必填,且必须与卡片当前设置的 PIN 码一致,否则操作失败。当 type 为 SET 时忽略。
Required string length:
4Pattern:
^\d{4}$示例:
"5678"

