0.介绍

0.1.编写目的



1. 本文档的编写目的是为合作商户开发人员提供开发所需接口说明

2. 本文档可供开发人员、测试人员参考。

0.2.调用说明



1. 各国网关对照:

国家 country 网关 币种 说明
印度 IN https://coffeepay.top INR 详见 1.印度;不传 country 时以商户开户国家为准
马来西亚 MY https://coffeepay.top MYR 详见 2.马来西亚
印尼 ID https://cfpay88.com IDR 详见 3.印尼;金额须为整数

2. 传输方式 采用 HTTPS 传输

3. 字符编码 统一采用 application/json UTF-8 字符编码

4. 响应状态码 code=200 代表请求成功,并不表示订单状态

5. 金额单位为当地货币,限额见 0.4 与各国章节

6. 请按国家进入对应章节对接完整代收/代付接口:1.印度 / 2.马来西亚 / 3.印尼


0.3.签名说明



待签名数据按照以下方式进行签名:

1. 将参数 key 值按照 ASCII 升序排序

2. 将参数值按照 key=value&key=value... 的形式拼接成字符串 stringA
   ⚠️ 重要:值为 null、空字符串或纯空白字符串的字段不参与签名拼接;sign 字段本身也不参与签名

3. 在 stringA 末尾追加平台密钥,格式为:stringA&key=密钥

4. 对拼接后的完整字符串做 MD5 加密,结果取小写即为 sign 值


关于 deeplink 与 mode 字段的签名说明:

deeplink 和 mode 均为可选字段。不传或值为空时不参与签名计算;若传入非空值(如 deeplink=true、mode=fz),则该字段需参与签名计算。


签名示例(代收下单,country=IN):

假设请求参数如下(deeplink、mode 未传,不参与签名):

merchantId1001
merchantOrderIdORDER2026030900001
amount100
countryIN
nameRahul
mobile9876543210
emailtest@example.com
notifyUrlhttps://your.domain/notify
deeplink(未传 — 不参与签名)
mode(未传 — 不参与签名)

第一步,将有值的参数按参数名 ASCII 升序排列并拼接:
amount=100&country=IN&email=test@example.com&merchantId=1001&merchantOrderId=ORDER2026030900001&mobile=9876543210&name=Rahul&notifyUrl=https://your.domain/notify
第二步,末尾追加密钥(将 YOUR_SECRET 替换为平台分配的密钥):
amount=100&country=IN&email=test@example.com&merchantId=1001&merchantOrderId=ORDER2026030900001&mobile=9876543210&name=Rahul&notifyUrl=https://your.domain/notify&key=YOUR_SECRET
第三步,对上述字符串做 MD5 并取小写,结果即为 sign 值。


各语言签名代码示例:

<?php
function generateSign(array $params, string $secret): string {
    // 过滤掉值为 null、空字符串以及 sign 字段本身
    $filtered = array_filter($params, function($v, $k) {
        return $k !== 'sign' && $v !== null && trim((string)$v) !== '';
    }, ARRAY_FILTER_USE_BOTH);

    // 按参数名 ASCII 升序排序
    ksort($filtered);

    // 拼接 key=value&key=value...
    $parts = [];
    foreach ($filtered as $k => $v) {
        $parts[] = "$k=$v";
    }

    // 末尾追加密钥
    $parts[] = "key=$secret";
    $stringToSign = implode('&', $parts);

    return md5($stringToSign);  // MD5 默认返回小写
}

// 示例调用
$params = [
    'merchantId'      => 1001,
    'merchantOrderId' => 'ORDER2026030900001',
    'amount'          => '100',
    'country'         => 'IN',
    'name'            => 'Rahul',
    'mobile'          => '9876543210',
    'email'           => 'test@example.com',
    'notifyUrl'       => 'https://your.domain/notify',
    // deeplink 和 mode 未传(不参与签名);若传入如 'deeplink' => true 则会参与签名
];
$secret = 'YOUR_SECRET';
$params['sign'] = generateSign($params, $secret);

0.4.金额与国家概览



各国订单金额范围:

国家 country 币种 金额范围 备注
印度ININR 代收 100~100000
代付 100~50000
金额为字符串
马来西亚MYMYR 代收 10~50000
代付 5~50000
金额为字符串
印尼IDIDR 代收/代付 10000~50000000 必须为整数,无小数

0.5.代收余额查询(各国通用)



1. URL:各国网关 + /api/payin/balance(POST,application/json)

2. 请求体:merchantId(必填)、sign(必填)

3. 成功时 data 为代收可用余额(number)

{
  "merchantId": 1001,
  "sign": "your_generated_sign_here"
}
{
  "code": 200,
  "data": 10000.00,
  "msg": "Success"
}
4. 代付余额请使用各国章节中的 /api/payout/balance

