# 按指定组获取游戏Key列表

从指定组获取用于构建商品目录的游戏Key列表。


  注意
    所有项目对响应中可获取的商品数量均有限制。默认值和最大值均为每个响应50个商品。如需按页获取更多数据，请使用limit和offset字段。





  注：
    未经授权使用此API调用时，会返回通用商品目录数据。如需获取
    个性化
    用户数据，例如与商品相关的数量限制和促销活动，请使用授权。为此，请在Authorization请求头中传递用户JWT。
    有关用户JWT的更多信息，请参阅此调用的Security部分。

Endpoint: GET /v2/project/{project_id}/items/game/key/group/{external_id}
Version: 2.0.0
Security: XsollaLoginUserJWT

## Path parameters:

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

  - `external_id` (string, required)
    创建商品组时指定的外部商品组ID。
    Example: "weapons"

## Query parameters:

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

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

  - `locale` (string)
    响应语言。符合ISO 639-1标准的两位小写语言代码（例如en）。name和description等本地化字段支持五字符区域代码（例如en-US），但在响应中会标准化为两位代码。支持的语言完整列表请参阅文档。

  - `additional_fields[]` (array)
    响应中需额外返回的字段。默认不返回这些字段。如需返回，请传入对应的字段值。
    Enum: "media_list", "order", "long_description", "custom_attributes", "item_order_in_group"

  - `country` (string)
    符合ISO 3166-1 alpha-2标准的两位大写国家/地区代码。关于艾克索拉支持的国家/地区和国家/地区判定流程的详细信息，请参阅文档。
    Example: "US"

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

  - `show_inactive_time_limited_items` (integer)
    显示对用户不可用的时效性商品。这类商品的有效期尚未开始或已经结束。
    Example: 1

