Latest update time:2021.08.18 Release notes
The deduction request implements deduction according to the priority payment method recorded in the signed contract. If the deduction fails, the other payment methods of the user will be polled in turn.
The deduction interface returns the deduction result synchronously. The following three situations may occur:
• If the deduction succeeds, the order details are returned.
• If the deduction fails, the order is processed according to the error code and the corresponding suggested processing method.
• The deduction interface times out. After the timeout, the order query interface can be called to obtain the order status, or the order status can be updated at the merchant side after the callback notification is received (see “Deduction Result Notification” for details), but the number of callbacks is limited, and WeChat does not guarantee that the merchant will receive the notification.
Request Url:https://apihk.mch.weixin.qq.com/v3/global/papay/transactions
Request method:POST
API rules: https://wechatpay-api.gitbook.io/wechatpay-api-v3
Applicable object:Common modeInstitutional mode
path parameter is a path parameter.
query parameter needs to be passed in the request URL.
body parameter needs to be passed in the request JSON.
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
App ID | appid | string[1,32] | Yes | body Appid bound to the merchant ID Note: Only forCommon mode Example:wxcbda96de0b165486 |
Sub-merchant ID | sub_mchid | string[1,32] | Yes | body Sub-merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000097 |
App ID of the service provider | sp_appid | string[1,32] | Yes | body Appid bound to the service provider Note: Only forInstitutional mode Example:wxcbda96de0b165486 |
App ID of the sub-merchant | sub_appid | string[1,32] | No | body Appid bound to the sub-merchant ID for initiating signing Note: Only forInstitutional mode Example:wxcbda96de0b165484 |
Goods description | description | string[1,128] | Yes | Brief description of the goods or payment slip, in this format: Store Brand Name-City Branch Store Name-Actual Goods Name Example:Image store-Shenzhen Tengda-QQ Doll |
Merchant data | attach | string[1,127] | No | Additional data, returned in the query API and payment notification without any changes; this field is used for the custom order data carried by the merchant Example:Custom data |
Notification address | notify_url | string[1,256] | Yes | Callback address for receiving the result notification from WeChat Pay asynchronously; the notification URL must be an URL that is accessible by the external network and cannot carry parameters. Please use an HTTPS protocol link Example:https://www.weixin.qq.com/wxpay/pay.php |
Merchant order No. | out_trade_no | string[1,32] | Yes | Order No. inside the merchant system, which consists of 32 characters and can contain letters; to change the authorization code, you must replace the merchant order No. with a new one. For other information, please refer to Merchant order No. Example:1217752501201407033233368018 |
Goods tag | goods_tag | string[1,32] | No | Goods tag, which is a parameter of the coupon or price reduction function. For more information, please refer to Coupon or price reduction Example:Goods_tag |
Merchant category code (MCC] | merchant_category_code | string[1,16] | Yes | Merchant category code Example:1011 |
Auto-debit contract ID | contract_id | string[1,64] | Yes | Auto-debit contract ID returned by WeChat after successful signing Example:Wx15463511252015071056489715 |
+Order amount | amount | object | Yes | Order amount information, which is detailed below |
+cene information | scene_info | object | No | Scene information object, which is detailed below |
POST
https://apihk.mch.weixin.qq.com/v3/global/papay/transactions
{
"appid": "wxcbda96de0b165486",
"description": "Image store-Shenzhen Tengda-QQ Doll",
"attach": "Custom data",
"notify_url": "https://wxpay.wxutil.com/pub_v2/pay/notify.v2.php",
"out_trade_no": "1217752501201407033233368018",
"goods_tag": "WXG",
"merchant_category_code": "1011",
"contract_id": "Wx15463511252015071056489715",
"amount": {
"total": 10000,
"currency": "HKD"
},
"scene_info": {
"device_ip": "59.37.125.32",
"device_id": "013467007045764"
}
}
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Merchant ID | mchid | string[1,32] | Yes | Merchant ID allocated by WeChat Pay Note: Only forCommon mode Example:10000091 |
App ID | appid | string[1,32] | Yes | Appid bound to the merchant ID Note: Only forCommon mode Example:wxcbda96de0b165486 |
Merchant ID of the service provider | sp_mchid | string[1,32] | Yes | The institution's merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000098 |
Sub-merchant ID | sub_mchid | string[1,32] | Yes | Sub-merchant ID allocated by WeChat Pay Note: Only forInstitutional mode Example:10000097 |
App ID of the service provider | sp_appid | string[1,32] | Yes | Appid bound to the service provider’s Official Account Note: Only forInstitutional mode Example:wxcbda96de0b165486 |
App ID of the sub-merchant | sub_appid | string[1,32] | No | Mini program appid of the sub-merchant who initiates the signing Note: Only forInstitutional mode Example:wxcbda96de0b165484 |
Merchant order No. | out_trade_no | string[1,32] | Yes | Returned merchant order No. Example:1217752501201407033233368018 |
WeChat Pay order No. | transaction_id | string[1,32] | Yes | WeChat Pay order No. Example:1217752501201407033233368018 |
Merchant data | attach | string[1,127] | No | Additional data, returned in the query API and payment notification without any changes; this field is used for the custom order data carried by the merchant Example:Custom data |
Transaction type | trade_type | string[1,16] | Yes | Deduction payment Example:AUTH |
Paying bank | bank_type | string[1,32] | No | Returned after successful payment. Bank type is a bank ID of string type. For the list of specific values, please refer to bank type CMC and other bank card types in the Chinese mainland WPHK: payment by Hong Kong Wallet Example:WPHK |
Payment completion time | success_time | string[1,64] | No | Payment completion time, in the rfc3339 format, e.g., 2018-06-08T10:34:56+08:00 indicates 10:34:56 a.m. on June 8, 2018 of Beijing time Example:2018-06-08T10:34:56+08:00 |
Transaction state | trade_state | string[1,32] | Yes | SUCCESS — Payment success REFUND — Transfer to refund NOTPAY — Not paid CLOSED — Closed PAYERROR — Payment failed USERPAYING — payment in progress Example:SUCCESS |
Transaction state description | trade_state_desc | string[1,256] | Yes | Description of the current order status and guidance for the next operation Example:Payment failed. Please order again to make payment |
Merchant category code (MCC] | merchant_category_code | string[1,16] | Yes | Merchant category code Example:1011 |
+Payer | payer | object | No | Returned after successful payment. Payer information, which is detailed below |
+Order amount | amount | object | Yes | Returned after successful payment. Order amount information, which is detailed below |
+Promotion function | promotion_detail | object | No | Returned after successful payment. Promotion function information, which is detailed below |
{
"mchid": "10000091",
"appid": "wxcbda96de0b165486",
"out_trade_no": "1217752501201407033233368018",
"transaction_id": "1217752501201407033233368018",
"attach": "Custom data",
"trade_type": "PAP",
"bank_type": "WPHK",
"success_time": "2018-06-08T10:34:56+08:00",
"trade_state": "SUCCESS",
"trade_state_desc": "Payment failed. Please order again to make payment",
"merchant_category_code": "1011",
"payer": {
"openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6a"
},
"amount": {
"total": 888,
"payer_total": 888,
"currency": "CNY",
"payer_currency": "HKD",
"exchange_rate": {
"type": "SETTLEMENT_RATE",
"rate": 80000000
}
},
"scene_info": {
"device_id": "013467007045764",
"device_ip": "128.0.0.1"
},
"promotion_detail": [
{
"promotion_id": "109519",
"name": "Single item discount-6",
"scope": "SINGLE",
"type": "COUPON",
"amount": 5,
"currency": "HKD",
"activity_id": "931386",
"wxpay_contribute_amount": 100,
"merchant_contribute_amount": 100,
"other_contribute_amount": 5,
"goods_detail": {
"goods_id": "124512",
"goods_remark": "1001",
"discount_amount": 100,
"quantity": 1,
"price": 528800
}
}
]
}
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证