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 ها را برای ادغام با برنامه اندروید و سرور شما ارائه می دهد که آشنایی و ایمنی خریدهای Google Play را برای کاربران شما باز می کند.
معماری یکپارچه سازی
این بخش ماژول های عملکردی مختلفی را که می توانید بسازید و API ها و کتابخانه های موجود برای ساده سازی فرآیند معرفی می کند.
شکل 1. نمودار یکپارچه سازی صورتحساب Google Play معمولی.
میتوانید با استفاده از کتابخانه صورتحساب Play، سیستم صورتحساب Google Play را با برنامه Android خود ادغام کنید. این کتابخانه ارتباط با لایه سرویسهای Google Play را امکانپذیر میسازد که پیشنهاد محصول بومیسازی شده را در دسترس هر کاربر در برنامه شما و همچنین روشهایی برای مدیریت سایر عملیاتهای ضروری کاربر، مانند راهاندازی جریان خرید و رسیدگی به نتیجه آن، ارائه میدهد.
همچنین باید سیستم صورتحساب Google Play را با باطن سرور خود ادغام کنید تا جریانهای توسعهدهنده لازم را ایجاد کنید. این امر برای تضمین کارآمد و ایمن بودن مدیریت خرید و حقوق بین پلتفرمی شما ضروری است. میتوانید این ادغام را با API اشتراکها و خریدهای درونبرنامه ارائه شده توسط Google Play Developer API ایجاد کنید. ادغام باطن همچنین از برخی ابزارهای پلتفرم Google Cloud استفاده می کند.
شکل 2. APIها و خدمات ارائه شده توسط Google Play Developer API.
اصطلاحات
این بخش فناوریها و مفاهیم سطح بالایی را که ممکن است هنگام ادغام سیستم صورتحساب Google Play در برنامه خود با آنها مواجه شوید، فهرست کرده و توضیح میدهد. همانطور که از طریق راهنمای ادغام ادامه می دهید به این لیست مراجعه کنید.
فن آوری ها
گوگل پلی یک فروشگاه آنلاین که در آن کاربران می توانند برنامه ها و سایر محصولات دیجیتال را دانلود کنند.
کنسول Google Play . پلتفرمی که رابطی را فراهم می کند که می توانید برنامه خود را در Google Play منتشر کنید. کنسول Google Play همچنین جزئیات برنامه شما را نشان می دهد، از جمله هر محصول یا محتوایی که با Google Play می فروشید.
Google Cloud Console پلتفرمی که API های Backend را مدیریت می کند، مانند Google Play Developer API.
کتابخانه صورتحساب Google Play . یک API که می توانید از آن برای ادغام سیستم صورتحساب Google Play در برنامه خود استفاده کنید.
Google Play Developer API . یک REST API که میتوانید از آن برای مدیریت برنامهنویسی انتشارات و وظایف مدیریت برنامه استفاده کنید.
Cloud Pub/Sub . یک سرویس پیام رسانی بلادرنگ کاملاً مدیریت شده که به شما امکان می دهد پیام ها را بین برنامه های مستقل ارسال و دریافت کنید. Google Play از Cloud Pub/Sub برای ارائه اعلانهای برنامهنویس در زمان واقعی استفاده میکند. برای استفاده از Cloud Pub/Sub ، باید پروژهای در Google Cloud Platform (GCP) با Cloud Pub/Sub API فعال داشته باشید. اگر با GCP و Cloud Pub/Sub آشنایی ندارید، به راهنمای Quickstart مراجعه کنید.
اعلانهای بیدرنگ توسعهدهنده مکانیزمی که به شما امکان میدهد با استفاده از Cloud Pub/Sub تغییرات وضعیت اشتراکهای مدیریتشده توسط Google Play را در زمان واقعی نظارت کنید.
سرور باطن امن بهعنوان بخشی از ادغام سیستم صورتحساب Google Play در برنامهتان، اکیداً توصیه میکنیم که از یک سرور پشتیبان امن برای اجرای کارهای مربوط به صورتحساب مانند تأیید خرید، ویژگیهای خاص اشتراک، و رسیدگی به اعلانهای برنامهنویس بلادرنگ استفاده کنید.
برنامه فروشگاه Google Play . برنامه ای که تمام عملیات مربوط به Google Play را مدیریت می کند. همه درخواستهای ارائه شده توسط برنامه شما توسط برنامه فروشگاه Google Play انجام میشود.
مفاهیم
جریان . یک جریان، مراحل معمولی درگیر در یک کار مربوط به صورتحساب را نشان میدهد. به عنوان مثال، یک جریان خرید مراحلی را که زمانی که کاربر محصول شما را خریداری می کند، مشخص می کند. یک جریان اشتراک ممکن است نشان دهد که چگونه یک اشتراک بین حالت ها انتقال می یابد.
استحقاق . هنگامی که کاربر یک محصول درون برنامه ای را خریداری می کند، پس از آن حق دریافت آن محصول در برنامه شما را دارد. برای محصولات یک بار مصرف، این بدان معنی است که کاربر اکنون باید دسترسی دائمی به محصول داشته باشد. برای اشتراک ها، این بدان معناست که کاربر باید در زمانی که اشتراک فعال است، دسترسی داشته باشد.
شناسه محصول . شناسه یک نوع محصول خاص
ژتون خرید . رشته ای که نشان دهنده حق خرید یک محصول در Google Play است. این نشان می دهد که یک کاربر گوگل برای یک محصول خاص پول پرداخت کرده است.
شناسه سفارش . رشته ای که نشان دهنده یک تراکنش مالی در Google Play است. هر بار که یک تراکنش مالی اتفاق می افتد یک شناسه سفارش ایجاد می شود. این رشته در رسیدی که برای خریدار ایمیل می شود گنجانده شده است. میتوانید از شناسه سفارش برای مدیریت بازپرداخت در بخش مدیریت سفارش در کنسول Google Play استفاده کنید. شناسه سفارش نیز در گزارش های فروش و پرداخت استفاده می شود.
مراحل بعدی
برای شروع یکپارچهسازی سیستم صورتحساب Google Play با برنامه و سرور خود، راهنمای راهاندازی را ببینید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]