1.印度(IN)

1.1.概述



1. 网关:https://coffeepay.top

2. 国家代码:country=IN(不传时以商户开户国家为准)

3. 币种:INR

4. 金额范围:代收 100 ~ 100000;代付 100 ~ 50000

5. 接口路径前缀:/api(与各国相同)

6. 代付 ifsc 填写标准 IFSC(无独立银行编码表);type=0 银行卡,type=1 UPI

7. 代收余额:见 0.5

1.2.代收说明



1. 代收下单接口:POST /api/payin/submit

2. 可选 deeplink、mode(由平台分配的通道模式编码)控制 UPI 拉起方式;非空时参与签名

3. 印度特有:UTR 查单/补单、UPI 归属查询(如下)

1.2.1.代收下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

用户姓名(建议填写;可不传)

false

-

mobile

string

用户电话(建议填写;可不传)

false

-

email

string

邮箱(建议填写;可不传)

false

-

sign

string

请求签名

true

-

deeplink

boolean

是否返回 UPI deeplink(仅印度,见下文说明)
⚠️ 不传或值为空时不参与签名计算;若传入非空值(如 true)则参与签名。

false

-

mode

string

UPI通道模式 由平台分配的通道模式编码(仅印度,见下文说明)
⚠️ 不传或值为空时不参与签名计算;若传入非空值(如 fz、ptm)则参与签名。

false

-

callbackUrl

string

支付完成后同步跳转地址。不传则默认跳转 https://www.google.com

false

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "IN202603060001",
  "amount": "100",
  "country": "IN",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Rahul",
  "mobile": "9876543210",
  "email": "test@example.com",
  "deeplink": true,
  "callbackUrl": "https://merchant.example.com/payin/return",
  "sign": "your_generated_sign_here"
}

说明:deeplink/mode 为印度可选字段;不传或为空时不参与签名。

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payUrl

string

支付链接

-

└─orderId

string

平台订单号

-

└─message

string

信息

-

└─country

string

国家

-

└─status

string

订单状态
0 等待 1 成功 2 失败

-

└─channelId

int32

通道

-

└─deeplink

string

UPI deeplink(仅印度)

-

└─payData

string

支付数据(可选)。通常为空,请使用 payUrl 引导用户支付

V1.1

└─payDataType

string

payData 类型(可选,多数场景为空)

V1.1

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payUrl": "https://payment.link/xxxxx",
    "orderId": "168111122223333",
    "message": "success",
    "status": "1",
    "channelId": 988,
    "deeplink": "upi://pay?pa=xxx@upi&....."
  },
  "msg": "Success"
}

1.2.2.代收查询

Type:POST

Content-Type:application/json

Description:查询

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "IN202603060001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─orderId

string

平台订单号

-

└─merchantOrderId

string

商户订单号

-

└─message

string

消息

-

└─status

string

订单状态
0 待支付 1 已支付 2 已失效

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "orderId": "168111122223333",
    "merchantOrderId": "MN168111122223333",
    "message": "success",
    "status": "1"
  },
  "msg": "Success"
}

1.2.3.代收回调

Type:POST

Content-Type:application/json

Description:支付成功后会将以下内容post至下单时设置的回调地址,商户返回 success 即认为通知成功

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantOrderId

string

商户订单号

true

-

amount

string

订单金额

true

-

payAmount

string

实付金额

false

-

orderId

string

平台订单

true

-

status

string

订单状态
0 等待 1 成功 2 失败

true

-

msg

string

错误消息

false

-

payTime

string

支付时间,格式 yyyy-MM-dd HH:mm:ss,按商户开户国家的当地时间(印度 Asia/Kolkata,马来 Asia/Kuala_Lumpur,印尼 Asia/Jakarta)

false

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "IN202603060001",
  "amount": "100",
  "payAmount": "100",
  "orderId": "2031287507960455168",
  "status": "1",
  "msg": "success",
  "payTime": "2026-03-06 12:00:00",
  "utr": "123456789012",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

1.3.UTR / UPI 接口



以下接口仅印度可用。

1.3.1.UTR查单

Type:POST

Content-Type:application/json

Description:UPI通道 utr 查单(仅印度)

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

utr

string

utr

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "utr": "123456789012",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─utr

string

utr

-

└─amount

number

金额

-

└─status

string

详见下方status枚举说明

-

└─matchOrderId

string

商户订单号

-

└─payAmount

number

实际支付金额

-

└─orderId

string

平台订单号

-

└─orderStatus

string

关联订单状态

-

└─message

string

说明/错误信息

-

msg

string

返回消息

-

Response-example:

