tags: GLO UA ID

UA_GLO商户对接文档 - 印尼(1.02)

change log

接入流程

API说明

签名步骤

  1. 将所有非空值(null)请求参数按照名称字符ASCII升序排列,轉換為{key}={value}字串並以&拼接,最後将密钥作为最后一个参数,参数名为key
  2. 若参数值的数据类型为dict,则按照其中参数名称字符ASCII升序排列(不需排除null),再转为JSON字串作为value

示例:

{
    "p1": {
        "c": 3,
        "a": 1,
        "b": null
    }
}

字符串

p1={"a":1,"b":null,"c":3}
  1. 将待签名字符串进行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&timestamp=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://<HOST>/api/withdraw/

电子钱包提現请求参数(非必填参数值可不传)

名称 含义 类型 是否必填 备注
mch_id 商户ID integer YES
mch_withdraw_no 商户订单号 string YES 不可重复
amount 订单金额 integer YES 单位为分
withdraw_type 提现类型 string YES dana/ovo/gopay
withdraw_account 提现帐号 string YES 手机号码,验证开头国码+62
user_id 用户ID string YES
device_type 设备类型 string YES 例如:ios
device_ip 设备IP string YES
device_id 设备ID string YES
withdraw_name 提现人姓名 string NO 提现人姓名
timestamp 下单时间戳 integer YES 下单时生成
sign 签名 string YES 字符串大写,参考签名步骤

银行卡提現请求参数(非必填参数值可不传)

名称 含义 类型 是否必填 备注
mch_id 商户ID integer YES
mch_withdraw_no 商户订单号 string YES 不可重复
amount 订单金额 integer YES 单位为分
withdraw_type 提现类型 string YES 固定值bankcard
withdraw_account 提现帐号 string YES 银行卡号
withdraw_bank_code 银行编码 string YES 参考银行编码列表
user_id 用户ID string YES
device_type 设备类型 string YES 例如:ios
device_ip 设备IP string YES
device_id 设备ID string YES
withdraw_name 提现人姓名 string NO 提现人姓名
timestamp 下单时间戳 integer YES 下单时生成
sign 签名 string YES 字符串大写,参考签名步骤
{
    "mch_id": 1,
    "mch_withdraw_no": "1234567890",
    "amount": 41700,
    "withdraw_type": "bankcard",
    "withdraw_account": "168168168168168168",
    "withdraw_bank_code": "CENA",
    "user_id": "1002026573",
    "device_type": "ios",
    "device_ip": "127.0.0.1",
    "device_id": "EC:51:BC:97:FF:19",
    "timestamp": 1659415725,
    "sign": "A21865AF49851812CC29D592F39F4B59"
}
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&timestamp=1659415725&user_id=1002026573&withdraw_account=168168168168168168&withdraw_bank_code=CENA&withdraw_type=bankcard&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
A21865AF49851812CC29D592F39F4B59

下单返回参数

名称 含义 类型 备注
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": "处理成功"
}

注意

回调参数

名称 含义 类型 备注
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&timestamp=1650343502&key=9ce23be4-a31b-498f-b951-ad7e771c3d73
9CD29D2F819C747268B6500BAB5358AF

获取当前提现区间

API请求方式

接口地址

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&timestamp=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": "ovo",
            "min_amount": 30000000,
            "max_amount": 500000000
        },
        {
            "withdraw_type": "bankcard",
            "min_amount": 30000000,
            "max_amount": 500000000
        }
    ] 
}

获取当前精准提现区间

API请求方式

接口地址

http://<HOST>/api/withdraw/withdraw_type/detail/

注意

请求参数(非必填参数值可不传)

名称 含义 类型 是否必填 备注
mch_id 商户ID integer YES
timestamp 时间戳 integer YES 请求时生成
sign 签名 string YES 字符串大写,参考签名步骤
{
    "mch_id": 1,
    "timestamp": 1650343839,
    "sign": "E351CA51F588B3D8C0676A5B6B06F394"
}
mch_id=1&timestamp=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 结构參考金额区间

