---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/console/purchases.md
  - https://yandex.com/dev/games/doc/hi/console/purchases.md
  - https://yandex.com/dev/games/doc/ko/console/purchases.md
  - https://yandex.com/dev/games/doc/ru/console/purchases.md
  - https://yandex.com/dev/games/doc/tr/console/purchases.md
  - https://yandex.com/dev/games/doc/vi/console/purchases.md
  - https://yandex.com/dev/games/doc/zh/console/purchases.md
  - href: zh/console/purchases.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/zh/llms.txt

# 应用内购买

<!-- source: zh/_includes/script-common.md -->
<!-- source: zh/_includes/script/index-js.md -->

<!-- endsource: zh/_includes/script/index-js.md -->

<!-- source: zh/_includes/script/requirements-js.md -->

<!-- endsource: zh/_includes/script/requirements-js.md -->

<!-- source: zh/_includes/script/image-modal-js.md -->

<!-- endsource: zh/_includes/script/image-modal-js.md -->
<!-- endsource: zh/_includes/script-common.md -->


连接应用内购买功能，通过收费服务（例如额外的关卡时间、游戏角色配饰等）赚取收入。

优势：

- **平台支持**：

  - 营销活动针对俄罗斯和国际市场的付费用户进行定向。
  - 推荐系统更常显示带有应用内购买的游戏。
  - 带有购买且指标良好的游戏可能会出现在更多的主页模块和精选中。
- **财务稳定性**：带有应用内购买的游戏受季节性和广告收入波动的影响较小。
- **玩家回流**：曾经购买过的玩家更可能回到游戏中。
- **流畅的游戏体验**：购买可以融入游戏过程，补充和提升游戏体验。

{% note alert %}