{
    "code": 200,
    "data": {
        "utr": "6ckj2u",
        "amount": 674,
        "status": "NOT_EXIST",
        "matchOrderId": "176"
    },
    "msg": "Success"
    }

status 状态说明:


    UNBOUND: 已确认收款,utr待领取,请补单
    COMPLETED: utr已领取,订单已完成
    NOT_EXIST: utr不存在
    CLAIMED_BY_OTHER: utr已被其他商户认领
    UTR_PAY_FAIL: 支付失败
    ERROR: 异常情况
    OTHER: UTR已在渠道到账,但不属于本平台

1.3.2.UTR补单

Type:POST

Content-Type:application/json

Description:UPI通道 utr 补单(仅印度)

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

merchantOrderId

string

商户订单

true

-

utr

string

utr

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "IN202603060001",
  "utr": "123456789012",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

200成功 400失败

data

object

数据

-

└─utr

string

utr

-

└─amount

number

订单金额

-

└─payAmount

number

实际支付金额

-

└─status

string

详见下方status枚举说明

-

└─orderId

string

平台订单号

-

└─merchantOrderId

string

商户订单号

-

└─message

string

描述

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "utr": "874658784512",
    "amount": 674,
    "payAmount": 674,
    "status": "SUCCESS",
    "orderId": "894651651316816",
    "merchantOrderId": "2222147865546",
    "message": "补单成功",
},
  "msg": "Success"
}

status 状态说明:


    SUCCESS: 补单成功
    FAIL: 补单失败
    CLAIMED: utr已被其他商户认领
    ALREADY_SUCCESS: 订单已成功无需补单
    NOT_EXIST: UTR不存在

1.3.3.UPI查询

Type:POST

Content-Type:application/json

Description:查询UPI是否属于CFPay

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

upi

string

upi

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "upi": "demo@okicici",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─upi

string

upi

-

└─channelId

number

渠道号

-

└─status

string

详见下方status枚举说明

-

Response-example:

{
    "code": 200,
    "data": {
        "upi": "aassdd@iob",
        "channelId": 001,
        "status": "0"
    },
    "msg": "Success"
    }

status 状态说明:


    0: 不属于CFPay
    1: 属于CFPay

1.4.代付说明



1. 代付下单接口:POST /api/payout/submit

2. type=0:银行卡,account=卡号,ifsc=印度 IFSC

3. type=1:UPI,upi 必填

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "amount": "100",
  "country": "IN",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Rahul",
  "type": "0",
  "account": "12345678901234",
  "ifsc": "HDFC0001234",
  "sign": "your_generated_sign_here"
}

1.4.1.代付下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantPayoutId

string

商户订单号

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

姓名

true

-

type

string

出款类型
0 银行卡
1 UPI

true

-

account

string

卡号
type=0 必填

false

-

ifsc

string

IFSC
type=0 必填,填写印度 IFSC

false

-

upi

string

upi
type=1 必填

false

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "amount": "100",
  "country": "IN",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Rahul",
  "type": "0",
  "account": "12345678901234",
  "ifsc": "HDFC0001234",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─country

string

国家

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "1",
    "status": "1",
    "msg": "success",
    "amount": "100.00",
    "utr": "300011112222"
  },
  "msg": "Success"
}

1.4.2.代付查询

Type:POST

Content-Type:application/json

Description:查询

请求限制:每分钟最多60次

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

merchantPayoutId

string

商户订单id

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "1",
    "status": "3",
    "msg": "success",
    "amount": "100.00",
    "utr": "300011112222"
  },
  "msg": "Success"
}

1.4.3.代付余额

Type:POST

Content-Type:application/json

Description:余额

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

number

数据

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": 833,
  "msg": "Success"
}

1.4.4.代付回调

Type:POST

Content-Type:application/json

Description:订单完成后会将以下内容post至下单时设置的回调地址,商户返回 success 确认收到

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantPayoutId

string

商户订单

true

-

amount

string

金额

true

-

payoutId

string

平台订单号

true

-

status

string

订单状态
1 成功 2 失败

true

-

msg

string

错误消息

false

-

fee

string

手续费

true

-

singleFee

string

单笔

true

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "amount": "100",
  "payoutId": "1933009541007978496",
  "status": "1",
  "msg": "success",
  "fee": "2.00",
  "singleFee": "1.00",
  "utr": "516121860047",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

2.马来西亚(MY)

2.1.概述



1. 网关:https://coffeepay.top

2. 国家代码:country=MY

3. 币种:MYR

4. 金额范围:代收 10 ~ 50000;代付 5 ~ 50000

5. 代收余额:见 0.5

6. 无 UTR/UPI 接口(印度专用)

2.2.代收说明



1. 代收下单:POST /api/payin/submit,传 country=MY

