# Submit a swipe payment
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: nontaxmicropay
When a payment request is submitted, WeChat returns the payment result synchronously.When the interface returns a system failure, wait 5 seconds to re-call to see the return code. When the result returns that a password is required in a user's payment, the interface can be recalled at intervals (10 seconds recommended) until there is a clear success, failure, or timeout (30 seconds recommended).
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/nontax/micropay?access_token=ACCESS_TOKEN
# Cloud Calls
- This interface does not support cloud calls
# Third party invocation
- Third Party Platform calls are not supported by this interface.
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
access_token | string | yes | Interface invoke credentials, using access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
appid | string | yes | appid |
bank_id | string | no | Bank ID (globally unique ID assigned by WeChat non-tax platform), randomly selected from the configured list of banks when not specified;The default production environment is not filled, the test environment needs to be filled |
bank_account | string | no | Split up bank account numbers (do not fill in those who do not use the splitting mechanism) |
mch_id | string | no | Specify the funds to be settled to mch_id. Can only be settled to mch_id bound under bank_id. Automatically select one from the mch_id bound under bank_id when not filled. |
desc | string | yes | Description (name of service) |
fee | number | yes | Total Amount (in units of units) |
user_name | string | no | User Name |
items | object | yes | Details of the sub-item of contributions |
payment_notice_create_time | number | yes | Payment Notice Creation Time (timestamp, in seconds) |
payment_expire_date | string | no | Payment Limit Date, Format YYYMMDD |
payment_notice_no | string | no | Payment Notice Number (Payment Notice number and order number must be chosen twice). If there is no payment notice number, fill in the order number) |
order_no | string | no | The order number. (The payment notice number and order number must be chosen.) If there is no payment notice number, fill in the order number) |
department_code | string | yes | Receipt unit code |
department_name | string | yes | Name of receiving unit |
payment_notice_type | number | no | Type of notification |
region_code | string | yes | Administrative division codes |
auth_code | string | yes | Scan the payment authorization code, and the device reads the user's barcode or QR code in WeChat (note: User barcode rule: 18 bits of pure digits, beginning with 10, 11, 12, 13, 14, 15) |
order_id | string | no | Order number (if the previous request had a return order number, please fill in it) |
# Body.itemsObject Payload
Details of the sub-item of contributions
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
no | number | yes | Item numbers, such as 1, 2, 3 |
item_id | string | yes | Project coding |
item_name | string | yes | Project Name |
overdue | number | no | Late payments (in units of units) |
penalty | number | no | Amount of additional penalty (in units of units) |
fee | number | yes | Amount (inclusive of late fees and additional penalties, in units of decimal units) |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | number | Return code |
errmsg | string | Return code description |
order_id | string | order number |
# 4. Note
There are no special considerations for this interface
# 5. Code examples
Example Requests
{
"appid": "wx5f6e43071809a9dd",
"bank_id": "test_bank_id",
"bank_account": "",
"desc": "测试办证缴费",
"fee": 1,
"user_name": "*三强",
"items": [
{
"no": 1,
"item_id": "000001",
"item_name": "测试办证缴费1",
"overdue": 0,
"fee": 1
},
{
"no": 2,
"item_id": "000002",
"item_name": "测试办证缴费2",
"overdue": 0,
"fee": 0
}
],
"payment_notice_create_time": 1500967298,
"payment_expire_date": "20190102",
"payment_notice_no": " 08111639088",
"department_code": "118610002",
"department_name": "测试执收单位",
"region_code": "440000",
"auth_code": " 134971951305811268"
}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"order_id": "AQAA_UjjdbLiUjMKDJ7fvb4AAAAA"
}
# 6. Error code
The following is a list of error codes for this interface, other error codes can refer to General error codes
Error code | Error Description | Solutions |
---|---|---|
40001 | invalid credential access_token isinvalid or not latest | access_token Invalid or not recently acquired access_token, please confirm the validity of the access_token |
# 7. Scope of application
Weixin Mini Program | Official Account | Service Account |
---|---|---|
Certification only | Certification only | Certification only |
- Authentication only: means that only authenticated accounts are allowed to be invoked by the enterprise entity, and accounts that are not authenticated or do not support authentication cannot be invoked.
- Other account types that are not expressly stated may not be called on this interface without special instructions;