UA_GLO商户对接文档 - 巴西(1.02)
接入流程
- 获取商户ID(mch_id)、密钥、API域名(HOST)
- 提供贵司下单IP,以开通IP白名单,并提供订单回调地址
- 依照此文档进行api接口对接
API说明
- 接口采用
HTTP
请求的形式
- 签名采用MD5杂凑运算
- 所有的金额单位为「分」
- 请求成功时,返回参数中的status固定为
0
且msg为OK
,其他情况请参考请求错误状态列表
签名步骤
- 将所有非空值(
null
)请求参数按照名称字符ASCII升序排列,轉換為{key}={value}
字串並以&
拼接,最後将密钥作为最后一个参数,参数名为key
- 若参数值的数据类型为
dict
,则按照其中参数名称字符ASCII升序排列(不需排除null
),再转为JSON字串作为value
示例:
{
"p1": {
"c": 3,
"a": 1,
"b": null
}
}
字符串
p1={"a":1,"b":null,"c":3}
- 将待签名字符串进行MD5杂凑运算并转为大写,得到签名
{
"mch_id": 1,
"mch_withdraw_no": "1234567890",
"amount": 56500,
"withdraw_type": "bankcard",
"withdraw_name": "Ida Bagus Sudjana",
"withdraw_account": "168168168168168168",
"withdraw_bank_code": "BMRI",
"user_id": "1002026573",
"timestamp": 1650276377
}
amount=56500&mch_id=1&mch_withdraw_no=1234567890×tamp=1650276377&user_id=1002026573&withdraw_account=168168168168168168&withdraw_bank_code=BMRI&withdraw_name=Ida Bagus Sudjana&withdraw_type=bankcard&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
D5C222E7BB941A0D13FCB236D53F159B
代付下单接口
注意
调用代付下单接口时,只有接口明确返回了不成功的状态码才表示下单失败。
其它比如请求超时,服务器错误等非约定场景均不能表示下单失败。
重新下单前请务必通过查询接口判断订单状态。
API请求方式
HTTP
POST
- Header
{"Content-Type": "application/json"}
- body为JSON字符串
- 注意参数的类型,区分
integer
和string
接口地址:
http://<HOST>/api/withdraw/
PIX提現请求参数(非必填参数值可不传)
名称 |
含义 |
类型 |
是否必填 |
备注 |
mch_id |
商户ID |
integer |
YES |
|
mch_withdraw_no |
商户订单号 |
string |
YES |
不可重复 |
amount |
订单金额 |
integer |
YES |
单位为分 |
withdraw_type |
提现类型 |
string |
YES |
固定值pix |
withdraw_name |
提现人姓名 |
string |
YES |
提现人姓名 |
withdraw_account |
提现帐号 |
string |
YES |
提现PIX键,依PIX键类型不同,分别有各自格式,参考PIX键类型列表 |
pix_withdraw_ext |
PIX提现扩展参数 |
dict |
YES |
参考PIX提现扩展参数 |
user_id |
用户ID |
string |
YES |
|
device_type |
设备类型 |
string |
YES |
|
device_ip |
设备IP |
string |
YES |
|
device_id |
设备ID |
string |
YES |
|
timestamp |
下单时间戳 |
integer |
YES |
下单时生成 |
sign |
签名 |
string |
YES |
字符串大写,参考签名步骤 |
PIX提现扩展参数
名称 |
含义 |
类型 |
是否必填 |
备注 |
pix_key_type |
PIX键类型 |
string |
YES |
参考PIX键类型列表 |
identity |
身份验证 |
string |
YES |
提现人CPF,格式:xxx.xxx.xxx-xx |
{
"mch_id": 1,
"mch_withdraw_no": "1234567890",
"amount": 41700,
"withdraw_type": "pix",
"withdraw_name": "João Luiz Ferreira Silva",
"withdraw_account": "123.456.789-01",
"pix_withdraw_ext": {
"pix_key_type": "CPF",
"identity": "123.456.789-01"
},
"user_id": "1002026573",
"device_type": "ios",
"device_ip": "127.0.0.1",
"device_id": "EC:51:BC:97:FF:19",
"timestamp": 1657189611,
"sign": "892CDBD230792ACEE232B590488A8415"
}
amount=41700&device_id=EC:51:BC:97:FF:19&device_ip=127.0.0.1&device_type=ios&mch_id=1&mch_withdraw_no=1234567890&pix_withdraw_ext={"identity":"123.456.789-01","pix_key_type":"CPF"}×tamp=1657189611&user_id=1002026573&withdraw_account=123.456.789-01&withdraw_name=João Luiz Ferreira Silva&withdraw_type=pix&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
892CDBD230792ACEE232B590488A8415
下单返回参数
名称 |
含义 |
类型 |
备注 |
status |
接口状态 |
integer |
0 为成功,其它为失败 |
msg |
接口消息 |
string |
接口状态非0 时为错误原因 |
timestamp |
时间戳 |
string |
返回时生成 |
data |
订单数据 |
dict |
|
data.order_id |
平台订单号 |
string |
|
data.mch_withdraw_no |
商户订单号 |
string |
|
data.status |
订单状态 |
string |
下单成功后固定为new |
data.remark |
订单备注 |
string |
預設值null |
{
"status": 0,
"msg": "OK",
"timestamp": "2022-04-19 10:39:38",
"data": {
"order_id": "2204191039380826",
"mch_withdraw_no": "1234567890",
"status": "new",
"remark": null
}
}
{
"status": 5001,
"msg": "暂无可用提现资源",
"timestamp": "2022-04-19 10:46:09"
}
代付回调
{
"status": 0,
"msg": "处理成功"
}
- 我司在没有收到贵司成功响应前,会通过一定的策略定期重新发起通知
注意
- 請同时校验商户订单号及订单金额是否正确。
- 建议商户添加回调IP白名单。
- 一个订单可能会多次发送给接入方系统,接入方系统必须能够正确处理重复的通知。
- 已回调成功的订单也有可能会再转为失败,我方会将款项退回给商户,并发起status为
callback
的回调(沖正)给商户,商户收到此回调也应将款项退回给用户。
回调参数
名称 |
含义 |
类型 |
备注 |
order_id |
平台订单号 |
string |
|
mch_withdraw_no |
商户订单号 |
string |
|
status |
订单状态 |
string |
success /fail /callback |
merchant_code |
商户代码 |
string |
保留字段 |
remark |
订单说明 |
string |
|
timestamp |
时间戳 |
integer |
请求时生成 |
sign |
签名 |
string |
字符串大写,参考签名步骤 |
{
"order_id": "2204191039380826",
"mch_withdraw_no": "1234567890",
"status": "success",
"remark": null,
"merchant_code": "test",
"timestamp": 1650343502,
"sign": "9CD29D2F819C747268B6500BAB5358AF"
}
mch_withdraw_no=1234567890&merchant_code=test&order_id=2204191039380826&status=success×tamp=1650343502&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
9CD29D2F819C747268B6500BAB5358AF
获取当前提现区间
API请求方式
HTTP
GET
- Header
{"Content-Type": "application/json"}
- 注意参数的类型,区分
integer
和string
接口地址
http://<HOST>/api/withdraw/withdraw_type/
注意
请求参数(非必填参数值可不传)
名称 |
含义 |
类型 |
是否必填 |
备注 |
mch_id |
商户ID |
integer |
YES |
|
timestamp |
时间戳 |
integer |
YES |
请求时生成 |
sign |
签名 |
string |
YES |
字符串大写,参考签名步骤 |
{
"mch_id": 1,
"timestamp": 1650343839,
"sign": "E351CA51F588B3D8C0676A5B6B06F394"
}
mch_id=1×tamp=1650343839&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
E351CA51F588B3D8C0676A5B6B06F394
返回参数
名称 |
含义 |
类型 |
备注 |
status |
接口状态 |
integer |
0 为成功,其它为失败 |
msg |
接口消息 |
string |
接口状态非0 时为错误原因 |
timestamp |
时间戳 |
string |
返回时生成 |
data |
可用提现类型数据列表 |
list(dict) |
请求成功时返回 |
data[i] |
可用提现类型数据 |
dict |
|
data[i].withdraw_type |
提现类型 |
string |
参考提现类型列表 |
data[i].min_amount |
单笔下单金额下限 |
integer |
|
data[i].max_amount |
单笔下单金额上限 |
integer |
|
{
"status": 0,
"msg": "OK",
"timestamp": "2022-04-19 13:23:28",
"data": [
{
"withdraw_type": "pix",
"min_amount": 30000000,
"max_amount": 500000000
}
]
}
获取当前精准提现区间
API请求方式
HTTP
GET
- Header
{"Content-Type": "application/json"}
- 注意参数的类型,区分
integer
和string
接口地址:
http://<HOST>/api/withdraw/withdraw_type/detail/
注意
- 本接口提供商户精准的提现区间
- 商户应根据此接口返回参数展示可用提现区间给用户
- 根据用户可提供的个人信息,展示给用户的区间也会不同
- 以下图为例,假设用户名及身分证明在下单时皆为选填,若用户不能提供用户名及身分证明,实际可用的提现区间则为default, unidentified, anonymous三者交集

