Method: monetization.subscriptions.basePlans.offers.activate
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Kích hoạt một gói thuê bao. Sau khi bạn kích hoạt, ưu đãi gói thuê bao sẽ được cung cấp cho người đăng ký mới.
Yêu cầu HTTP
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Tham số |
packageName |
string
Bắt buộc. Ứng dụng mẹ (tên gói) của ưu đãi sẽ kích hoạt.
|
productId |
string
Bắt buộc. Gói thuê bao chính (Mã nhận dạng) của ưu đãi sẽ kích hoạt.
|
basePlanId |
string
Bắt buộc. Gói cơ bản chính (Mã) của ưu đãi sẽ kích hoạt.
|
offerId |
string
Bắt buộc. Mã ưu đãi duy nhất của ưu đãi cần kích hoạt.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Trường |
latencyTolerance |
enum (ProductUpdateLatencyTolerance )
Không bắt buộc. Dung sai độ trễ cho việc truyền tải bản cập nhật sản phẩm này. Giá trị mặc định là nhạy cảm với độ trễ.
|
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của SubscriptionOffer
.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/androidpublisher
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eActivates a subscription offer, making it available to new subscribers.\u003c/p\u003e\n"],["\u003cp\u003eRequires a POST request to a specific endpoint with package name, product ID, base plan ID, and offer ID.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, includes latency tolerance for product update propagation within the request body.\u003c/p\u003e\n"],["\u003cp\u003eA successful activation returns a SubscriptionOffer object.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e authorization scope.\u003c/p\u003e\n"]]],["This document outlines how to activate a subscription offer via a POST HTTP request to the specified URL, utilizing gRPC Transcoding syntax. The request requires four path parameters: `packageName`, `productId`, `basePlanId`, and `offerId`. The request body optionally includes a `latencyTolerance` field within its JSON structure. A successful request returns a `SubscriptionOffer` instance in the response body. The `https://www.googleapis.com/auth/androidpublisher` OAuth scope is necessary for authorization.\n"],null,["# Method: monetization.subscriptions.basePlans.offers.activate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nActivates a subscription offer. Once activated, subscription offers will be available to new subscribers.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate`\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) of the offer to activate. |\n| `productId` | `string` Required. The parent subscription (ID) of the offer to activate. |\n| `basePlanId` | `string` Required. The parent base plan (ID) of the offer to activate. |\n| `offerId` | `string` Required. The unique offer ID of the offer to activate. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------|\n| ``` { \"latencyTolerance\": enum (/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance) } ``` |\n\n| Fields ||\n|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `latencyTolerance` | `enum (`[ProductUpdateLatencyTolerance](/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance)`)` Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. |\n\n### Response body\n\nIf successful, the response body contains an 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`"]]