Skip to main content
Version: v2.0

API Reference

Public Parameters

Request header

NameRequiredDescriptionCommentSample
customerIdYcustomer IDPre-configured.ASR3F1B4Z5
serviceYAPI nameSee APIs.createCard
versionYAPI versionCurrent version 2.0.2.0
requestIdYrequest IDMust be unique for each request, UUID is recommended.472f37e3-a803-47ed-b9b6-32632895b466
timestampYrequest timestampUNIX timestamp (milliseconds).1642747436113
signYrequest signatureSee Signature._Ue0BiWsCOxbYD39Ldd (partial data)

Response header

NameDescriptionCommentSample
customerIdcustomer IDSame as Request header.ASR3F1B4Z5
serviceAPI nameSame as Request header.createCard
versionAPI versionSame as Request header.2.0
requestIdrequest IDSame as Request header.472f37e3-a803-47ed-b9b6-32632895b466
timestampresponse timestampUNIX timestamp (milliseconds).1642747437393
coderesponse codeEnumerated type, 3 digits, see response code drop-down list.200 (code other than 200 means API call failed)
messageresponse code detailsSee response code drop-down list.succeed
signresponse signatureSee Signature.WO8waUZ30bYlKp-_s9m (partial data)
response code
codemessageComment
200succeedSucceed.
400payload decrypt failedDecrypt payload failed.
403the ip is not whitelistedRequest IP not in whitelist
405unsupported methodRequest method not supported. (only support POST)
406too many requestsToo many requests.
407verify sign failedVerify sign failed.
417the parameter is null or invalidRequired request header is empty.
500(not fixed)System error.

APIs

NameMethodRequest service header
Create CardPOSTcreateCard
Update CardPOSTupdateCard
Recharge CardPOSTrechargeCard
Withdraw CardPOSTwithdrawCard
Suspend CardPOSTsuspendCard
Unsuspend CardPOSTunSuspendCard
Close CardPOSTcloseCard
Query CardPOSTqueryCardDetail
Query Account CreditPOSTqueryCustomerCredit
Query Authorization TransactionsPOSTqueryAuthTransactionByPage
Query Settlement TransactionsPOSTsettlementTransactionQuery
Initiate Account WithdrawalPOSTpayoutCreate
Query Account WithdrawalPOSTpayoutQuery
FX QuotePOSTfxQuote
FX Create OrderPOSTfxCreate
FX Query OrderPOSTfxQuery

Encryption

To ensure data security, TripLink will encrypt every requests and responses.

The user and TripLink should use the symmetric encryption algorithm AES/ECB/PKCS5Padding to encrypt and decrypt both Request body and Response body, the result is encoded by Base64.

The user should provide 128 bits AES key (Base64 encoded) to TripLink in advance, see Preparation.

Request body

For the meaning of each properties in original request body, please refer to each API description below.

User: Encrypts the original request body with AES key and encodes with Base64. Makes the result as the value of payload property in actual request body. Sends out the actual request body.

TripLink: Decodes the payload property of received actual request body with Base64 and decrypts with AES key. The result is the original request body.

  {
"key_1": "value_1",
"key_2": "value_2",
"key_3": "value_3"
}

Response body

For the meaning of each properties in original response body, please refer to each API description below.

TripLink: Encrypts the original response body with AES key and encodes with Base64. Makes the result as the value of payload property in actual response body. Sends out the actual response body.

User: Decodes the payload property of received actual response body with Base64 and decrypts with AES key. The result is the original response body.

  {
"key_1": "value_1",
"key_2": "value_2",
"key_3": "value_3"
}

Utilities example

   import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;

import static java.nio.charset.StandardCharsets.UTF_8;

public class AesUtils {

private static final Base64.Encoder ENCODER = Base64.getEncoder();
private static final Base64.Decoder DECODER = Base64.getDecoder();

/**
* replace your aesKey
*/
private static String aesKey = "amJPkH98aHGXskiH91r0dw==";


/**
* example for get encrypted payload
*/
public static void main(String[] args) throws Exception {
// replace your request payload
String payload = "{\"requestId\":\"7ca6f405-acb4-4dd1-b35e-2b741b595e98\",\"customerId\":\"CSR9372F4E8ADG85\",\"cardLogId\":\"85a934fafb02cd5f27h53d2764bd884075c123fc87a04a3ddf919c710f281234\"}";

// encrypt payload
String encryptPayload = aesEncrypt(newAesKey(aesKey), payload);

// print result
System.out.println(encryptPayload);
}

public static String aesEncrypt(SecretKey key, String plaintext) throws Exception {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherBytes = cipher.doFinal(plaintext.getBytes(UTF_8));
return new String(ENCODER.encode(cipherBytes), UTF_8);
}

public static String aesDecrypt(SecretKey key, String ciphertext) throws Exception {
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] cipherBytes = DECODER.decode(ciphertext.getBytes(UTF_8));
return new String(cipher.doFinal(cipherBytes), UTF_8);
}

public static SecretKey newAesKey(String keyStr) {
return new SecretKeySpec(DECODER.decode(keyStr.getBytes(UTF_8)), "AES");
}

public static String toAesKeyStr(SecretKey key) {
return new String(ENCODER.encode(key.getEncoded()), UTF_8);
}
}

Java 6 users can consider using the org.apache.commons.codec.binary.Base64 Class instead of the new java.util.Base64 Class introduced in Java 8.

Signature

To ensure safe API calls, TripLink will authenticate each request and response using signature.

TripLink uses the signature algorithm SHA256withRSA to sign both Request string to be signed and Response string to be signed. The signature result is encoded by Base64, located in sign property of request header and response header.

The user will be assigned 2048 bits RSA public key T (Base64 encoded). The user should also provide 2048 bits RSA public key U (Base64 encoded) to TripLink in advance, see Preparation.

The entire request and response process involves 2 RSA keys: The public key T and private key T which belongs to TripLink, the public key U and private key U which belongs to user. The public keys are used for verifying the signature and the private keys are used for generating the signature.

Request string to be signed

All the properties are concatenated by | symbol in the following order.

customerId|service|version|requestId|timestamp|payload

customerId, service, version, requestId and timestamp comes from request header.

payload comes from the encrypted payload property in actual request body.

User: Generates the signature on request string to be signed with private key U and encodes with Base64. Makes the result as the value of sign property in request header.

TripLink: Decodes the sign property of received request header with Base64 and verifies with public key U.

Response string to be signed

All the properties are concatenated by | symbol in the following order.

customerId|service|version|requestId|timestamp|code|message|payload

customerId, service, version, requestId, timestamp, code and message comes from response header.

payload comes from the payload property in actual response body.

TripLink: Generates the signature on response string to be signed with private key T and encodes with Base64. Makes the result as the value of sign property in response header.

User: Decodes the sign property of received response header with Base64 and verifies with public key T.

Java Utilities example
import org.apache.commons.lang3.StringUtils;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;

import static java.nio.charset.StandardCharsets.UTF_8;

