跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://developers-sandbox.uqpaytech.com/llms.txt

Use this file to discover all available pages before exploring further.

本页覆盖 UQPayClient 上所有资源命名空间,每个命名空间对应一条 UQPAY 产品线。

Account

// 读取单个账户
const account = await client.account.accounts.retrieve('acc-123')

// 列出账户
const page = await client.account.accounts.list({ page_number: 1, page_size: 20 })

// 创建子账户
const subAccount = await client.account.subAccounts.create({
  business_type: 'BANKING',
  entity_type: 'COMPANY',
  nickname: 'My Sub-account',
})

// 按国家获取额外必填资料列表
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 })

换汇

// 获取报价
const quote = await client.banking.conversions.createQuote({
  sell_currency: 'SGD',
  buy_currency: 'USD',
  amount: 100,
  fixed_side: 'SELL',
})

// 执行换汇
const conversion = await client.banking.conversions.create({
  quote_id: quote.quote_id,
})

// 查询当前汇率
const rates = await client.banking.conversions.listCurrentRates({
  currency_pairs: ['SGD/USD', 'USD/SGD'],
})

虚拟账户

const va = await client.banking.virtualAccounts.create({
  currency: 'SGD',
})

支付方式

const methods = await client.banking.paymentMethods.list({ page_number: 1, page_size: 20 })

Card Issuance

持卡人

const cardholder = await client.issuing.cardholders.create({
  email: '[email protected]',
  first_name: 'Jane',
  last_name: 'Smith',
  country_code: 'SG',
  phone_number: '+6512345678',
})

卡片

// 创建卡片
const card = await client.issuing.cards.create({
  card_currency: 'SGD',
  cardholder_id: cardholder.cardholder_id,
  card_product_id: 'prod-123',
})

// 列表与读取
const cards = await client.issuing.cards.list({ page_number: 1, page_size: 20 })
const retrieved = await client.issuing.cards.retrieve(card.card_id)

// 冻结 / 解除冻结
await client.issuing.cards.updateStatus(card.card_id, { card_status: 'FROZEN' })
await client.issuing.cards.updateStatus(card.card_id, { card_status: 'ACTIVE' })

// 充值与提现
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

Payment intent

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',
})

余额、Attempt 与结算

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'

// 上传文件
const uploaded = await client.supporting.files.upload(
  readFileSync('./kyc-document.pdf'),
  { filename: 'kyc-document.pdf', mimeType: 'application/pdf' }
)
console.log(uploaded.file_id)

// 获取下载链接
const links = await client.supporting.files.downloadLinks([uploaded.file_id])

模拟器(仅沙盒)

模拟器仅在 sandbox 环境可用。在生产环境调用任何模拟器方法都会抛出 SimulatorNotAvailableError
// 模拟一次卡授权
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',
})

// 模拟一次冲正
await client.simulator.issuing.reverse({
  transaction_id: auth.transaction_id,
})

// 模拟一笔充值
const deposit = await client.simulator.deposits.simulate({
  currency: 'SGD',
  amount: 500,
  sender_swift_code: 'WELGBE22',
})