Obtaining the Refund Bill Download URL
Update Time:2025.01.07WeChat Pay provides funds-distribution refund files by day. Merchants can call this API to get the download URL for billing files. The files include the amount, time, and other information of the funds-distribution refunds, so merchants can check the status of transfers.
|
1. API Instructions
Applicable to:Common mode Institutional mode
Request URL:https://apihk.mch.weixin.qq.com/v3/global/profit-sharing/refunds/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 If a merchant is a directly linked merchant:
If the merchant is a service provider or institution:
Example:19000000001 |
Bill Date | bill_date | string[10, 10] | Yes | Query The Profit-sharing Downloading Reconciliation API can only download bills within 90 days. |
Request Example:
URL
3. Return Parameters
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Download URL | download_url | string[1, 2048] | 是 | The URL for downloading the billing files. The URL is valid for 30s. |
Response Example:
SUCCESS
Notes on File Format
A billing file consists of two parts: overview and details. Each part includes a header and a certain number of lines of data.
In the bill details, each line corresponds to a funds-distribution. A character is inserted before each data entry to prevent Excel from treating it as a number. If you need to sum amounts, you can remove the character using Replace All.
The headers are as follows: Refund apply time, Refund success time, Wechat refund number(refund_id), Vendor refund number(out_refund_no), Wechat order number(transaction_id), Vendor order number(out_transaction_id), Refund amount(refund_fee), Currency type, Coupon refund amount, Payer's refund amount, Payer's refund currency type, Rate, Refund source, Refund source type, Refund source amount, Refund source fee in CNY, Refund settlement currency type, Refund exchange rate, Refund source settlement amount, and Refund source fee in settlement currency type. See the following table for the definitions.
Variable | Field Name | Description |
---|---|---|
Refund apply time | Refund Application Time | The time at which the refund is initiated for the transaction. The format is YYYY-MM-DD HH:MM:SS. |
Refund success time | Refund Completion Time | The time at which the refund for the transaction is successful. The format is YYYY-MM-DD HH:MM:SS. |
Wechat refund number(refund_id) | WeChat Refund Number | The refund number that WeChat Pay assigned to the refund. |
Vendor refund number(out_refund_no) | Merchant Refund Number | The refund number that is entered by the merchant when the refund is initiated. |
Wechat order number(transaction_id) | WeChat Order Number | The order number that WeChat Pay assigned to the order corresponding to the refund. |
Vendor order number(out_transaction_id) | Merchant Order Number | The merchant order number of the order passed by the merchant (or the order corresponding to the refund). The field corresponds to the out_trade_no field of the order placement API. |
Refund amount(refund_fee) | Refund Amount | The refund amount in the priced currency. |
Currency type | Priced Currency | The three-letter ISO 4217 code for the priced currency. |
Coupon refund amount | Voucher or Discount Amount | The amount of the WeChat Pay voucher used for the order, including prepaid and non-prepaid vouchers (CNY, to two decimal places). |
Payer's refund amount | Refund Amount in Payment Currency | The total amount of the refund in the user's payment currency. |
Payer's refund currency type | Payment Currency Type | The three-letter ISO 4217 code for the user's payment currency. |
Rate | Fee Rate | The fee rate used to calculate this transaction (in percent). |
Refund source | Refund Source | The refund source of a funds-distribution. Enumerated values:
Example:ORDER_REFUNDABLE_BALANCE |
Refund source type | Refund Source Type | The refund source type of a funds-distribution. There are two types as follows:
Enumerated values:
Example:PACKAGE |
Refund source amount | Refund Amount (CNY) | The refund amount of each "Refund Source" item in a refund bill. |
Refund source fee in CNY | Refund Fee (CNY) | The fee incurred for each refund amount in a refund bill. |
Refund settlement currency type | Refund Settlement Currency | The three-letter ISO 4217 code for the currency in which the merchant initiated the refund. |
Refund exchange rate | Refund Exchange Rate | Take the exchange rate between the foreign currency and CNY and multiply it by 10 to the power of 8 to get this value. For example, if the exchange rate between USD and CNY is 6.5, the refund exchange rate is 650000000. |
Refund source settlement amount | Refund Amount for Settlement | The foreign currency amount for settlement corresponding to each refund amount in a refund bill.
Example:0.00 |
Refund source fee in settlement currency type | Refund Fee in Settlement Currency | The foreign currency fee for settlement corresponding to each refund amount in a refund bill.
Example:-0.00 |
Example Fields in a Bill
4. Error Codes
Error Codes | Error Message | Description | Solution |
---|---|---|---|
400 | NO_STATEMENT_EXIST | The requested billing file does not exist. | Check whether the current merchant account has a successfully processed funds-distribution order within the specified date. |
400 | STATEMENT_CREATING | Generating the bill. | Check whether the current merchant account has a successfully processed funds-distribution order within the specified date, and if so, download it again after 10:00 am on T+1 day. |
403 | NO_AUTH | The merchant parent-child relationship does not exist. Initiate the request with the correct Sub-Merchant ID. | Check if the Sub-Merchant ID (sub_mchid) is correct. |
403 | NO_AUTH | The merchant has not signed up for the overseas funds-distribution function. | See the product process and preparation before access, and check that the merchant has funds-distribution permission before initiating a request. |
403 | NO_AUTH | The merchant has enabled the funds-distribution function and is waiting for it to take effect. (In most cases, the function will take effect only on the next day.) | You cannot initiate a funds-distribution on the day that you enable the function. Initiate the request on the next day. |