Method: monetization.subscriptions.patch
透過集合功能整理內容 你可以依據偏好儲存及分類內容。
HTTP 要求
PATCH https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{subscription.packageName}/subscriptions/{subscription.productId}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
subscription.packageName | string 無法變更。父項應用程式的套件名稱。 |
subscription.productId | string 無法變更。產品的專屬產品 ID。父項應用程式中的專屬 ID。產品 ID 必須由小寫英文字母 (a-z)、數字 (0-9)、底線 (_) 和點 (.) 組成,開頭必須為小寫英文字母或數字,長度必須介於 1 到 40 (含) 字元之間。 |
查詢參數
參數 |
updateMask | string (FieldMask format) 必要欄位。要更新的欄位清單。 此為以半形逗號分隔的完整欄位名稱清單。範例:"user.displayName,photo" 。 |
regionsVersion | object (RegionsVersion ) 必要欄位。訂閱項目在適用區域的版本。 |
allowMissing | boolean 選用設定。如果設為 true,且指定的 packageName 和 productId 不存在,系統就會建立訂閱項目。 如果建立新訂閱項目,系統會忽略 updateMask。 |
latencyTolerance | enum (ProductUpdateLatencyTolerance ) 選用設定。此產品更新傳播的延遲時間容忍度。預設為容易受延遲影響。 |
要求主體
要求主體包含 Subscription
的例項。
回應主體
如果成功,回應主體會包含 Subscription
的執行例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/androidpublisher
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","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-26 (世界標準時間)。"],[[["\u003cp\u003eUpdates an existing subscription, or creates a new one if it doesn't exist and \u003ccode\u003eallowMissing\u003c/code\u003e is set to true.\u003c/p\u003e\n"],["\u003cp\u003eUses \u003ccode\u003ePATCH\u003c/code\u003e HTTP request with specified path and query parameters to update the subscription details.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the \u003ccode\u003epackageName\u003c/code\u003e, \u003ccode\u003eproductId\u003c/code\u003e, \u003ccode\u003eupdateMask\u003c/code\u003e, and \u003ccode\u003eregionsVersion\u003c/code\u003e for updates.\u003c/p\u003e\n"],["\u003cp\u003eRequest and response bodies contain a \u003ccode\u003eSubscription\u003c/code\u003e object, allowing access to subscription data.\u003c/p\u003e\n"],["\u003cp\u003eNeeds \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e authorization scope for access.\u003c/p\u003e\n"]]],["This document outlines the process for updating an existing subscription via a `PATCH` HTTP request to the Android Publisher API. Key actions include specifying the subscription to update using `packageName` and `productId` in the URL path. Required `updateMask` and `regionsVersion` query parameters detail the fields to modify and the region version. The request body uses the `Subscription` resource. Optional parameters `allowMissing` allows creating missing subscriptions, and `latencyTolerance` adjusts update propagation. Successful requests return an updated `Subscription` resource. The process requires `androidpublisher` authorization scope.\n"],null,["# Method: monetization.subscriptions.patch\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\nUpdates an existing subscription.\n\n### HTTP request\n\n`PATCH https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{subscription.packageName}/subscriptions/{subscription.productId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `subscription.packageName` | `string` Immutable. Package name of the parent app. |\n| `subscription.productId` | `string` Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length. |\n\n### Query parameters\n\n| Parameters ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. The list of fields to be updated. This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n| `regionsVersion` | `object (`[RegionsVersion](/android-publisher/api-ref/rest/v3/RegionsVersion)`)` Required. The version of the available regions being used for the subscription. |\n| `allowMissing` | `boolean` Optional. If set to true, and the subscription with the given packageName and productId doesn't exist, the subscription will be created. If a new subscription is created, updateMask is ignored. |\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### Request body\n\nThe request body contains an instance of [Subscription](/android-publisher/api-ref/rest/v3/monetization.subscriptions#Subscription).\n\n### Response body\n\nIf successful, the response body contains an instance of [Subscription](/android-publisher/api-ref/rest/v3/monetization.subscriptions#Subscription).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`"]]