# 直连接口下单并支付
# 请求接口ROOT地址
测试环境 : https://gateway-sandbox.luxpag.com
正式环境 : https://gateway.luxpag.com
# 接口
/trade/pay
# 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 |
out_trade_no | string | yes | 64 | 商户订单号 |
method | string | yes | 32 | 支付方式(CreditCard) |
channel | string | no | 32 | 小渠道选择(目前只有钱包可用,可指定具体钱包) |
order_currency | string | yes | 3 | 币种:巴西(BRL) |
order_amount | decimal | yes | 0.01 ~ 99999999999999.99 | 订单金额 |
subject | string | yes | 128 | 订单标题 |
content | string | no | 255 | 订单内容,Khipu必须按实际填写 |
notify_url | string | yes | 255 | 回调地址,IPN通知地址 |
return_url | string | no | 255 | 页面返回地址,部分渠道只支持https(Peru-Wallet) |
buyer_id | string | yes | 128 | 商户的用户ID |
timeout_express | string | no | 90m | m(分), h(小时), d(日), c(当日UTC) |
cancellation_express | string | no | Luxpag主动cancel时间:m(分), h(小时), d(日),必须是整数,例:90m,必须大于 timeout_express,最大值为3天 | |
token | string | no | 信用卡token(信用卡方式),Wallet Paypal token | |
issuer | string | no | 信用卡组织(信用卡方式) | |
bank | string | no | OpenFinance(通过 API 获取)、Khipu(通过 API 获取)、厄瓜多尔银行转账(bpacifico、internacional、pichincha 之一)需要银行代码或银行 ID | |
customer.name | string | yes | 用户姓名(SPEI少于10个字符会被拒绝),不能带表情字符(emoji),巴西不能有数字 ,(Pago46:非必须) | |
customer.email | string | yes | 用户邮箱(不支持‘+’号)(PIX:非必须) | |
customer.phone | string | yes | 用户电话(Khipu、Pago46、OpenFinance、PIX:非必须) | |
customer.identify.number | string | yes | 用户ID (Khipu、Pago46、CoDi、OXXO、SPEI、OXXOPay、CASH、BNCR(部分渠道):非必须),需要校验ID格式 | |
customer.identify.type | string | yes | 用户ID类型 (Khipu、Pago46、CoDi、OXXO、SPEI、OXXOPay、CASH、BNCR(部分渠道):非必须) | |
address.zip_code | string | no | 邮编:Boleto和Lottery必须 | |
address.state | string | no | 区 | |
address.city | string | no | 城市 | |
address.street_number | string | no | 街道1号码 | |
address.street | string | no | 街道1 | |
address.neighborhood | string | no | 街道2 | |
ip | string | no | 用户IP(信用卡方式必传) | |
language_code | string | no | 语言编码(Cash、BankTransfer:需要调获取银行接口,墨西哥Cash不需要) | |
installments | int | no | 信用卡分期数(默认1期) | |
fingerprint | string | no | 信用卡需要 | |
account_number | string | no | 10~18个数字 | Wallet Todito 卡号必须 测试数据 |
account_verification_code | string | no | 4个数字 | Wallet Todito PIN必须 测试数据 |
region | string | no | 区域编码,当 app 为 Global 时,该字段必须 |
# 请求样例
curl --location --request POST 'https://gateway.luxpag.com/trade/pay' \
--header 'Authorization: Basic Base64(appid:secret_key)' \
--header 'Content-Type: application/json' \
--data-raw '{
"app_id": "app_id",
"content": "content",
"method": "Boleto",
"notify_url": "notify_url",
"order_amount": 10,
"order_currency": "BRL",
"out_trade_no": "{{$randomUUID}}",
"subject": "subject",
"timeout_express": "1h",
"timestamp": "{{datetime}}",
"customer": {
"email": "email"
},
"address": {
"zip_code": "zip_code"
}
}'
# 响应(JSON格式)
参数名 | 类型 | 描述 |
---|---|---|
code | string | 返回码 |
msg | string | 返回消息 |
sub_code | string | 子码 |
sub_msg | string | 子消息 |
out_trade_no | string | 商户订单号 |
trade_no | string | Luxpag创建的订单号 |
trade_status | string | Luxpag创建的订单状态 |
pay_url | string | 下单成功地址;Luxpag 支付成功页面(支付成功后商户可跳转到该页面),可支持的支付渠道:PIX、Boleto、DepositExpress、Lottery、OXXO、SPEI、Wallet-AME、PSE、Efecty;PSE、Efecty |
barcode | string | Boleto条码;仅Boleto |
qr_code | string | PIX二维码;仅PIX |
provider_owner | string | 银行信息; 仅DepositExpress |
provider_owner_document | string | 银行信息; 仅DepositExpress |
provider_agency | string | 银行信息; 仅DepositExpress |
provider_number | string | 银行信息; 仅DepositExpress |
wallet_url | string | 钱包地址; AME:付款二维码地址,PicPay:付款地址,Todito、Paypal:无返回(根据卡号直接付款) |
app_link_url | string | AME手机版钱包地址(APP用) |
bank_code | string | 银行编码;仅Boleto |
bank_name | string | 银行名称;仅SPEI |
reference | string | 支付码;仅SPEI |
clabe | string | CLABE 银行编码;仅SPEI |
beneficiary_name | string | 服务商;仅SPEI |
# 返回样例(成功)
{
"code": "10000",
"msg": "Success",
"out_trade_no": "{out_trade_no}",
"trade_no": "{trade_no}",
"trade_status": "{trade_status}",
"pay_url": "{pay_url}",
"barcode": "{barcode}",
"qr_code": "{qr_code}",
"provider_owner": "{provider_owner}",
"provider_owner_document": "{provider_owner_document}",
"provider_agency": "{provider_agency}",
"provider_number": "{provider_number}",
"wallet_url": "{wallet_url}",
"app_link_url": "{app_link_url}",
"luxpag_url": "{luxpag_url}"
}
# 返回样例(失败)
{
"code": "40002",
"msg": "Business Failed",
"sub_code": "invalid-signature",
"sub_msg": "invalid signature"
}
# 返回状态码
创建订单时返回状态。
# 完成样例
# PIX

# Boleto

# DepositExpress

# OXXO

# Cash

# SPEI

# PSE


# Efecty