含子类结构

名称 含义 类型 备注
withdraw_type 提现类型代码 string 参考提现类型列表
sub_withdraw_types 可用子类列表 list(dict)
sub_withdraw_types[j].sub_withdraw_type 子类代码 string
sub_withdraw_types[j].default 满足所有条件时的金额区间 dict 结构參考金额区间

金额区间

名称 含义 类型 备注
quota 定额额度 list(integer)
min_amount 单笔下单金额下限 integer
max_amount 单笔下单金额上限 integer
{
    "status": 0,
    "msg": "OK",
    "timestamp": "2022-04-19 13:23:28",
    "data": [
        {
            "withdraw_type": "ovo",
            "default": {
                "quota": [],
                "min_amount": 30000000,
                "max_amount": 500000000
            }
        },
        {
            "withdraw_type": "bankcard",
            "sub_withdraw_types": [
                {
                    "sub_withdraw_type": "CENA",
                    "default": {
                        "quota": [],
                        "min_amount": 30000000,
                        "max_amount": 500000000
                    }
                },
                {
                    "sub_withdraw_type": "BRIN",
                    "default": {
                        "quota": [],
                        "min_amount": 30000000,
                        "max_amount": 500000000
                    }
                },
                {
                    "sub_withdraw_type": "BMRI",
                    "default": {
                        "quota": [],
                        "min_amount": 30000000,
                        "max_amount": 500000000
                    }
                }
            ]
        }
    ] 
}

订单查询

API请求方式

接口地址

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&timestamp=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"
}

提现类型列表

名称 代码 存在子类型
银行卡 bankcard YES,参考银行编码列表
DANA钱包 dana NO
GOPAY钱包 gopay NO
OVO钱包 ovo NO

银行编码列表

银行名称 代码
Bank Central Asia CENA
Bank Rakyat Indonesia BRIN
Bank Mandiri BMRI
Bank Negara Indonesia BNIN
CIMB Niaga BNIA
Maybank IBBK
Permata Bank BBBA
Panin Bank PINB
Bank Danamon Indonesia BDIN
Bank BTN BTAN
BANK UOB INDONESIA BBIJ
BANK OCBC NISP NISP
CITIBANK CITI
BANK ARTHA GRAHA ARTG
BANK DBS INDONESIA DBSB
BANK CAPITAL INDONESIA BCIA
ANZ PANIN BANK ANZB
BANK BJB PDJB
BPD DKI JAKARTA BDKI
BPD JAWA TENGAH PDJG
BANK JATIM PDJT
BPD ACEH PDAC
BPD SUMATERA BARAT/BANK NAGARI PDSB
BPD LAMPUNG PDLP
BPD KALIMANTAN BARAT PDKB
BPD KALIMANTAN TIMUR PDKT
BPD SULAWESI UTARA PDWU
BANK NUSANTARA PARAHYANGAN NUPA
BANK MUAMALAT INDONESIA MUAB
BANK SINARMAS SBJK
BANK GANESHA GNES
Bank BTPN TAPE
BANK MEGA MEGA
BANK BUKOPIN BBUK
BANK SYARIAH INDONESIA BSMD
BANK HANA HNBN
BANK NATIONAL NOBU NOBU
BANK SAHABAT SAMPOERNA BDIP
BANK KESEJAHTERAAN EKONOMI BKEX
BANK ARTOS INDONESIA BAIX
BANK MAYORA MAYO
BANK COMMONWEALTH BICN

请求错误状态列表

status 描述
-1 内部错误,请联系管理员
1 参数错误
2001 商户不存在
2004 该提现帐号已在黑名单内
2012 商户订单ip不在白名单中
2101 商户不支持该提现支付方式
2102 商户余额不足
2105 商户提现金额不在允许范围
5001 暂无可用提现资源
5002 提现订单不存在
5003 订单状态冲突
5005 银行卡提现缺少withdraw_bank_code字段
5012 银行编码错误
5014 手机国码错误