# 请求退款 发送退款请求以向用户退款。详细过程请参阅退款功能。 注:您可以在沙盒模式下调用此API方法,方法是在请求中传入测试支付的数据。关于沙盒模式访问和测试场景的详细信息,请参阅说明。 注意此API调用不包含project_id路径参数,因此您需要使用在您公司的所有项目中都有效的API密钥来设置授权。 Endpoint: PUT /merchants/{merchant_id}/reports/transactions/{transaction_id}/refund Version: 2.0 Security: basicAuth ## Path parameters: - `merchant_id` (integer, required) 商户ID。 - `transaction_id` (integer, required) 交易ID。 ## Request fields (application/json): - `description` (string, required) 退款原因。 - `email` (string) 用户电子邮件。 ## Response 200 fields (application/json): - `message` (string) 可能返回以下消息之一: - No content. - The request for a refund has been accepted. Xsolla CS will manually complete the refund. It may take up to two business days. - The request for a refund has been accepted. Xsolla CS will automatically send the customer an email with alternative refund options as the user's method does not support direct refunds. ## Response 404 fields (application/json): - `message` (string) 交易ID无效。请检查支付凭据。否则请发送邮件至support@xsolla.com与艾克索拉支持人员联系。 ## Response 422 fields (application/json): - `message` (string) 可能返回以下消息之一: - We are processing the refund request. This may take up to two business days. - We are reaching the user for the information required for the refund. For details, contact Xsolla Support. - Incorrect payment status. Refund is possible only for payments with "completed" or "error" status. - To process this request, the customer's email address field must be filled. Please specify the customer's email address and try again. - Full refund is unavailable because there are successful partial refunds for this transaction. - Refund failed. Please contact Xsolla Support to process it manually. - Dispute for this invoice is already opened. Can’t make a refund yet. ## Response 204 fields ## Response 401 fields