跳转到内容

Overview

  • Version: 2.0.0
  • Servers: https://store.xsolla.com/api
  • Contact Us by Email
  • Contact URL: https://xsolla.com/
  • Required TLS version: 1.2

Shop Builder API provides a third-party solution for implementing the server side for your store interface. Use the endpoints to manage in-game items, in-game currencies, cart, player inventory, promotions, game library, etc.

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

个性化目录

此API可让您针对用户属性指定规则。如果用户满足具体规则的所有条件,则会显示个性化商品。

有关个性化促销活动的信息,请参阅促销活动部分

要在购买前传递属性,您可以使用艾克索拉Login API或在使Pay Station API生成令牌时将它们传入user.attributes属性

操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作

目录

本API允许获取任意类型的可售商品或指定商品。

操作
操作
操作
操作
操作
操作

优惠券

此API让您可以管理优惠券。

操作

促销码

此API让您可以管理促销码。

操作

特别目录优惠

此API让您可以管理特别目录优惠活动。

操作

折扣

此API让您可以管理折扣促销活动。

操作

奖励

此API让您可以管理奖励促销活动。

操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作

获取商品导入状态Server-sideAdmin

请求

检索将商品导入项目的进度信息。此API调用检索通过API或发布商帐户执行的最后一次导入的数据。

安全
basicAuth
路径
project_idinteger必需

项目ID。您可以在您的发布商帐户项目名称旁边找到。

示例: 44056
curl -i -X GET \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v1/admin/projects/44056/connectors/import_items/import/status

响应

已成功检索导入状态。

正文application/json
date_completedstring

导入操作完成的时间戳(GMT+3 时区)。如果导入因错误而中断且未导入任何项,则将返回空字符串。

示例: "2024-11-19T15:27:31+03:00"
date_createdstring

创建导入操作的时间戳(GMT+3 时区)。

示例: "2024-11-19T14:27:31+03:00"
date_updatedstring

由于错误而导致导入中断的时间戳(GMT+3 时区)。

示例: "2024-11-19T15:27:31+03:00"
errorstring

一般导入错误的描述。

error_codestring

一般导入错误的代码。

progressinteger

导入执行的进度(以百分比表示)。

示例: 100
resultobject

包含特定商品SKU的导入结果和导入错误数据的对象。

示例: {"errors_by_sku":[{"error_code":4055,"error_message":"[0401-4055]: Item default price not set","sku":"com.xsolla.sword_1","type":"virtual_items"},{"error_code":1817,"error_message":"[0410-1817]: SKU can't be empty","sku":"","type":null}],"errors_count":2,"total_entities_count":10}
statusstring

导入状态。

枚举 值描述
done

导入成功。

error

由于发生错误,导入未完成或仅部分完成。

initialized

已发起导入。

process

导入正在进行中。

示例: "error"
响应
application/json
{ "date_completed": "2024-11-19T15:27:31+03:00", "date_created": "2024-11-19T14:27:31+03:00", "date_updated": "2024-11-19T15:27:31+03:00", "error": null, "error_code": null, "progress": 100, "result": { "errors_by_sku": [], "errors_count": 2, "total_entities_count": 10 }, "status": "error" }

通过JSON文件导入商品Server-sideAdmin

请求

通过指定的URL从JSON文件将商品导入商店。关于从JSON文件导入的更多信息,请参阅文档

安全
basicAuth
路径
project_idinteger必需

项目ID。您可以在您的发布商帐户项目名称旁边找到。

示例: 44056
正文application/json
connector_external_idstring必需

指定导入项操作类型的固定值。

"import_items"
file_urlstring必需

包含JSON格式数据的文件的URL。该文件应托管在具有公共访问权限的存储服务上。您可以在发布商帐户的商店 > 虚拟物品 > 目录管理 > 导入商品 (JSON)部分中下载文件模板。

示例: "https://my-bucket.s3.amazonaws.com/items.json"
modestring

导入操作:

默认值 "create_and_update"
枚举 值描述
create

添加新项。

create_and_update

添加新项并更新现有项。

sync

添加新项、更新现有项并禁用缺失项。

curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v1/projects/44056/import/from_external_file \
  -H 'Content-Type: application/json' \
  -d '{
    "connector_external_id": "import_items",
    "file_url": "https://my-bucket.s3.amazonaws.com/items.json",
    "mode": "create"
  }'

响应

该文件已成功导入并正在处理。

正文application/json
import_idstring

导入操作ID。如果在导入JSON文件时遇到困难,请将此ID报告给您的客户成功经理或发送电子邮件至csm@xsolla.com。

示例: "af9f3638a16e11ef880da2cd677d2d24"
响应
application/json
{ "import_id": "af9f3638a16e11ef880da2cd677d2d24" }