curl --request POST \
--url https://api.kyrenpay.com/epay/mapi.php \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data pid=merch_001 \
--data type=wxpay \
--data out_trade_no=order_20260409002 \
--data notify_url=https://merchant.example.com/pay/notify \
--data return_url=https://merchant.example.com/pay/return \
--data 'name=AI Credits 1000' \
--data money=9.99 \
--data money_type=CNY \
--data 'display_merchant_name=Campaign Store' \
--data param=user_42 \
--data clientip=203.0.113.9 \
--data device=pc \
--data sign=1ce4f4f5294ec4c95f6b79ff79dbb57b \
--data sign_type=MD5import requests
url = "https://api.kyrenpay.com/epay/mapi.php"
payload = {
"pid": "merch_001",
"type": "wxpay",
"out_trade_no": "order_20260409002",
"notify_url": "https://merchant.example.com/pay/notify",
"return_url": "https://merchant.example.com/pay/return",
"name": "AI Credits 1000",
"money": "9.99",
"money_type": "CNY",
"display_merchant_name": "Campaign Store",
"param": "user_42",
"clientip": "203.0.113.9",
"device": "pc",
"sign": "1ce4f4f5294ec4c95f6b79ff79dbb57b",
"sign_type": "MD5"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
pid: 'merch_001',
type: 'wxpay',
out_trade_no: 'order_20260409002',
notify_url: 'https://merchant.example.com/pay/notify',
return_url: 'https://merchant.example.com/pay/return',
name: 'AI Credits 1000',
money: '9.99',
money_type: 'CNY',
display_merchant_name: 'Campaign Store',
param: 'user_42',
clientip: '203.0.113.9',
device: 'pc',
sign: '1ce4f4f5294ec4c95f6b79ff79dbb57b',
sign_type: 'MD5'
})
};
fetch('https://api.kyrenpay.com/epay/mapi.php', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kyrenpay.com/epay/mapi.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kyrenpay.com/epay/mapi.php"
payload := strings.NewReader("pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kyrenpay.com/epay/mapi.php")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kyrenpay.com/epay/mapi.php")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5"
response = http.request(request)
puts response.read_body{
"code": 1,
"trade_no": "order_epay_001",
"out_trade_no": "order_20260409002",
"qrcode": "weixin://wxpay/bizpayurl?pr=xxxx",
"img": "https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=weixin%3A%2F%2Fwxpay%2Fbizpayurl%3Fpr%3Dxxxx"
}mapi.php (direct create payment compatibility endpoint)
Creates (or reuses) an order directly and returns Epay-style response fields.
For QR-style channels, response includes qrcode and img.
For redirect-style channels, response includes payurl.
Paydify:商户一次性加密货币通道绑定 Paydify 时使用 type=crypto,沿用 MD5 签名。
返回 code=1/trade_no/out_trade_no/payurl,其中 payurl 指向 KyrenPay 本地支付页;不返回上游 qrcode/img。
买家选择 App / 网络并确认有效 USDT 报价后才创建上游支付;不新增商户必填参数,目前不支持 USDC。
money/money_type 表示原商品计价金额,不是应付 USDT 数量;入口 code=1 不代表已付款。
同一商户 out_trade_no 重试必须保持金额、币种和支付方式一致,不能用重建订单处理未知支付结果。
目标环境须已部署且渠道已开通;文档不替代 Sandbox 真付验收。
Signature algorithm:
- Remove
signandsign_type, and drop empty values. - Sort parameters by key in ascending order.
- Join as
k=vwith&, append merchant API key. - MD5 the final string and compare in lowercase.
curl --request POST \
--url https://api.kyrenpay.com/epay/mapi.php \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data pid=merch_001 \
--data type=wxpay \
--data out_trade_no=order_20260409002 \
--data notify_url=https://merchant.example.com/pay/notify \
--data return_url=https://merchant.example.com/pay/return \
--data 'name=AI Credits 1000' \
--data money=9.99 \
--data money_type=CNY \
--data 'display_merchant_name=Campaign Store' \
--data param=user_42 \
--data clientip=203.0.113.9 \
--data device=pc \
--data sign=1ce4f4f5294ec4c95f6b79ff79dbb57b \
--data sign_type=MD5import requests
url = "https://api.kyrenpay.com/epay/mapi.php"
payload = {
"pid": "merch_001",
"type": "wxpay",
"out_trade_no": "order_20260409002",
"notify_url": "https://merchant.example.com/pay/notify",
"return_url": "https://merchant.example.com/pay/return",
"name": "AI Credits 1000",
"money": "9.99",
"money_type": "CNY",
"display_merchant_name": "Campaign Store",
"param": "user_42",
"clientip": "203.0.113.9",
"device": "pc",
"sign": "1ce4f4f5294ec4c95f6b79ff79dbb57b",
"sign_type": "MD5"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
pid: 'merch_001',
type: 'wxpay',
out_trade_no: 'order_20260409002',
notify_url: 'https://merchant.example.com/pay/notify',
return_url: 'https://merchant.example.com/pay/return',
name: 'AI Credits 1000',
money: '9.99',
money_type: 'CNY',
display_merchant_name: 'Campaign Store',
param: 'user_42',
clientip: '203.0.113.9',
device: 'pc',
sign: '1ce4f4f5294ec4c95f6b79ff79dbb57b',
sign_type: 'MD5'
})
};
fetch('https://api.kyrenpay.com/epay/mapi.php', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kyrenpay.com/epay/mapi.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kyrenpay.com/epay/mapi.php"
payload := strings.NewReader("pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kyrenpay.com/epay/mapi.php")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kyrenpay.com/epay/mapi.php")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "pid=merch_001&type=wxpay&out_trade_no=order_20260409002¬ify_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Fnotify&return_url=https%3A%2F%2Fmerchant.example.com%2Fpay%2Freturn&name=AI%20Credits%201000&money=9.99&money_type=CNY&display_merchant_name=Campaign%20Store¶m=user_42&clientip=203.0.113.9&device=pc&sign=1ce4f4f5294ec4c95f6b79ff79dbb57b&sign_type=MD5"
response = http.request(request)
puts response.read_body{
"code": 1,
"trade_no": "order_epay_001",
"out_trade_no": "order_20260409002",
"qrcode": "weixin://wxpay/bizpayurl?pr=xxxx",
"img": "https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=weixin%3A%2F%2Fwxpay%2Fbizpayurl%3Fpr%3Dxxxx"
}Body
Types for the 21 live payment methods available through submit.php and mapi.php. Use the recommended lowercase types below. Type matching is case-insensitive; sign the original value sent. Queries and notifications return the recommended type. Availability depends on enabled merchant channels, bindings, supported currencies and amount limits.
| Payment method | Recommended type | Accepted aliases |
|---|---|---|
| Alipay | alipay | — |
| AlipayHK | alipay_hk | alipayhk, alihk |
| Boost | boost | — |
| Credit card | creditcard | credit_card |
| Cryptocurrency | crypto | — |
| DANA | dana | — |
| JKOPay | jkopay | — |
| Mir | mir | — |
| OVO SNAP | ovo | — |
| PAYCO | payco | — |
| PayNow | paynow | — |
| Samsung Pay | samsungpay | samsung_pay |
| Sber Pay | sberpay | sber_pay |
| SBP | sbp | — |
| ShopeePay | shopeepay | — |
| Toss Pay | tosspay | toss_pay |
| Touch ’n Go eWallet | touch_n_go_ewallet | touchngo, tng |
| T-Pay | t_pay | tpay |
| USDT Direct | usdt_direct | — |
| WeChat Pay | wxpay | — |
| YooMoney | yoomoney | yoo_money |
crypto uses the existing merchant binding to Paydify or legacy Satogate.
usdt_direct is the separate USDT Direct method and only routes to Satogate.
Provider names such as paydify, satogate, and evonet are not valid types.
alipay, alipay_hk, boost, creditcard, crypto, dana, jkopay, mir, ovo, payco, paynow, samsungpay, sberpay, sbp, shopeepay, tosspay, touch_n_go_ewallet, t_pay, usdt_direct, wxpay, yoomoney, alipayhk, alihk, credit_card, samsung_pay, sber_pay, toss_pay, touchngo, tng, tpay, yoo_money Optional JSON string for non-card channel-specific fields.
For type=creditcard, the raw value participates in signature verification
but is ignored after verification. Do not send card details or billing/contact
data in this field; the buyer enters card information on a hosted payment page.
Response
Epay-compatible create payment result
- Option 1
- Option 2
