从JSON文件导入商品目录

您可以通过从JSON文件导入来创建、更新或禁用商品。

注:
您可以通过API调用手动在发布商帐户中创建、更新或禁用商品。但是,您需要对每个商品进行单独请求或操作。通过导入功能,您可以在一个JSON文件指定多个商品,从而同时对它们执行这些操作。

通过此工具,您可以:

功能:

  • 支持以下类型的商品:
    • 虚拟物品
    • 虚拟货币
    • 虚拟货币套餐
    • 捆绑包
  • 数据验证。如文件结构或数据格式不符合要求,导入时将看到以下错误列表。

限制:

注:
对于预先创建好的商品,可从CSV文件中导入区域价格

导入商品目录

要从文件导入商品目录:

  1. 发布商帐户中打开项目。
  2. 在侧边栏中,单击商店,然后前往虚拟货币虚拟物品捆绑包部分。
  3. 单击导入商品

  1. 选择操作:
    • 添加新商品 — 仅添加具有新SKU的商品。
    • 添加新商品并更新现有商品 — 将添加具有新SKU的商品,且将更新现有商品的数据。
    • 添加新商品,更新现有商品并禁用缺失的商品 — 将添加/更新文件中具有SKU的商品。如目录中有某个商品,但文件中没有SKU,则该商品在发布商帐户中的状态将变为部分可用 — 商品将无法单独购买,但可以作为捆绑包或奖励的一部分提供。

  1. 填充文件以便导入:
    • 在下载窗口中下载文件模板,根据下方示例进行填写。
    • 导出商品并用导出的文件作为模板。
    • 创建您自己的JSON文件并按照下方示例进行填写。

完整JSON文件示例:

