# 退款
# 支持退款
支付方式 | 退款类型 | 是否用户信息 |
---|---|---|
PIX | 通过银行转账退款 | 是 |
Boleto | 通过银行转账退款 | 是 |
Lottery | 通过银行转账退款 | 是 |
DepositExpress | 通过银行转账退款 | 是 |
SPEI | 通过银行转账退款(Clabe) | 用户邮箱必须 |
Wallet | 退回原账户 | 用户邮箱必须 |
CreditCard | 退回原账户 | 用户邮箱必须 |
# 请求接口ROOT地址
测试环境 : https://gateway-sandbox.luxpag.com
正式环境 : https://gateway.luxpag.com
# 接口
/trade/refund
# Request Header
参数名 | 必须 | 描述 |
---|---|---|
Content-Type | 推荐 | application/json |
Authorization | yes | Basic Base64(app_id:secret_key) |
# 请求参数(JSON格式)
参数名 | 类型 | 必须 | 最大长度/默认值 | 描述 |
---|---|---|---|---|
app_id | string | yes | 32 | 商户后台创建并获得 |
timestamp | string | yes | 19 | yyyy-MM-dd HH:mm:ss |
trade_no | string | yes | 64 | Luxpag订单号(与商户订单号不能同时为空) |
out_trade_no | string | yes | 64 | 商户订单号(与Luxpag订单号不能同时为空) |
out_request_no | string | no | 16 | 退款请求唯一标识(如部分退款,次参数必传) |
refund_currency | string | yes | 3 | 巴西(BRL) |
refund_amount | decimal | yes | 0.01 ~ 99999999999999.99 | 退款金额 |
refund_reason | string | no | 128 | 退款原因 |
user_info.identify.number | string | yes | 16 | 用户ID |
user_info.identify.type | string | no | 16 | 用户ID类型 |
user_info.name | string | yes | 64 | 用户姓名 |
user_info.email | string | yes | 64 | 用户邮箱 |
user_info.phone | string | no | 64 | 用户联系电话 |
platform_type | string | no | 3 | 参数:API |
bank_info.bank_id | string | no | 64 | 接收退款的用户银行ID |
bank_info.bank_name | string | no | 64 | 接收退款的用户银行 |
bank_info.agency | string | no | 64 | 接收退款的用户银行机构 |
bank_info.type | string | no | 64 | 接收退款的用户银行类型 |
bank_info.number | string | no | 64 | 接收退款的用户银行号码;SPEI Clabe |
# 请求样例
curl --location --request POST 'https://gateway.luxpag.com/trade/refund' \
--header 'Authorization: Basic Base64(appid:secret_key)' \
--header 'Content-Type: application/json' \
--data-raw '{
"app_id": "app_id",
"content": "content",
"trade_no": "trade_no",
"refund_amount": 10,
"refund_currency": "BRL",
"out_trade_no": "{{$randomUUID}}",
"user_info": {
"identify": {
"number": "number",
"type": "type"
},
"name": "name",
"email": "email"
}
}'
# 响应(JSON格式)
参数名 | 类型 | 描述 |
---|---|---|
code | string | 返回码 |
msg | string | 返回消息 |
sub_code | string | 子码 |
sub_msg | string | 子消息 |
out_trade_no | string | 商户订单号 |
trade_no | string | Luxpag创建的订单号 |
refund_currency | string | 实际退款币种 |
refund_amount | decimal | 实际退款金额 |
refund_status | string | 退款状态 |
# 返回样例(成功)
{
"code": "10000",
"msg": "Success",
"out_trade_no": "{out_trade_no}",
"trade_no": "{trade_no}",
"refund_currency": "{refund_currency}",
"refund_amount": "{refund_amount}",
"refund_status": "{refund_status}"
}
# 返回样例(失败)
{
"code": "40002",
"msg": "Business Failed",
"sub_code": "invalid-signature",
"sub_msg": "invalid signature"
}