- 接口返回参数说明中若无default之外的金额区间,直接使用default即可
请求参数(非必填参数值可不传)
名称 |
含义 |
类型 |
是否必填 |
备注 |
mch_id |
商户ID |
integer |
YES |
|
timestamp |
时间戳 |
integer |
YES |
请求时生成 |
sign |
签名 |
string |
YES |
字符串大写,参考签名步骤 |
{
"mch_id": 1,
"timestamp": 1650343839,
"sign": "E351CA51F588B3D8C0676A5B6B06F394"
}
mch_id=1×tamp=1650343839&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
E351CA51F588B3D8C0676A5B6B06F394
返回参数
名称 |
含义 |
类型 |
备注 |
status |
接口状态 |
integer |
0 为成功,其它为失败 |
msg |
接口消息 |
string |
接口状态非0 时为错误原因 |
timestamp |
时间戳 |
string |
返回时生成 |
data |
可用提现类型数据列表 |
list(dict) |
请求成功时返回 |
data[i] |
可用提现类型数据 |
dict |
根据提现类型是否有子类,分为两种结构;无子类结构,含子类结构 |
无子类结构
名称 |
含义 |
类型 |
备注 |
withdraw_type |
提现类型代码 |
string |
参考提现类型列表 |
default |
满足所有条件时的金额区间 |
dict |
结构參考金额区间 |
unidentified |
不提供身分证明时的金额区间 |
dict |
结构參考金额区间 |
含子类结构
名称 |
含义 |
类型 |
备注 |
withdraw_type |
提现类型代码 |
string |
参考提现类型列表 |
sub_withdraw_types |
可用子类列表 |
list(dict) |
|
sub_withdraw_types[j].sub_withdraw_type |
子类代码 |
string |
|
sub_withdraw_types[j].default |
满足所有条件时的金额区间 |
dict |
结构參考金额区间 |
sub_withdraw_types[j].unidentified |
不提供身分证明时的金额区间 |
dict |
结构參考金额区间 |
金额区间
名称 |
含义 |
类型 |
备注 |
quota |
定额额度 |
list(integer) |
|
min_amount |
单笔下单金额下限 |
integer |
|
max_amount |
单笔下单金额上限 |
integer |
|
{
"status": 0,
"msg": "OK",
"timestamp": "2022-04-19 13:23:28",
"data": [
{
"withdraw_type": "pix",
"sub_withdraw_types": [
{
"sub_withdraw_type": "CPF",
"default": {
"quota": [],
"min_amount": 30000000,
"max_amount": 500000000
},
"unidentified": {
"quota": [],
"min_amount": 30000000,
"max_amount": 400000000
}
},
{
"sub_withdraw_type": "EMAIL",
"default": {
"quota": [],
"min_amount": 30000000,
"max_amount": 500000000
},
"unidentified": {
"quota": [],
"min_amount": 30000000,
"max_amount": 400000000
}
},
{
"sub_withdraw_type": "PHONE",
"default": {
"quota": [],
"min_amount": 30000000,
"max_amount": 500000000
},
"unidentified": {
"quota": [],
"min_amount": 30000000,
"max_amount": 400000000
}
}
]
}
]
}
订单查询
API请求方式
HTTP
GET
- Header
{"Content-Type": "application/json"}
- 注意参数的类型,区分
integer
和string
接口地址:
http://<HOST>/api/withdraw/query/<str:mch_withdraw_no>/
请求参数(非必填参数值可不传)
名称 |
含义 |
类型 |
是否必填 |
备注 |
mch_id |
商户ID |
integer |
YES |
|
timestamp |
时间戳 |
integer |
YES |
请求时生成 |
sign |
签名 |
string |
YES |
字符串大写,参考签名步骤 |
http://<HOST>/api/order/query/2204191039380826/
{
"mch_id": 1,
"timestamp": 1650343839,
"sign": "E351CA51F588B3D8C0676A5B6B06F394"
}
mch_id=1×tamp=1650343839&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
E351CA51F588B3D8C0676A5B6B06F394
返回参数
名称 |
含义 |
类型 |
备注 |
status |
接口状态 |
integer |
0 为成功,其它为失败 |
msg |
接口消息 |
string |
接口状态非0 时为错误原因 |
timestamp |
时间戳 |
integer |
返回时生成 |
data |
订单数据 |
dict |
请求成功时返回 |
data.order_id |
平台订单号 |
string |
|
data.mch_withdraw_no |
商户订单号 |
string |
|
data.status |
订单状态 |
string |
new /success /fail /callback |
data.remark |
订单说明 |
string |
|
{
"status": 0,
"msg": "OK",
"timestamp": "2022-04-19 13:31:27",
"data": {
"order_id": "2204191039380826",
"mch_withdraw_no": "1234567890",
"status": "fail",
"remark": null
}
}
{
"status": 5002,
"msg": "提现订单不存在",
"timestamp": "2022-04-19 13:38:18"
}
提现类型列表
PIX键类型列表
PIX键类型 |
withdraw_account格式 |
CPF |
xxx.xxx.xxx-xx |
CNPJ |
xx.xxx.xxx/xxxx-xx |
PHONE |
+55xxxxxxxxxxx |
EMAIL |
只检查是否包含@ |
EVP |
32位英数 |
请求错误状态列表
status |
描述 |
-1 |
内部错误,请联系管理员 |
1 |
参数错误 |
2001 |
商户不存在 |
2004 |
该提现帐号已在黑名单内 |
2012 |
商户订单ip不在白名单中 |
2101 |
商户不支持该提现支付方式 |
2102 |
商户余额不足 |
2105 |
商户提现金额不在允许范围 |
5001 |
暂无可用提现资源 |
5002 |
提现订单不存在 |
5003 |
订单状态冲突 |
5016 |
PIX键格式不正确 |
5017 |
CPF格式不正确 |
tags:
GLO
UA
BR
UA_GLO商户对接文档 - 巴西(1.02)
change log
接入流程
API说明
HTTP
请求的形式0
且msg为OK
,其他情况请参考请求错误状态列表签名步骤
null
)请求参数按照名称字符ASCII升序排列,轉換為{key}={value}
字串並以&
拼接,最後将密钥作为最后一个参数,参数名为key
dict
,则按照其中参数名称字符ASCII升序排列(不需排除null
),再转为JSON字串作为value示例:
字符串
本文档所有示例皆使用以下配置:
商戶ID:
1
密钥:
9ce23be4-a31b-498f-b951-ad7e771c3d73
示例,待签名数据:
代付下单接口
注意
调用代付下单接口时,只有接口明确返回了不成功的状态码才表示下单失败。
其它比如请求超时,服务器错误等非约定场景均不能表示下单失败。
重新下单前请务必通过查询接口判断订单状态。
API请求方式
HTTP
POST
{"Content-Type": "application/json"}
integer
和string
接口地址:
PIX提現请求参数(非必填参数值可不传)
integer
string
integer
string
pix
string
string
dict
string
string
string
string
integer
string
PIX提现扩展参数
string
string
xxx.xxx.xxx-xx
下单返回参数
integer
0
为成功,其它为失败string
0
时为错误原因string
dict
string
string
string
new
string
null
代付回调
支付结果会以
HTTP
POST
JSON
形式从平台服务器发往贵司提供的回调地址贵司收到通知处理成功后回复
{"status": 0}
回复内容可加上msg以具体描述处理情形(非必填)
示例
注意
callback
的回调(沖正)给商户,商户收到此回调也应将款项退回给用户。回调参数
string
string
string
success
/fail
/callback
string
string
integer
string
获取当前提现区间
API请求方式
HTTP
GET
{"Content-Type": "application/json"}
integer
和string
接口地址
注意
请求参数(非必填参数值可不传)
integer
integer
string
返回参数
integer
0
为成功,其它为失败string
0
时为错误原因string
list(dict)
dict
string
integer
integer
获取当前精准提现区间
API请求方式
HTTP
GET
{"Content-Type": "application/json"}
integer
和string
接口地址:
注意
请求参数(非必填参数值可不传)
integer
integer
string
返回参数
integer
0
为成功,其它为失败string
0
时为错误原因string
list(dict)
dict
无子类结构
string
dict
dict
含子类结构
string
list(dict)
string
dict
dict
金额区间
list(integer)
integer
integer
订单查询
API请求方式
HTTP
GET
{"Content-Type": "application/json"}
integer
和string
接口地址:
mch_withdraw_no
为商户订单号请求参数(非必填参数值可不传)
integer
integer
string
返回参数
integer
0
为成功,其它为失败string
0
时为错误原因integer
dict
string
string
string
new
/success
/fail
/callback
string
提现类型列表
PIX键类型列表
xxx.xxx.xxx-xx
xx.xxx.xxx/xxxx-xx
+55xxxxxxxxxxx
@
请求错误状态列表