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.
外部优惠 API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在某些国家/地区,符合条件的开发者可以将用户引导到应用以外,包括宣传应用内数字功能和服务的相关优惠。本指南将介绍用于启用外部优惠的 API。您应该先查看计划要求并加入外部优惠计划,然后再使用这些 API。
术语词汇表
本指南使用的惯用术语:
- 外部优惠 API:用于将用户定向到应用之外(包括显示所需信息界面和报告适用交易)的 API。
- 外部交易:在应用之外发生的符合条件的交易(如计划要求中所定义)。
- 外部交易令牌:通过 Play 结算库向开发者提供的令牌,供开发者在用户完成外部交易时使用。此令牌用于通知 Google Play 有一笔购买交易已成功完成。
- 外部交易 ID:开发者生成的用于标识外部交易的唯一标识符。
支持外部优惠
本部分介绍如何支持外部商品。
使用这些 API 之前,请确保以下几点:
在 Play 管理中心内配置
如需在 Play 管理中心内配置外部优惠,请按照计划要求中列出的步骤操作。
信息界面有助于用户了解他们将要访问一个外部网站。系统每次都会向用户显示信息界面,然后才会使用外部优惠 API 将用户定向到应用之外。
信息屏幕
|
示例仅供说明之用。
后续步骤
如需开始集成外部优惠 API,请遵循应用内集成和后端集成的深度指南。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# External offers APIs\n\nIn certain countries, eligible developers are able to lead users outside the\napp, including to promote offers for in-app digital features and services. This\nguide addresses the APIs to enable external offers. You should review the\n[program requirements](https://support.google.com/googleplay/android-developer/answer/14372887) and enroll in the external offers program before\nusing these APIs.\n\nGlossary of terms\n-----------------\n\nTerm conventions followed by this guide:\n\n- **External offers APIs**: APIs used to direct the user outside of the app, including surfacing required information screen and reporting applicable transactions.\n- **External transaction** : A qualifying transaction that occurs outside of the app as defined by the [program requirements](https://support.google.com/googleplay/android-developer/answer/14372887).\n- **External transaction token**: A token provided to the developer through the Play Billing Library for the developer to use when the user completes an external transaction. This token is used to notify Google Play of a successful purchase.\n- **External transaction ID**: A unique identifier generated by the developer to identify an external transaction.\n\nSupport external offers\n-----------------------\n\nThis section describes how to support external offers.\nBefore using these APIs, ensure the following:\n\n- Review the eligibility requirements for the relevant program and complete the onboarding steps outlined in the [program requirements](https://support.google.com/googleplay/android-developer/answer/14372887).\n- Integrate [Play Billing Library 6.2.1](/google/play/billing/release-notes) or higher.\n\n### Configure in Play Console\n\nTo configure external offers in Play Console, follow the steps outlined in\nthe [program requirements](https://support.google.com/googleplay/android-developer/answer/14372887).\n\n### Information screen for users\n\nThe information screen helps users understand that they are about to visit an\nexternal website. The information screen will be shown to users each time before\nthey are directed outside of the app using the external offers APIs. \n\n|--------------------|\n| Information screen |\n\nExample for illustrative purposes only.\n\n### Next steps\n\nTo begin integrating the external offers APIs, follow the in-depth guides\nfor both [in-app integration](/google/play/billing/external/integration) and [backend integration](/google/play/billing/outside-gpb-backend)."]]