Skip to main content
POST
/
epay
/
mapi.php
mapi.php (direct create payment compatibility endpoint)
curl --request POST \
  --url https://api.kyren.top/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 param=user_42 \
  --data clientip=203.0.113.9 \
  --data device=pc \
  --data sign=1ce4f4f5294ec4c95f6b79ff79dbb57b \
  --data sign_type=MD5
{
  "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

application/x-www-form-urlencoded
pid
string
required

Merchant ID

type
enum<string>
required

Payment channel type in Epay compatibility mode.

Available options:
alipay,
wxpay,
creditcard,
crypto,
paynow
out_trade_no
string
required

Merchant order number (must be unique under one merchant)

notify_url
string<uri>
required

Merchant async callback URL

name
string
required

Product name

money
string
required

Order amount, decimal string, must be greater than 0

clientip
string
required

Client IP address

sign
string
required

Lowercase MD5 signature

sign_type
enum<string>
required

Signature type. Current compatibility implementation only supports MD5.

Available options:
MD5
return_url
string<uri>

Merchant sync return URL

money_type
string
default:CNY

Currency code. Defaults to CNY when omitted.

param
string

Pass-through parameter returned in callbacks and order queries

device
string
default:pc

Device identifier passed to gateway (e.g. pc)

channel_param
string

Optional JSON string for channel-specific fields. Credit card mode supports fields such as: cardNo, cardExpireMonth, cardExpireYear, cardSecurityCode, billFirstName, billLastName, billPhone, billAddress, billCountry, billState, billCity, billZip, email.

Response

200 - application/json

Epay-compatible create payment result

code
enum<integer>
Available options:
1
trade_no
string

Platform order ID

out_trade_no
string

Merchant order number

payurl
string | null

Redirect URL for browser/app payment flows

qrcode
string | null

QR code payload or H5 payment URL depending on channel

img
string | null

QR image URL generated from qrcode