Method: monetization.subscriptions.basePlans.offers.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建新的订阅优惠。只有自动续订的基础方案才能提供订阅优惠。在激活之前,优惠状态为“草稿”。
HTTP 请求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers
网址采用 gRPC 转码语法。
路径参数
参数 |
packageName |
string
必需。应为其创建优惠的父级应用(软件包名称)。必须等于订阅资源上的 packageName 字段。
|
productId |
string
必需。应为其创建优惠的父级订阅 (ID)。必须等于 SubscriptionOffer 资源上的 productId 字段。
|
basePlanId |
string
必需。要为其创建优惠的父级基础方案 (ID)。必须等于 SubscriptionOffer 资源上的 basePlanId 字段。
|
查询参数
参数 |
offerId |
string
必需。用于优惠的 ID。有关此格式的要求,请参阅 SubscriptionOffer 资源上 offerId 字段的文档。
|
regionsVersion |
object (RegionsVersion )
必需。用于 subscriptionOffer 的可用地区的版本。
|
请求正文
请求正文包含一个 SubscriptionOffer
实例。
响应正文
如果成功,响应正文将包含一个新创建的 SubscriptionOffer
实例。
授权范围
需要以下 OAuth 作用域:
https://www.googleapis.com/auth/androidpublisher
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCreates a new subscription offer for auto-renewing base plans, initially in DRAFT state until activated.\u003c/p\u003e\n"],["\u003cp\u003eUses an HTTP POST request to \u003ccode\u003ehttps://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers\u003c/code\u003e with specified path and query parameters.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing a \u003ccode\u003eSubscriptionOffer\u003c/code\u003e object in the request body, detailing the offer's specifics.\u003c/p\u003e\n"],["\u003cp\u003eUpon success, the response body returns the newly created \u003ccode\u003eSubscriptionOffer\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This document details how to create a new subscription offer for auto-renewing base plans. The `POST` request is sent to a specific URL with `packageName`, `productId`, and `basePlanId` as required path parameters. The `offerId` and `regionsVersion` are required query parameters. The request body must contain `SubscriptionOffer` data, and a successful response returns the newly created `SubscriptionOffer`. Authorization requires the `https://www.googleapis.com/auth/androidpublisher` OAuth scope.\n"],null,["# Method: monetization.subscriptions.basePlans.offers.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new subscription offer. Only auto-renewing base plans can have subscription offers. The offer state will be DRAFT until it is activated.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Required. The parent app (package name) for which the offer should be created. Must be equal to the packageName field on the Subscription resource. |\n| `productId` | `string` Required. The parent subscription (ID) for which the offer should be created. Must be equal to the productId field on the SubscriptionOffer resource. |\n| `basePlanId` | `string` Required. The parent base plan (ID) for which the offer should be created. Must be equal to the basePlanId field on the SubscriptionOffer resource. |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `offerId` | `string` Required. The ID to use for the offer. For the requirements on this format, see the documentation of the offerId field on the SubscriptionOffer resource. |\n| `regionsVersion` | `object (`[RegionsVersion](/android-publisher/api-ref/rest/v3/RegionsVersion)`)` Required. The version of the available regions being used for the subscriptionOffer. |\n\n### Request body\n\nThe request body contains an instance of [SubscriptionOffer](/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [SubscriptionOffer](/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`"]]