Login expired. Please log in again.

Feedback

0/300

Feedback

Submitted successfully

ok

Feedback

Network exception, please try again later

ok

API Download Address for Bill

Latest update time:2023.10.24 Release notes

Merchant initiates a request to delete receiver. The settled funds of the merchant cannot be distributed to the deleted receiver.

Tips:

● Unsuccessful funds-distribution orders on the WeChat side will not be listed in the bill;

● The unit of amount in the bill is Yuan (CNY).

● The Profit-sharing Downloading Reconciliation API can only download bills within 90 days.

1. API Intro

Applicable object: Common mode Institutional mode

API rules:https://apihk.mch.weixin.qq.com/v3/global/profit-sharing/bill-download-url

Request method:GET


Pathparameter is a path parameter.
Queryparameter needs to be passed in the request URL.
Bodyparameter needs to be passed in the request JSON.

2. Request Parameters

Name Variable Name Type Required Description
Sub-merchant ID sub_mchid string[1, 32] No QuerySub-merchant ID allocated by WeChat Pay. It needs to be consistent with the sub-merchant ID in the transaction of WeChat Pay.
Note: Only forInstitutional mode
Example: 1900000109
Bill date bill_date string[10, 10] Yes QueryFormat: yyyy-MM-DD
The Profit-sharing Downloading Reconciliation API can only download bills within 90 days.
Example: 2020-01-01

Request Example


https://apihk.mch.weixin.qq.com/v3/global/profit-sharing/bill-download-url?sub_mchid=19000000001&bill_date=2020-01-01

{
    "account": "of8YZ6LPmjDmYAqdobIvwTdQQjR8",
    "appid": "wx78898sdfwe9888835", 
    "type": "PERSONAL_OPENID", 
    "sub_mchid": "999968480"
}

									{
										"stock_id": ".NET",
										"limit": 10,
									}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

3. Response Parameters

Name Variable Name Type Required Description
Download address download_url string[1, 2048] Yes The download address of the bill file for the next request is valid for 30 seconds
Example: https://apihk.mch.weixin.qq.com/v3/bill/downloadurl?token=xxx

Return Example


{
  "download_url": "https://apihk.mch.weixin.qq.com/v3/bill/downloadurl?token=xxx"
}

{
	"code": "SYSTEM_ERROR",
	"message": "Parameter error"
}

									{
										"stock_id": ".NET",
										"limit": 10,
									}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

File Format Description

• The bill file includes two parts: detailed data and summary data. Each part contains one line of header and several lines of specific data;

• In the detail data table, funds-distribution is recorded in each line , and each data is preceded by a character ` to avoid being processed by Excel. You can replace the character in batches to summarize the amount and other data.

• Data table header format:create_time,initiator,sponsor,sub_mchid,transaction_id,order_id,out_order_no,detaill_id,receiver_account,amount,currency,
settlement_amount,settlement_currency,exchange_rate,business_type,status,description; The explanations of the headers are in the following table:


Variable Parameter name Description
create_time Funds-distribution initiation time System acceptance time of the merchant's funds-distribution request/the system's unfreezing command
initiator Funds-distribution initiator If the funds-distribution is initiated by a merchant, the initiator is the merchant ID. If the funds-distribution is initiated by the system, the initiator is "System".
sponsor Funds-distribution sponsor The actual contributed merchant ID is the same as that of the settled funds account
sub_mchid Sub-merchant ID The sub-merchant ID of the transaction corresponding to the funds-distribution
transaction_id Weixin Pay order No. WeChat Pay transaction ID with funds-distribution mark
order_id WeChat order ID When requesting funds-distribution, WeChat returns the order ID to the merchant
out_order_no Merchant order No. When the merchant requests funds-distribution, the merchant order No. is generated. When the system unfreezes the remaining funds to sponsor, this field is null
detaill_id WeChat funds-distribution detail ID The transfer detail ID corresponding to the funds-distribution to the receiver at the merchant's request
receiver_account Account of receiver When the funds are distributed, there is an account of receiver. When the business_type=TO_SPONSOR, the receiver_account is null
amount Funds-distribution amount Actual amount of funds-distribution in the order
currency Distribution currency  
settlement_amount Settled funds amount outbound Only when business_type=TO_SPONSOR, there is settlement amount
settlement_currency Settlement currency Only when business_type=TO_SPONSOR, there is settlement amount
exchange_rate Exchange rate Only when business_type=TO_SPONSOR, there is settlement amount
business_type Business type Distribute funds: TO_ACCEPTOR; unfreeze the remaining funds: TO_SPONSOR
status Status "SUCCESS". Currently, only successful funds-distribution orders are listed in the bill.
description Funds-distribution description Funds-distribution description uploaded by the merchant. If the system initiates the unfreezing command, the description is "Unfreeze the remaining funds to sponsor"

• Summary table header format: total_count, total_amount_to_sponsor, total_amount_to_acceptor; Explanations of the headers are: total number of funds-distribution orders in the bill, total unfrozen funds amount released of the day, and total distributed funds amount of the day;

• There are empty lines between the data lines and the summary header.



create_time,initiator,sponsor,sub_mchid,transaction_id,order_id,out_order_no,detaill_id,receiver_account,amount,currency,settlement_amount,settlement_currency,exchange_rate,business_type,status,description
`2020-08-01 15:19:53,`1489578022,`1489578022,`1489578025,`4200001201202111086372797299,`7100010010202111091636447398824,`HX3804579307200708608,`7200010010202111091636447398823,`,`80.38,`CNY,`16.40,`AUD,`490176891,`TO_SPONSOR,`SUCCESS,`Unfreeze the remaining funds to sponsor

total_count,total_amount_to_sponsor,total_amount_to_acceptor
`1,`80.38,`0

{
    "account": "of8YZ6LPmjDmYAqdobIvwTdQQjR8",
    "appid": "wx78898sdfwe9888835", 
    "type": "PERSONAL_OPENID", 
    "sub_mchid": "999968480"
}

									{
										"stock_id": ".NET",
										"limit": 10,
									}

									{
										"stock_id": "Python",
										"stock_creator_mchid": "123456",
										"limit": 10,
									}

4. Error Code

Error Codes Error Message Description Solution
400 NO_STATEMENT_EXIST The requested bill file does not exist Check whether the current merchant ID has successful funds-distribution orders on the specified date
400 STATEMENT_CREATING Generating bill file Check whether the current merchant ID has successful funds-distribution orders within the specified date. If yes, download the file again after 10: 00 am on day T+1
403 NO_AUTH The parent-child relationship of the merchant does not exist. Please use correct sub-merchant ID to initiate the request Please check if the sub-merchant ID (sub_mchid) is filled in correctly
403 NO_AUTH The merchant has not signed the overseas funds-distribution product Refer to the product process and access preparation, confirm that the merchant has funds-distribution authorization, and initiate the request again
403 NO_AUTH The merchant has enabled the funds-distribution product and is waiting for it to take effect (Usually takes effect the next day) The funds-distribution function cannot be initiated on the first day. Please initiate the request on the next day




    Page Navigation

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

置顶