public class RsaUtils {

private static final Base64.Encoder ENCODER = Base64.getEncoder();
private static final Base64.Decoder DECODER = Base64.getDecoder();

/**
* replace your private rsaKey
*/
private static String rsaPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCoyUMgQDCtymWE" +
"83IGbrbYgrIWK++QzQBsUIypci1hPNEzSuc9X34ICpsFbtyp9RSYX4Es+nNrKE2I" +
"SLdtTsQescPQHSwl6OW7fzk/jmaZpCFXznU+vgrnvhDMIGTvQTN2M3hdfgMGvF3B" +
"DsDvep8ZQ84YWIjJdLGvlXvJ/OjyGQDOKoclMfi3gVkI0izlZUDdBGgHUpGAlMpK" +
"A8yp28GCURioMrsr7CtSjmVP0lPsPrP5sI6Vk0qAlxt6GGVTDghZI3flixuiEpFL" +
"vOyLJjw7TkTCUvFcWsLn15F45TA2AGUzzWHcMdwiUKJEQBy0FlFoFET7GjnQkimC" +
"UU0QZJQ7AgMBAAECggEAAOXFFhxRRfNQE+NphVA8Z61WPhjwtq/oYysQfGwvgpdc" +
"s22gCisCVA+eYGqFAOBdQiwr1y3jxDucIe/lDc8/6rveQzKMhA0Xf6Y/Cy/6KrH9" +
"PWbLJ9DB5RaVJ0i60KzjlarTZoffgz8oLnkiHIPl6a/7HhUGcS/OLBVa6amPIY5v" +
"QmY14gVHh8K2FdZLBL3F2i7djAwBIlqT2EgQdxKoq0RMsvKmqlLePLfBytAu6RxT" +
"hC0vqANPJoPZVz8rV8ixsWINmJ2jx9A+xaGTHYAC6MdcM7sButDhJccIX2H6Zyem" +
"bl0KhfGmrerKZTmeqI/JjsJyaGsXV+h4qAyDpXwcJQKBgQDloiinUDrZZUMnU9af" +
"DacDZ4AWluefmnTvpO3JRKS8wYGYSSE0Aee4CnHTyNv7FFsGorQJgMFGHFNvHFQ1" +
"pk1+tuOgqycVPec6EzLgBPJC/1dMRRPk9JDXMpIM8dYkQ93phvfLqSKOCagGHOdR" +
"PMpk1LBhMUVmvHijFzX2+wMExwKBgQC8Ko9wvbT5GAiu6rIz1PVDvD5dQbv7jXPR" +
"Mu0QJlFJH5gQ5rVBZdxfBIjpQe4aMDtdot3KWkNjpgJm4OGA4T9E5OpHIIHZ+9cr" +
"PLEq9Evp9llrBEFICVC+DI3DZWC9+6Ussrs5p1y2Wyjuai6kZnDuvroUXpV1a6aE" +
"MydQNSWY7QKBgQC4ppOgLsCTrXy5dA4h6d2BvElgYMoyKgab6XiYHo2FhujJ5ww/" +
"AMUu1Z9AWMSjenPTuyOgfJtt4DsrHpGMboTkPvZ9bQNJbnSv215Oi0uvmhm9p9Je" +
"ilap5O1SYWj70mLwdOpvJzs1Egi9maJcTdDGEc0e6nrPKQCszG5FgwSjYwKBgG8f" +
"N0yeS/Ta863Q3mJrvlg9IBtUyZ4aAC6oQ4XJCzIC3XwFsz8m14iple0iyWlf2H9I" +
"wnBQ9AEyNbLp1WKWIxYdlhlhIi5IYt6e3gX+9aH6oP3pKmBPWAaURVgCU6p+pSIL" +
"fzPiGYd7uGVsAZWHBeSIcD29SchpRZJG302nxUdVAoGAQYSVYM7TMeTuQgDAXUD5" +
"g4ulLpZKiq910M7DufQ4tgrZOwT44I1ihDXh0s2BKg8+PLJPT1ldgH/Dtglwosv1" +
"peD0Lep3zSwrTXpyMstdCW16bl96FOKGP8H8c2zXXG7e39E6D9rPSKDt5TtGVScS" +
"PYsWAsMHzfsX2F4aUJNUuN0=";


/**
* example for get encrypted sign
*/
public static void main(String[] args) throws Exception {
// request head params
String customerId = "CSR9372F4E8ADG85";
String service = "queryCard";
String version = "2.0";
String requestId = "7ca6f405-acb4-4dd1-b35e-2b741b595e98";
long timestamp = 1741846955993L;

// payload after aesKey encryption, refer to AesUtils
String payload = "A/R7OP/qWzmIGDwfs0I3c8XmOfwRshvO1NaHDUIaq0yZAnqptgt7WiEXXF6Cg6LgbQ8+p5M6eikXuBLeTe+zxmkjF1Mc/nrnjyVwqwd7/WsWhYJ4YCEGAjjbGO8hftwZsVEufCRwIrL+wxbp8d7cD3AwVxuHr1+mkr2Rb+ox9j4qB5Z3dkUUpNnaMdIxqtMkXZjydoe9A8sAgYEmK28TTkUf/pYGWv7Wj0KtBkX4rMU=";

// generate sign
String sign = buildRequestSignContent(customerId, service, version, requestId, timestamp, payload);

// encrypt sign
String encryptSign = rsaSign(newRsaPrivateKey(rsaPrivateKey), sign);

// print result
System.out.println(encryptSign);
}

public static String rsaSign(PrivateKey privateKey, String content) throws Exception {
Signature signer = Signature.getInstance("SHA256withRSA");
signer.initSign(privateKey);
signer.update(content.getBytes(UTF_8));
return new String(ENCODER.encode(signer.sign()), UTF_8);
}

public static boolean rsaVerify(PublicKey publicKey, String content, String signature) throws Exception {
Signature signer = Signature.getInstance("SHA256withRSA");
signer.initVerify(publicKey);
signer.update(content.getBytes(UTF_8));
return signer.verify(DECODER.decode(signature.getBytes(UTF_8)));
}

public static PrivateKey newRsaPrivateKey(String privateKeyStr) throws Exception {
byte[] bytes = DECODER.decode(privateKeyStr.getBytes(UTF_8));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(bytes));
}

public static PublicKey newRsaPublicKey(String publicKeyStr) throws Exception {
byte[] bytes = DECODER.decode(publicKeyStr.getBytes(UTF_8));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
return keyFactory.generatePublic(new X509EncodedKeySpec(bytes));
}

public static String toRsaPrivateKeyStr(PrivateKey privateKey) {
return new String(ENCODER.encode(privateKey.getEncoded()), UTF_8);
}

public static String toRsaPublicKeyStr(PublicKey publicKey) {
return new String(ENCODER.encode(publicKey.getEncoded()), UTF_8);
}

private static String buildRequestSignContent(String customerId, String service, String version, String requestNo, long timestamp, String payload) {
StringBuilder builder = new StringBuilder();
if (StringUtils.isNotBlank(customerId)) {
builder.append(customerId).append("|");
}
if (StringUtils.isNotBlank(service)) {
builder.append(service).append("|");
}
if (StringUtils.isNotBlank(version)) {
builder.append(version).append("|");
}
if (StringUtils.isNotBlank(requestNo)) {
builder.append(requestNo).append("|");
}
if (0 != timestamp) {
builder.append(timestamp).append("|");
}
if (StringUtils.isNotBlank(payload)) {
builder.append(payload);
}
return builder.toString();
}
}

Java 6 users can consider using the org.apache.commons.codec.binary.Base64 Class instead of the new java.util.Base64 Class introduced in Java 8.

C# Utilities example
using System;
using System.Security.Cryptography;
using System.Text;

