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 ของแอป ระบบการเรียกเก็บเงินของ Google Play มีวิธีจัดการแง่มุมที่สำคัญที่สุดของธุรกิจผลิตภัณฑ์ดิจิทัล ตั้งแต่การตั้งค่าแคตตาล็อกไปจนถึงการติดตามธุรกรรม
รูปที่ 1 แผนภาพการผสานรวมแบ็กเอนด์ทั่วไปกับระบบการเรียกเก็บเงินของ Google Play
ระบบการเรียกเก็บเงินของ Google Play จะส่งการแจ้งเตือนนักพัฒนาแอปแบบเรียลไทม์ (RTDN) สำหรับการซื้อทั้ง 2 ประเภท และแบ็กเอนด์ของคุณควรพร้อมที่จะนำเข้าข้อความเหล่านี้และทำการเปลี่ยนแปลงที่จำเป็น ดูวิธีใช้ประโยชน์จากไคลเอ็นต์ RTDN และ Google Play Developer API เพื่อจัดการวงจรการซื้อได้ที่คู่มือวงจรการซื้อ
การป้องกันการประพฤติมิชอบและการละเมิด
ป้องกันการละเมิดด้วยการเปลี่ยนตรรกะที่ละเอียดอ่อนไปยังแบ็กเอนด์และตรวจสอบการซื้อที่ยกเลิกใน Google Play Google Play Developer API มีฟังก์ชันในการตอบรับการซื้อใหม่ ใช้การซื้อผลิตภัณฑ์ในแอป และจัดการการซื้อที่ถูกยกเลิก ดูข้อมูลเพิ่มเติมเกี่ยวกับการป้องกันการประพฤติมิชอบและการละเมิดได้ที่ต่อสู้กับการประพฤติมิชอบและการละเมิด
การรายงานและการไกล่เกลี่ยทางการเงินอัตโนมัติ
คุณสามารถนำเข้าข้อมูลการรายงานจาก Google Play ได้โดยดาวน์โหลดรายงาน Play Console
คุณใช้ประโยชน์จาก Google Cloud Storage API เพื่อดาวน์โหลดข้อมูลที่มีให้ใน Play Console เพื่อจัดการกรณีการใช้งานที่เกี่ยวข้องกับข้อมูลนี้ได้
[[["เข้าใจง่าย","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,["# Integrate Google Play with your server backend\n\nYour secure server backend plays a key role in your app's management of in-app\npurchases through Google Play. Google Play's billing system provides a way to\nmanage the most important aspects of your digital product business, from setting\nup the catalog to tracking your transactions.\n**Figure 1.** Diagram of a typical backend integration with Google Play's billing system.\n\nThe [Google Play Developer API](https://developers.google.com/android-publisher)\nincludes several endpoints to keep your backend in sync with the Google Play\nbackend. In particular, the [Subscriptions and in-app purchases\nAPI](https://developers.google.com/android-publisher#subscriptions) handles\nfunctionality related to your digital product sales on Google Play.\n**Figure 2.** Billing-related endpoints provided by the Google Play Developer API.\n\nAutomated digital product catalog management\n--------------------------------------------\n\nThere are many use cases where it's potentially useful to have a digital product\ncatalog management integration in your backend. For example, this integration\ncould enable you to do the following:\n\n- Keep a mirror of your products' details on your backend for access when granting entitlements.\n- Set up a batch process to update all of your prices automatically.\n- Connect your own catalog management system with the catalog in Google Play's billing system to make sure it's updated synchronously.\n\nYou can use the\n[`monetization.subscriptions`](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions)\nand\n[`inappproducts`](https://developers.google.com/android-publisher/api-ref/rest/v3/inappproducts)\nendpoints to manage your digital product catalog.\n\nPurchase lifecycle management and entitlement sync\n--------------------------------------------------\n\nMonitoring purchase lifecycle events is essential for quick, accurate response\nto changes in your users' entitlements. You should build purchase status\nmanagement into your backend for both subscriptions and one-time purchases so\nthat all of your purchases are secure and all of your entitlements are\nconsistent.\n\nGoogle Play's billing system sends [Real-time developer\nnotifications](/google/play/billing/rtdn-reference) (RTDN) for both types of\npurchase, and your backend should be ready to import these messages and make the\nnecessary changes. To learn how to leverage an RTDN client and the\nGoogle Play Developer API to manage your purchase lifecycle, see the\n[purchase lifecycle guide](/google/play/billing/lifecycle).\n\nFraud and abuse prevention\n--------------------------\n\nPrevent abuse by moving sensitive logic to your backend and monitoring voided\npurchases on Google Play. The Google Play Developer API offers functions\nto acknowledge new purchases, consume in-app product purchases, and handle\nvoided purchases. To learn more about preventing fraud and abuse, see [Fight\nfraud and abuse](/google/play/billing/security).\n\nAutomated financial conciliation and reporting\n----------------------------------------------\n\nYou can import your reporting data from Google Play by downloading your [Play\nConsole\nreports](https://support.google.com/googleplay/android-developer/answer/6135870).\nYou can leverage [Google Cloud Storage APIs](https://cloud.google.com/storage/)\nto download the information available to you on the Play Console to address any\nuse cases related to this information.\n\nExternal transaction management\n-------------------------------\n\nIf you are integrating with the\n[alternative billing](/google/play/billing/alternative) or\n[external offers](/google/play/billing/external) APIs, use\nthe [`Externaltransactions APIs`](/google/play/billing/outside-gpb-backend)\nto report and manage completed transactions."]]