跳转到内容

概览

  • **版本:**2.0.0
  • 服务器
    • https://api.xsolla.com/api

支付中心通过向用户提供在游戏商店中进行游戏内购买支付时的便捷UI,让合作伙伴实现其游戏变现。要设置支付UI的打开,请参阅这些说明

Pay Station API提供以下调用组:

  • 令牌 — 包含使用任意用户参数生成令牌以便通过支付UI进行后续支付处理的API调用。
  • 令牌化 包含用于在不打开支付UI或无需用户介入的情况下安全处理支付的API调用。
  • 报告— 包含返回用户交易数据、生成报告及获取按货币分类的提现细目。
  • 退款 — 包含请求完全或部分退款的API调用。
  • 测试 — 包含测试拒付过程的API调用。

关于配置支付UI的详细信息,请参阅付款解决方案集成指南

注:

还可参阅Postman合集下的Xsolla Base API部分来测试用于集成的API调用。

下载 OpenAPI 描述
语言
服务器
Mock server
https://xsolla.redocly.app/_mock/zh/api/pay-station/
https://api.xsolla.com/merchant/v2/
操作
操作
操作
操作

请求

向用户发送部分退款请求。关于退款流程和支持部分退款的支付方式的详细信息,请参阅我们的文档

注:

您可以在沙盒模式下调用此API方法,方法是在请求中传入测试支付的数据。关于沙盒模式访问和测试场景的详细信息,请参阅说明

注意

此API调用不包含project_id路径参数,因此您需要使用在您公司的所有项目中都有效的API密钥来设置授权。

安全
basicAuth
路径
merchant_idinteger必需

商户ID。

transaction_idinteger必需

交易ID。

正文application/json必需
descriptionstring<= 4000 characters必需

退款原因。

refund_amountnumber(float)必需

以购买货币表示的退款金额。

curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/{transaction_id}/partial_refund' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "test refund request",
    "refund_amount": 1.5
  }'

响应

已接受退款请求

响应
无内容

请求

发送退款请求以向用户退款。详细过程请参阅退款功能

注:

您可以在沙盒模式下调用此API方法,方法是在请求中传入测试支付的数据。关于沙盒模式访问和测试场景的详细信息,请参阅说明

注意

此API调用不包含project_id路径参数,因此您需要使用在您公司的所有项目中都有效的API密钥来设置授权。

安全
basicAuth
路径
merchant_idinteger必需

商户ID。

transaction_idinteger必需

交易ID。

正文application/json必需
descriptionstring<= 4000 characters必需

退款原因。

emailstring<= 100 characters

用户电子邮件。

curl -i -X PUT \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/{transaction_id}/refund' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "test refund request"
  }'

响应

OK.

正文application/json
messagestring

可能返回以下消息之一:

  • 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.
响应
application/json
{ "message": "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." }
操作