# 获取游戏列表（管理）

获取项目中的游戏列表以进行管理。
游戏由可供用户购买的游戏Key组成。

注：请勿使用此接口来构建商店商品目录。

Endpoint: GET /v2/project/{project_id}/admin/items/game
Version: 2.0.0
Security: basicAuth

## Path parameters:

  - `project_id` (integer, required)
    项目ID。您可以在发布商帐户的项目名称旁找到此参数；使用项目时，也可以在浏览器地址栏中找到此参数。URL格式如下：https://publisher.xsolla.com//projects/。
    Example: 44056

## Query parameters:

  - `limit` (integer)
    页面上元素数量的限制。
    Example: 50

  - `offset` (integer)
    生成列表时作为起始位置的元素编号（从0开始计数）。

  - `promo_code` (string)
    区分大小写的唯一兑换码。包含字母和数字。
    Example: "WINTER2021"

## Response 200 fields (application/json):

  - `has_more` (boolean)
    用作指示还有更多页面。

  - `total_items_count` (integer)
    系统中的商品总数。

  - `items` (array)

  - `items.item_id` (integer)
    创建商品时提供的内部唯一商品ID。
    Example: 1

  - `items.sku` (string)
    唯一商品ID。SKU只能包含大小写英文字母、数字、句点、短横线和下划线。
    Example: "game_1"

  - `items.type` (string)
    商品类型。此情况下始终为unit。
    Example: "unit"

  - `items.name` (object,null)
    包含商品本地化名称的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的语言代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `items.description` (object,null)
    包含本地化商品描述的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的区域设置代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `items.long_description` (object,null)
    包含商品详细本地化描述的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的区域设置代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `items.image_url` (string)
    图片URL。
    Example: "https://image.example.com"

  - `items.media_list` (array)
    游戏的附加资源，例如屏幕截图、游戏视频等。
    Example: [{"type":"image","url":"https://cdn3.xsolla.com/img/misc/images/71ab1e12126f2103e1868076f0acb21a.jpg"}]

  - `items.media_list.type` (string)
    媒体类型：image/video。
    Enum: "image", "video"

  - `items.media_list.url` (string)
    资源文件。
    Example: "https://cdn3.xsolla.com/img/misc/images/71ab1e12126f2103e1868076f0acb21a.jpg"

  - `items.is_enabled` (boolean)
    如果禁用，则无法购买该商品，也无法通过物品库访问该商品。

  - `items.is_show_in_store` (boolean)
    商品可供购买。

  - `items.order` (integer)
    游戏在列表中的排序优先级。
    Example: 1

  - `items.groups` (array)
    商品所属分组。
    Example: [{"external_id":"horror","name":{"en":"Horror"}}]

  - `items.groups.external_id` (string)
    Example: "horror"

  - `items.groups.name` (object)
    Example: {"en":"Horror"}

  - `items.attributes` (array)
    属性列表。
    Example: [{"external_id":"attribute_external_id","name":{"en":"Attribute name","de":"Attributname"},"values":[{"external_id":"value_1","name":{"en":"value 1","de":"wert 1"}},{"external_id":"value_2","name":{"en":"value 2","de":"wert 2"}}]}]

  - `items.attributes.external_id` (string, required)
    唯一属性ID。 external_id只能包含大小写英文字母、数字、短横线和下划线。
    Example: "attribute_external_id"

  - `items.attributes.name` (object)
    包含属性本地化名称的对象。编码按照ISO 3166-1的规定。
    Example: {"en":"Attribute name","de":"Attributname"}

  - `items.attributes.values` (array, required)
    Example: [{"external_id":"value_1","name":{"en":"value 1","de":"wert 1"}},{"external_id":"value_2","name":{"en":"value 2","de":"wert 2"}}]

  - `items.attributes.values.external_id` (string, required)
    属性的唯一值ID。 external_id只能包含小写英文字母、数字、短横线和下划线。
    Example: "value_external_id"

  - `items.attributes.values.value` (object, required)
    包含值本地化名称的对象。编码按照ISO 3166-1的规定。

  - `items.is_free` (boolean)
    该商品是否免费。

  - `items.unit_items` (array)
    用于不同DRM的游戏Key。

  - `items.unit_items.item_id` (integer)
    创建商品时提供的内部唯一商品ID。
    Example: 1

  - `items.unit_items.sku` (string)
    唯一商品ID。SKU只能包含大小写英文字母、数字、句点、短横线和下划线。
    Example: "game_1"

  - `items.unit_items.type` (string)
    商品类型。此情况下始终为game_key。
    Example: "game_key"

  - `items.unit_items.is_free` (boolean)
    该商品是否免费。

  - `items.unit_items.prices` (array)
    以真实货币表示的价格。
    Example: [{"amount":1299.99,"currency":"RUB","is_default":true,"is_enabled":true}]

  - `items.unit_items.prices.amount` (number)
    Example: 1299.99

  - `items.unit_items.prices.currency` (string)
    商品价格币种。符合[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)标准的三字母代码。
    Example: "RUB"

  - `items.unit_items.prices.is_default` (boolean)
    如果未指定用户币种的价格，则使用默认价格生成商品目录。

  - `items.unit_items.prices.is_enabled` (boolean)

  - `items.unit_items.prices.country_iso` (string,null)
    适用此价格的国家/地区。符合[ISO 3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)的两字母代码。
    Example: "US"

  - `items.unit_items.virtual_prices` (array,null)
    Example: [{"sku":"com.xsolla.gold_1","name":{"en":"Gold"},"type":"virtual_currency","description":null,"image_url":"https://i.pinimg.com/originals/91/ae/56/91ae5683045f6dbef16b1482bade938f.png","amount":1000,"is_default":true}]

  - `items.unit_items.virtual_prices.sku` (string)
    唯一商品ID。SKU只能包含大小写英文字母、数字、句点、短横线和下划线。
    Example: "gold"

  - `items.unit_items.virtual_prices.name` (object)
    包含虚拟货币本地化名称的对象。编码按照ISO 3166-1的规定。
    Example: {"en":"Gold"}

  - `items.unit_items.virtual_prices.type` (string)
    商品类型。此情况下始终为virtual_currency。
    Example: "virtual_currency"

  - `items.unit_items.virtual_prices.description` (object,null)
    包含本地化游戏描述的对象。编码按照ISO 3166-1的规定。
    Example: {"en":"Game 1 Example"}

  - `items.unit_items.virtual_prices.image_url` (string)
    图片URL。
    Example: "https://image.example.com"

  - `items.unit_items.virtual_prices.amount` (number)

  - `items.unit_items.virtual_prices.is_default` (boolean)

  - `items.unit_items.order` (integer)
    游戏在列表中的排序优先级。
    Example: 1

  - `items.unit_items.is_enabled` (boolean)
    如果禁用，则无法购买该商品，也无法通过物品库访问该商品。

  - `items.unit_items.is_show_in_store` (boolean)
    商品可供购买。

  - `items.unit_items.drm_name` (string)
    游戏Key DRM名称。
    Example: "Steam"

  - `items.unit_items.drm_sku` (string)
    DRM唯一ID。
    Example: "steam"

  - `items.unit_items.drm_image` (string,null)
    游戏Key DRM图标。
    Example: "https://upload.wikimedia.org/wikipedia/en/4/48/Steam_Icon_2014.png"

  - `items.unit_items.drm_id` (integer)
    DRM内部唯一ID。
    Example: 1

  - `items.unit_items.keys` (object)

  - `items.unit_items.keys.available` (integer)
    可供购买的游戏Key数量。

  - `items.unit_items.keys.total` (integer)
    上传的游戏Key总数。

  - `items.unit_items.keys.used` (integer)
    已售的游戏Key数量。

  - `items.unit_items.is_sales_exist` (boolean)
    如果为true，则该游戏Key已被用户购买。

  - `items.unit_items.pre_order` (object)
    预售设置。

  - `items.unit_items.pre_order.release_date` (string,null)
    游戏Key发布日期，采用ISO 8601格式。

  - `items.unit_items.pre_order.is_enabled` (boolean)
    如果禁用，则该商品不是预售商品。

  - `items.unit_items.pre_order.description` (string,null)
    预订的附加信息，将通过电子邮件发送。

  - `items.unit_items.regions` (array)

  - `items.unit_items.regions.id` (integer)
    Example: 1

  - `items.unit_items.limits` (object,null)
    商品限制数。

  - `items.unit_items.limits.per_user` (object,null)
    单个用户的商品限制数。

  - `items.unit_items.limits.per_user.total` (integer)
    单个用户可购买的最大商品数量。

  - `items.unit_items.limits.per_user.limit_exceeded_visibility` (string)
    设定商品在达到购买限制后、下次限制重置前在商品目录中的可见性。