2. 无需 method / deeplink / mode(印度/印尼专用字段请勿传)

3. 返回 payUrl 引导用户完成支付

{
  "merchantId": 1001,
  "merchantOrderId": "MY202607240001",
  "amount": "10",
  "country": "MY",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Ahmad",
  "mobile": "0123456789",
  "email": "ahmad@example.com",
  "sign": "your_generated_sign_here"
}

2.2.1.代收下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

用户姓名(建议填写;可不传)

false

-

mobile

string

用户电话(建议填写;可不传)

false

-

email

string

邮箱(建议填写;可不传)

false

-

sign

string

请求签名

true

-

callbackUrl

string

支付完成后同步跳转地址。不传则默认跳转 https://www.google.com

false

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "MY202607240001",
  "amount": "10",
  "country": "MY",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Ahmad",
  "mobile": "0123456789",
  "email": "ahmad@example.com",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payUrl

string

支付链接

-

└─orderId

string

平台订单号

-

└─message

string

信息

-

└─country

string

国家

-

└─status

string

订单状态
0 等待 1 成功 2 失败

-

└─channelId

int32

通道

-

└─payData

string

支付数据(可选)。通常为空,请使用 payUrl 引导用户支付

V1.1

└─payDataType

string

payData 类型(可选,多数场景为空)

V1.1

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payUrl": "https://payment.link/xxxxx",
    "orderId": "168111122223333",
    "message": "success",
    "status": "1",
    "channelId": 988
  },
  "msg": "Success"
}

2.2.2.代收查询

Type:POST

Content-Type:application/json

Description:查询

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "MY202607240001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─orderId

string

平台订单号

-

└─merchantOrderId

string

商户订单号

-

└─message

string

消息

-

└─status

string

订单状态
0 待支付 1 已支付 2 已失效

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "orderId": "168111122223333",
    "merchantOrderId": "MN168111122223333",
    "message": "success",
    "status": "1"
  },
  "msg": "Success"
}

2.2.3.代收回调

Type:POST

Content-Type:application/json

Description:支付成功后会将以下内容post至下单时设置的回调地址,商户返回 success 即认为通知成功

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantOrderId

string

商户订单号

true

-

amount

string

订单金额

true

-

payAmount

string

实付金额

false

-

orderId

string

平台订单

true

-

status

string

订单状态
0 等待 1 成功 2 失败

true

-

msg

string

错误消息

false

-

payTime

string

支付时间,格式 yyyy-MM-dd HH:mm:ss,按商户开户国家的当地时间(印度 Asia/Kolkata,马来 Asia/Kuala_Lumpur,印尼 Asia/Jakarta)

false

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "MY202607240001",
  "amount": "10.00",
  "payAmount": "10.00",
  "orderId": "2031287507960455168",
  "status": "1",
  "msg": "success",
  "payTime": "2026-07-24 12:00:00",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

2.3.代付说明



1. 代付下单:传 country=MY

2. 仅支持 type=0(银行卡/电子钱包)

3. ifsc 填写马来西亚银行代码(如 CIMB、MBB),不是全称;见下方编码表

4. account 填写银行账号

{
  "merchantId": 1001,
  "merchantPayoutId": "MYPO202607240001",
  "amount": "10",
  "country": "MY",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Ahmad",
  "type": "0",
  "account": "1234567890",
  "ifsc": "CIMB",
  "sign": "your_generated_sign_here"
}

2.3.1.代付下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantPayoutId

string

商户订单号

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

姓名

true

-

type

string

出款类型
仅支持 0(银行卡/电子钱包)

true

-

account

string

银行账号
type=0 必填

false

-

ifsc

string

银行代码
type=0 必填,填写马来银行代码(见 2.4),不是全称

false

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "MYPO202607240001",
  "amount": "10",
  "country": "MY",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Ahmad",
  "type": "0",
  "account": "1234567890",
  "ifsc": "CIMB",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─country

string

国家

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "0",
    "status": "1",
    "msg": "success",
    "amount": "10.00",
    "utr": "300011112222"
  },
  "msg": "Success"
}

2.3.2.代付查询

Type:POST

Content-Type:application/json

Description:查询

请求限制:每分钟最多60次

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

merchantPayoutId

string

商户订单id

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "0",
    "status": "3",
    "msg": "success",
    "amount": "10.00",
    "utr": "300011112222"
  },
  "msg": "Success"
}

2.3.3.代付余额

Type:POST

Content-Type:application/json

Description:余额

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

number

数据

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": 833,
  "msg": "Success"
}

2.3.4.代付回调

Type:POST

Content-Type:application/json

Description:订单完成后会将以下内容post至下单时设置的回调地址,商户返回 success 确认收到

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantPayoutId

string

商户订单

true

-

amount

