/epay/mapi.php is the server-to-server Epay compatibility endpoint. It accepts form POST, creates or reuses a Kyren order, and returns Epay-style response fields such as payurl, qrcode, img, and trade_no depending on the selected channel.
This endpoint uses pid + sign, not x-api-key. Because it is server-to-server, it may be subject to the API IP allowlist when enabled. A failed allowlist check can return numeric code 0 with msg.
Parameters
Required parameters:| Parameter | Description |
|---|---|
pid | Kyren-issued merchant Epay-compatible merchant ID. |
type | Payment type. Supported values include alipay, wxpay, creditcard, crypto, and paynow. |
out_trade_no | Your merchant order number. |
notify_url | Merchant payment result notification URL. |
name | Order or product name. |
money | Decimal string amount, for example "9.99". |
clientip | End-user client IP collected by your server. |
sign | Epay-compatible MD5 signature. |
sign_type | Signature type, usually MD5. |
| Parameter | Description |
|---|---|
return_url | Browser return URL when the channel uses a payment page. |
money_type | Currency or money type if provided by your existing integration. |
device | Device context from your existing integration. |
display_merchant_name | Per-payment merchant display name shown on Kyren intermediate payment pages. |
param | Passthrough merchant metadata returned in notifications. |
channel_param | Channel-specific extension data. |
Example request
Success response example
Failure response example
mapi.php API reference.