API Download Address for Bill

Update Time:2025.01.07

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

 

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.


2. Request Parameters

Name

Variable Name

Type

Required

Description

Sub-merchant ID

sub_mchid

string[1, 32]

No

Query Sub-merchant ID allocated by WeChat Pay. It needs to be consistent with the sub-merchant ID in the transaction of WeChat Pay.
Note: Only for Institutional mode
Example: 1900000109

Bill date

bill_date

string[10, 10]

Yes

Query Format: yyyy-MM-DD
The Profit-sharing Downloading Reconciliation API can only download bills within 90 days.
Example: 2020-01-01

Request Example

URL

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

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

SUCCESS

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

ERROR

1{
2	"code": "SYSTEM_ERROR",
3	"message": "Parameter error"
4}

 

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.

 

Example of bill

1create_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
2`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
3
4total_count,total_amount_to_sponsor,total_amount_to_acceptor
5`1,`80.38,`0

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

 

 

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2025 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global

Contact Us

Customer Service Tel

+86 571 95017

9:00-18:00 Monday-Friday GMT+8

Business Development

wxpayglobal@tencent.com

Developer Support

wepayTS@tencent.com

Wechat Pay Global

About Tenpay
Powered By Tencent & Tenpay Copyright© 2005-2025 Tenpay All Rights Reserved.