string

金额

true

-

payoutId

string

平台订单号

true

-

status

string

订单状态
1 成功 2 失败

true

-

msg

string

错误消息

false

-

fee

string

手续费

true

-

singleFee

string

单笔

true

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "amount": "100",
  "payoutId": "1933009541007978496",
  "status": "1",
  "msg": "success",
  "fee": "2.00",
  "singleFee": "1.00",
  "utr": "516121860047",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

2.3.5.银行列表接口

Type:POST

Content-Type:application/json

Description:获取银行/钱包编码列表。出款时请填写编码而非全称。完整码表见 2.4。

Query-parameters:

Parameter Type Description Required Since

country

string

国家代码(MY-马来西亚,IN-印度,ID-印尼),马来西亚传 MY(默认)

false

-

Request-example:

curl -X POST "https://coffeepay.top/api/payout/banks?country=MY"
# country=MY 马来西亚 | country=ID 印尼 | country=IN 印度(若有)

Response-example:

{
  "code": 200,
  "data": {
    "CIMB": "CIMB Bank Berhad",
    "MBB": "Maybank / Malayan Banking Berhad",
    "TNG": "Touch N Go"
  },
  "msg": "Success"
}

完整码表见 2.4。

2.4.银行编码表

Description:马来西亚代付时,请求字段 ifsc 填写下列银行代码(不是全称)。也可调用 POST /api/payout/banks?country=MY 获取。

curl -X POST "https://coffeepay.top/api/payout/banks?country=MY"

银行代码参考表:

银行代码 银行全称

AFFIN

Affin Bank Berhad

AGRO

AGROBANK / BANK PERTANIAN MALAYSIA BERHAD

ALLI

Alliance Bank Malaysia Berhad

AMB

AmBank (M) Berhad

BIMB

Bank Islam Malaysia Berhad

BMMB

Bank Muamalat (Malaysia) Berhad

BSN

Bank Simpanan Nasional Berhad

CIMB

CIMB Bank Berhad

CITI

Citibank Berhad

GXB

GX Bank

HLB

Hong Leong Bank Berhad

HSBC

HSBC Bank Malaysia Berhad

KFH

Kuwait Finance House

MBB

Maybank / Malayan Banking Berhad

OCBC

OCBC Bank (Malaysia) Berhad

PBB

Public Bank Berhad

RHB

RHB Bank Berhad

SCB

Standard Chartered Bank (Malaysia) Berhad

TNG

Touch N Go

UOB

United Overseas Bank (Malaysia) Berhad

3.印尼(ID)

3.1.概述



1. 网关:https://cfpay88.com

2. 国家代码:country=ID(不传时以商户开户国家为准)

3. 币种:IDR,金额必须为整数(无小数)

4. 金额范围:10000 ~ 50000000

5. 代收手续费 = 订单金额 × 代收费率 + 代收单笔。代收单笔在下单时按商户配置锁定,成功入账 = 订单金额 − 手续费(merchantFee 已包含比例费和单笔)。单笔为 0 时只扣比例费。代收回调不另带手续费字段

6. 签名算法与各国一致

7. 订单状态沿用平台统一枚举:代收 0处理中 / 1成功 / 2失败

3.2.代收说明



1. 代收接口:POST /api/payin/submit
POST /api/payin/status;余额见 0.5

