curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/connect/token \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/connect/token"
headers = {
"x-api-key": "<api-key>",
"x-client-id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'x-client-id': '<api-key>'}
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/connect/token', 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/connect/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-client-id: <api-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"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.uqpaytech.com/api/v1/connect/token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-client-id", "<api-key>")
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/connect/token")
.header("x-api-key", "<api-key>")
.header("x-client-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/connect/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-client-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"auth_token": "2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA",
"expired_at": 1757449854
}Access Token
Request an access token by specifying your x-client-id and x-api-key in the HTTP request header. The returned auth_token is required for all other API endpoints and must be passed in the x-auth-token header prefixed with Bearer — for example, x-auth-token: Bearer <YOUR_TOKEN_HERE>. The Bearer prefix is required across all business lines.
You can reuse an access token until it expires or is invalidated under the business-line rules below. Use expired_at to determine its expiration time.
auth_token is valid for 30 minutes in Production.
Token concurrency by business line
For the same x-client-id, the following rules apply in Production and Sandbox:
- Multiple tokens may coexist — Account Center, Global Account, Card Issuance, Stablecoin Account. Issuing a new token does not invalidate previously issued tokens that have not expired.
- Only the latest token is accepted — Global Acquiring. Issuing a new token invalidates previously issued tokens, even if their
expired_attime has not been reached.
For Global Acquiring, coordinate token issuance and share the latest token across processes. Avoid issuing tokens independently in multiple processes, because issuing a new token causes requests using an older token to fail authentication.
curl --request POST \
--url https://api-sandbox.uqpaytech.com/api/v1/connect/token \
--header 'x-api-key: <api-key>' \
--header 'x-client-id: <api-key>'import requests
url = "https://api-sandbox.uqpaytech.com/api/v1/connect/token"
headers = {
"x-api-key": "<api-key>",
"x-client-id": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'x-client-id': '<api-key>'}
};
fetch('https://api-sandbox.uqpaytech.com/api/v1/connect/token', 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/connect/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-client-id: <api-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"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.uqpaytech.com/api/v1/connect/token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-client-id", "<api-key>")
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/connect/token")
.header("x-api-key", "<api-key>")
.header("x-client-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.uqpaytech.com/api/v1/connect/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-client-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"auth_token": "2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA",
"expired_at": 1757449854
}Authorizations
The API key generated by UQPAY.
The API client id generated by UQPAY.
Response
Successfully.
Returned authentication token. Clients must store this securely and destroy it when it is no longer needed.
"2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA2YotnFZFEjr1zCsicMWpAA"
Expiration time represented as a Unix timestamp in second-level precision. Indicates the point in time after which the token becomes invalid.
1757449854

