跳转到内容

概览

  • Version: 2.0
  • 服务器https://api.xsolla.com/merchant/v2/

本API参考介绍管理订阅、优惠券和促销活动的端点。 如需了解关于订阅的详细信息,请参考产品指南词汇表

下载 OpenAPI 描述
语言
服务器
Mock server
https://xsolla.redocly.app/_mock/zh/api/subscriptions/
操作
操作
操作
操作
操作
操作

请求

所有促销活动的列表。

注意

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

安全
basicAuth
路径
merchant_idinteger必需

商户ID。

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/merchants/{merchant_id}/promotions'

响应

OK.

正文application/json
响应
application/json
[ { "datetime": {}, "enabled": true, "id": 17840, "is_active": true, "is_infinite": false, "project": {}, "read_only": false, "technical_name": "christmas" }, { "datetime": null, "enabled": false, "id": 17891, "is_active": false, "is_infinite": true, "project": {}, "read_only": false, "technical_name": "Sale promotion" } ]

请求

创建一个新的推广。

注意

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

安全
basicAuth
路径
merchant_idinteger必需

商户ID。

正文application/json必需
descriptionobject

本地化促销描述数组。

labelobject

本地化标签数组,显示在支付 UI 中。

nameobject

本地化促销名称数组。

project_idinteger必需

项目ID。

technical_namestring必需

促销活动的技术名称。

enabledboolean
idinteger
read_onlyboolean
show_bannerboolean
curl -i -X POST \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/merchants/{merchant_id}/promotions' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": {
      "en": "Promotion with 30% discount",
      "ru": "Акция со скидкой 30%"
    },
    "label": {
      "en": "30%",
      "ru": "30%"
    },
    "name": {
      "en": "30% discount",
      "ru": "скидка 30%"
    },
    "project_id": 12345,
    "technical_name": "Sale promotion"
  }'

响应

Created.

正文application/json
idinteger

促销活动 ID。

响应
application/json
{ "id": 17890 }

请求

删除提升。 您只能使用enabled=false删除促销活动。

注意

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

安全
basicAuth
路径
merchant_idinteger必需

商户ID。

promotion_idinteger必需

促销活动 ID。

curl -i -X DELETE \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/subscriptions/merchants/{merchant_id}/promotions/{promotion_id}'

响应

No content.

操作
操作