## Response 200 fields (application/json):

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

  - `items` (array)
    Example: [{"sku":"com.xsolla.game_1","name":"Game name","groups":[{"external_id":"all","name":"All games"},{"external_id":"Xsolla","name":"Xsolla games"}],"type":"game_key","description":"Game description","image_url":"https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png","attributes":[{"external_id":"OS","name":"OS","values":[{"external_id":"9d5c5efb7c0f00a00fe4e3583f1215b0050bc723","value":"Windows"}]},{"external_id":"genre","name":"Genre","values":[{"external_id":"23fda05111c125608af8f1fa0e99db45a10ea1cc","value":"Horror"}]}],"is_free":false,"price":{"amount":"30.5","amount_without_discount":"30.5","currency":"USD"},"virtual_prices":[],"drm_name":"Steam","drm_sku":"steam_key_1","has_keys":true,"is_pre_order":true,"release_date":"2020-08-11T10:00:00+03:00","periods":[{"date_from":"2020-08-11T10:00:00+03:00","date_until":"2020-08-11T20:00:00+03:00"}]},{"sku":"com.xsolla.game_2","name":"Game name","groups":[{"external_id":"all","name":"All games"}],"type":"game_key","description":"Game description","image_url":"https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png","attributes":[{"external_id":"OS","name":"OS","values":[{"external_id":"9d5c5efb7c0f00a00fe4e3583f1215b0050bc723","value":"Windows"}]},{"external_id":"genre","name":"Genre","values":[{"external_id":"23fda05111c125608af8f1fa0e99db45a10ea1cc","value":"Horror"}]}],"is_free":false,"price":{"amount":"30.5","amount_without_discount":"30.5","currency":"USD"},"virtual_prices":[],"drm_name":"Steam","drm_sku":"steam_key_2","has_keys":true,"is_pre_order":false,"release_date":null,"periods":[]}]

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

  - `items.name` (string)
    商品名称。
    Example: "Game name"

  - `items.groups` (array)
    商品所属分组。

  - `items.groups.external_id` (string)
    创建商品组时指定的[外部商品组ID](/zh/api/catalog/item-groups-admin/admin-create-item-group#item-groups-admin/admin-create-item-group/t=request&path=external_id)。
    Example: "exclusive"

  - `items.groups.name` (string)
    组名称。
    Example: "Exclusive"

  - `items.groups.item_order_in_group` (integer)
    商品在组内的位置，用于决定其显示顺序。
仅在通过additional_fields[]查询参数请求时返回。
    Example: 1

  - `items.attributes` (array)
    与商品对应的属性及其值的列表。可用于商品目录筛选。

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

  - `items.attributes.name` (string)
    属性名称。
    Example: "Genre"

  - `items.attributes.values` (array)

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

  - `items.attributes.values.value` (string)
    属性值。
    Example: "Strategy"

  - `items.type` (string)
    商品类型：game_key。
    Example: "game_key"

  - `items.description` (string)
    商品描述。
    Example: "Game description"

  - `items.image_url` (string)
    图片URL。
    Example: "https://cdn.xsolla.net/img/misc/images/b79342cdf24f0f8557b63c87e8326e62.png"

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

  - `items.price` (object)
    商品价格。

  - `items.price.amount` (string)
    商品折后价格。
    Example: "2.9900"

  - `items.price.amount_without_discount` (string)
    商品价格。
    Example: "2.9900"

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

  - `items.virtual_prices` (array)
    虚拟价格。

  - `items.virtual_prices.amount` (integer)
    以虚拟货币表示的商品价格。
    Example: 100

  - `items.virtual_prices.amount_without_discount` (integer)
    商品折扣前的虚拟货币价格。由于折扣不适用于虚拟货币价格，因此该值始终等于amount。
    Example: 200

  - `items.virtual_prices.sku` (string)
    虚拟货币SKU。
    Example: "vc_gold"

  - `items.virtual_prices.is_default` (boolean)
    是否为默认虚拟货币价格。
    Example: true

  - `items.virtual_prices.image_url` (string,null)
    虚拟货币图片URL。
    Example: "http://image.png"

  - `items.virtual_prices.name` (string)
    虚拟货币名称。
    Example: "Gold"

  - `items.virtual_prices.type` (string)
    商品类型。对于虚拟货币，该值为virtual_currency。
    Example: "virtual_currency"

  - `items.virtual_prices.description` (string,null)
    虚拟货币说明。
    Example: "In-game currency used to purchase weapons and upgrades"

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

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

  - `items.has_keys` (boolean)
    如果为true，则该游戏Key有供销售的Key。

  - `items.is_pre_order` (boolean)
    如果为true，则该游戏Key为预售，且尚未到发布日期。
    Example: true

  - `items.release_date` (string,null)
    游戏Key发布日期，采用ISO 8601格式。
    Example: "2020-08-11T10:00:00+03:00"

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

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

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

  - `items.loyalty_rewards` (array)
    用户购买商品后获得的忠诚积分奖励。

  - `items.loyalty_rewards.name` (string)
    忠诚积分名称。

  - `items.loyalty_rewards.sku` (string)
    忠诚积分SKU。调用其他API时，请将该值作为loyalty_point_sku参数传入，例如创建使用忠诚积分支付的订单时。

  - `items.loyalty_rewards.description` (string)
    忠诚积分描述。

  - `items.loyalty_rewards.image_url` (string,null)
    图片URL。

  - `items.loyalty_rewards.amount` (integer)
    用户购买商品后获得的忠诚积分数量。

  - `items.loyalty_prices` (array)
    可用于购买该商品的忠诚积分。

  - `items.loyalty_prices.name` (string)
    忠诚积分名称。

  - `items.loyalty_prices.sku` (string)
    忠诚积分SKU。调用其他API时，请将该值作为loyalty_point_sku参数传入，例如创建使用忠诚积分支付的订单时。

  - `items.loyalty_prices.description` (string)
    忠诚积分描述。

  - `items.loyalty_prices.image_url` (string,null)
    图片URL。

  - `items.loyalty_prices.amount` (integer)
    以指定忠诚积分计价的商品价格。