public class RsaUtils {
private static readonly Base64Encoder ENCODER = new Base64Encoder();
private static readonly Base64Decoder DECODER = new Base64Decoder();

/**
* replace your private rsaKey
*/
private static string rsaPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCoyUMgQDCtymWE" +
"83IGbrbYgrIWK++QzQBsUIypci1hPNEzSuc9X34ICpsFbtyp9RSYX4Es+nNrKE2I" +
"SLdtTsQescPQHSwl6OW7fzk/jmaZpCFXznU+vgrnvhDMIGTvQTN2M3hdfgMGvF3B" +
"DsDvep8ZQ84YWIjJdLGvlXvJ/OjyGQDOKoclMfi3gVkI0izlZUDdBGgHUpGAlMpK" +
"A8yp28GCURioMrsr7CtSjmVP0lPsPrP5sI6Vk0qAlxt6GGVTDghZI3flixuiEpFL" +
"vOyLJjw7TkTCUvFcWsLn15F45TA2AGUzzWHcMdwiUKJEQBy0FlFoFET7GjnQkimC" +
"UU0QZJQ7AgMBAAECggEAAOXFFhxRRfNQE+NphVA8Z61WPhjwtq/oYysQfGwvgpdc" +
"s22gCisCVA+eYGqFAOBdQiwr1y3jxDucIe/lDc8/6rveQzKMhA0Xf6Y/Cy/6KrH9" +
"PWbLJ9DB5RaVJ0i60KzjlarTZoffgz8oLnkiHIPl6a/7HhUGcS/OLBVa6amPIY5v" +
"QmY14gVHh8K2FdZLBL3F2i7djAwBIlqT2EgQdxKoq0RMsvKmqlLePLfBytAu6RxT" +
"hC0vqANPJoPZVz8rV8ixsWINmJ2jx9A+xaGTHYAC6MdcM7sButDhJccIX2H6Zyem" +
"bl0KhfGmrerKZTmeqI/JjsJyaGsXV+h4qAyDpXwcJQKBgQDloiinUDrZZUMnU9af" +
"DacDZ4AWluefmnTvpO3JRKS8wYGYSSE0Aee4CnHTyNv7FFsGorQJgMFGHFNvHFQ1" +
"pk1+tuOgqycVPec6EzLgBPJC/1dMRRPk9JDXMpIM8dYkQ93phvfLqSKOCagGHOdR" +
"PMpk1LBhMUVmvHijFzX2+wMExwKBgQC8Ko9wvbT5GAiu6rIz1PVDvD5dQbv7jXPR" +
"Mu0QJlFJH5gQ5rVBZdxfBIjpQe4aMDtdot3KWkNjpgJm4OGA4T9E5OpHIIHZ+9cr" +
"PLEq9Evp9llrBEFICVC+DI3DZWC9+6Ussrs5p1y2Wyjuai6kZnDuvroUXpV1a6aE" +
"MydQNSWY7QKBgQC4ppOgLsCTrXy5dA4h6d2BvElgYMoyKgab6XiYHo2FhujJ5ww/" +
"AMUu1Z9AWMSjenPTuyOgfJtt4DsrHpGMboTkPvZ9bQNJbnSv215Oi0uvmhm9p9Je" +
"ilap5O1SYWj70mLwdOpvJzs1Egi9maJcTdDGEc0e6nrPKQCszG5FgwSjYwKBgG8f" +
"N0yeS/Ta863Q3mJrvlg9IBtUyZ4aAC6oQ4XJCzIC3XwFsz8m14iple0iyWlf2H9I" +
"wnBQ9AEyNbLp1WKWIxYdlhlhIi5IYt6e3gX+9aH6oP3pKmBPWAaURVgCU6p+pSIL" +
"fzPiGYd7uGVsAZWHBeSIcD29SchpRZJG302nxUdVAoGAQYSVYM7TMeTuQgDAXUD5" +
"g4ulLpZKiq910M7DufQ4tgrZOwT44I1ihDXh0s2BKg8+PLJPT1ldgH/Dtglwosv1" +
"peD0Lep3zSwrTXpyMstdCW16bl96FOKGP8H8c2zXXG7e39E6D9rPSKDt5TtGVScS" +
"PYsWAsMHzfsX2F4aUJNUuN0=";

/**
* example for get encrypted sign
*/
public static void Main(string[] args) {
// request head params
string customerId = "CSR9372F4E8ADG85";
string service = "queryCard";
string version = "2.0";
string requestId = "7ca6f405-acb4-4dd1-b35e-2b741b595e98";
long timestamp = 1741846955993L;

// payload after aesKey encryption, refer to AesUtils
string payload = "A/R7OP/qWzmIGDwfs0I3c8XmOfwRshvO1NaHDUIaq0yZAnqptgt7WiEXXF6Cg6LgbQ8+p5M6eikXuBLeTe+zxmkjF1Mc/nrnjyVwqwd7/WsWhYJ4YCEGAjjbGO8hftwZsVEufCRwIrL+wxbp8d7cD3AwVxuHr1+mkr2Rb+ox9j4qB5Z3dkUUpNnaMdIxqtMkXZjydoe9A8sAgYEmK28TTkUf/pYGWv7Wj0KtBkX4rMU=";

// generate sign
string sign = BuildRequestSignContent(customerId, service, version, requestId, timestamp, payload);

// encrypt sign
string encryptSign = RsaSign(NewRsaPrivateKey(rsaPrivateKey), sign);

// print result
Console.WriteLine(encryptSign);
}

public static string RsaSign(RSA privateKey, string content) {
byte[] dataBytes = Encoding.UTF8.GetBytes(content);
byte[] signatureBytes = privateKey.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
return ENCODER.Encode(signatureBytes);
}

public static bool RsaVerify(RSA publicKey, string content, string signature) {
byte[] dataBytes = Encoding.UTF8.GetBytes(content);
byte[] signatureBytes = DECODER.Decode(signature);
return publicKey.VerifyData(dataBytes, signatureBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
}

public static RSA NewRsaPrivateKey(string privateKeyStr) {
byte[] privateKeyBytes = DECODER.Decode(privateKeyStr);
RSA rsa = RSA.Create();
rsa.ImportPkcs8PrivateKey(privateKeyBytes, out _);
return rsa;
}

public static RSA NewRsaPublicKey(string publicKeyStr) {
byte[] publicKeyBytes = DECODER.Decode(publicKeyStr);
RSA rsa = RSA.Create();
rsa.ImportSubjectPublicKeyInfo(publicKeyBytes, out _);
return rsa;
}

public static string ToRsaPrivateKeyStr(RSA privateKey) {
byte[] privateKeyBytes = privateKey.ExportPkcs8PrivateKey();
return ENCODER.Encode(privateKeyBytes);
}

public static string ToRsaPublicKeyStr(RSA publicKey) {
byte[] publicKeyBytes = publicKey.ExportSubjectPublicKeyInfo();
return ENCODER.Encode(publicKeyBytes);
}

private static string BuildRequestSignContent(string customerId, string service, string version, string requestNo, long timestamp, string payload) {
StringBuilder builder = new StringBuilder();
if (!string.IsNullOrEmpty(customerId)) {
builder.Append(customerId).Append("|");
}
if (!string.IsNullOrEmpty(service)) {
builder.Append(service).Append("|");
}
if (!string.IsNullOrEmpty(version)) {
builder.Append(version).Append("|");
}
if (!string.IsNullOrEmpty(requestNo)) {
builder.Append(requestNo).Append("|");
}
if (timestamp != 0) {
builder.Append(timestamp).Append("|");
}
if (!string.IsNullOrEmpty(payload)) {
builder.Append(payload);
}
return builder.ToString();
}
}

public class Base64Encoder {
public string Encode(byte[] data) {
return Convert.ToBase64String(data);
}
}

public class Base64Decoder {
public byte[] Decode(string data) {
return Convert.FromBase64String(data);
}
}

It may need to be adjusted according to the C# runtime environment, for reference only.

PHP Utilities example
<?php declare(strict_types=1);

class RsaUtils {

public static function rsaSign(string $privateKeyStr, string $content): string {
openssl_sign($content, $signature, self::pemFormat($privateKeyStr, 'PRIVATE KEY'), OPENSSL_ALGO_SHA256);
return base64_encode($signature);
}

public static function rsaVerify(string $publicKeyStr, string $content, string $signature): bool {
return openssl_verify($content, base64_decode($signature), self::pemFormat($publicKeyStr, 'PUBLIC KEY'), OPENSSL_ALGO_SHA256) === 1;
}

private static function pemFormat(string $keyStr, string $label): string {
return "-----BEGIN {$label}-----\n" . chunk_split($keyStr, 64) . "-----END {$label}-----\n";
}
}

Create Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardCurrencyCodeStringNcard currency codeDefault same as settlement currency code.
ISO 4217 currency code, 3 digits.
settlementCurrencyCodeStringYsettlement currency codeISO 4217 currency code, 3 digits.
activeDateStringYeffective dateFormat yyyy-MM-dd.
inactiveDateStringYexpiration dateFormat yyyy-MM-dd.
activeTimeStringNeffective timeFormat HH:mm:ss. The default is 00:00:00 if unprovided
(Valid only for Hong Kong Mastercard, Singapore VISA card and UnionPay card.)
inactiveTimeStringNexpiration timeFormat HH:mm:ss. The default is 23:59:59 if unprovided
(Valid only for Hong Kong Mastercard, Singapore VISA card and UnionPay card.)
cardLimitNumberYcredit limitDecimal, matching card currency.
minAuthAmountNumberYlower limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
maxAuthAmountNumberYupper limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
maxAuthTimesNumberYmaximum authorized transaction timesInteger. 1: one time card, -1: no limit.
cardCloseUsageNumberNauto close threshold percentageInteger, between 0 and 100, default 0.
When the settled credit / credit limit per cent larger than or equal to this value, the card will be auto closed.
Special value 0: the card will not be auto closed.
(Not take effect on Prepaid card)
supportedMccGroupStringYaccepted MCC groupAccepted Merchant Category Code group, defined by TripLink.
Transaction requests which are not belong to this group will be rejected.
supportedMidStringNaccepted merchant IDTransaction requests which are not from this merchant will be rejected.
supportedAcquirerIdStringNaccepted acquirer IDTransaction requests which are not from this acquirer will be rejected.
multipleCurrencyCardBooleanNwhether allow transactions not in card currencyDefault true.
allow3dsBooleanNwhether allow 3DSDefault true.
(Only take effect on Hong Kong MasterCard)
cardProductCodeStringYcard product codeEnumerated type
Allowed values: C02, C03, C05.
cardTypeStringYcard brandEnumerated type, default GWTTP.
Allowed values: GWTTP, MCO, USDVCC etc.
cardLabelStringYcard associationEnumerated type, default MasterCard.
Allowed values: MasterCard, VISA.
cardBinStringNIIN codeThe Issuer Identification Number, defined by TripLink.
quoteIdStringNquote IDThe quote ID returned by FX Quote.
If valid, exchange at this rate; If invalid, exchange at the real-time rate.
(Only take effect on card product code C05)
timeZoneStringNcard time zoneThe time zone of the card effective and expiration date, format example:
China Standard Time GMT+08:00
Eastern Standard Time GMT-05:00
The default value can be configurated at Merchant System/Setting/VAN Default Configuration
userReferenceMapObjectNuser defined propertiesString key-value pair, including 20 optional keys.
Between useRef1Txt and useRef20Txt.

TripLink will only save and display the user defined properties without involving business logic.

request body sample
{
"requestId": "1ac60d08-0e15-47da-a341-7287dd46ff39",
"customerId": "CSR47284A93E35E4",
"cardCurrencyCode": "840",
"settlementCurrencyCode": "840",
"activeDate": "2025-01-01",
"inactiveDate": "2027-06-01",
"activeTime": "00:00:00",
"inactiveTime": "23:59:59",
"cardLimit": 1000.12,
"minAuthAmount": 3.45,
"maxAuthAmount": 500.67,
"maxAuthTimes": -1,
"cardCloseUsage": 40,
"supportedMccGroup": "ecom",
"multipleCurrencyCard": true,
"cardBin":"522981",
"cardType": "GWTTP",
"cardLabel": "MasterCard",
"userReferenceMap": {
"useRef1Txt": "anything"
}
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
cardLogIdStringcard IDTripLink card ID.
cardNumStringcard number16 digits card number.
cardExpirationDateStringexpiration dateFormat yyMM.
cvv2StringCVV2Card Verification Value.
cardTypeStringcard brand
cardLabelStringcard association
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
100001Reduplicative requestid
200002Both MCC, MCC groups and [acquirerId,merchantId] are all empty
200003Customer info not find
200007Global parameter not find
200008InactiveDate must be greater than activeDate
200013Not find the mapping between the cardCurrency and settlementCurrency
200014AcquirerId/mid must not be empty
200022Not find active pan number config
200029Card exists pending request
200036card bin not support
200037InactiveDate must submit
200038cardCloseUsage not be null
200040Invalid global parameter (indate)
200043mcc group is empty
200044mcc group all is not supported
200048Card issuer failed (not fixed)
200060Card issuer parameter error (not fixed)
201000Card available balance exceeds the maximum limit
300004mcc link channel group is empty
300005Trading is risky
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"cardLogId": "9448b6a7b3bcb22f99c1bedd246aba092c7932fd5e7f3042607bf58bc7cc3d83",
"cardNum": "5229811460053354",
"cardExpirationDate": "2406",
"cvv2": "123",
"cardType": "GWTTP",
"cardLabel": "MasterCard"
}

SDK Sample

Java SDK
public void testCreateCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardCreateRequest request = new CardCreateRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardCurrencyCode("840");
request.setSettlementCurrencyCode("840");
request.setActiveDate("2025-01-01");
request.setInactiveDate("2027-06-01");
request.setCardLimit(BigDecimal.valueOf(1000.12));
request.setMinAuthAmount(BigDecimal.valueOf(3.45));
request.setMaxAuthAmount(BigDecimal.valueOf(500.67));
request.setMaxAuthTimes(-1);
request.setCardCloseUsage(40);
request.setSupportedMccGroup("ecom");
request.setMultipleCurrencyCard(true);
request.setCardBin("522981");
request.setCardType("GWTTP");
request.setCardLabel("MasterCard");
Map<String, String> userReference = new HashMap<>();
userReference.put("useRef1Txt", "anything");
request.setUserReferenceMap(userReference);

CardCreateResponse response = tripLinkApi.create(request);
}
PHP SDK
public function testCreateCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new CreateCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardCurrencyCode('840');
$request->setSettlementCurrencyCode('840');
$request->setActiveDate('2025-01-01');
$request->setInactiveDate('2027-06-01');
$request->setCardLimit(1000.12);
$request->setMinAuthAmount(3.45);
$request->setMaxAuthAmount(500.67);
$request->setMaxAuthTimes(-1);
$request->setCardCloseUsage(40);
$request->setSupportedMccGroup('ecom');
$request->setMultipleCurrencyCard(true);
$request->setCardBin('522981');
$request->setCardType('GWTTP');
$request->setCardLabel('MasterCard');
$userReference = new UserReference();
$userReference->setUseRef1Txt('anything');
$request->setUserReferenceMap($userReference);