适用于在recurrent_schedule数组中配置了周期性重置数量限制的商品。

如果未配置重置限制，则达到购买限制后，无论limit_exceeded_visibility的值如何，该商品都不会显示在商品目录中。

可能值：
- show — 达到购买限制后，商品目录检索API调用仍会返回该商品。在客户端侧
商品目录检索API调用中，达到限制后返回的商品会带有can_be_bought: false 标志。下一次重置日期
将在reset_next_date中返回。
- hide — 达到购买限制后，在限制
重置之前，商品目录检索API调用不会返回该商品。
    Enum: "show", "hide"

  - `items.unit_items.limits.per_item` (object,null)
    全局商品限制数。

  - `items.unit_items.limits.per_item.total` (integer)
    所有用户可购买的最大商品数量。

  - `items.unit_items.limits.per_item.available` (integer)
    所有用户还可购买的剩余商品数量。

  - `items.unit_items.limits.per_item.reserved` (integer)

  - `items.unit_items.limits.per_item.sold` (integer)

  - `items.unit_items.limits.recurrent_schedule` (object,null)
    限制数刷新周期。

  - `items.unit_items.limits.recurrent_schedule.per_user` (any)
    用户的限制数刷新周期。

  - `items.unit_items.periods` (array)
    商品销售期。

  - `items.unit_items.periods.date_from` (string,null)
    指定商品开始可购的日期。
    Example: "2020-08-11T10:00:00+03:00"

  - `items.unit_items.periods.date_until` (string,null)
    指定商品停止可购的日期。可为null。
    Example: "2020-08-11T20:00:00+03:00"

  - `items.unit_items.name` (object,null)
    包含商品本地化名称的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的语言代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `items.unit_items.attributes` (array)
    属性列表。
    Example: [{"external_id":"attribute_external_id","name":{"en":"Attribute name","de":"Attributname"},"values":[{"external_id":"value_1","name":{"en":"value 1","de":"wert 1"}},{"external_id":"value_2","name":{"en":"value 2","de":"wert 2"}}]}]

  - `items.unit_items.attributes.external_id` (string, required)
    唯一属性ID。 external_id只能包含大小写英文字母、数字、短横线和下划线。
    Example: "attribute_external_id"

  - `items.unit_items.attributes.name` (object)
    包含属性本地化名称的对象。编码按照ISO 3166-1的规定。
    Example: {"en":"Attribute name","de":"Attributname"}

  - `items.unit_items.attributes.values` (array, required)
    Example: [{"external_id":"value_1","name":{"en":"value 1","de":"wert 1"}},{"external_id":"value_2","name":{"en":"value 2","de":"wert 2"}}]

  - `items.unit_items.attributes.values.external_id` (string, required)
    属性的唯一值ID。 external_id只能包含小写英文字母、数字、短横线和下划线。
    Example: "value_external_id"

  - `items.unit_items.attributes.values.value` (object, required)
    包含值本地化名称的对象。编码按照ISO 3166-1的规定。

  - `items.unit_items.long_description` (object,null)
    包含商品详细本地化描述的对象。值接受以下两种格式之一：两个小写字母的语言代码（例如，en）或五个字符的区域设置代码（例如，en-US）。虽然两种格式都可作为输入接受，但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时（例如：en和en-US），将存储最后提供的值。您可以在[文档](/zh/doc/shop-builder/references/supported-languages/)中找到支持语言的完整列表。

  - `items.unit_items.groups` (array)
    商品所属分组。
    Example: [{"external_id":"horror","name":{"en":"Horror"}}]

  - `items.unit_items.groups.external_id` (string)
    Example: "horror"

  - `items.unit_items.groups.name` (object)
    Example: {"en":"Horror"}

## Response 401 fields (application/json):

  - `statusCode` (integer)
    Example: 401

  - `errorCode` (integer)
    Example: 1020

  - `errorMessage` (string)
    Example: "[0401-1020]: Error in Authentication method occurred"


