OK.
Pay Station API (2.0)
- **版本:**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/
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports?datetime_from=2023-02-08&datetime_to=2023-03-08'响应
application/json
[ { "agreement_document_id": "Organization Inc_RUB", "currency": "RUB", "is_direct_payout": false, "is_draft_by_agreement": true, "month": "January", "report_id": 57613, "year": 2019 }, { "agreement_document_id": "Organization Inc_EUR", "currency": "USD", "is_direct_payout": false, "is_draft_by_agreement": true, "month": "January", "report_id": 57619, "year": 2019 } ]
查询
开始日期,使用YYYY-MM-DD格式。如传入了以下任一参数,则此参数非必需:
transfer_idreport_id
示例: datetime_from=2023-02-08
结束日期,使用YYYY-MM-DD格式。如传入了以下任一参数,则此参数非必需:
transfer_idreport_id
datetime_from和datetime_to之间的间隔不得超过92天。 示例: datetime_to=2023-03-08
在册商户。可以是xsolla、merchant或不指定。如果为merchant,则返回通过合作伙伴直接帐户进行的交易。如果为xsolla,则返回非通过合作伙伴直接帐户进行的交易。如未指定,则返回所有交易。
| 枚举 值 | 描述 |
|---|---|
| merchant | 返回通过合作伙伴直接帐户进行的交易。 |
| xsolla | 返回非通过合作伙伴直接帐户进行交易。 |
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/registry.{format}
- https://api.xsolla.com/merchant/v3/merchants/{merchant_id}/reports/transactions/registry.{format}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/registry.{format}?datetime_from=2023-02-08&datetime_to=2023-03-08&in_transfer_currency=0&show_total=true&merchant_of_records=xsolla&project_id=0&show_dry_run=true&transfer_id=0&report_id=0&offset=0&limit=0&status=done'响应
application/json
[ { "payment_details": { … }, "purchase": { … }, "transaction": { … }, "user": { … }, "user_balance": { … } } ]
查询
存储在己侧的游戏内唯一用户ID。请确保传入现有用户ID。如遇到错误,请参阅常见问题回答。
一种交易状态。
| 枚举 值 | 描述 |
|---|---|
| awaitingRefund | 交易正在等待退款决定。用户申请退款后,艾克索拉客户支持将手动处理该申请并作出决定。 |
| canceled | 有两种可能场景:
|
| created | 用户发起了交易但交易尚未被处理。 |
| done | 交易已成功处理。 |
| error | 处理交易时发生了错误。此类支付可通过联系艾克索拉客户支持进行退款。 |
| partiallyRefunded | 用户收到了部分退款。 |
| processing | 交易正在处理中。 |
| refunded | 退款已退回用户的艾克索拉余额。 |
| review | 交易处理被反欺诈系统暂停,当前正对交易进行额外验核。 |
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/search.{format}
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/search.{format}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/search.{format}?datetime_from=string&datetime_to=string&project_id=0&transaction_id=0&type=all&phone=string&user_id=string&user_name=string&user_custom=string&email=string&external_id=string&order_id=1234&offset=0&limit=0&status=created'响应
application/json
[ { "payment_details": { … }, "payment_system": { … }, "purchase": { … }, "transaction": { … }, "user": { … } } ]
请求
在几秒钟内基于特定搜索参数获取交易列表。此为以JSON、CSV或XLS格式返回该数据的查找交易API调用的另一选择。
注意
此API调用不包含project_id路径参数,因此您需要使用在您公司的所有项目中都有效的API密钥来设置授权。
安全
basicAuth
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/simple_search
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/simple_search
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/simple_search?transaction_id=0&external_id=string'响应
application/json
[ { "payment_details": { … }, "transaction": { … }, "user": { … } } ]
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/summary/transfer
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/summary/transfer
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/summary/transfer?datetime_from=string&datetime_to=string&legal_entity_id=0&status=done'响应
application/json
[ { "DirectTaxesOfPayments": 0.46, "IsoCurrency": "RUB", "PaymentsAmount": 223679.84, "SumCommissionAgent": 11329.58, "SumCommissionUserTaxes": 153.67, "SumItems": 571325.13, "SumNominalSum": 214792.98, "SumOutProject": 551096.13, "SumPayoutSum": 193316.71, "TaxesOfPayments": 171.56 }, { "DirectTaxesOfPayments": 0.14, "IsoCurrency": "USD", "PaymentsAmount": 482.58, "SumCommissionAgent": 77.51, "SumCommissionUserTaxes": 0.07, "SumItems": 243777.62, "SumNominalSum": 493.09, "SumOutProject": 241787.62, "SumPayoutSum": 462.62, "TaxesOfPayments": 0.14 }, { "DirectTaxesOfPayments": 0.07, "IsoCurrency": "EUR", "PaymentsAmount": 608.2, "SumCommissionAgent": 55.71, "SumCommissionUserTaxes": 90.94, "SumItems": 156238.62, "SumNominalSum": 607.26, "SumOutProject": 156158.62, "SumPayoutSum": 460.8, "TaxesOfPayments": 90.94 } ]
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/{transaction_id}/details
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/{transaction_id}/details
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transactions/{transaction_id}/details'响应
application/json
[ { "customer_details": { … }, "finance_details": { … }, "payment_details": { … }, "subscription_details": { … }, "transaction_details": { … } } ]
- Mock serverhttps://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transfers
- https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transfers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://xsolla.redocly.app/_mock/zh/api/pay-station/merchants/{merchant_id}/reports/transfers?datetime_from=string&datetime_to=string&legal_entity_id=0&status=hold'响应
application/json
[ { "canceled": 0, "payout": { … }, "rate": 1, "transfer": { … } } ]