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.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Sistem penagihan Google Play adalah layanan yang memungkinkan Anda menjual produk dan
konten digital di aplikasi Android, baik jika Anda ingin memonetisasi melalui pembelian satu kali
maupun menawarkan langganan ke layanan Anda. Google Play menawarkan kumpulan API lengkap untuk integrasi dengan aplikasi Android dan backend server yang mempermudah pengalaman dan menciptakan keamanan pembelian Google Play bagi pengguna Anda.
Arsitektur integrasi
Bagian ini memperkenalkan berbagai modul fungsional yang dapat Anda bangun serta
API dan library yang tersedia untuk menyederhanakan prosesnya.
Gambar 1. Diagram integrasi standar Layanan Penagihan
Google Play.
Anda dapat mengintegrasikan sistem penagihan Google Play dengan aplikasi Android menggunakan Play Billing Library. Library ini
memungkinkan komunikasi dengan lapisan Layanan Google Play yang menyediakan
penawaran produk yang dilokalkan dan tersedia untuk setiap pengguna di aplikasi Anda, serta
metode untuk menangani operasi pengguna lain yang diperlukan, seperti meluncurkan alur
pembelian dan menangani hasilnya.
Anda juga harus mengintegrasikan sistem penagihan Google Play dengan backend server untuk
membuat alur developer yang diperlukan. Penting untuk menjamin bahwa
pengelolaan pembelian dan hak lintas platform Anda efisien dan aman.
Anda dapat membuat integrasi ini dengan API Langganan dan pembelian
dalam aplikasi yang disediakan oleh
Google Play Developer API. Integrasi backend juga memanfaatkan beberapa
alat platform Google Cloud.
Gambar 2. API dan layanan yang disediakan oleh Google Play
Developer API.
Terminologi
Bagian ini mencantumkan dan menjelaskan teknologi dan konsep tingkat tinggi yang
mungkin Anda temui saat mengintegrasikan sistem penagihan Google Play ke aplikasi.
Rujuk daftar ini saat Anda melanjutkan panduan integrasi.
Teknologi
Google Play. Toko online tempat pengguna dapat
mendownload aplikasi dan produk digital lainnya.
Konsol Google Play. Platform
yang menyediakan antarmuka tempat Anda dapat memublikasikan aplikasi ke Google Play. Konsol
Google Play juga menampilkan detail tentang aplikasi Anda, yang meliputi
produk atau konten apa pun yang Anda jual dengan Google Play.
Konsol Google Cloud. Platform
yang mengelola API backend, seperti Google Play Developer API.
Google Play Billing Library. API yang
dapat Anda gunakan untuk mengintegrasikan sistem penagihan Google Play ke aplikasi.
Google Play Developer API.
REST API yang dapat Anda gunakan untuk menangani tugas publikasi dan
pengelolaan aplikasi secara terprogram.
Cloud Pub/Sub. Layanan pesan real-time
terkelola sepenuhnya yang memungkinkan Anda mengirim dan menerima pesan
antar-aplikasi independen. Google Play menggunakan Cloud Pub/Sub untuk mengirimkan
Notifikasi developer real-time. Untuk menggunakan Cloud
Pub/Sub, Anda harus memiliki project di
Google Cloud Platform (GCP) dengan Cloud
Pub/Sub API yang telah diaktifkan. Jika Anda belum terbiasa menggunakan GCP dan Cloud Pub/Sub, lihat
Panduan memulai.
Notifikasi developer real time.
Mekanisme yang memungkinkan Anda memantau perubahan status untuk langganan yang dikelola
Google Play secara real time dengan memanfaatkan Cloud
Pub/Sub.
Server backend aman. Sebagai bagian dari integrasi sistem penagihan Google Play
ke aplikasi, sebaiknya Anda menggunakan server backend yang aman untuk
mengimplementasikan tugas terkait penagihan, seperti verifikasi pembelian,
fitur khusus langganan, dan penanganan
Notifikasi developer real time.
Aplikasi Google Play Store. Aplikasi yang mengelola semua operasi yang terkait dengan Google Play. Semua permintaan yang dibuat oleh aplikasi Anda ditangani oleh aplikasi Google Play
Store.
Konsep
Alur. Alur menunjukkan langkah-langkah umum yang terlibat dalam tugas
terkait penagihan. Misalnya, alur pembelian menguraikan langkah-langkah
yang dilibatkan saat pengguna membeli produk Anda. Alur langganan dapat menunjukkan
transisi langganan antar-status.
Hak. Jika pengguna membeli produk dalam aplikasi, mereka akan
memperoleh hak atas produk tersebut dalam aplikasi Anda. Untuk produk sekali beli, hal ini berarti
pengguna sekarang memiliki akses permanen ke produk tersebut.
Untuk langganan, hal ini berarti pengguna memiliki akses selama
langganan aktif.
ID Produk. ID jenis produk tertentu.
Token pembelian. String yang mewakili hak pembeli atas
produk di Google Play. Token ini menunjukkan bahwa pengguna Google telah melakukan pembayaran untuk
produk tertentu.
ID Pesanan. String yang mewakili transaksi keuangan di Google Play.
ID pesanan dibuat setiap kali transaksi keuangan dilakukan. String ini
disertakan dalam tanda terima yang dikirimkan kepada pembeli melalui email. Anda dapat menggunakan ID
pesanan untuk mengelola pengembalian dana di bagian Pengelolaan Pesanan
Konsol Google Play. ID pesanan juga digunakan dalam laporan penjualan dan
pembayaran.
Langkah berikutnya
Untuk mulai mengintegrasikan sistem penagihan Google Play dengan backend aplikasi dan server Anda,
lihat panduan penyiapan.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]