2. 默认自有收银台:返回 CFPay payUrl(如 https://cfpay88.com/id/?o={orderId}),可不传 method,用户在收银台选择支付方式

3. API 直出:没有独立的"通道开关"——是否走 API 直出,完全由请求里 method 是否非空决定:传了已开通的 method(如 QRIS/BNI),响应即含 payData + payDataType(VA / QR_CODE / CASHIER_URL / OTC),由商户自渲染;不传则走收银台模式。两种模式共用同一个 payUrl 兜底跳转

3-1. method 只有已开通才能用:当前仅 QRIS / BCA / BNI / BRI / MANDIRI 五个已开通;传未开通编码(如 GOPAY_QRIS/DANA/OVO)会直接返回失败,message 为 支付方式暂未开通 method=xxx,详见 3.3 的"是否开通"列

4. 支付方式列表:POST /api/payin/methods?country=ID 仅兼容旧版,返回全部编码且不含是否开通标记,不建议用它判断 API 直出可用性;请以 POST /api/v1/id/payin/methods(含分层 layer 与 enabled 字段)为准

5. 代付银行码:POST /api/v1/id/payout/banks

Request-example(收银台模式):

{
  "merchantId": 1000,
  "merchantOrderId": "ID202607240001",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Budi Santoso",
  "mobile": "081234567890",
  "email": "budi@example.com",
  "callbackUrl": "https://merchant.example.com/payin/return",
  "sign": "your_generated_sign_here"
}

Request-example(API 模式):

{
  "merchantId": 1000,
  "merchantOrderId": "ID202607240002",
  "amount": "10000",
  "country": "ID",
  "method": "QRIS",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Budi Santoso",
  "mobile": "081234567890",
  "email": "budi@example.com",
  "sign": "your_generated_sign_here"
}

3.2.1.代收下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

用户姓名(建议填写;可不传)

false

-

mobile

string

用户电话(建议填写;可不传)

false

-

email

string

邮箱(建议填写;可不传)

false

-

sign

string

请求签名

true

-

callbackUrl

string

支付完成后同步跳转地址(收银台成功页回跳)。不传则停留在成功页,不强制外跳。

false

-

method

string

印尼代收支付方式编码(如 QRIS / BNI)。不存在单独的"API 模式"通道开关,传了合法且已开通的 method 就是 API 直出,不传就是收银台模式。
必须是3.3 里标记已开通的编码,否则下单直接失败(支付方式暂未开通)。
⚠️ 只要该字段值非空字符串就会被拼入签名原文(与 country 无关)。印度/马来商户不要传此字段,否则也必须把 method 计入签名,不然验签失败。

false

V1.1

Request-example(收银台):

{
  "merchantId": 1000,
  "merchantOrderId": "ID202607240001",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Budi Santoso",
  "mobile": "081234567890",
  "email": "budi@example.com",
  "callbackUrl": "https://merchant.example.com/payin/return",
  "sign": "your_generated_sign_here"
}

Request-example(API 模式):

{
  "merchantId": 1000,
  "merchantOrderId": "ID202607240002",
  "amount": "10000",
  "country": "ID",
  "method": "QRIS",
  "notifyUrl": "https://merchant.example.com/payin/notify",
  "name": "Budi Santoso",
  "mobile": "081234567890",
  "email": "budi@example.com",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payUrl

string

支付链接

-

└─orderId

string

平台订单号

-

└─message

string

信息

-

└─country

string

国家

-

└─status

string

订单状态
0 等待 1 成功 2 失败

-

└─channelId

int32

通道

-

└─payData

string

API 模式下的支付数据(如 VA 账号、QRIS 码串、跳转 URL)。收银台模式通常为空,使用 payUrl

V1.1

└─payDataType

string

payData 类型:VA / QR_CODE / CASHIER_URL / OTC(便利店等线下付款码)。没有 QR_URL 这个取值,QRIS 一律是 QR_CODE(EMV 字符串,商户自行渲染二维码)

V1.1

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payUrl": "https://payment.link/xxxxx",
    "orderId": "168111122223333",
    "message": "success",
    "status": "1",
    "channelId": 988
  },
  "msg": "Success"
}

3.2.2.代收查询

Type:POST

Content-Type:application/json

Description:查询

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantOrderId

string

商户订单

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "ID202607240001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─orderId

string

平台订单号

-

└─merchantOrderId

string

商户订单号

-

└─message

string

消息

-

└─status

string

订单状态
0 待支付 1 已支付 2 已失效

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "orderId": "168111122223333",
    "merchantOrderId": "MN168111122223333",
    "message": "success",
    "status": "1"
  },
  "msg": "Success"
}

3.2.3.代收回调

Type:POST

Content-Type:application/json

Description:支付成功后会将以下内容post至下单时设置的回调地址,商户返回 success 即认为通知成功

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantOrderId

string

商户订单号

true

-

amount

string

订单金额

true

-

payAmount

string

实付金额

false

-

orderId

string

平台订单

true

-

status

string

订单状态
0 等待 1 成功 2 失败

true

-

msg

string

错误消息

false

-

payTime

string

支付时间,格式 yyyy-MM-dd HH:mm:ss,按商户开户国家的当地时间(印度 Asia/Kolkata,马来 Asia/Kuala_Lumpur,印尼 Asia/Jakarta)

false

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantOrderId": "ID202607240001",
  "amount": "10000",
  "payAmount": "10000",
  "orderId": "2031287507960455168",
  "status": "1",
  "msg": "success",
  "payTime": "2026-07-24 12:00:00",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

3.3.代收支付方式编码

Type:POST

Description:获取印尼代收支付方式编码(兼容旧版接口,返回全部编码的 Map,不含是否开通标记)。收银台模式下单可不传 method;API 直出下单时 method 必须填已开通的编码,本接口无法判断哪些已开通,请改用 POST /api/v1/id/payin/methods(含 enabled 字段)确认可用性,或参考下文编码表的"是否开通"列。

Query-parameters:

Parameter Type Description Required Since

country

string

国家代码,印尼传 ID(默认 ID)

false

V1.1

Request-example:

