Create Transfer
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/transfer \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"source_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"target_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"currency": "USD",
"amount": "1000",
"reason": "Transfer"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/transfer"
payload = {
"source_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"target_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"currency": "USD",
"amount": "1000",
"reason": "Transfer"
}
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({
source_account_id: 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
target_account_id: 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
currency: 'USD',
amount: '1000',
reason: 'Transfer'
})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/transfer', 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/transfer",
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([
'source_account_id' => 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
'target_account_id' => 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
'currency' => 'USD',
'amount' => '1000',
'reason' => 'Transfer'
]),
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/transfer"
payload := strings.NewReader("{\n \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\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/transfer")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/transfer")
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 \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\n}"
response = http.request(request)
puts response.read_body{
"transfer_id": "e08146de-4267-4e76-b35b-f7b34b656a53",
"short_reference_id": "P220406-LLCVLRM"
}Transfers
Create Transfer
在账户之间创建一笔新的内部转账,通常用于在 Banking 系统下的主账户与其子账户之间划转资金。 请注意:此 API 仅适用于 Banking 相关账户,不适用于 Issuing 系统内部的内部转账。
POST
/
v1
/
transfer
Create Transfer
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/transfer \
--header 'Content-Type: application/json' \
--header 'x-auth-token: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"source_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"target_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"currency": "USD",
"amount": "1000",
"reason": "Transfer"
}
'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/transfer"
payload = {
"source_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"target_account_id": "f5bb6498-552e-40a5-b14b-616aa04ac1c1",
"currency": "USD",
"amount": "1000",
"reason": "Transfer"
}
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({
source_account_id: 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
target_account_id: 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
currency: 'USD',
amount: '1000',
reason: 'Transfer'
})
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/transfer', 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/transfer",
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([
'source_account_id' => 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
'target_account_id' => 'f5bb6498-552e-40a5-b14b-616aa04ac1c1',
'currency' => 'USD',
'amount' => '1000',
'reason' => 'Transfer'
]),
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/transfer"
payload := strings.NewReader("{\n \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\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/transfer")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("x-auth-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/transfer")
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 \"source_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"target_account_id\": \"f5bb6498-552e-40a5-b14b-616aa04ac1c1\",\n \"currency\": \"USD\",\n \"amount\": \"1000\",\n \"reason\": \"Transfer\"\n}"
response = http.request(request)
puts response.read_body{
"transfer_id": "e08146de-4267-4e76-b35b-f7b34b656a53",
"short_reference_id": "P220406-LLCVLRM"
}授权
由 UQPay 提供的登录 API Token。
请求头
用于保持操作幂等性的唯一标识符(UUID),确保同一操作的重复执行不会产生意外影响或重复。它有助于在网络错误、重试或失败时保持数据一致性。
请求体
application/json
⌘I

