Create Order
API Endpoint
https://api.yypay.io/open-api/mchOrder/createOrder
Request Method
POST
Request Data Type
application/json
Request Headers
sign
Secret Key:
APPSECRET: Obtain the secret key from the merchant application (please store it securely).
Request Parameters:
reqId
Merchant Order ID
body
true
string
Ensure uniqueness
appId
Platform Application ID
body
true
string
Obtained from the merchant application interface
mchNumber
Platform Merchant ID
body
true
string
Merchant number obtained from the merchant interface
orderType
Order Type
body
true
string
Enum values: API_PAYEE (Collection), API_PAYER (Payout)
chain
Blockchain Type
body
true
string
Network type: TRC20 (Tron), Ethereum (ERC20)
coin
Currency Pair
body
true
string
Refer to the currency pair information of the corresponding blockchain
amount
Order Amount
body
true
string
toAddr
Payment Address
body
false
string
Do not pass for Collection orders
remark
Remark
body
true
string
expireTs
Expiration Time (seconds)
body
true
string
Value range: [600, 1200]
timestamp
Timestamp (milliseconds)
body
true
string
The timestamp of the request, the server will validate that it does not exceed 60 seconds
nonce
Random String
body
true
string
32-character string
lang
Language
body
true
string
zh_cn
sign
Signature
header
true
string
Concatenate parameters into a string and sign the result using appSecret
Example Request:
{
"amount": 0.02,
"appId": "baf2d7e716f25a26",
"chain": "Ethereum(ERC20)",
"coin": "ETH",
"expireTs": 1200, // Order expires in 20 minutes
"lang": "zh_cn",
"mchNumber": "2020212330001336",
"nonce": "tT7RfHjuM0CdGiCAJpHOnHT3NnC1oWbr",
"orderType": "API_PAYEE",
"remark": "remark",
"reqId": "10850029",
"timestamp": 1749172965057
}
Response Parameters:
code
Status code, 0 for success, 500 for failure
integer (int32)
data
Data object
reqId
Merchant Order ID
string
orderId
Platform Order ID
string
orderType
Order Type
string
paymentUrl
Payment URL
string
Not returned for Payout orders
msg
Return message
string
success
Whether the request was successful
boolean
Example Response:
{
"code": 0,
"data": {
"reqId": "11854236249",
"orderId": "P1930801341052092416",
"orderType": "API_PAYEE",
"paymentUrl": "https://yypay.io/payment/P1930801341052092416"
},
"msg": "",
"success": true
}
Last updated