curl -X POST "https://cfpay88.com/api/payin/methods?country=ID"

推荐接口:POST /api/v1/id/payin/methods(含 enabled,判断可用性以此为准)

curl -X POST "https://cfpay88.com/api/v1/id/payin/methods"
{
  "code": 200,
  "data": [
    { "code": "QRIS", "name": "QRIS 聚合码", "layer": "qris", "enabled": true, "sort": 1 },
    { "code": "BCA", "name": "BCA", "layer": "va", "enabled": true, "sort": 10 },
    { "code": "GOPAY_QRIS", "name": "GoPay(QRIS)", "layer": "qris", "enabled": false, "sort": 2 }
  ],
  "msg": "Success"
}

enabled=false 的编码目前只是产品目录占位(对齐市场支付方式),传给 /api/payin/submit 的 method 会返回 支付方式暂未开通,请勿使用。

支付方式编码参考表:"是否开通"为空时代表产品目录占位(对齐市场支付方式),传给 API 直出会返回 支付方式暂未开通;本表可能滞后,实际以 POST /api/v1/id/payin/methods 的 enabled 字段为准。

method 编码 说明 是否开通(API 直出)

ALFAMART

便利店支付

未开通(规划中)

BCA

BCA 支付

已开通

BNI

BNI 支付

已开通

BRI

BRI 支付

已开通

BSS

BSS 支付

未开通(规划中)

CIMB

CIMB 支付

未开通(规划中)

DANA

DANA 钱包

未开通(规划中)

DANA_2

DANA 钱包(伪原生)

未开通(规划中)

DANAMON

Danamon 支付

未开通(规划中)

GOPAY_QRIS

GoPay(QRIS)

未开通(规划中)

LINKAJA

LINKAJA 钱包

未开通(规划中)

MANDIRI

Mandiri 支付

已开通

MAYBANK

Maybank 支付

未开通(规划中)

OVO

OVO 钱包

未开通(规划中)

PERMATA

Permata 支付

未开通(规划中)

QRIS

QRIS 聚合码

已开通

SHOPEEPAY

ShopeePay

未开通(规划中)

TRANSFER_BCA

BCA 转账

未开通(规划中)

TRANSFER_BRI

BRI 转账

未开通(规划中)

3.4.代付说明



1. 代付接口:POST /api/payout/submit / query / balance

2. 仅支持 type=0(银行卡 / 电子钱包),不支持 type=1 UPI

3. 字段映射:name=收款人姓名;account=银行账号或钱包手机号;ifsc=印尼 bankCode

4. 完整编码列表:POST /api/payout/banks?country=ID;常用编码见 3.5

银行代付示例:

{
  "merchantId": 1000,
  "merchantPayoutId": "IDPO202607240001",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Budi Santoso",
  "type": "0",
  "account": "1234567890",
  "ifsc": "014",
  "sign": "your_generated_sign_here"
}

电子钱包代付示例(DANA):

{
  "merchantId": 1000,
  "merchantPayoutId": "IDPO202607240002",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Budi Santoso",
  "type": "0",
  "account": "081234567890",
  "ifsc": "10002",
  "sign": "your_generated_sign_here"
}

3.4.1.代付下单

Type:POST

Content-Type:application/json

Description:下单

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

merchantPayoutId

string

商户订单号

true

-

amount

string

金额

true

-

country

string

国家(印度IN / 马来西亚MY / 印尼ID)。不传时以商户开户国家为准

false

-

notifyUrl

string

通知地址

false

-

name

string

姓名

true

-

type

string

出款类型
仅支持 0(银行卡/电子钱包)

true

-

account

string

银行账号或钱包手机号
type=0 必填

false

-

ifsc

string

银行/钱包编码(字段名 ifsc)
type=0 必填,填写印尼 bankCode(见 3.5)

false

-

sign

string

请求签名

true

-

Request-example(银行):

{
  "merchantId": 1000,
  "merchantPayoutId": "IDPO202607240001",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Budi Santoso",
  "type": "0",
  "account": "1234567890",
  "ifsc": "014",
  "sign": "your_generated_sign_here"
}

Request-example(电子钱包 DANA):

{
  "merchantId": 1000,
  "merchantPayoutId": "IDPO202607240002",
  "amount": "10000",
  "country": "ID",
  "notifyUrl": "https://merchant.example.com/payout/notify",
  "name": "Budi Santoso",
  "type": "0",
  "account": "081234567890",
  "ifsc": "10002",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─country

string

国家

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "0",
    "status": "1",
    "msg": "success",
    "amount": "10000",
    "utr": "300011112222"
  },
  "msg": "Success"
}

3.4.2.代付查询

Type:POST

Content-Type:application/json

Description:查询

请求限制:每分钟最多60次

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户id