$response = $tripLinkAgent->createCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Update Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
activeDateStringNeffective dateFormat yyyy-MM-dd.
inactiveDateStringNexpiration dateFormat yyyy-MM-dd.
activeTimeStringNeffective timeFormat HH:mm:ss.
(Valid only for Hong Kong Mastercard, Singapore VISA card and UnionPay card.)
inactiveTimeStringNexpiration timeFormat HH:mm:ss.
(Valid only for Hong Kong Mastercard, Singapore VISA card and UnionPay card.)
cardLimitNumberNcredit limitDecimal, matching card currency.
(Not take effect on Prepaid card)
minAuthAmountNumberNlower limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
maxAuthAmountNumberNupper limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
cardCloseUsageNumberNauto cancel threshold percentageInteger, between 0 and 100, default 0.
When the settled credit / credit limit per cent larger than or equal to this value, the card will be auto closed.
Special value 0: the card will not be auto closed.
(Not take effect on Prepaid card)
supportedMccGroupStringNaccepted MCC groupAccepted Merchant Category Code group, defined by TripLink.
Transaction requests which are not belong to this group will be rejected.
supportedMidStringNaccepted merchant IDTransaction requests which are not from this merchant will be rejected.
supportedAcquirerIdStringNaccepted acquirer IDTransaction requests which are not from this acquirer will be rejected.
multipleCurrencyCardBooleanNwhether allow transactions not in card currency
allow3dsBooleanNwhether allow 3DS(Only take effect on Hong Kong MasterCard)
timeZoneStringNcard time zoneThe time zone of the card effective and expiration date, format example:
China Standard Time GMT+08:00
Eastern Standard Time GMT-05:00
The default value can be configurated at Merchant System/Setting/VAN Default Configuration
userReferenceMapObjectNuser defined propertiesString key-value pair, including 20 optional keys.
Between useRef1Txt and useRef20Txt.

TripLink will only save and display the user defined properties without involving business logic.

request body sample
{
"requestId": "15b77002-748d-4c89-b6a3-1fa0a25adf3b",
"customerId": "CSR47284A93E35E4",
"cardLogId": "9f289daa62ac6e941f918634de3f91a142eea82c09ac27783ea7c2d9c07f8ec3",
"cardLimit": 2000.12,
"multipleCurrencyCard": false
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
cardLogIdStringcard IDTripLink card ID.
cardNumStringcard number16 digits card number.
cardExpirationDateStringexpiration dateFormat yyMM.
cvv2StringCVV2Card Verification Value.
userReferenceMapObjectuser defined propertiesString key-value pair, including 20 optional keys.
Between useRef1Txt and useRef20Txt.

TripLink will only save and display the user defined properties without involving business logic.

result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
100001Reduplicative requestid
200001ActiveDate must be greater than current date (not fixed)
200003Customer info not find
200007Global parameter not find
200009Effective mccGroup not find
200014AcquirerId/mid must not be empty
200015Not find card
200016Card status is clop or clos
200019Update card limit is less than the amount of used card
200029Card exists pending request
200032Not find customer global setting
200036card bin not support
200048Card issuer failed (not fixed)
200060Card issuer parameter error (not fixed)
201000Card available balance exceeds the maximum limit
300004mcc link channel group is empty
300005Trading is risky
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"cardLogId": "9f289daa62ac6e941f918634de3f91a142eea82c09ac27783ea7c2d9c07f8ec3",
"cardNum": "5395933355051253",
"cardExpirationDate": "2406",
"cvv2": "123",
"userReferenceMap": {
"useRef1Txt": "anything"
}
}

SDK Sample

Java SDK
public void testUpdateCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardUpdateRequest request = new CardUpdateRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);
request.setCardLimit(BigDecimal.valueOf(2000.12));
request.setMultipleCurrencyCard(false);

CardUpdateResponse response = tripLinkApi.update(request);
}
PHP SDK
public function testUpdateCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new UpdateCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);
$request->setCardLimit(2000.12);
$request->setMultipleCurrencyCard(false);

