Create Withdrawal Order

View Markdown

Last edited on 2026-03-30

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: create_withdraw_order

This API is used to create a withdrawal order.

1. Call Method

HTTPS Call

POST https://api.weixin.qq.com/xpay/create_withdraw_order?access_token=ACCESS_TOKEN&pay_sig=PAY_SIG

Cloud Call

  • This API does not support cloud call.

Third-party Call

  • This API supports third-party platforms on behalf of Merchant call.

  • The permission set ID of this API is: 157

  • After the service provider obtains one of the permission set authorizations, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredExampleDescription
access_tokenstringYesACCESS_TOKENAPI call credential, you can use access_token, authorizer_access_token
pay_sigstringYes-Payment signature

Request Body Request Payload

ParameterTypeRequiredDescription
withdraw_nostringYesWithdrawal order ID. Length must be between [8,32]. Only letters, numbers, '\_', and '-' are allowed.
withdraw_amountstringYesWithdrawal amount in CNY (yuan). For example, use 0.01 to withdraw 1 cent. This parameter is optional; if omitted, it indicates a full balance withdrawal.
envnumberYes0 - Production environment; 1 - Sandbox environment

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
errcodenumberError code
errmsgstringError message
withdraw_nostringWithdrawal order ID
wx_withdraw_nostringWeChat-side order ID for the withdrawal order

4. Notes

Use Payment Signature

Payment Signature

The signature parameter is pay_sig, which should be appended to the query string.

For example, if the API endpoint is: https://api.weixin.qq.com/xpay/query_user_balance?access_token=xxxx

After adding the signature, it must be passed as: https://api.weixin.qq.com/xpay/query_user_balance?access_token=xxxx&pay_sig=xxx

5. Code Example

No code example for this API

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError Description
-1System error
268490001Invalid openid
268490002Invalid request parameter field. Refer to errmsg for details.
268490003Signature error
268490004Duplicate operation (returned by gift, token payment, and ad credit recharge related APIs, indicating that the previous operation was successful)
268490005The order has already been refunded via the cancel_currency_pay API; further refunds are not supported.
268490006Insufficient token balance for refund/payment operation
268490007Images or text contain sensitive content and are prohibited.
268490008Token is not published; token operations are not allowed.
268490009User session_key does not exist or has expired. Please log in again.
268490011Data is being generated. Please call this API later to retrieve it.
268490012Batch task is running. Please wait for completion before running again.
268490013Refunds are prohibited for orders in verified status.
268490014Refund operation is in progress. Please retry with the same parameters later.
268490015Rate limit exceeded
268490016The left_fee field in the refund request does not match the actual value. Please query and confirm via the query_order API.
268490018Industry ID of the ad credit recharge account does not match
268490019Ad credit recharge account ID is already bound to another appid
268490020Invalid subject name for the ad credit recharge account
268490021Account onboarding is incomplete
268490022Invalid ad credit recharge account
268490023Insufficient ad credit balance
268490024Ad credit recharge amount must be greater than 0

7. Applicable Scope

The callable account types for this API are not yet clear, or are determined by the calling parameters in business. Please refer to the actual calling situation.