Copy
Full screen
Small screen
  1{
  2    "virtual_currency": [
  3        {
  4            "sku": "Gem_test_import",
  5            "name": {
  6                "en": "Gem_test_import"
  7            },
  8            "type": "virtual_currency",
  9            "description": {
 10                "en": "my test imported currency"
 11            },
 12            "image_url": "https://cdn3.xsolla.com/img/misc/merchant/default-dc-image.png",
 13            "description": {
 14                "en": "my test imported currency",
 15                "de": "meine importierte Testwährung"
 16            },
 17            "attributes": [],
 18            "is_free": false,
 19            "order": 1,
 20            "groups": [],
 21            "regional_prices": [],
 22            "prices": [
 23                {
 24                    "amount": 2,
 25                    "currency": "USD",
 26                    "is_default": true,
 27                    "is_enabled": true
 28                }
 29            ],
 30            "media_list": [],
 31            "vc_prices": [],
 32            "is_enabled": true,
 33            "is_show_in_store": true,
 34            "regions": [],
 35            "limits": {
 36                "per_user": null,
 37                "per_item": null,
 38                "recurrent_schedule": null
 39            },
 40            "periods": [],
 41            "inventory_options": {
 42                "consumable": true,
 43                "expiration_period": null
 44            },
 45            "is_hard": false
 46        }
 47    ],
 48    "virtual_items": [
 49        {
 50            "sku": "event_access_test_import",
 51            "name": {
 52                "en": "Special Event Access_test_import"
 53            },
 54            "type": "virtual_good",
 55            "description": {
 56                "en": "Get special event access as a bonus only on your first purchase. Find the right doggy at the Robo-Dog Exhibition!"
 57            },
 58            "image_url": "https://cdn3.xsolla.com/img/misc/images/1e3ef1a96cc9dd8d98bc124d5d6fad79.png",
 59            "long_description": null,
 60            "attributes": [],
 61            "is_free": false,
 62            "order": 1,
 63            "groups": [
 64                "my_test_group"
 65            ],
 66            "regional_prices": [],
 67            "prices": [
 68                {
 69                    "amount": 35,
 70                    "currency": "USD",
 71                    "is_default": true,
 72                    "is_enabled": true
 73                }
 74            ],
 75            "media_list": [],
 76            "vc_prices": [],
 77            "is_enabled": true,
 78            "is_show_in_store": true,
 79            "regions": [],
 80            "limits": {
 81                "per_user": null,
 82                "per_item": null,
 83                "recurrent_schedule": null
 84            },
 85            "periods": [],
 86            "inventory_options": {
 87                "consumable": true,
 88                "expiration_period": null
 89            }
 90        }
 91    ],
 92    "virtual_currency_packages": [
 93        {
 94            "item_id": 441982,
 95            "sku": "small_gold_pack_test_import",
 96            "type": "bundle",
 97            "name": {
 98                "en": "Small gold pack"
 99            },
100            "bundle_type": "virtual_currency_package",
101            "description": {
102                "en": "Gold x100"
103            },
104            "image_url": "https://cdn3.xsolla.com/img/misc/images/ba43c46ea75fd5713c210f5736993a92.png",
105            "vc_prices": [],
106            "regional_prices": [],
107            "prices": [
108                {
109                    "amount": 5,
110                    "currency": "USD",
111                    "is_default": true,
112                    "is_enabled": true
113                }
114            ],
115            "is_enabled": true,
116            "is_show_in_store": true,
117            "regions": [],
118            "limits": {
119                "per_user": null,
120                "per_item": null,
121                "recurrent_schedule": null
122            },
123            "periods": [],
124            "attributes": [],
125            "long_description": null,
126            "media_list": [],
127            "order": 100000000,
128            "is_free": false,
129            "groups": [],
130            "content": [
131                {
132                    "sku": "Gem_test_import",
133                    "quantity": 100
134                }
135            ]
136        }
137    ],
138    "bundles": [
139        {
140            "item_id": 684024,
141            "sku": "start_pack_test_import_test_import",
142            "type": "bundle",
143            "name": {
144                "en": "Legendary Start Pack"
145            },
146            "bundle_type": "standard",
147            "description": {
148                "en": "Crystal x 1\nGem x 1"
149            },
150            "image_url": "https://cdn3.xsolla.com/img/misc/merchant/default-dc-image.png",
151            "regional_prices": [],
152            "prices": [
153                {
154                    "amount": 20,
155                    "currency": "USD",
156                    "is_default": true,
157                    "is_enabled": true
158                }
159            ],
160            "virtual_prices": [],
161            "is_enabled": true,
162            "is_show_in_store": true,
163            "regions": [],
164            "limits": {
165                "per_user": null,
166                "per_item": null,
167                "recurrent_schedule": null
168            },
169            "periods": [],
170            "attributes": [],
171            "long_description": null,
172            "media_list": [],
173            "order": 5,
174            "is_free": false,
175            "groups": [
176                "my_test_group"
177            ],
178            "content": [
179                {
180                    "sku": "Gem_test_import",
181                    "quantity": 1
182                },
183                {
184                    "sku": "event_access_test_import",
185                    "quantity": 1
186                }
187            ]
188        }
189    ]
190}

  1. 在导入窗口的相应字段中上传完整文件。
  2. 如导入过程中发生错误,导入窗口中将显示错误列表和改正建议。请对文件作出必要更改,然后重新上传。

成功上传后,具有指定SKU的商品将完成创建、更新或禁用。

注:
您可以使用通过JSON文件导入商品API调用来导入商品。
为避免导入过程中发生错误,请按照上文中的建议填充文件。

导出商品目录

要将一个商品或商品目录导出到JSON文件:

  1. 发布商帐户中打开项目。
  2. 在侧边栏中,单击商店,然后前往虚拟货币虚拟物品捆绑包部分。
  3. 单击导出商品

  1. 选择操作:
    • 导出全部商品 — 将导出包含该项目所有类型商品的完整目录。例如您前往虚拟货币部分并导出所有商品,JSON文件将导出项目的虚拟货币、虚拟货币套餐、虚拟物品和游戏密钥套餐。
    • 仅导出所选商品 — 在打开的窗口中选择要导出的商品。

  1. 单击导出

JSON文件将自动开始下载。

本文对您的有帮助吗?
谢谢!
我们还有其他可改进之处吗? 留言
非常抱歉
请说明为何本文没有帮助到您。 留言
感谢您的反馈!
我们会查看您的留言并运用它改进用户体验。
上次更新时间: 2025年4月2日

发现了错别字或其他内容错误? 请选择文本,然后按Ctrl+Enter。

报告问题
我们非常重视内容质量。您的反馈将帮助我们做得更好。
请留下邮箱以便我们后续跟进
感谢您的反馈!
无法发送您的反馈
请稍后重试或发送邮件至doc_feedback@xsolla.com与我们联系。