$response = $tripLinkAgent->updateCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Recharge Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
rechargeAmountNumberYrecharge amountDecimal, matching card currency.
request body sample
{
"requestId": "9340c297-e8b8-4148-b0b7-3d8aa5fcb487",
"customerId": "CSR47284A93E35E4",
"cardLogId": "9261267e66b808e9a2f62fe54e516192677236b943aa2dee1836284b369768d7",
"rechargeAmount": 100.12
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200003Customer info not find
200015Not find card
200016Card status is clop or clos
201000Card available balance exceeds the maximum limit
300003Call JPM gateway error
300004mcc link channel group is empty
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success"
}

SDK Sample

Java SDK
public void testRechargeCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardRechargeRequest request = new CardRechargeRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);
request.setRechargeAmount(BigDecimal.valueOf(100.12));

CardRechargeResponse response = tripLinkApi.recharge(request);
}
PHP SDK
public function testRechargeCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new RechargeCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);
$request->setRechargeAmount(100.12);

$response = $tripLinkAgent->rechargeCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Withdraw Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
withdrawAmountNumberYwithdraw amountDecimal, matching card currency.
request body sample
{
"requestId": "8f26c686-6275-4271-aa6d-a0a6a4df441e",
"customerId": "CSR47284A93E35E4",
"cardLogId": "9261267e66b808e9a2f62fe54e516192677236b943aa2dee1836284b369768d7",
"withdrawAmount": 80.12
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200003Customer info not find
200015Not find card
200016Card status is clop or clos
200019Update card limit is less than the amount of used card
200029Card exists pending request
200048card issuer failed
300004mcc link channel group is empty
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success"
}

SDK Sample

Java SDK
public void testWithdrawCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardWithdrawRequest request = new CardWithdrawRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);
request.setWithdrawAmount(BigDecimal.valueOf(80.12));

CardWithdrawResponse response = tripLinkApi.withdraw(request);
}
PHP SDK
public function testWithdrawCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new WithdrawCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);
$request->setWithdrawAmount(80.12);

$response = $tripLinkAgent->withdrawCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Suspend Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
request body sample
{
"requestId": "7d451d22-fab3-471e-acfa-efd7aa3a1db9",
"customerId": "CSR47284A93E35E4",
"cardLogId": "f05c9c6670a956150aa346e671d6d9fe757cbe178d555a763631be75e61fee07"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200003Customer info not find
200015Not find card
200016Card status is clop or clos
300006Not support suspend the card
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success"
}

SDK Sample

Java SDK
public void testSuspendCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardSuspendRequest request = new CardSuspendRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);

CardSuspendResponse response = tripLinkApi.suspend(request);
}
PHP SDK
public function testSuspendCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new SuspendCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);

$response = $tripLinkAgent->suspendCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Unsuspend Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
request body sample
{
"requestId": "7d451d22-fab3-471e-acfa-efd7aa3a1db9",
"customerId": "CSR47284A93E35E4",
"cardLogId": "f05c9c6670a956150aa346e671d6d9fe757cbe178d555a763631be75e61fee07"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200003Customer info not find
200015Not find card
200016Card status is clop or clos
300006Not support unsuspend the card
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success"
}

SDK Sample

Java SDK
public void testUnsuspendCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardUnsuspendRequest request = new CardUnsuspendRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);

CardUnsuspendResponse response = tripLinkApi.unsuspend(request);
}
PHP SDK
public function testUnsuspendCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new UnsuspendCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);

$response = $tripLinkAgent->unsuspendCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Close Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
request body sample
{
"requestId": "7d451d22-fab3-471e-acfa-efd7aa3a1db9",
"customerId": "CSR47284A93E35E4",
"cardLogId": "f05c9c6670a956150aa346e671d6d9fe757cbe178d555a763631be75e61fee07"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200003Customer info not find
200015Not find card
200016Card status is clop or clos
200025card status pre cancel not allow
200051card cancel exception
200053Incorrect card status
300005Trading is risky
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success"
}

SDK Sample

Java SDK
public void testCloseCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardCancelRequest request = new CardCancelRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);

CardCancelResponse response = tripLinkApi.close(request);
}
PHP SDK
public function testCloseCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new CloseCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);

$response = $tripLinkAgent->closeCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Query Card

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
request body sample
{
"requestId": "5148d00e-d98f-4ccc-a5ef-acd1ff53d37e",
"customerId": "CSR47284A93E35E4",
"cardLogId": "0b51f2edf394d3875fa3c284186e5022236a59bc31dda6b3aba7dbe2982bc91a"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
customerIdStringcustomer IDSame as Request header.
cardLogIdStringcard IDTripLink card ID.
cardCurrencyCodeStringcard currency codeISO 4217 currency code, 3 digits.
settlementCurrencyCodeStringsettlement currency codeISO 4217 currency code, 3 digits.
activeDateStringeffective dateFormat yyyy-MM-dd.
inactiveDateStringexpiration dateFormat yyyy-MM-dd.
activeTimeStringeffective timeFormat HH:mm:ss.
inactiveTimeStringexpiration timeFormat HH:mm:ss.
cardLimitNumbercredit limitDecimal, matching card currency.
minAuthAmountNumberlower limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
maxAuthAmountNumberupper limit of single authorized transactionDecimal, matching card currency.
(Not take effect on Prepaid card)
maxAuthTimesNumbermaximum authorized transaction timesInteger. 1: one time card, -1: no limit.
cardCloseUsageNumberauto cancel threshold percentageInteger, between 0 and 100, default 0.
When the settled credit / credit limit per cent larger than or equal to this value, the card will be auto closed.
Special value 0: the card will not be auto closed.
(Not take effect on Prepaid card)
supportedMccGroupStringaccepted MCC groupAccepted Merchant Category Code group, defined by TripLink.
Transaction requests which are not belong to this group will be rejected.
supportedMidStringaccepted merchant IDTransaction requests which are not from this merchant will be rejected.
supportedAcquirerIdStringaccepted acquirer IDTransaction requests which are not from this acquirer will be rejected.
multipleCurrencyCardBooleanwhether allow transactions not in card currency
allow3dsBooleanwhether allow 3DSOnly take effect on Hong Kong MasterCard
applyTimeStringapply dateFormat yyyy-MM-dd.
statusStringcard statusNORM: Normal, SUSP: Suspended, CLOP: Pre-Canceled, CLOS: Canceled.
cardNumStringcard number16 digits card number.
cardExpirationDateStringexpiration dateFormat yyMM.
cvv2StringCVV2Card Verification Value.
availableBalanceNumberavailable balanceDecimal, matching card currency.
authorizeAmountNumberauthorized amountDecimal, matching card currency.
settlementAmountNumbersettled amountDecimal, matching card currency.
cardTypeStringcard brandEnumerated type.
Allowed values: GWTTP, MCO, USDVCC etc.
cardLabelStringcard associationEnumerated type.
Allowed values: MasterCard, VISA.
timeZoneStringcard time zoneThe time zone of the card effective and expiration date, format example:
China Standard Time GMT+08:00
Eastern Standard Time GMT-05:00
The default value can be configurated at Merchant System/Setting/VAN Default Configuration
userReferenceMapObjectuser defined propertiesString key-value pair, including 20 optional keys.
Between useRef1Txt and useRef20Txt.

TripLink will only save and display the user defined properties without involving business logic.

result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect (not fixed)
200015Not find card
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"customerId": "CSR47284A93E35E4",
"cardLogId": "0b51f2edf394d3875fa3c284186e5022236a59bc31dda6b3aba7dbe2982bc91a",
"cardCurrencyCode": "840",
"settlementCurrencyCode": "840",
"activeDate": "2025-01-01",
"inactiveDate": "2027-06-01",
"activeTime": "00:00:00",
"inactiveTime": "23:59:59",
"cardLimit": 1000.12,
"minAuthAmount": 3.45,
"maxAuthAmount": 500.67,
"maxAuthTimes": -1,
"cardCloseUsage": 40,
"supportedMccGroup": "ecom",
"multipleCurrencyCard": true,
"allow3ds": true,
"applyTime": "2025-02-17",
"status": "NORM",
"cardNum": "5395933355052420",
"cardExpirationDate": "2406",
"cvv2": "123",
"availableBalance": 1000.12,
"authorizeAmount": 0.00,
"settlementAmount": 0.00,
"cardType": "GWTTP",
"cardLabel": "MasterCard",
"timeZone": "GMT+08:00",
"userReferenceMap": {
"useRef1Txt": "anything"
}
}

SDK Sample

Java SDK
public void testQueryCard() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

CardDetailQueryRequest request = new CardDetailQueryRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);

CardDetailQueryResponse response = tripLinkApi.queryCard(request);
}
PHP SDK
public function testQueryCard(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new QueryCardRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);

