settings 更新卡片消费规则,写法与渠道 10010105 相同。允许自定义的维度整体替换;卡组预设锁定的维度忽略请求值,保留当前值;limits 传空数组,或 transaction 不带 maxMinor,会清除限额或单笔上限;singleUse 不能修改。| 错误码 | 触发条件 |
|---|---|
VALIDATION.INVALID_PARAMETER | 卡片不属于渠道 10010108,或消费规则不受支持、结构无效(如 limits 多于 1 条、transaction.minMinor 大于 0)。 |
RESOURCE.NOT_FOUND | 卡片不存在或不属于当前工作区。 |
CARD.LINKED_RESOURCE_UNAVAILABLE | 关联的服务商资源不可用。 |
REQUEST.CONFLICT | 同一幂等请求仍在处理中、幂等键已用于不同请求,或已超过 24 小时结果重放期;可通过 X-Operation-Id 查询处理状态。 |
{
"cardInfoBizId": "VC_ABCDEF1234567890",
"settings": {
"limits": [
{
"period": "DAILY",
"amountMinor": 50000
}
],
"transaction": {
"minMinor": 0,
"maxMinor": 100000
},
"merchantRule": {
"mode": "ALLOW",
"merchantIds": [
"string"
]
},
"countryRule": {
"mode": "ALLOW",
"countries": [
"string"
]
}
}
}curl --location '/card-products/10010108/cards/spending-controls/update' \
--header 'X-API-VERSION: 2' \
--header 'X-Api-Key: {{api_key}}' \
--header 'X-Timestamp;' \
--header 'X-Nonce;' \
--header 'X-Signature;' \
--header 'X-Signature-Algorithm: RSA-SHA256' \
--header 'X-Signature-Version: 2' \
--header 'X-Idempotency-Key;' \
--header 'Content-Type: application/json' \
--data '{
"cardInfoBizId": "VC_ABCDEF1234567890",
"settings": {
"limits": [
{
"period": "DAILY",
"amountMinor": 50000
}
],
"transaction": {
"minMinor": 0,
"maxMinor": 100000
},
"merchantRule": {
"mode": "ALLOW",
"merchantIds": [
"string"
]
},
"countryRule": {
"mode": "ALLOW",
"countries": [
"string"
]
}
}
}'{
"version": "string",
"timestamp": 0,
"success": true,
"code": "string",
"message": "string",
"data": {
"bizId": "VC_ABCDEF1234567890",
"userCardProductGroupBizId": "UCPG_ABCDEF1234567890",
"groupCode": "UCPG00000123",
"platformCardProductBizId": "PLCP_ABCDEF1234567890",
"platformProductName": "Travel Card",
"cardWalletBizId": "UCPGW_ABCDEF1234567890",
"cardDisplayName": "Operations Card",
"platformCardDisplayName": "Operations Card",
"cardNetwork": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"cardRegion": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"binCode": "54502000",
"cardType": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"cardFundingModel": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"currency": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active",
"scale": 2,
"isFiat": true,
"isStablecoin": false
},
"maskedPan": "**** 4242",
"last4": "4242",
"status": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"providerOperationStatus": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"infoSyncStatus": {
"code": "ACTIVE",
"value": 35010102,
"label": "Active"
},
"providerType": 10010105,
"spentAmount": 0,
"limitAmount": 0,
"availableAmount": 0,
"createdAt": 1713628800000,
"updatedAt": 1713629600000
}
}