Property | Type | Required | Description |
out_trade_no | string | True | Order number. |
Property | Type | Required | Description |
appid | string | True | Mini program ID. |
mch_id | string | True | Merchant account, provided when the merchant places the order. |
out_trade_no | string | True | Merchant order number, provided when the merchant places the order. |
transaction_id | string | False | Unique identifier of the payment order, which is returned when the order is paid successfully. |
trade_type | string | False | Transaction type: JSAPI for mini program payments. |
trade_state | string | True | Transaction status: WAIT_PAY - Awaiting payment Success - Payment successful CLOSED - Order closed AUTO_CLOSED - Order automatically closed due to expiration REFUND - Refunded PAY_ERROR - Payment failed |
bank_type | string | False | Bank code. Non-bank card payment types are uniformly marked as OTHERS. |
attach | string | False | Merchant data packet, custom data provided by the merchant when placing the order, not visible to the user, up to 256 characters. If provided, it will be returned as-is in this API, payment success callback notification, and transaction bill. If not provided, it will not be returned. |
success_time | string | False | Payment completion time. It follows the RFC 3339 standard format: yyyy-MM-DDTHH:mm:ss+TIMEZONE. yyyy-MM-DD represents the date; T separates the date and time; HH:mm:ss represents the time; TIMEZONE represents the time zone (e.g., +08:00 for Beijing time). |
payer | payer | False | Information about the payer, returned when the order is paid successfully. |
amount | orderAmount | False | Order amount. |
{"appid": "mpco56h12e6e52hj","mch_id": "mi_7b0a5e40f9","out_trade_no": "2b695106b888d14328d9","transaction_id": "pi1738915449351wbrgic93qlahw34134wjr","trade_type": "JSAP","trade_state": "SUCCESS","bank_type": "OTHERS","attach": "attch info","success_time": "2025-02-28T10:34:56+08:00","payer": {"openid": "o910d4edeee717377adguZS89513"},"amount": {"payer_total": "88800","total": 88800,"currency": "USD","payer_currency": "USD"}}
Property | Type | Required | Description |
out_trade_no | string | True | Merchant order number, provided when the merchant places the order. |
mchid | string | True | Merchant account, provided when the merchant places the order. |
Property | Type | Required | Description |
204 No Content
Property | Type | Required | Description |
appid | string | True | Mini program ID. |
description | string | True | Product description, up to 127 characters. |
out_trade_no | string | True | Internal order number in the merchant system, must be 6-32 characters long, can only include numbers, uppercase and lowercase letters, _-|*, and must be unique within the same merchant ID. |
time_expire | string | True | 1. Definition: The payment end time is the last time the user can complete the payment for this order, not the order closing time. After this time, the user will not be able to pay for the order. To close an order, call the order closing API. 2. Format requirements: The payment end time shall follow the RFC 3339 standard format: yyyy-MM-DDTHH:mm:ss+TIMEZONE. yyyy-MM-DD represents the date; T separates the date and time; HH:mm:ss represents the time; TIMEZONE represents the time zone (e.g., +08:00 for Beijing time). 3. Parameters can only be configured when the user first places an order, and subsequent modifications are not allowed, attempts to modify will result in errors. If the actual payment time exceeds the set payment end time, the merchant needs to place a new order with a new merchant order number for the user to pay. If the payment end time has not been exceeded, the original parameters can be used to request the order API again to get the latest prepay_id for payment. The payment end time cannot be earlier than 1 minute after the order time. If the set payment end time is earlier, the system will automatically adjust it to 1 minute after the order time. |
attach | string | False | Custom data packet provided by the merchant when creating the order, not visible to the user, used to store merchant custom information related to the order, with a total length limit of 128 characters. This field will be returned to the merchant in the order query API and payment success callback notification, and will also appear in the transaction bill. |
notify_url | string | True | The URL where the merchant receives payment success callback notifications. It must comply with the notify_url specification. |
amount | amount | True | Order amount. |
payer | payer | True | Payer information. |
detail | detail | True | Discount feature. |
Property | Type | Required | Description |
prepay_id | string | True | Prepay transaction session identifier, required for JSAPI or mini program payment initiation, valid for 2 hours. If it expires, a new prepay_id must be requested by calling this API again. |
{"prepay_id":"pi173898442419368bhz26jn4rikpwzr1akn"}
Property | Type | Required | Description |
id | string | True | Unique identifier for the callback notification. |
create_time | string | True | The time when the callback notification was created. Format: Follow the RFC 3339 standard format: yyyy-MM-DDTHH:mm:ss+TIMEZONE. yyyy-MM-DD represents the year, month, and day. the “T” character is used to separate the date and time portions. HH:mm:ss represents the specific hour, minute, and second. TIMEZONE represents the time zone (for example, +08:00 corresponds to the East 8th Zone time, which is Beijing Time). Example: 2015-05-20T13:29:35+08:00 represents 13:29:35 on May 20, 2015 (Beijing time). |
resource_type | string | True | Resource data type of the notification. It is fixed as encrypt-resource. |
event_type | string | True | Type of payment callback notification. For successful payment notifications, the type is TRANSACTION.SUCCESS. |
pay_model | string | False | Type of payment bank card, OTHERS for non-bank card payments. |
summary | string | True | The summary note for callback content in the payment system, limited to 64 characters. |
resource | paymentNotifyResource | True | Notification resource data. |
Property | Type | Required | Description |
ok | string | True | - |
{"ok"}
Property | Type | Required | Description |
original_type | string | True | Original callback type: The object type before encryption, which is transaction. |
algorithm | string | True | Encryption algorithm type: The encryption algorithm type for the callback data ciphertext. It is currently AEAD_AES_256_GCM. Developers need to use the same type of data for decryption. |
ciphertext | string | True | Data ciphertext: The Base64-encoded ciphertext of the callback data. Merchants need to Base64 decode and decrypt it. |
associated_data | string | False | Additional data: Additional data involved in decryption. This field may be empty. |
nonce | string | True | Random string: The random string involved in decryption. |
Property | Type | Required | Description |
cost_price | integer | False | Original price of the order. |
goods_detail | array[goods_detail] | False | List of individual product details. |
Property | Type | Required | Description |
merchant_goods_id | string | False | Unified product ID defined by the payment system (optional). |
goods_name | string | False | Actual name of the product. |
quantity | integer | True | Quantity of products purchased by the user. |
unit_price | integer | True | Integer, unit: cents. If the merchant offers a discount, the discounted unit price should be provided (e.g., if a user uses a 100-50 coupon on a 100 USD order, the unit price of the promotional product should be the original unit price minus 50). |
Property | Type | Required | Description |
openid | string | False | Unique identifier for the user under the merchant's appid. |
Property | Type | Required | Description |
payer_total | string | False | Total order amount (in cents). |
total | interger | False | Actual amount paid by the user, an integer value, in cents. User payment amount = total amount - voucher amount. |
currency | string | False | Currency type: CNY - Chinese Yuan, USD - US Dollar. |
payer_currency | string | False | User payment currency: CNY - Chinese Yuan, USD - US Dollar. |
Property | Type | Required | Description |
total | interger | False | Actual amount paid by the user, an integer value, in cents. User payment amount = total amount - voucher amount. |
currency | string | False | Currency type: CNY - Chinese Yuan, USD - US Dollar. |
Error description | Error example |
URL only contains a domain, missing a specific path. | http://www.weixin.qq.com |
URL does not start with https:// or http://, missing domain or IP. | ./PayNotify.aspx |
URL contains a local or internal network IP. | http://127.0.0.1/pay/notify.php |
Non-URL formatted string. | xxxxxxx, 1234567, test |