$response = $tripLinkAgent->queryCard($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Query Account Credit

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
request body sample
{
"requestId": "3ddf14f6-04b0-4a66-840b-a21cf0c148ee",
"customerId": "CSR47284A93E35E4"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
customerIdStringcustomer IDSame as Request header.
listArrayaccount informationSee Account.

Account

NameTypeDescriptionComment
accountTypeStringaccount typeCREDIT: credit account; DEBIT: debit account; CCP_ACCT: exchange account.
accountCurrencyStringaccount currencyISO 4217 currency code, 3 digits.
accountAmountNumberaccount amountOnly has value when account type CREDIT.
Decimal, matching card currency.
remainAccountAmountNumberremain account amountDecimal, matching card currency.
result code
returnCodeerrorMessage
000000Success
100000input parameter is incorrect
200007not find the account credit
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "success",
"customerId": "CSR47284A93E35E4",
"list": [
{
"accountType": "DEBIT",
"accountCurrency": "840",
"remainAccountAmount": 999967.66
},
{
"accountType": "DEBIT",
"accountCurrency": "978",
"remainAccountAmount": 999999.99
}
]
}

SDK Sample

Java SDK
public void testQueryAccount() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

QueryCustomerCreditAmountRequest request = new QueryCustomerCreditAmountRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);

