the merchant server first calls the [Order Placement API] to generate a prepayment order, and signs the obtained parameter prepay_id again before transferring it to the app to initiate payment.
1. API intro
Applicable object:Common modeInstitutional mode
2. Request Parameters
This API signature has no background interface interaction, and the data in the list shall be signed
the client request field (Note: The following field names are case sensitive):
Name
Variable Name
Type
Required
Description
APPID
appId
string[1,16]
Yes
APPID corresponding to the mobile app applied by the merchant on the WeChat Open Platform Example: wx8888888888888888
Merchant ID
partnerid
string[1,32]
Yes
Merchant ID assigned by WeChat Pay. Example: 1900000109
Prepayment transaction session
prepayid
string[1,64]
Yes
Prepayment session ID generated by WeChat, which is used in subsequent API calls. The value is valid for 2 hours. Example: WX1217752501201407033233368018
An extension string for order details
package
string[1,128]
Yes
Specify as the static value “Sign=WXPay” Example: Sign=WXPay
Random string
noncestr
string[1,32]
Yes
Random string, not longer than 32 digits. It is recommended to use the random number generation algorithm. Example: 5K8264ILTKCH16CQ2502SI8ZNMTM67VS
Timestamp
timestamp
string[1,10]
Yes
The current time. For details, see timestamp rules. Example: 1412000000
There are four lines in the signature string, and each line is a parameter. Each line ends with \n (Newline character; the ASCII code value is 0x0A), and even the last line shall ends with \n. If the parameter itself ends with \n, an additional \n is also required
Signature fields and formats:
1 Account ID 2 Timestamp3 Random string4 Prepayment transaction session
The signature method is the same as the signature for request data. Use the merchant private key to sign the string using the SHA256-with-RSA signature algorithm, and obtain the signature value through Base64 encoding.