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.
消费限额可以限制持卡人单笔交易的最大金额,以及允许交易的商户类别。这些限制为可选项,可以在创建卡片时设置,也可以之后再更新。
单笔限额
为每笔交易设置最大金额。限额必须大于 0,且不能超过系统规定的最大授权上限。
在创建卡片时设置
在 Create Card 请求中加入 spending_controls:
{
"cardholder_id": "25ea804d-7fd5-43d5-8792-0fc0214cdb2f",
"card_product_id": "467e993f-317a-49fc-9ea0-bf49de7d1f76",
"card_currency": "USD",
"card_limit": 1000,
"spending_controls": [
{
"amount": 500,
"interval": "PER_TRANSACTION"
}
]
}
对已有卡片进行更新
使用 Update Card 接口:
curl -X POST https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/{card_id} \
-H "x-auth-token: YOUR_API_TOKEN" \
-H "x-idempotency-key: $(uuidgen | tr '[:upper:]' '[:lower:]')" \
-H "Content-Type: application/json" \
-d '{
"spending_controls": [
{
"amount": 1001,
"interval": "PER_TRANSACTION"
}
]
}'
响应:
{
"card_id": "f5d1e60a-6852-4fea-bb09-1d5bdab657a0",
"card_order_id": "68363a75-6feb-40e0-aa90-4594dfd021bb",
"card_status": "ACTIVE",
"order_status": "PENDING"
}
修改在 card.update.succeeded webhook 触发后生效。
目前仅支持 PER_TRANSACTION 区间。币种与卡片的 card_currency 一致。创建卡片时若未指定,系统会使用账户级的最大单笔授权限额作为默认值。
MCC 限制
MCC(商户类别代码)限制可以限定卡片能与哪些类型的商户交易。你可以定义白名单或黑名单,但两者不能同时使用。
白名单(allowed_mcc)
只有 MCC 在此名单中的交易会被受理,其他 MCC 一律拒绝。
{
"risk_controls": {
"allowed_mcc": ["5411", "5541", "5812"]
}
}
黑名单(blocked_mcc)
MCC 在此名单中的交易会被拒绝,其他 MCC 会被受理。
{
"risk_controls": {
"blocked_mcc": ["6551", "5533"]
}
}
allowed_mcc 与 blocked_mcc 不能同时设置。两者只能选其一,或都不设置。
设置 MCC 限制
在创建卡片时加入 risk_controls,或使用 Update Card 接口:
curl -X POST https://api-sandbox.uqpaytech.com/api/v1/issuing/cards/{card_id} \
-H "x-auth-token: YOUR_API_TOKEN" \
-H "x-idempotency-key: $(uuidgen | tr '[:upper:]' '[:lower:]')" \
-H "Content-Type: application/json" \
-d '{
"risk_controls": {
"blocked_mcc": ["6551", "5533"]
}
}'
响应:
{
"card_id": "f5d1e60a-6852-4fea-bb09-1d5bdab657a0",
"card_order_id": "9492771e-5247-49fe-9846-55719bd9dabb",
"card_status": "ACTIVE",
"order_status": "PENDING"
}
交易被拒绝示例
当交易因 MCC 限制被拒绝时,授权 webhook 中会出现 transaction_status: DECLINED,并在 description 中说明原因:
{
"version": "V1.6.0",
"event_name": "ISSUING",
"event_type": "issuing.transaction.authorization",
"event_id": "9f0b529f-ad56-42f3-bef7-31393d543f40",
"source_id": "07560ca4-5905-416f-a969-157094667d66",
"data": {
"card_id": "4e8f8c99-47e2-40a2-990d-c6f3e821a510",
"card_number": "40963608****9191",
"transaction_amount": "3",
"transaction_currency": "SGD",
"transaction_status": "DECLINED",
"description": "Forbid MCC from account",
"merchant_data": [
{
"category_code": "5999",
"city": "CITY NAME",
"country": "US",
"name": "ACQUIRER NAME"
}
],
"transaction_type": "AUTHORIZATION"
}
}