Reminder: By Aug 31, 2025, all new apps and updates to existing apps must use Billing Library version 7 or newer. If you need more time to update your app, you can request an extension until Nov 1, 2025. Learn about Play Billing Library version deprecation.
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Биллинговая система Google Play — это сервис, который позволяет вам продавать цифровые продукты и контент в вашем приложении Android, независимо от того, хотите ли вы монетизировать их с помощью разовых покупок или предлагать подписки на свои услуги. Google Play предлагает полный набор API для интеграции как с вашим приложением Android, так и с вашим серверным бэкэндом, которые открывают привычность и безопасность покупок Google Play для ваших пользователей.
Архитектура интеграции
В этом разделе представлены различные функциональные модули, которые вы можете создать, а также API и библиотеки, доступные для упрощения процесса.
Рисунок 1. Схема типичной интеграции платежной системы Google Play.
Вы можете интегрировать платежную систему Google Play с вашим приложением Android с помощью Play Billing Library . Эта библиотека обеспечивает связь со слоем Google Play Services, который предоставляет локализованное предложение продукта, доступное каждому пользователю в вашем приложении, а также методы для обработки других необходимых пользовательских операций, таких как запуск процесса покупки и обработка его результата.
Вам также следует интегрировать биллинговую систему Google Play с вашим серверным бэкендом, чтобы создать необходимые потоки разработчиков. Это необходимо для гарантии того, что ваше управление покупками и кроссплатформенные права являются эффективными и безопасными. Вы можете создать эту интеграцию с API подписок и покупок в приложении, предоставляемым API разработчика Google Play. Интеграция бэкенда также использует некоторые инструменты платформы Google Cloud.
Рисунок 2. API и сервисы, предоставляемые Google Play Developer API.
Терминология
В этом разделе перечислены и описаны высокоуровневые технологии и концепции, с которыми вы можете столкнуться при интеграции биллинговой системы Google Play в свое приложение. Ссылайтесь на этот список по мере продвижения по руководству по интеграции.
Технологии
Google Play . Интернет-магазин, где пользователи могут загружать приложения и другие цифровые продукты.
Google Play Console . Платформа, которая предоставляет интерфейс, где вы можете опубликовать свое приложение в Google Play. Google Play Console также показывает сведения о вашем приложении, включая любые продукты или контент, которые вы продаете с помощью Google Play.
Google Cloud Console . Платформа, которая управляет внутренними API, такими как Google Play Developer API.
API разработчика Google Play . API REST, который можно использовать для программного управления задачами публикации и управления приложениями.
Cloud Pub/Sub . Полностью управляемая служба обмена сообщениями в реальном времени, которая позволяет отправлять и получать сообщения между независимыми приложениями. Google Play использует Cloud Pub/Sub для доставки уведомлений разработчикам в реальном времени. Для использования Cloud Pub/Sub у вас должен быть проект на Google Cloud Platform (GCP) с включенным API Cloud Pub/Sub. Если вы не знакомы с GCP и Cloud Pub/Sub, см. руководство по быстрому старту .
Защищенный внутренний сервер . В рамках интеграции платежной системы Google Play в ваше приложение мы настоятельно рекомендуем вам использовать защищенный внутренний сервер для реализации задач, связанных с выставлением счетов, таких как проверка покупок, функции, связанные с подпиской, и обработка уведомлений разработчиков в режиме реального времени.
Приложение Google Play Store . Приложение, которое управляет всеми операциями, связанными с Google Play. Все запросы, сделанные вашим приложением, обрабатываются приложением Google Play Store.
Концепции
Поток . Поток показывает типичные шаги, связанные с задачей выставления счетов. Например, поток покупки описывает шаги, которые необходимо выполнить, когда пользователь покупает ваш продукт. Поток подписки может показывать, как подписка переходит между состояниями.
Право . Когда пользователь покупает продукт в приложении, он получает право на этот продукт в вашем приложении. Для одноразовых продуктов это означает, что пользователь теперь должен иметь постоянный доступ к продукту. Для подписок это означает, что пользователь должен иметь доступ, пока подписка активна.
Идентификатор продукта . Идентификатор определенного типа продукта.
Токен покупки . Строка, которая представляет право покупателя на продукт в Google Play. Она указывает, что пользователь Google заплатил за определенный продукт.
Идентификатор заказа . Строка, представляющая финансовую транзакцию в Google Play. Идентификатор заказа создается каждый раз, когда происходит финансовая транзакция. Эта строка включается в квитанцию, которая отправляется покупателю по электронной почте. Вы можете использовать идентификатор заказа для управления возвратами в разделе «Управление заказами» консоли Google Play. Идентификаторы заказов также используются в отчетах о продажах и выплатах.
Следующие шаги
Чтобы начать интеграцию биллинговой системы Google Play с вашим приложением и серверным бэкэндом, ознакомьтесь с руководством по настройке .
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 UTC."],[],[],null,["# Google Play's billing system is a service that enables you to sell digital products\nand content in your Android app, whether you want to monetize through one-time\npurchases or offer subscriptions to your services. Google Play offers a full set\nof APIs for integration with both your Android app and your server backend that\nunlock the familiarity and safety of Google Play purchases for your users.\n| **Note:** Google Play's billing system is only for digital items. For physical goods and services, or other non-digital content, see the [Google Pay SDK](https://developers.google.com/pay/api/android/overview).\n\nIntegration architecture\n------------------------\n\nThis section introduces the different functional modules that you can build and\nthe APIs and libraries available to simplify the process.\n**Figure 1.** Diagram of a typical Google Play billing integration.\n\nYou can integrate Google Play's billing system with your Android app using the [Play\nBilling Library](/reference/com/android/billingclient/classes). This library\nenables communication with the Google Play Services layer that provides the\nlocalized product offering available to each user in your app, as well as\nmethods to handle other necessary user operations, like launching the purchase\nflow and handling its outcome.\n\nYou should also integrate Google Play's billing system with your server backend to\ncreate the necessary developer flows. This is essential to guarantee that your\npurchase management and cross-platform entitlements are efficient and secure.\nYou can create this integration with the [Subscriptions and in-app purchases\nAPI](https://developers.google.com/android-publisher#subscriptions) provided by\nthe Google Play Developer API. The backend integration also leverages some\nGoogle Cloud platform tools.\n**Figure 2.** APIs and services provided by the Google Play Developer API.\n\nTerminology\n-----------\n\nThis section lists and describes the high-level technologies and concepts that\nyou might encounter when integrating Google Play's billing system into your app.\nReference this list as you proceed through the integration guidance.\n\n### Technologies\n\n- [**Google Play**](https://play.google.com). An online store where users can download apps and other digital products.\n- [**Google Play Console**](https://play.google.com/console). A platform that provides an interface where you can publish your app to Google Play. The Google Play Console also shows details about your app, including any products or content that you sell with Google Play.\n- [**Google Cloud Console**](https://console.developers.google.com/). A platform that manages backend APIs, such as the Google Play Developer API.\n- [**Google Play Billing Library**](/google/play/billing/integrate). An API that you can use to integrate Google Play's billing system into your app.\n- [**Google Play Developer API**](https://developers.google.com/android-publisher/). A REST API that you can use to programmatically handle publishing and app management tasks.\n- [**Cloud Pub/Sub**](https://cloud.google.com/pubsub/). A fully managed real-time messaging service that enables you to send and receive messages between independent applications. Google Play uses Cloud Pub/Sub to deliver Real-time developer notifications. To use [Cloud\n Pub/Sub](https://cloud.google.com/pubsub/), you must have a project on the [Google Cloud Platform (GCP)](https://cloud.google.com/) with the Cloud Pub/Sub API enabled. If you aren't familiar with GCP and Cloud Pub/Sub, see the [Quickstart guide](https://cloud.google.com/pubsub/docs/quickstart-console).\n- [**Real-time developer notifications**](/google/play/billing/getting-ready#configure-rtdn). A mechanism that lets you monitor state changes for Google Play-managed subscriptions in real time by leveraging [Cloud\n Pub/Sub](https://cloud.google.com/pubsub).\n- **Secure backend server**. As part of integrating Google Play's billing system into your app, we strongly recommend that you use a secure backend server to implement billing-related tasks such as purchase verification, subscription-specific features, and handling Real-time developer notifications.\n- **Google Play Store app**. An app that manages all operations related to Google Play. All requests made by your app are handled by the Google Play Store app.\n\n### Concepts\n\n- **Flow** . A flow shows the typical steps involved in a billing-related task. For example, a *purchase flow* outlines the steps involved when a user purchases your product. A *subscription flow* might show how a subscription transitions between states.\n- **Entitlement** . When a user purchases an in-app product, they are then *entitled* to that product within your app. For one-time products, this means that the user should now have permanent access to the product. For subscriptions, this means that the user should have access while the subscription is active.\n- **Product ID**. The ID of a specific product type.\n- **Purchase token**. A string that represents a buyer's entitlement to a product on Google Play. It indicates that a Google user has paid for a specific product.\n- **Order ID** . A string that represents a financial transaction on Google Play. An order ID is created every time a financial transaction occurs. This string is included in a receipt that is emailed to the buyer. You can use the order ID to manage refunds in the **Order Management** section of the Google Play Console. Order IDs are also used in sales and payout reports.\n\nNext steps\n----------\n\nTo begin integrating Google Play's billing system with your app and server backend,\nsee the [setup guide](/google/play/billing/getting-ready)."]]