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.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O sistema de faturamento do Google Play é um serviço que permite vender produtos e
conteúdos digitais no seu app Android, seja para gerar receita com compras únicas
ou oferecer assinaturas aos seus serviços. O Google Play oferece um conjunto completo
de APIs para integração com seu app Android e o back-end do servidor,
desbloqueando a familiaridade e segurança das compras do Google Play para os usuários.
Arquitetura de integração
Esta seção apresenta os diferentes módulos funcionais que podem ser criados e as APIs e
bibliotecas disponíveis para simplificar o processo.
Figura 1. Diagrama de uma integração típica do
Google Play Faturamento.
Integre o sistema de faturamento do Google Play ao seu app Android usando a Biblioteca
Play Faturamento. Essa biblioteca
permite a comunicação com a camada do Google Play Services que fornece a
oferta de produto localizada disponível para cada usuário no seu app. Ela também oferece
métodos para processar outras operações do usuário necessárias, como iniciar o fluxo de
compra e processar os resultados.
Você também precisa integrar o sistema de faturamento do Google Play ao back-end do servidor para
criar os fluxos de desenvolvimento necessários. Isso é essencial para garantir que o
gerenciamento de compras e os direitos multiplataforma sejam eficazes e seguros.
Crie essa integração usando a API Subscriptions and In-App Purchases,
fornecida pela
API Google Play Developer. A integração de back-end também aproveita algumas
ferramentas do Google Cloud Platform.
Figura 2. APIs e serviços fornecidos pela API Google Play
Developer.
Terminologia
Esta seção lista e descreve as tecnologias e os conceitos de alto nível que
você pode encontrar ao integrar o sistema de faturamento do Google Play com seu app.
Consulte a lista conforme avança na orientação de integração.
Tecnologias
Google Play: uma loja on-line em que os usuários podem
fazer o download de apps e outros produtos digitais.
Google Play Console: uma plataforma
que oferece uma interface para você publicar seu app no Google Play. O
Google Play Console também mostra detalhes sobre seu app, incluindo todos
os produtos ou conteúdos que você vende com o Google Play.
Console do Google Cloud: uma
plataforma que gerencia APIs de back-end, como a API Google Play Developer.
API Google Play Developer:
uma API REST que pode ser usada para processar tarefas de publicação e
gerenciamento de apps de maneira programática.
Cloud Pub/Sub: um serviço de mensagens
em tempo real totalmente gerenciado que permite enviar e receber mensagens
entre aplicativos independentes. O Google Play usa o Cloud Pub/Sub para entregar
notificações do desenvolvedor em tempo real. Para usar
o Cloud Pub/Sub, é preciso ter um projeto no
Google Cloud Platform (GCP) com a
API Cloud Pub/Sub ativada. Se você não conhece o GCP e o Cloud Pub/Sub, consulte o
Guia de início rápido.
Servidor de back-end seguro: como parte da integração do sistema de faturamento do Google Play
no seu app, recomendamos usar um servidor de back-end seguro para
implementar tarefas relacionadas ao faturamento, como verificação de compras,
recursos específicos para assinaturas e o processamento de notificações do desenvolvedor em
tempo real.
App Google Play Store: um app que gerencia todas as operações relacionadas ao
Google Play. Todas as solicitações feitas pelo seu app são processadas pelo
app Google Play Store.
Conceitos
Fluxo: um fluxo mostra etapas típicas de uma tarefa de
faturamento. Por exemplo, um fluxo de compra descreve as etapas
de quando um usuário compra seu produto. Um fluxo de assinatura pode mostrar
como uma assinatura faz a transição entre estados.
Direito de acesso: quando um usuário faz uma compra no app, ele tem
direito de acesso ao produto comprado. Para produtos únicos, isso
significa que o usuário terá acesso permanente a eles.
Para assinaturas, isso significa que o usuário terá acesso enquanto
a assinatura estiver ativa.
ID do produto: o ID de um tipo de produto específico.
Token da compra: uma string que representa o direito de acesso de um comprador a um
produto no Google Play. O token indica que um usuário do Google pagou
por um produto específico.
Código do pedido: uma string que representa uma transação financeira no Google Play.
Um código do pedido é criado sempre que ocorre uma transação financeira. Essa string
é incluída em um recibo enviado por e-mail ao comprador. É possível usar o código do
pedido para gerenciar reembolsos na seção Gerenciamento de pedidos do
Google Play Console. Os códigos de pedidos também são usados em relatórios de vendas e de
pagamentos.
Próximas etapas
Para começar a integrar o sistema de faturamento do Google Play ao back-end do app e do servidor,
consulte o guia de configuração.
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2025-07-27 UTC.
[null,null,["Última atualização 2025-07-27 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)."]]