APPID |
appid |
string[1,32] |
Yes |
Body APPID corresponding to the Service Account applied for by the merchant on the WeChat Official Accounts Platform
Note:Only forCommon mode
Example: wx8888888888888888 |
Merchant ID |
mchid |
string[1,32] |
Yes |
Body Merchant ID assigned by WeChat Pay
Note:Only forCommon mode
Example: 1900000109 |
Organization APPID |
sp_appid |
string[1,32] |
Yes |
Body APPID corresponding to the Service Account applied for by the institution on the WeChat Official Accounts Platform
Note:Only forInstitutional mode
Example: wx8888888888888888 |
Sub-merchant APPID |
sub_appid |
string[1,32] |
No |
Body APPID corresponding to the Service Account applied for by the sub-merchant on the WeChat Official Accounts Platform
Note:Only forInstitutional mode
Example: wx8888888888888888 |
Institution's Merchant ID |
sp_mchid |
string[1,32] |
Yes |
Body Institution's Merchant ID assigned by WeChat Pay
Note:Only forInstitutional mode
Example: 1900000109 |
Sub-merchant ID |
sub_mchid |
string[1,32] |
Yes |
Body Sub-merchant ID assigned by WeChat Pay
Note:Only forInstitutional mode
Example: 1900000109 |
Merchant order No. |
out_trade_no |
string[1,32] |
Yes |
Body The order No. in the merchant system with a length of not more than 32 characters, including letters. If the authorization code changes, a new merchant order No. must be used. For more information, see Merchant Order No.
Example: 1217752501201407033233368018 |
Transaction type |
trade_type |
string[1,16] |
Yes |
Body
OfficialPayment:JSAPI
Native Payment: NATIVE
In-APP payment: APP
H5 payment: MWEB
QuickPay: MICROPAY
MiniProgram payment: JSAPI
Example: NATIVE |
Notification address |
notify_url |
string[1,256] |
Yes |
Body The callback address to receive WeChat Pay result notifications asynchronously. The notification URL must be accessible by external networks, and is not allowed to carry any parameters. Use the HTTPS protocol URL.
Example: https://www.weixin.qq.com/wxpay/pay.php |
Merchant data |
attach |
string[1,127] |
No |
Body Additional data, which will be returned unchanged in the query API and payment notifications. This field is mainly used for the custom data in the orders of the merchant.
Example: Custom data |
Product description |
description |
string[1,128] |
Yes |
Body Brief description of the product or payment order in the following format: Name of the store brand - Name of the city branch - Name of the actual product.
Example: Tencent Image Store- Shenzhen
Tencent Building - QQ Doll |
Product tag |
goods_tag |
string[1,32] |
No |
Body The product tag, which is a parameter for the voucher or discount feature. For more information, see Vouchers or Discounts.
Example: WXG |
Payment method |
limit_pay |
string[1,32] |
No |
Body no_credit: Credit card cannot be used for payment
Example: no_credit |
Start time of a transaction |
time_start |
string[1,64] |
No |
Body Order generation time, in RFC3339 format. For example, 2018-06-08T10:34:56+08:00 represents BJT 10:34:56 June 8, 2018.
Example: 2018-06-08T10:34:56+08:00 |
End time of a transaction |
time_expire |
string[1,64] |
No |
Body Order expiration time, in RFC3339 format. For example, 2018-06-08T10:34:56+08:00 represents BJT 10:34:56 June 8, 2018. The order expiration time is specific to the order No. Since the code_url returned by the API is only valid for two hours, it is necessary to request the API again to obtain a new code_url after two hours.
It is recommended that the minimum expiration time interval be greater than 1 minute.
Example: 2018-06-08T10:34:56+08:00 |
MCC code |
merchant_cat egory_code |
string[1,16] |
Yes |
Body Merchant Category Code
Example: 4111 |
Payer |
payer |
object |
No |
Body Payer information. For more information, see the description below. |
Name |
Variable Name |
Type |
Required |
Description |
User ID |
openid |
string[1,128] |
No |
The unique user ID corresponding to the merchant's appid. The [web authorization] API is required to be called to obtain the user's openid before order placement.
Note: Only forCommon mode
Example: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o |
User ID (service provider) |
sp_openid |
string[1,128] |
No |
The unique user ID corresponding to the service provider's sp_appid. Either sp_openid or sub_openid can be passed. If sub_openid is selected, sub_appid must also be passed. The [web authorization] API is required to be called to obtain the user's openid before order placement.
Note: Only forInstitutional mode
Example: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o |
User ID (contracted merchant) |
sub_openid |
string[1,128] |
No |
The unique user ID corresponding to the sub-merchant's sub_appid. Either sp_openid or sub_openid can be passed. If sub_openid is selected, sub_appid must also be passed. The [web authorization] API is required to be called to obtain the user's openid before order placement.
Note: Only forInstitutional mode
Example: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o |
|
Order amount |
amount |
object |
Yes |
Body Information on the order amount. For more information, see the description below. |
Name |
Variable Name |
Type |
Required |
Description |
Total amount |
total |
int |
Yes |
The total order amount. The minimum unit of the currency can only be an integer. For more information, see Transaction Amount.
Example: 888 |
Currency type |
currency |
string[1,16] |
No |
Three-letter code in accordance with ISO 4217.
Example: HKD |
|
Scenario information |
scene_info |
object |
No |
Body The scenario information object. For more information, see the description below. |
Name |
Variable Name |
Type |
Required |
Description |
Merchant's device No. |
device_id |
string[1,32] |
No |
Terminal device No. (which is customized by the merchant, such as store No.)
Example: 013467007045764 |
Merchant's device IP |
device_ip |
string[1,40] |
No |
The IP of the merchant's device, which is the public network egress IP and supports IPV6.
Example: 128.0.0.1 |
User terminal IP |
payer_client_ip |
string[1,40] |
No |
The IP of the user's device, which is the public network egress IP and supports IPV6
Example: 128.0.0.1 |
Operator ID |
operator_id |
string[1,32] |
No |
Cashier ID, customized by the merchant
Example: 123145 |
Merchants' store information |
store_info |
object |
No |
Store information object. For more information, see the description below. |
Name |
Variable Name |
Type |
Required |
Description |
No. |
id |
string[1,32] |
No |
Merchant store ID
Example: 0001 |
Name |
name |
string[1,32] |
Yes |
Merchant store name
Example: Tencent Building Branch |
Address |
address |
string[1,64] |
Yes |
Detailed address of the merchant's store
Example: No. 10000, No.1, Keji Road, Science and Technology Park, Nanshan District, Shenzhen, Guangdong |
|
|
Discount feature |
detail |
Object |
No |
Body Discount feature info. For more information, see the description below. |
Name |
Variable Name |
Type |
Required |
Description |
Original order price |
cost_price |
int |
No |
1. The payment for a merchant's order may be split, and the original order price indicates the transaction amount of the entire order.
2. If the original order price is different from the payment amount, the discount is not available.
3. This field is mainly used to prevent split payment for multiple discounts. This parameter is not required for normal payment.
Example: 608800 |
Product receipt ID |
receipt_id |
string[1,32] |
No |
Merchant receipt ID
Example: wx123 |
Product details |
goods_detail |
array |
Yes |
Product details, submitted in JSON array format. See the table below. |
Name |
Variable Name |
Type |
Required |
Description |
Product code |
goods_id |
string[1,32] |
Yes |
It consists of a combination of uppercase and lowercase letters, numbers, hyphens and underscores.
Example: Product code |
Product code on WeChat |
wxpay_goods_id |
string[1,32] |
No |
Unified product No. defined by WeChat Pay (optional)
Example: 1001 |
Product name |
goods_name |
string[1,256] |
No |
Actual product name
Example: iPhone6s 16G |
Number of products |
quantity |
int |
Yes |
Number of products purchased by a user
Example: 1 |
Unit price |
price |
int |
Yes |
If the merchant provides a discount, the discounted unit price should be transferred (for example, if the user has applied a voucher of 50 CNY off 100 CNY issued by the shop to an order of 100 CNY, the discounted price should be the original 100 CNY minus 50 CNY).
Example: 528800 |
|
|