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. הספרייה הזו מאפשרת תקשורת עם השכבה של Google Play Services שמספקת את חבילת המוצרים המתורגמת שזמינה לכל משתמש באפליקציה, וגם שיטות לטיפול בפעולות אחרות הנדרשות מהמשתמשים, כמו הפעלת תהליך הרכישה וטיפול בתוצאה שלו.
כדאי גם לשלב את מערכת החיוב של Google Play עם הקצה העורפי של השרת כדי ליצור את תהליכי הפיתוח הנדרשים. זה חיוני כדי להבטיח שהניהול של הרכישות וההרשאות בפלטפורמות השונות יעילים ומאובטחים.
אפשר ליצור את השילוב הזה באמצעות Subscriptions and in-App Purchases API שסופק על ידי Google Play Developer API. השילוב בצד העורפי משתמש גם בכמה כלים של פלטפורמת Google Cloud.
איור 2. ממשקי API ושירותים שסופקו על ידי ממשק API של Google Play למפתחים.
טרמינולוגיה
בקטע הזה מפורטים ומתוארים המושגים והטכנולוגיות ברמה גבוהה שעשויים להופיע במהלך השילוב של מערכת החיוב של Google Play באפליקציה. מומלץ להיעזר ברשימה הזו במהלך ההדרכה לשילוב.
טכנולוגיות
Google Play. חנות אונליין שבה המשתמשים יכולים להוריד אפליקציות ומוצרים דיגיטליים אחרים.
Google Play Console. פלטפורמה שמספקת ממשק שבו אפשר לפרסם את האפליקציה ב-Google Play. ב-Google Play Console מוצגים גם פרטים על האפליקציה, כולל מוצרים או תוכן שאתם מוכרים דרך Google Play.
מסוף Google Cloud. פלטפורמה לניהול ממשקי API לקצה העורפי, כמו Google Play Developer API.
Google Play Developer API.
ממשק API ל-REST שאפשר להשתמש בו כדי לטפל באופן פרוגרמטי במשימות של פרסום וניהול אפליקציות.
Cloud Pub/Sub. שירות מנוהל להעברת הודעות בזמן אמת שמאפשר לשלוח ולקבל הודעות בין אפליקציות עצמאיות. Google Play משתמש ב-Cloud Pub/Sub כדי לשלוח התראות למפתחים בזמן אמת. כדי להשתמש ב-Cloud Pub/Sub, צריך פרויקט ב-Google Cloud Platform (GCP) שבו מופעל Cloud Pub/Sub API. אם אתם לא מכירים את GCP ו-Cloud Pub/Sub, תוכלו לעיין במדריך למתחילים.
שרת בק-אנד מאובטח. כחלק משילוב מערכת החיוב של Google Play באפליקציה, מומלץ מאוד להשתמש בשרת אחורי מאובטח כדי להטמיע משימות שקשורות לחיוב, כמו אימות רכישות, תכונות ספציפיות למינויים וטיפול בהתראות למפתחים בזמן אמת.
אפליקציית חנות Google Play. אפליקציה שמנהלת את כל הפעולות שקשורות ל-Google Play. כל הבקשות שהאפליקציה שלכם שולחת מטופלות על ידי האפליקציה של חנות Google Play.
מושגים
Flow. תהליך מציג את השלבים האופייניים לביצוע משימה שקשורה לחיוב. לדוגמה, תהליך רכישה מתאר את השלבים שבהם משתמש רוכש את המוצר שלכם. תהליך המינוי עשוי להראות איך מינוי עובר בין מצבים.
זכאות. כשמשתמש רוכש מוצר מתוך האפליקציה, הוא זכאי למוצר הזה באפליקציה. במוצרים חד-פעמיים, המשמעות היא שלמשתמש אמורה להיות עכשיו גישה קבועה למוצר.
לגבי מינויים, המשמעות היא שלמשתמש צריכה להיות גישה כל עוד המינוי פעיל.
מזהה המוצר. המזהה של סוג מוצר ספציפי.
Purchase token (אסימון רכישה). מחרוזת שמייצגת את הזכאות של הקונה למוצר ב-Google Play. הוא מציין שמשתמש Google שילם על מוצר ספציפי.
מזהה הזמנה. מחרוזת שמייצגת עסקה פיננסית ב-Google Play.
מספר הזמנה נוצר בכל פעם שמתבצעת עסקה פיננסית. המחרוזת הזו כלולה בחשבונית שנשלחת באימייל לקונה. אפשר להשתמש במספר ההזמנה כדי לנהל את ההחזרים הכספיים בקטע ניהול הזמנות ב-Google Play Console. מזהי ההזמנות משמשים גם בדוחות המכירות והתשלומים.
השלבים הבאים
כדי להתחיל לשלב את מערכת החיוב של Google Play עם האפליקציה ועם הקצה העורפי של השרת, תוכלו לעיין במדריך ההגדרה.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון 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-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)."]]