跳转到内容

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

Catalog API提供端点,用于管理您的游戏内商店目录并处理购买。使用这些端点配置虚拟物品、虚拟货币、游戏密钥、捆绑包、购物车和支付流程、物品属性,以及从外部来源导入物品。

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

获取商品导入状态Server-sideAdmin

请求

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

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
curl -i -X GET \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/catalog/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/catalog/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" }
操作
操作
操作

目录

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

操作
操作
操作