UQPayClient 上所有资源命名空间,每个命名空间对应一条 UQPAY 产品线。
Account
// Retrieve a single account
const account = await client.account.accounts.retrieve('acc-123')
// List accounts
const page = await client.account.accounts.list({ page_number: 1, page_size: 20 })
// Create a sub-account
const subAccount = await client.account.subAccounts.create({
business_type: 'BANKING',
entity_type: 'COMPANY',
nickname: 'My Sub-account',
})
// Get required additional documents for a country
const docs = await client.account.additionalDocs.get({
country: 'SG',
business_code: 'BANKING',
})
Global Account
余额
const balances = await client.banking.balances.list({ page_number: 1, page_size: 20 })
const transactions = await client.banking.balances.listTransactions({ page_number: 1, page_size: 20 })
充值
const deposits = await client.banking.deposits.list({ page_number: 1, page_size: 20 })
转账
const transfer = await client.banking.transfers.create({
source_account_id: 'acc-123',
destination_account_id: 'acc-456',
currency: 'SGD',
amount: 100,
})
const transfers = await client.banking.transfers.list({ page_number: 1, page_size: 20 })
出款
const payout = await client.banking.payouts.create({
beneficiary_id: 'ben-123',
currency: 'SGD',
amount: 50,
purpose_code: 'PERSONAL',
})
受益人
const beneficiary = await client.banking.beneficiaries.create({
// ...
})
const beneficiaries = await client.banking.beneficiaries.list({ page_number: 1, page_size: 20 })
换汇
// Get a quote
const quote = await client.banking.conversions.createQuote({
sell_currency: 'SGD',
buy_currency: 'USD',
amount: 100,
fixed_side: 'SELL',
})
// Execute the conversion
const conversion = await client.banking.conversions.create({
quote_id: quote.quote_id,
})
// Get current exchange rates
const rates = await client.banking.conversions.listCurrentRates({
currency_pairs: ['SGD/USD', 'USD/SGD'],
})
虚拟账户
SDK v2.0.0支持申请式Create、List Applications、Retrieve Application和application级Webhook。请在2026年9月3日Production上线前按照REST迁移指南完成适配。
支付方式
const methods = await client.banking.paymentMethods.list({ page_number: 1, page_size: 20 })
Card Issuance
持卡人
const cardholder = await client.issuing.cardholders.create({
email: 'user@example.com',
first_name: 'Jane',
last_name: 'Smith',
country_code: 'SG',
phone_number: '+6512345678',
})
卡片
// Create a card
const card = await client.issuing.cards.create({
card_currency: 'SGD',
cardholder_id: cardholder.cardholder_id,
card_product_id: 'prod-123',
})
// List and retrieve
const cards = await client.issuing.cards.list({ page_number: 1, page_size: 20 })
const retrieved = await client.issuing.cards.retrieve(card.card_id)
// Freeze / unfreeze
await client.issuing.cards.updateStatus(card.card_id, { card_status: 'FROZEN' })
await client.issuing.cards.updateStatus(card.card_id, { card_status: 'ACTIVE' })
// Recharge and withdraw
await client.issuing.cards.recharge(card.card_id, { amount: 100 })
await client.issuing.cards.withdraw(card.card_id, { amount: 50 })
安全卡信息展示(iframe)
返回一个短期有效(60 秒)的 URL,在 UQPAY 托管的 PCI 合规 iframe 中渲染卡号、CVV 与有效期:const { iframeUrl, expires_at } = await client.issuing.cards.getSecureIframeUrl(card.card_id)
console.log(iframeUrl) // https://embedded-sandbox.uqpaytech.com/iframe/card?token=...
console.log(expires_at) // 2026-04-02T18:50:23+08:00
const { iframeUrl } = await client.issuing.cards.getSecureIframeUrl(card.card_id, {
lang: 'zh',
styles: { '.card-number': { color: '#333', 'font-size': '18px' } },
})
余额与交易
const balances = await client.issuing.balances.list({ page_number: 1, page_size: 20 })
const balance = await client.issuing.balances.retrieve('SGD')
const txns = await client.issuing.balances.listTransactions({ page_number: 1, page_size: 20 })
const transactions = await client.issuing.transactions.list({ page_number: 1, page_size: 20 })
转账
const transfer = await client.issuing.transfers.create({
source_account_id: 'acc-123',
destination_account_id: 'acc-456',
currency: 'SGD',
amount: 100,
})
产品与报表
const products = await client.issuing.products.list({ page_number: 1, page_size: 20 })
const report = await client.issuing.reports.create({
report_type: 'SETTLEMENT',
start_time: '2026-01-01T00:00:00Z',
end_time: '2026-01-31T23:59:59Z',
})
Payment
PaymentIntent
const intent = await client.payment.paymentIntents.create({
amount: '100.00',
currency: 'SGD',
})
await client.payment.paymentIntents.confirm(intent.payment_intent_id, { /* ... */ })
await client.payment.paymentIntents.capture(intent.payment_intent_id, { /* ... */ })
await client.payment.paymentIntents.cancel(intent.payment_intent_id)
const intents = await client.payment.paymentIntents.list({ page_number: 1, page_size: 20 })
退款
const refund = await client.payment.refunds.create({
payment_intent_id: intent.payment_intent_id,
amount: '50.00',
})
const refunds = await client.payment.refunds.list({ page_number: 1, page_size: 20 })
银行账户
const bankAccount = await client.payment.bankAccounts.create({
currency: 'USD',
bank_account_number: '1234567890',
bank_routing_number: '021000021',
bank_address: '12 Marina Blvd, Singapore',
})
出款
const payout = await client.payment.payouts.create({
bank_account_id: bankAccount.bank_account_id,
amount: '100.00',
currency: 'USD',
})
余额、PaymentAttempt与结算
const balances = await client.payment.balances.list({ page_number: 1, page_size: 20 })
const attempts = await client.payment.paymentAttempts.list({ page_number: 1, page_size: 20 })
const settlements = await client.payment.settlements.list({ page_number: 1, page_size: 20 })
Supporting(文件上传与下载)
import { readFileSync } from 'fs'
// Upload a file
const uploaded = await client.supporting.files.upload(
readFileSync('./kyc-document.pdf'),
{ filename: 'kyc-document.pdf', mimeType: 'application/pdf' }
)
console.log(uploaded.file_id)
// Get download links
const links = await client.supporting.files.downloadLinks([uploaded.file_id])
模拟器(仅沙盒)
模拟器仅在
sandbox 环境可用。在生产环境调用任何模拟器方法都会抛出 SimulatorNotAvailableError。// Simulate a card authorization
const auth = await client.simulator.issuing.authorize({
card_id: 'card-123',
transaction_amount: 25,
transaction_currency: 'SGD',
merchant_name: 'Coffee Shop',
merchant_category_code: '5734',
})
// Simulate a reversal
await client.simulator.issuing.reverse({
transaction_id: auth.transaction_id,
})
// Simulate a deposit
const deposit = await client.simulator.deposits.simulate({
currency: 'SGD',
amount: 500,
sender_swift_code: 'WELGBE22',
})