true

-

merchantPayoutId

string

商户订单id

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

object

数据

-

└─payoutId

string

平台订单号

-

└─merchantPayoutId

string

商户订单号

-

└─type

string

用户提现类型

-

└─status

string

提现状态
0 等待 1 成功 2 失败 3 新建

-

└─msg

string

错误消息

-

└─amount

string

订单金额

-

└─utr

string

utr

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": {
    "payoutId": "1780909111111",
    "merchantPayoutId": "MN1780909111111",
    "type": "0",
    "status": "3",
    "msg": "success",
    "amount": "10000",
    "utr": "300011112222"
  },
  "msg": "Success"
}

3.4.3.代付余额

Type:POST

Content-Type:application/json

Description:余额

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户号

true

-

sign

string

请求签名

true

-

Request-example:

{
  "merchantId": 1001,
  "sign": "your_generated_sign_here"
}

Response-fields:

Field Type Description Since

code

int32

状态码

-

data

number

数据

-

msg

string

返回消息

-

Response-example:

{
  "code": 200,
  "data": 833,
  "msg": "Success"
}

3.4.4.代付回调

Type:POST

Content-Type:application/json

Description:订单完成后会将以下内容post至下单时设置的回调地址,商户返回 success 确认收到

Body-parameters:

Parameter Type Description Required Since

merchantId

int32

商户

true

-

merchantPayoutId

string

商户订单

true

-

amount

string

金额

true

-

payoutId

string

平台订单号

true

-

status

string

订单状态
1 成功 2 失败

true

-

msg

string

错误消息

false

-

fee

string

手续费

true

-

singleFee

string

单笔

true

-

utr

string

utr

false

-

sign

string

签名

true

-

Request-example:

{
  "merchantId": 1001,
  "merchantPayoutId": "PO202603060001",
  "amount": "100",
  "payoutId": "1933009541007978496",
  "status": "1",
  "msg": "success",
  "fee": "2.00",
  "singleFee": "1.00",
  "utr": "516121860047",
  "sign": "your_generated_sign_here"
}

Response-example

成功(success)示例:

"success"

3.4.5.银行列表接口

Type:POST

Content-Type:application/json

Description:获取银行/钱包编码列表。出款时请填写编码而非全称。完整码表见 3.5。

Query-parameters:

Parameter Type Description Required Since

country

string

印尼传 country=ID

false

-

Request-example:

curl -X POST "https://cfpay88.com/api/payout/banks?country=ID"
# country=MY 马来西亚 | country=ID 印尼 | country=IN 印度(若有)

Response-example:

{
  "code": 200,
  "data": {
    "014": "Bank Central Asia (BCA)",
    "10002": "DANA"
  },
  "msg": "Success"
}

完整码表见 3.5。

3.5.代付银行/钱包编码

Description:印尼代付时,请求字段 ifsc 填写下列 bankCode(不是银行全称)。完整列表(含全部银行/VA/钱包,约 200+)请调用:

curl -X POST "https://cfpay88.com/api/payout/banks?country=ID"

常用银行编码:

bankCode(填入 ifsc) 银行名称

014

Bank Central Asia (BCA)

009

Bank Negara Indonesia(BNI)

002

Bank Rakyat Indonesia(BRI)

008

Bank Mandiri

022

Bank CIMB Niaga

011

Bank Danamon

013

Bank Permata

016

Bank Maybank

4510

Bank Syariah Indonesia(BSI)

200

Bank Tabungan Negara (BTN)

213

Bank BTPN

028

Bank OCBC NISP

019

Bank Panin

023

TMRW/Bank UOB Indonesia

490

Neo Commerce/Bank Yudha Bhakti(BNC)

542

Bank ARTOS/ Bank Jago

5010

Blu/BCA Digital

535

Seabank/Bank Kesejahteraan Ekonomi(BKE)

147

Bank Muamalat Indonesia

426

Bank Mega

电子钱包编码:

代付到电子钱包时:ifsc=钱包编码,account=钱包绑定手机号,type=0。

钱包编码 钱包名称

10001

OVO

10002

DANA

10003

GOPAY

10008

SHOPEEPAY

10009

LINKAJA

VA 虚拟账号编码(代付侧,按需):

编码 名称

10011

VA_BRI

10012

VA_MANDIRI

10013

VA_CIMB

10014

VA_PERMATA

10015

VA_BNI

10016

VA_BCA

10017

VA_DANAMON

10018

VA_BSI

10019

VA_BNC

3.6.不适用接口



以下为印度业务专用,印尼环境不可用:

1. /api/payin/utr/check、/api/payin/utr/fix

2. /api/payin/upi

3. 代收参数 deeplink、mode

4. 代付 type=1 + upi

Top