在添加购买之前，请设置[未处理支付的检查](https://yandex.com/dev/games/doc/zh/sdk/sdk-purchases.md#check-purchases)。

这项检查[是必须的](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-13-1)通过审核，所以即使对于测试购买也必须设置。如果在游戏中添加购买并在设置消耗之前进行测试，测试后可能会留下未处理的支付，这将导致无法通过审核。

{% endnote %}

## 平台货币 {#currency}

[Yandex Games](https://yandex.com/games/){.external}平台的平台货币用于支付游戏内购买。它存储在玩家的统一余额中，可以使用银行卡充值。平台货币对卢布的汇率是动态的。

{% note info %}

对于国际支付，Yan 对其他国家货币的[汇率](#portal-currency-rate)取决于玩家所在的国家/地区。

{% endnote %}

可以通过以下方式充值：
- 在目录的标题栏中；
- 在玩家个人资料中；
- 在游戏购买过程中。

玩家还可以通过参与活动或购买固定包获得平台货币作为奖励。

授权和未授权的用户都可以进行游戏内购买。用户可以在游戏过程中授权，包括在购买时。

引入平台货币后，许可费的支付顺序和条件不会改变。

{% note alert %}

要在游戏中显示门户货币的名称和图标，请使用 [SDK](https://yandex.com/dev/games/doc/zh/sdk/sdk-purchases.md#getcatalog) 功能（[第 1.13.2 项](https://yandex.com/dev/games/doc/zh/concepts/requirements.md#1-13-2)）。

{% endnote %}

## 连接购买功能 {#connect}

### 步骤 1. 检查合作方案 {#check-unified-licensing-model}

1. 打开[开发人员控制台](https://games.yandex.com/console){.external}。
1. 转到 **Account** 部分。
1. 检查 **Unified licensing model** 字段的值：
    - **Connected** —— 您所有游戏中的购买功能已自动启用。请转到[步骤 3](#update-files)。
    - **Not connected** —— 您需要单独连接购买功能。请转到[步骤 2](#connection-request)。

### 步骤 2. 发送连接请求 {#connection-request}

1. [启用变现](https://yandex.com/dev/games/doc/zh/console/adv-monetization.md#enable-int-monetization)，包括在 Yandex Advertising Network 中注册。

   确保在 [合作伙伴接口](https://partner.yandex.com/){.external}中已提供用于广告和购买的付款信息。如果没有，请点击按钮 **Add bank details**，填写字段并发送数据。

   经过数据检查后，Yandex Advertising Network 接口中 **Extras → Documents** 部分的合同状态将变为 **Offer accepted**。

   {% note alert %}

   只能在接受要约后才能连接游戏内购买。

   {% endnote %}

1. 连接购买功能。为此，请发送电子邮件请求连接到邮箱 [games-partners@yandex-team.com](mailto:games-partners@yandex-team.com){.external}。请提供：

   - 游戏名称；
   - 游戏标识符 (ID)。

   您将收到来自 [games-partners@yandex-team.com](mailto:games-partners@yandex-team.com){.external} 的确认邮件，表明购买已被允许。

### 步骤 3. 添加购买项 {#add-purchases}

{% note alert %}

购买项的最大数量为 500 个。

{% endnote %}

{% list tabs %}

* 单次上传

    1. 前往 **In-app purchases** → **Inaps**选项卡。
    1. 点击 **Add in-app**。
    1. 填写字段：

        #|
        || **字段** | **描述** | **是否必填** ||
        || **ID** | 将在 `payments.purchase()` 方法中传递的购买标识符。 |::{align="center"} ![SVG](../_images/icons/yes-button.svg) ||
        || **Price in yans** | 用户以平台货币支付的[购买成本](#portal-currency-rate)。整数。 | ||
        || **USD (US)** | 以美元计算的大致成本。 | ||
        || **EUR** | 以欧元计算的大致成本。 | ||
        || **Item Icon** | 大小为 256 × 256 像素。格式为 PNG。将在支付购买时的对话框中显示。 | ||
        || **Item Name** | 购买的俄语和英语名称。将在支付购买时的对话框中显示。 |::{align="center"} ![SVG](../_images/icons/yes-button.svg) ||
        || **Item Description** | 购买的俄语和英语描述。将在支付购买时的对话框中显示。限制为 200 个字符。 | ||
        |#

        {% note tip %}

        以任何货币指定购买价格 — 其余货币将根据区域系数表自动计算。

        {% endnote %}

    1. 点击 **Add**。购买表将更新。

    {% note info %}

    您可以上传[默认图标](#default-icon)。如果某个应用内购买项没有单独设置图片，将会显示该默认图标。

    {% endnote %}

* 批量上传

    1. 转到标签 **In-app purchases** → **Inaps**。
    1. 按照链接 **Download an example**中的示例准备要上传的 [CSV](*csv) 格式文件。

        检查是否填写了必填字段：

        #|
        || **字段** | **描述** | **是否必填** ||
        || `id` | 在`payments.purchase()`方法中传递的购买标识符。 |::{align="center"} ![](../_images/icons/yes-button.svg) ||
        || `price` | 以港口币计算的购买成本。整数。 |::{align="center"} ![](../_images/icons/yes-button.svg) ||
        || `title_en` | 英文购买名称。 |::{align="center"} ![](../_images/icons/yes-button.svg) ||
        || `description_en` | 购买的英文描述。限制为200个字符。 |  ||
        || `title_ru` | 购买的俄语名称。 |::{align="center"} ![](../_images/icons/yes-button.svg) ||
        || `description_ru` | 购买的俄语描述。限制为200个字符。 |  ||
        |#

    1. 点击按钮 **Upload a CSV file**。

    1. 在选项卡中选择要上传的购买：

        - **Ready for import** —— 具有新`id`的购买。如果将其上传，系统中将创建新的购买。
        - **Matches** —— `id`已经在系统中的购买。如果上传它们，当前购买将被更新。

        在 **Errors** 选项卡中，可以查看出现问题的购买。要上传它们，请返回步骤2并在CSV文件中更正字段。

       {% note alert %}

       一次最多可以上传100个购买。如果文件中的购买数量超过最大允许值，将只上传前100个元素。

       {% endnote %}

    1. 点击 **Import \<N\> in-apps**。购买表格将更新。

    {% note info %}

    若要为应用内购买使用自己的图片：

    - [编辑](#edit)该项并上传个性化图标。

    - 上传[默认图标](#default-icon)。对于没有单独指定图片的应用内购买，将显示该默认图标。

    {% endnote %}

{% endlist %}

### 步骤 4. 更新游戏源文件 {#update-files}

1. [将 SDK 代码添加到游戏源文件中](https://yandex.com/dev/games/doc/zh/sdk/sdk-purchases.md#install)。
1. <!-- source: zh/_includes/console/open-console.md -->
   使用开发者账号登录[控制台](https://games.yandex.com/console){.external}。
   <!-- endsource: zh/_includes/console/open-console.md -->

1. 在控制台左上角，点击 [Games](https://games.yandex.com/console/applications){.external}。
1. 在列表中找到之前已下载的游戏，并点击它。
1. 前往 **Draft** 选项卡。
1. 编辑字段并上传新存档。有关字段的详细说明，请参阅“[填写草稿](https://yandex.com/dev/games/doc/zh/console/add-new-game/draft.md)”部分。

### 步骤 5. 发布新版本游戏 {#publish-new-version}

{% note tip %}

- 在通过审核之前，您可以自行 [测试游戏](https://yandex.com/dev/games/doc/zh/console/test-game.md)。
- 如果您不想立即将游戏发送进行审核，请保存游戏草稿（状态将变为 **Created**），以便稍后返回编辑字段。

{% endnote %}

1. 转到 **Draft**选项卡。
1. 如果您想自己选择发布游戏的时间，请选择 **Postpone publication**选项。否则，游戏将在审核后立即发布。
1. 点击 **Submit for moderation**。

    <!-- source: zh/_includes/console/moderation.md -->
    {% note info %}

    如果游戏在100天前提交审核，您将看到一条警告，提示要求可能已更改。取消审核提交，查看要求并检查游戏是否符合要求。之后，重新提交游戏进行审核。

    {% endnote %}
    <!-- endsource: zh/_includes/console/moderation.md -->

    游戏将上传到 Yandex 服务器并且其状态更改为**Waiting for moderation**。

    <!-- source: zh/_includes/console/moderation.md -->
    游戏将接受[要求](https://yandex.com/dev/games/doc/zh/concepts/requirements.md)合规性审核。通常[审核](https://yandex.com/dev/games/doc/zh/concepts/moderation.md)需要3−5个工作日。
    <!-- endsource: zh/_includes/console/moderation.md -->

  审核结果您将在控制台中看到：

  {% list tabs %}

  - 具有 Postpone publication 选项

    - 如果游戏获得批准，草稿状态将变为 **Verified**，在 **Draft** 选项卡上将出现 **Publish** 按钮，在 **In-app purchases** → **Inaps** 选项卡上将显示状态 **Purchases are enabled**。

      <!-- source: zh/_includes/console/updated-game.md -->
      在 **Draft** 标签页点击 **Publish**。几分钟后状态将更改为 **Published**，用户便可以在[雅虎游戏目录](https://yandex.com/games/){.external}中找到您的游戏。
      <!-- endsource: zh/_includes/console/updated-game.md -->

  - 没有选项

    - 如果游戏获得批准，草稿状态将直接变为 **Published**，在 **In-app purchases** → **Inaps** 选项卡上的状态将变为 **Purchases are enabled**。您的游戏将在 [Yandex Games](https://yandex.com/games/){.external} 目录中上线。

  {% endlist %}

  - 如果游戏未通过审核，草稿将转为 **Rejected** 状态，我们会通过邮件告诉您未通过的原因。请做出必要的修改并返回第 1 步。

连接购买后，您可以 [更改](#edit) 其参数。

## 测试购买 {#test}

{% note info %}

您可以在提交审核和发布前测试购买功能。为此，请在[草稿模式](https://yandex.com/dev/games/doc/zh/console/draft-mode.md)或[prod环境](https://yandex.com/dev/games/doc/zh/concepts/local-launch.md#prod-env)中打开游戏。

{% endnote %}

要测试购买，请将登录名添加到测试购买列表中：

1. <!-- source: zh/_includes/console/open-console.md -->
   使用开发者账号登录[控制台](https://games.yandex.com/console){.external}。
   <!-- endsource: zh/_includes/console/open-console.md -->
1. 在控制台左上角，点击 [Games](https://games.yandex.com/console/applications){.external}。
1. 在列表中找到之前已下载的游戏，并点击它。
1. 转到 **In-app purchases** 选项卡。
1. 选择 **Settings**。
1. 在 **List of logins for test purchases** 块中：

    1. 输入您计划用于测试购买的 [Yandex ID](https://id.yandex.com/){.external}。
    1. 点击 **Add** 按钮。账户将出现在列表中。

几分钟后，您就可以使用此账户测试购买了。购买不会收取费用。

## 编辑购买 {#edit}

连接购买并发布游戏后，您可以更改其参数。请确保它们与当前的游戏代码相符，如有必要，[更新](https://yandex.com/dev/games/doc/zh/console/update-game.md#update-game) 它。这将需要重新审核。在此之前，目录中将保留上一个版本的游戏。

要编辑购买：

1. <!-- source: zh/_includes/console/open-console.md -->
   使用开发者账号登录[控制台](https://games.yandex.com/console){.external}。
   <!-- endsource: zh/_includes/console/open-console.md -->

1. 在控制台左上角，点击 [Games](https://games.yandex.com/console/applications){.external}。
1. 在列表中找到之前已下载的游戏，并点击它。
1. 转到 **In-app purchases** → **Inaps** 选项卡。
1. 在列表中找到该购买项并点击它。
1. 在需要的[字段](#add-purchases)中进行更改。
1. 点击 **Edit**。
1. 如果您更改了游戏代码，请[上传新的归档文件](https://yandex.com/dev/games/doc/zh/console/update-game.md)。

## 删除购买 {#delete}

{% note alert %}

别忘了不仅要删除购买项，还要删除与其相关的代码。否则，用户在游戏中会看到该购买项，但无法使用它。

{% endnote %}

要删除购买：

1. <!-- source: zh/_includes/console/open-console.md -->
   使用开发者账号登录[控制台](https://games.yandex.com/console){.external}。
   <!-- endsource: zh/_includes/console/open-console.md -->

1. 在控制台左上角，点击 [Games](https://games.yandex.com/console/applications){.external}。
1. 在列表中找到之前已下载的游戏，并点击它。
1. 转到 **In-app purchases** → **Inaps** 选项卡。
1. 在表格中：

    {% list tabs %}

    - 单个删除

        1. 点击购买项以打开编辑窗口。
        1. 点击 **Remove**。

    - 批量删除

        1. 在所需的购买项左侧打勾。如果您想全选所有商品，请在购买表格的标题处打勾。

            {% note info %}

            取消选中有以下几种方式：

            - 在标题处取消勾选。
            - 在带有 **Remove** 按钮的面板右侧，点击 ![叉号](../_images/icons/delete-button.svg)。

            {% endnote %}

        1. 点击 **Remove**。

    {% endlist %}

1. 如果您修改了游戏代码，请[上传一个新的归档文件](https://yandex.com/dev/games/doc/zh/console/update-game.md)。

## 默认图标 {#default-icon}

{% note tip %}

我们建议为每个内购商品使用独特、清晰且有吸引力的图片，确保其风格与游戏整体设计相符。

{% endnote %}

如果您还没有为每个商品准备独立的图片，或者暂时无法创建，您可以上传通用默认图标：

1. 进入 **In-app purchases** → **Settings** 选项卡。
1. 在 **Default icon** 字段点击 **Select file**。
1. 添加符合以下参数的文件：
    - 尺寸：256 × 256 像素。
    - 格式：PNG。

默认图标将会显示在所有未单独设置图片的内购商品上。

## 门户货币汇率 {#portal-currency-rate}

您可以了解一定数量的门户货币在不同国家的实际货币价值：

1. <!-- source: zh/_includes/console/open-console.md -->
   使用开发者账号登录[控制台](https://games.yandex.com/console){.external}。
   <!-- endsource: zh/_includes/console/open-console.md -->

1. 在控制台左上角，点击 [Games](https://games.yandex.com/console/applications){.external}。

1. 在列表中找到之前已下载的游戏，并点击它。

1. 转到 **In-app purchases** 选项卡。

1. 选择 **Prices in countries and regions**。

1. 在 **The cost of 1 in-app \<X\> yan** 字段中输入所需数量的门户货币。结果将在表格的列中显示：

    - **Your share** —— 您因购买获得的奖励。

    - **The price for the player** —— 购买对玩家的成本，以其国家货币计算。

## 内购统计和付款 {#statistics-payments}

### 付款 {#payments}


为提供游戏使用许可，Yandex将支付许可费，扣除适用税费（如适用于俄罗斯联邦法律）。

奖金将累计，直到达到付款阈值。一旦达到阈值，Yandex 将向您发送一封邮件，列出总奖金额。奖金将在下个月支付。

{% note info %}

收入按启用内购的所有您的游戏计算。

{% endnote %}

详情请参阅 许可协议 第 [8. Fees and Payment](https://yandex.com/legal/licensegames/en/#fees-and-payment){.external}。

### 统计 {#statistics}

可以在 [Yandex Games 控制台](https://games.yandex.com/console){.external} 的 [Purchase metrics](https://yandex.com/dev/games/doc/zh/console/purchase-metrics.md) 选项卡上查看内购详细报表。

{% note tip %}

要查看特定应用内购买的数据：

1. 在 [Yandex Games 控制台](https://games.yandex.com/console){.external}中，转到 **In-app purchases** 选项卡。
1. 选择所需的购买项，然后点击 ![SVG](../_images/icons/open-product-metrics.svg)</svg> **Open product metrics** 按钮。

{% endnote %}

[*csv]: 逗号分隔值。