QueryCustomerCreditAmountResponse response = tripLinkApi.queryCustomerCreditAmount(request);
}
PHP SDK
public function testQueryAccount(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new QueryAccountRequest(uniqid(), CUSTOMER_ID);

$response = $tripLinkAgent->queryAccount($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Query Authorization Transactions

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
orderNoStringNorder numberOrder number.
transactionStatusStringNtransaction statusEnumerated type, allowed values: 1: Approved, 2: Declined.
transactionCodeStringNtransaction typeEnumerated type, 4 digits, see authorization type drop-down list.
transactionStartTimeStringNtransaction start timeFormat yyyy-MM-dd HH:mm:ss.
transactionEndTimeStringNtransaction end timeFormat yyyy-MM-dd HH:mm:ss.
pageNoNumberNpage numberInteger, range [1,100], default 1.
pageSizeNumberNpage sizeInteger, range [1,100], default 5.
request body sample
{
"requestId":"7fb57ff0-ea70-4099-acf5-eacba55e18ef",
"customerId":"CSR47284A93E35E4",
"cardLogId":"c55d99dac26bb334c07879404a93d2c6a96b42f7372f9c04d14034d019203fe4",
"transactionStartTime":"2024-10-01 03:00:00",
"transactionEndTime":"2024-10-02 04:00:00",
"pageNo":1,
"pageSize":10
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
cardLogIdStringcard IDTripLink card ID.
countNumbercountInteger, the number of transaction data returned.
moreBooleanmore dataWhether there are more paginated data under this request condition.
true means there are more.
transactionDataArrayauthorization transactionsSee AuthTransaction.
result code
returnCodeerrorMessage
000000Success
100007NOT_FIND_CARD
9XXXXXSystem error (not fixed)

AuthTransaction

NameTypeDescriptionComment
requestIdStringtransaction IDGlobally unique.
cardLogIdStringcard IDTripLink card ID.
transactionIdStringtransaction relation IDAuthorization and corresponding reversal has same value.
orderNoStringorder numberOrder number.
transactionCurrencyCodeStringtransaction currency codeISO 4217 currency code, 3 digits.
transactionAmountNumbertransaction amountDecimal, matching transaction currency.
cardCurrencyCodeStringcard currencyISO 4217 currency code, 3 digits.
cardTransactionAmountNumbercard transaction AmountDecimal, matching card currency.
responseCodeStringtransaction response codeEnumerated type, 4 digits, see response code drop-down list.
(code other than 0000 means authorization reject)
responseDescriptionStringtransaction response code descriptionSee response code drop-down list.
approvalCodeStringauthorization codeRandom 6 alphanumeric.
transactionCodeStringtransaction typeEnumerated type, 4 digits, see authorization type drop-down list.
transactionDateStringtransaction timeFormat yyyy-MM-dd HH:mm:ss.
localTimeStringtransaction local timeFormat yyyy-MM-dd HH:mm:ss.
merchantNameStringmerchant name
mccStringmerchant MCCISO 18245 merchant type, 4 digits.
merchantCountryStringmerchant country(unstandardized)
isoMerchantCountryCodeStringmerchant countryISO 3166 country code, 3 letters.
(maybe empty)
merchantCityStringmerchant city
merchantIdStringmerchant ID
acquiringBankIdStringacquirer ID
cardInitialBalanceNumbercard opening balanceDecimal, matching card currency.
cardEndingBalanceNumbercard closing balanceDecimal, matching card currency.
creditTransactionSignStringcredit transaction markerEnumerated type, allowed values: 0: Debit, 1: Credit.
reversalTypeStringreversal typeOnly has value when authorization type 6930 or 6940.
0: system reversal; 1: non system reversal.
authorization type
messageTypemessageTypeDescriptionTransaction Direction
6810Authorization ApprovalDebit
6510Auth Refund ApprovalCredit
6930Authorization Reversal ApprovalCredit
6940Auth Refund Reversal ApprovalDebit
6820Authorization QueryDebit
response code (6810 Authorization Approval)
responseCoderesponseCodeDescription
0000Authorization Approval
1002High Risk Transaction
1003Invalid Account
1101Abnormal Customer Status
1102Card canceled
1103Authorization Amount Error
1104VAN Amount Limit Error
1105Invalid Expiry Date
1106Transaction Count Over Limit
1107Invalid CVV2
1108VAN Amount Limit Error
1110Trans Currency Not Allowed
1111MCC Error
1112VAN credit limit greater than max Limit
1113VAN credit limit less than min Limit
1114Transaction Date before card activeDate
1115Transaction Date after card inactiveDate
1116Auth Amount greater than available VAN credit limit
1117Auth Amount greater than available account credit limit
1118Limited usage with abnormal card status
1201Authorization already in process, please wait until the last authorization completed
1203Not support 3ds
2012Cardholder cancels identity verification
2014Cardholder fails to complete identity verification within the specified time
2019Cardholder fails to complete identity verification within the specified number of attempts
2022Merchant requests invalid information
2222Authorization decision reject
2299Authorization decision downgrade reject
3004Abnormal Card Scheme Network
9000Unknow Error
response code (6510 Auth Refund Approval)
responseCoderesponseCodeDescription
0000Authorization Approval
1002High Risk Transaction
1003Invalid Account
1101Abnormal Customer Status
1107Invalid CVV2
1110Trans Currency Not Allowed
1111MCC Error
response code (6930 Authorization Reversal Approval)
responseCoderesponseCodeDescription
0000Authorization Approval
1002High Risk Transaction
1003Invalid Account
1101Abnormal Customer Status
1105Invalid Expiry Date
2001Original Transaction Unmatch
2002Original Transaction Unmatch
response code (6940 Auth Refund Reversal Approval)
responseCoderesponseCodeDescription
0000Authorization Approval
1002High Risk Transaction
1003Invalid Account
2001Original Transaction Unmatch
2002Original Transaction Unmatch
response code (6820 Authorization Query)
responseCoderesponseCodeDescription
0000Authorization Approval
1002High Risk Transaction
1003Invalid Account
1102Card canceled
1118Limited usage with abnormal card status
response body sample
{
"returnCode":"000000",
"errorMessage":"Success",
"cardLogId":"3d70589dfe5c9a771c520d3382ad67af6a17389128b1c3d7968d33b3f62d0703",
"count":1,
"more":true,
"transactionData":[
{
"cardLogId":"3d70589dfe5c9a771c520d3382ad67af6a17389128b1c3d7968d33b3f62d0703",
"requestId":"63fe1c0b-9030-4d57-82c7-74eec6e4a450",
"transactionId":"0707110634049997213457",
"orderNo":"dingdan11",
"transactionCurrencyCode":"344",
"transactionAmount":1000,
"cardCurrencyCode":"840",
"cardTransactionAmount":127.44,
"responseCode":"0000",
"responseDescription":"Authorization Approval",
"approvalCode":"730704",
"transactionCode":"6810",
"transactionDate":"2024-07-07 19:06:34",
"localTime":"2024-07-07 13:06:34",
"merchantName":"ALIEXPRESS.COM",
"mcc":"0015",
"merchantCountry":"SGP",
"merchantCity":"Singapore",
"merchantId":"87846545546",
"acquiringBankId":"213457",
"creditTransactionSign":"0",
"reversalType":"0"
}
]
}

SDK Sample

Java SDK
public void testQueryAuthorizationByPage() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

QueryAuthTransactionByPageRequest request = new QueryAuthTransactionByPageRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setCardLogId(CARD_LOG_ID);
request.setTransactionStartTime("2024-02-01 03:00:00");
request.setTransactionEndTime("2024-03-02 04:00:00");

QueryAuthTransactionByPageResponse response = tripLinkApi.authTransactionQueryByPage(request);
}
PHP SDK
public function testQueryAuthorizationByPage(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new QueryAuthorizationByPageRequest(uniqid(), CUSTOMER_ID);
$request->setCardLogId(CARD_LOG_ID);
$request->setTransactionStartTime('2024-02-01 03:00:00');
$request->setTransactionEndTime('2024-03-02 04:00:00');

$response = $tripLinkAgent->queryAuthorizationByPage($request);
}

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Query Settlement Transactions

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
cardLogIdStringYcard IDTripLink card ID.
settlementStartTimeStringYsettlement start timeFormat yyyy-MM-dd HH:mm:ss.
settlementEndTimeStringYsettlement end timeFormat yyyy-MM-dd HH:mm:ss.
pageNoNumberNpage numberInteger, range [1,100], default 1.
pageSizeNumberNpage sizeInteger, range [1,100], default 5.
request body sample
{
"requestId": "9032aee1-85aa-41e8-bc46-7ff8bb36097d",
"customerId": "CSR47284A93E35E4",
"cardLogId": "c55d99dac26bb334c07879404a93d2c6a96b42f7372f9c04d14034d019203fe4",
"settlementStartTime": "2025-02-01 03:00:00",
"settlementEndTime": "2025-03-01 04:00:00"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
cardLogIdStringcard IDTripLink card ID.
countNumbercountInteger, the number of transaction data returned.
moreBooleanmore dataWhether there are more paginated data under this request condition.
true means there are more.
settlementDataArraysettlement transactionsSee SettlementTransaction.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect
100007NOT_FIND_CARD
9XXXXXSystem error (not fixed)

SettlementTransaction

NameTypeDescriptionComment
serialNoStringtransaction IDGlobally unique.
occurDateTimeStringtransaction timeFormat yyyy-MM-dd HH:mm:ss.
postingDateTimeStringposting timeFormat yyyy-MM-dd HH:mm:ss.
postingSysTimeStringsystem posting timeFormat yyyy-MM-dd.
transactionCodeStringtransaction typeEnumerated type, 4 digits, see settlement type drop-down list.
transactionTypeStringtransaction code descriptionSee settlement type drop-down list.
approvalCodeStringauthorization codeRandom 6 alphanumeric.
isCreditStringcredit transactionDEBT: Debit, CRED: Credit.
originalTransactionCurrencyStringtransaction currency codeISO 4217 currency code, 3 digits.
originalTransactionAmountNumbertransaction amountDecimal, matching transaction currency.
cardTransactionCurrencyStringcard currencyISO 4217 currency code, 3 digits.
cardTransactionAmountNumbercard transaction AmountDecimal, matching card currency.
accountCurrencyStringsettlement currency codeISO 4217 currency code, 3 digits.
billAccountAmountNumbersettlement amountDecimal, matching settlement currency.
posMerchantIDStringmerchant ID
posMerchantNameStringmerchant name
posMerchantClassCodeStringmerchant MCCISO 18245 merchant type, 4 digits.
posMerchantCountryStringmerchant country(unstandardized)
isoMerchantCountryCodeStringmerchant countryISO 3166 country code, 3 letters.
(maybe empty)
posMerchantCityStringmerchant city
posAcquirerIDStringacquirer ID
transactionIdStringtransaction relation IDSettlement and corresponding authorization has same value.
settlement type
transactionCodetransactionTypeDebit/CreditAmount Sign
2010PurchaseDEBTPositive
2110RefundCREDNegative
4060Chargeback ReleaseDEBTPositive
4160ChargebackCREDNegative
4170Dispute ClaimDEBTPositive
4260Dispute RefundCREDNegative
response body sample

SDK Sample

Java SDK
PHP SDK

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Initiate Account Withdrawal

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
paymentCurrencyStringYwithdrawal currency codeISO 4217 currency code, 3 digits.
paymentAmountNumberYwithdrawal amountDecimal, matching withdrawal currency.
beneficiaryAccountNoStringYbeneficiary account numberThe account must be registered at TripLink.
Please contact your account manager for details.
beneficiaryAccountNameStringYbeneficiary account name
beneficiaryBankNameStringYbeneficiary bank name
beneficiaryBankCountryCodeStringYbeneficiary bank countryISO 3166 country code, 2 letters.
referenceStringYreferenceWill be directly transmitted to the receiving bank, the length should not exceed 90 characters.
Only English, numbers, spaces, and some special characters , - ()./ are allowed.
clientOrderIdStringNclient order ID
request body sample
{
"requestId": "9032aee1-85aa-41e8-bc46-7ff8bb36097d",
"customerId": "CSR47284A93E35E4",
"paymentCurrency": "840",
"paymentAmount": "100.21",
"beneficiaryAccountNo": "660010011001",
"beneficiaryAccountName": "Trip company",
"beneficiaryBankName": "JP Morgan",
"beneficiaryBankCountryCode": "HK",
"reference": "payment to xx",
"clientOrderId": "13211000"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
orderIdStringorder IDGlobally unique.
paymentCurrencyStringwithdrawal currency codeISO 4217 currency code, 3 digits.
paymentAmountNumberwithdrawal amountDecimal, matching withdrawal currency.
acceptTimeStringacceptance timeFormat yyyy-MM-dd HH:mm:ss.
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect
150016RequestId is exists
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"orderId": "142303141346210898",
"paymentCurrency": "840",
"paymentAmount": "100.21",
"acceptTime": "2025-03-14 12:00:00"
}

SDK Sample

Java SDK
public void testPayoutCreate() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

PayoutCreateRequest request = new PayoutCreateRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId("CSR2E54DC4B8A5D4");
request.setPaymentCurrency("840");
request.setPaymentAmount(new BigDecimal("100"));
request.setBeneficiaryAccountNo("12321424");
request.setBeneficiaryAccountName("trip company");
request.setBeneficiaryBankName("bank name");
request.setBeneficiaryBankCountryCode("HK");
request.setReference("reference123");
request.setClientOrderId("f334f967102d");

PayoutCreateResponse response = tripLinkApi.payoutCreate(request);
}
PHP SDK

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

Query Account Withdrawal

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
oriRequestIdStringYoriginal initiate request ID
request body sample
{
"requestId": "68519520-66ef-404d-82cc-fa34f967002d",
"customerId": "CSR47284A93E35E4",
"oriRequestId": "9032aee1-85aa-41e8-bc46-7ff8bb36097d"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
orderIdStringorder IDGlobally unique.
statusStringorder status1: Processing, 2: Remitted, 3: Review Rejection,
4: Remittance Rejection, 5: Remittance Exception, 6: Refunded
paymentCurrencyStringwithdrawal currency codeISO 4217 currency code, 3 digits.
paymentAmountNumberwithdrawal amountDecimal, matching withdrawal currency.
beneficiaryAccountNoStringbeneficiary account number
beneficiaryAccountNameStringbeneficiary account name
acceptTimeStringacceptance timeFormat yyyy-MM-dd HH:mm:ss.
clientOrderIdStringclient order ID
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect
150017Order is not exists
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"orderId": "142303141346210898",
"status": 1,
"paymentCurrency": "840",
"paymentAmount": "100.21",
"beneficiaryAccountNo": "1232112",
"beneficiaryAccountName": "trip company",
"acceptTime": "2023-03-14 12:00:00",
"clientOrderId": "clientOrderId"
}

SDK Sample

Java SDK
public void testPayoutQuery() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

PayoutQueryRequest request = new PayoutQueryRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId("CSR2E54DC4B8A5D4");
request.setOriRequestId("9032aee1-85aa-41e8-bc46-7ff8bb36097d");

PayoutQueryResponse response = tripLinkApi.payoutQuery(request);
}
PHP SDK

BASE_URL: API URL; CARD_LOG_ID: card ID.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

FX Quote

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
sellCurrencyStringYsell currencyISO 4217 currency code, 3 digits.
buyCurrencyStringYbuy currencyISO 4217 currency code, 3 digits.
fxDirectionNumberYtrading direction0:Selling, in this case, fxAmount is the sell amount;
1:Buying, in this case, fxAmount is the buy amount.
fxAmountNumberYtrading amountDecimal, matching buy or sell currency.
request body sample
{
"requestId": "3ddf14f6-04b0-4a66-840b-a21cf0c148ee",
"customerId": "CSR47284A93E35E4",
"sellCurrency": "156",
"buyCurrency": "840",
"fxDirection": 0,
"fxAmount": 100.00
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
quoteIdStringquote IDGlobally unique.
sellCurrencyStringsell currencyISO 4217 currency code, 3 digits.
sellAmountNumbersell amountDecimal, matching sell currency.
buyCurrencyStringbuy currencyISO 4217 currency code, 3 digits.
buyAmountNumberbuy amountDecimal, matching buy currency.
rateNumberexchange rateDecimal.
expireTimeStringexpiration timeFormat yyyy-MM-dd HH:mm:ss (Time zone UTC+08:00).
result code
returnCodeerrorMessage
000000Success
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "success",
"quoteId": "f3c41a86e880f2c71de0b5c45d4ae066",
"sellCurrency": "156",
"sellAmount": 100.00,
"buyCurrency": "840",
"buyAmount": 15.72,
"rate": 0.15707102,
"expireTime": "2022-02-25 21:56:51"
}

SDK Sample

Java SDK
public void testFxQuote() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

QuoteRequest request = new QuoteRequest();
request.setRequestId(UUID.randomUUID().toString());
request.setCustomerId(CUSTOMER_ID);
request.setSellCurrency("156");
request.setBuyCurrency("840");
request.setFxDirection(0);
request.setFxAmount(BigDecimal.valueOf(100.00));

QuoteResponse response = tripLinkApi.quote(request);
}
PHP SDK
public function testFxQuote(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);
$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);

