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:2022.05.18 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).

API Intro

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

Request method:GET

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.

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 forInstitutional mode
Example:1900000109

Bill date

bill_date

string[10, 10]

Yes query Format: yyyy-MM-DD
Example:2020-01-01

Request Sample

Example:

https://api.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"
}

Return 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://api.mch.weixin.qq.com/v3/bill/downloadurl?token=xxx

Return Example


{
  "download_url": "https://api.mch.weixin.qq.com/v3/bill/downloadurl?token=xxx"
}
                                
{
"code":"SYSTEM_ERROR",
"message":"Parameter error"
}

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

Release notes

close
V1.0
2022.05.18
1. API Download Address for Bill released online

About  WeChat  Pay

Powered By Tencent & Tenpay Copyright©

2005-2024 Tenpay All Rights Reserved.

Contact Us
Wechat Pay Global

WeChat Pay Global