跳转到主要内容

创建收款

Quick Reference

What为任意支付方式创建收款
Why通过单一端点,在 11 种支付方式、7 个国家和 29 个收单机构之间处理支付
Reading Time10 分钟
Difficulty初级
Prerequisites身份验证 → 环境配置
POST/api/v1/bank/wallet/charge/Bearer Token创建新收款

何时使用此端点

场景创建收款如何帮助您
接受信用卡支付设置 type_charge: "credit_card" 并提供卡片字段,或让 SDK/结账页面处理
提供 PIX 即时支付设置 type_charge: "pix"——响应包含二维码和复制粘贴码
生成 Boleto 银行缴费单设置 type_charge: "boleto"——响应包含条形码和到期日
接受 Apple Pay / Google Pay设置 type_charge: "applepay""googlepay" 并传入令牌数据
设置定期扣款添加 subscription 对象,一次调用同时创建收款和订阅
仅授权流程设置 capture: false,适用于酒店、租车和预授权场景

选择支付方式

选择下方的支付方式。页面将仅显示与该方式相关的字段、代码和响应。


请求参数(所有方式)

以下字段对所有支付方式都是必填的:

字段类型必填说明
wallet_uuidstring (UUID(通用唯一标识符))接收资金的钱包
merchant_idstring商户标识符
payer_namestring付款人全名
payer_emailstring付款人邮箱地址
payer_tax_idstring税务 ID(巴西 CPF、墨西哥 RFC、智利 RUT、阿根廷 CUIT)
payer_cell_phonestring付款人手机号(含国际区号)
installment_valuenumber每期收费金额。对于零小数货币(CLP、COP),使用整数——参见下方货币规则
installment_countinteger分期数(一次性支付使用 1
currencystringISO 4217 货币代码:BRLMXNCLPCOPPENARS
due_datestring到期日,格式为 YYYY-MM-DD
descriptionstring向付款人显示的收款描述
type_chargestring支付方式——参见上方选择器
payer_addressobject账单地址(详见下方)

付款人地址对象

字段类型必填说明
streetstring街道名称
address_numberstring门牌号
complementstring公寓、套房、楼层
neighborhoodstring社区或区域
citystring城市
statestring州/省代码(如 SPCDMX
postal_codestring邮政编码
countrystringISO 3166-1 alpha-2(如 BR)。默认为钱包所在国家

各货币金额规则

货币小数位格式示例后端行为
BRL2150.00"installment_value": 150.00存储为 Numeric(11,2)
MXN22500.00"installment_value": 2500.00存储为 Numeric(11,2)
USD2100.00"installment_value": 100.00存储为 Numeric(11,2)
PEN2350.00"installment_value": 350.00存储为 Numeric(11,2)
ARS285000.00"installment_value": 85000.00存储为 Numeric(11,2)
CLP050000"installment_value": 50000发送至收单方前截断为整数
COP0200000"installment_value": 200000发送至收单方前截断为整数
零小数货币

CLP(智利比索)和COP(哥伦比亚比索)没有小数单位。后端在发送至收单方前将金额转换为整数。发送 CLP 50000.50 将得到 50000。这些货币请始终发送整数。

可选字段(所有方式)

字段类型默认值说明
webhook_urlstring——覆盖此收款的默认 Webhook URL
redirect_urlstring——结账页面或 3DS 验证后的返回 URL
reference_external_idstring——用于对账的内部订单 ID
is_asyncbooleanfalse在支持的情况下进行异步处理
shipping_addressobject——收货地址(与 payer_address 结构相同)

卡片特定字段

字段类型必填说明
card_numberstring仅 H2H卡号 PAN(SDK 和结账页面会自动处理)
card_namestring仅 H2H卡面印刷姓名
card_expiry_monthstring仅 H2H到期月份 MM
card_expiry_yearstring仅 H2H到期年份 YYYY
card_cvvstring仅 H2H卡片验证码
capturebooleantrue(默认)= 自动捕获;false = 仅授权
threeds_authenticationbooleantrue 强制 3DS 验证
device_infoobject3DS3DS 所需的浏览器/设备指纹(详见下方)
antifraud_infoobject用于反欺诈评分的行为数据
subscriptionobject随此收款创建定期订阅
何时需要卡片字段?
  • H2H 集成:您直接发送 card_numbercard_namecard_expiry_monthcard_expiry_yearcard_cvv
  • SDK 集成:SDK 在浏览器中收集卡片数据。您只需发送通用字段。
  • 结账页面:A55 的托管页面收集所有信息。您只需发送通用字段 + redirect_url

设备信息对象(3DS)

在 H2H 流程中当 threeds_authentication: true 时必填:

字段类型说明
ip_addressstring付款人的 IP 地址
user_agentstring浏览器 User-Agent 字符串
device_idstringSDK 生成的设备指纹
session_idstring发卡行的 DDC 会话 ID
http_accept_contentstring浏览器 Accept 头
http_browser_languagestring浏览器语言(如 en-US
http_browser_java_enabledboolean浏览器是否启用 Java
http_browser_javascript_enabledboolean是否启用 JavaScript
http_browser_color_depthstring颜色深度(如 24
http_browser_screen_heightstring屏幕高度(像素)
http_browser_screen_widthstring屏幕宽度(像素)
http_browser_time_differencestringUTC 偏移量(如 -3

反欺诈信息对象

提升欺诈评分和通过率:

字段类型说明
sales_channelstringwebappposmarketplacelinksubscriptionapi
cardholder_logged_inboolean付款人是否已登录
cardholder_since_daysinteger账户创建以来的天数
purchase_historyinteger历史购买总数
days_since_last_purchase_merchantinteger距上次在您处购买的天数

订阅对象

随此收款创建定期订阅:

字段类型必填说明
cyclestringweeklybiweeklymonthlyquarterlysemiannuallyyearly
end_datestring订阅结束日期 YYYY-MM-DD(省略表示无限期)

代码示例

信用卡收款

curl -s -X POST https://core-manager.a55.tech/api/v1/bank/wallet/charge/ \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"payer_name": "张伟",
"payer_email": "zhangwei@example.com",
"payer_tax_id": "123.456.789-09",
"payer_cell_phone": "+5511999999999",
"installment_value": 150.00,
"installment_count": 3,
"currency": "BRL",
"due_date": "2026-12-31",
"description": "订单 #42——3 期分期",
"type_charge": "credit_card",
"card_number": "4024007153763191",
"card_name": "张伟",
"card_expiry_month": "12",
"card_expiry_year": "2030",
"card_cvv": "123",
"capture": true,
"webhook_url": "https://your-app.com/webhooks/a55",
"payer_address": {
"street": "Av. Paulista",
"address_number": "1000",
"complement": "Sala 101",
"neighborhood": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"postal_code": "01310-100",
"country": "BR"
}
}'

响应

收款生命周期

响应字段

字段类型说明
charge_uuidstring收款唯一标识符
statusstringissuedpendingconfirmedpaiderrorcanceledrefunded
local_currencynumber钱包结算币种的金额
currencystringISO 4217 货币代码
usd_currencynumber等值美元金额
eur_currencynumber等值欧元金额
typestring使用的支付方式
datestring收款创建日期
descriptionstring收款描述
due_datestring付款到期日
installment_countinteger分期数
installmentsarray每期分期明细
charge_payment_urlstring结账/SDK 支付 URL(适用时)
url_3dsstring3DS 验证重定向 URL(仅 H2H)
messagearray/nullstatus: "error" 时的错误详情
subscriptionobject订阅详情(当包含 subscription 时)

卡片响应示例

{
"charge_uuid": "51dcca6e-7310-4b73-a94c-90835408f2ff",
"local_currency": 150.00,
"currency": "BRL",
"usd_currency": 26.90,
"eur_currency": 23.58,
"type": "credit_card",
"date": "2026-03-20",
"description": "订单 #42——3 期分期",
"due_date": "2026-12-31",
"status": "confirmed",
"message": null,
"installment_count": 3,
"installments": [
{
"local_currency": 50.00,
"currency": "BRL",
"usd_currency": 8.97,
"eur_currency": 7.86,
"due_date": "2026-12-31",
"status": "confirmed",
"installment_number": 1
},
{
"local_currency": 50.00,
"currency": "BRL",
"usd_currency": 8.97,
"eur_currency": 7.86,
"due_date": "2027-01-31",
"status": "confirmed",
"installment_number": 2
},
{
"local_currency": 50.00,
"currency": "BRL",
"usd_currency": 8.97,
"eur_currency": 7.86,
"due_date": "2027-02-28",
"status": "confirmed",
"installment_number": 3
}
]
}

错误响应

{
"charge_uuid": "51dcca6e-7310-4b73-a94c-90835408f2ff",
"status": "error",
"message": [
{
"code": "error_threeds_authentication",
"source": "authentication",
"description": "Issuing bank declined the authentication"
}
]
}

错误代码

代码含义处理方式
INVALID_TYPE_CHARGE不支持的 type_charge检查上方选择器中的允许值
errors.wallet.not_found钱包 UUID 不存在验证 wallet_uuid
errors.unexpected内部服务器错误使用指数退避重试;若持续出现请联系支持
error_threeds_authentication3DS 验证失败要求付款人重试或使用其他卡片
务必使用 Webhook

切勿仅依赖同步响应来判断最终支付状态。收款可能会异步经过多个状态。设置 webhook_url 并将 Webhook 视为真实数据来源。