$request = new FxQuoteRequest(uniqid(), CUSTOMER_ID);
$request->setSellCurrency('156');
$request->setBuyCurrency('840');
$request->setFxDirection(0);
$request->setFxAmount(100.00);

$response = $tripLinkAgent->fxQuote($request);
}

BASE_URL: API URL.

CUSTOMER_ID: customer ID; CUSTOMER_PRIVATE_KEY: customer RSA private key.

AES_KEY: AES key; TRIPLINK_PUBLIC_KEY: TripLink RSA public key.

FX Create Order

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
sellCurrencyStringYsell currencyISO 4217 currency code, 3 digits.
buyCurrencyStringYbuy currencyISO 4217 currency code, 3 digits.
fxDirectionNumberYtrading direction0:Selling, in this case, fxAmount is the sell amount;
1:Buying, in this case, fxAmount is the buy amount.
fxAmountNumberYtrading amountDecimal, matching buy or sell currency.
quoteIdStringNquote IDThe quote ID returned by FX Quote.
If not provided, exchange at the real-time rate.
request body sample
{
"requestId": "9032aee1-85aa-41e8-bc46-7ff8bb36097d",
"customerId": "CSR32384FAC033D4",
"sellCurrency": "840",
"buyCurrency": "157",
"fxDirection": "0",
"fxAmount": "200.99"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
orderIdStringorder IDGlobally unique.
acceptTimeStringacceptance timeFormat yyyy-MM-dd HH:mm:ss.
sellCurrencyStringsell currencyISO 4217 currency code, 3 digits.
sellAmountNumbersell amountDecimal, matching sell currency.
buyCurrencyStringbuy currencyISO 4217 currency code, 3 digits.
buyAmountNumberbuy amountDecimal, matching buy currency.
rateNumberexchange rateDecimal.
quoteIdStringquote ID
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect
100006No rate
100010account currency not enough
100017customer product is not support
120034RequestId is exists
120035Fx info not match quote info
120037The exchange amount is not within the limit
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"orderId": "646873e2-4d3f-486b-83af-e6a0bc6d464c",
"acceptTime": "2024-01-08 14:38:17",
"sellCurrency": "840",
"sellAmount": "28.08",
"buyCurrency": "157",
"buyAmount": "200.99",
"rate": "7.15711345",
"quoteId": "ff36346e5c5c4562af194ba44165d759"
}

SDK Sample

Java SDK
public void testFxCreate() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

FxCreateRequest request = new FxCreateRequest();
request.setRequestId(String.valueOf(UUID.randomUUID()));
request.setCustomerId("CSR2E54DC4B8A5D4");
request.setSellCurrency("840");
request.setBuyCurrency("344");
request.setFxDirection(0);
request.setFxAmount(new BigDecimal("100.03"));

FxCreateResponse response = tripLinkApi.fxCreate(request);
}
PHP SDK
public function testFxCreate(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);

$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);
$request = new FxCreateRequest(uniqid(), CUSTOMER_ID);
$request->setSellCurrency('840');
$request->setBuyCurrency('157');
$request->setFxDirection(0);
$request->setFxAmount(2.98);
$request->setQuoteId('');

$response = $tripLinkAgent->fxCreate($request);
}

BASE_URL: API URL.

CUSTOMER_ID:customer ID;CUSTOMER_PRIVATE_KEY:customer RSA private key.

AES_KEY:AES key;TRIPLINK_PUBLIC_KEY:TripLink RSA public key.

FX Query Order

Request body

NameTypeRequiredDescriptionComment
requestIdStringYrequest IDSame as Request header.
customerIdStringYcustomer IDSame as Request header.
oriRequestIdStringNoriginal initiate request IDEither oriRequestId or orderId is required.
orderIdStringNorder IDEither oriRequestId or orderId is required.
request body sample
{
"requestId": "2024010800000001",
"customerId": "CSR32384FAC033D4",
"oriRequestId": "9032aee1-85aa-41e8-bc46-7ff8bb360976"
}

Response body

NameTypeDescriptionComment
returnCodeStringresult codeEnumerated type, 6 digits, see result code drop-down list.
(code other than 000000 means request failed)
errorMessageStringresult code descriptionSee result code drop-down list.
orderIdStringorder IDGlobally unique.
statusNumberstatus0: Processing, 1: Success, 2: Failure.
acceptTimeStringacceptance timeFormat yyyy-MM-dd HH:mm:ss.
sellCurrencyStringsell currencyISO 4217 currency code, 3 digits.
sellAmountNumbersell amountDecimal, matching sell currency.
buyCurrencyStringbuy currencyISO 4217 currency code, 3 digits.
buyAmountNumberbuy amountDecimal, matching buy currency.
rateNumberexchange rateDecimal.
quoteIdStringquote ID
result code
returnCodeerrorMessage
000000Success
100000Input parameter is incorrect
120036Fx order not found
9XXXXXSystem error (not fixed)
response body sample
{
"returnCode": "000000",
"errorMessage": "Success",
"orderId": "f1f0dded-a130-4bc9-be08-0d9cc9072dc4",
"status": 1,
"acceptTime": "2024-01-08 14:39:31",
"sellCurrency":"840",
"sellAmount":200.99,
"buyCurrency":"157",
"buyAmount":1438.51,
"rate":7.15711345,
"quoteId":"94eae20cbbc54c7e89c502a653ce41bc"
}

SDK Sample

Java SDK
public void testFxQuery() {
HttpClient<CallHttpResponse> httpClient = new TripLinkHttpClient();
TripLinkBizImplV2 tripLinkCore = new TripLinkBizImplV2(CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY, AES_KEY, BASE_URL, httpClient);
TripLinkApiImplV2 tripLinkApi = new TripLinkApiImplV2(tripLinkCore);

FxQueryRequest request = new FxQueryRequest();
request.setRequestId(String.valueOf(UUID.randomUUID()));
request.setCustomerId("CSR2E54DC4B8A5D4");
request.setOriRequestId("testRequest1");

FxQueryResponse response = tripLinkApi.fxQuery(request);
}
PHP SDK
public function testFxQuery(): void {
$httpClient = new GuzzleHttpClient();
$customer = new Customer(CUSTOMER_ID, AES_KEY, CUSTOMER_PRIVATE_KEY, TRIPLINK_PUBLIC_KEY);

$tripLinkAgent = new SimpleTripLinkAgent(BASE_URL, $customer, $httpClient);
$request = new FxQueryRequest(uniqid(), CUSTOMER_ID);
$request->setOrderId('27f4b30b-3ddc-4736-8c9d-a35d3e73cae7');

$response = $tripLinkAgent->fxQuery($request);
}

BASE_URL: API URL.

CUSTOMER_ID:customer ID;CUSTOMER_PRIVATE_KEY:customer RSA private key.

AES_KEY:AES key;TRIPLINK_PUBLIC_KEY:TripLink RSA public key.