Method: monetization.subscriptions.patch
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.
Cập nhật gói thuê bao hiện có.
Yêu cầu HTTP
PATCH https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{subscription.packageName}/subscriptions/{subscription.productId}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
subscription.packageName | string Không thể thay đổi. Tên gói của ứng dụng mẹ. |
subscription.productId | string Không thể thay đổi. Mã sản phẩm duy nhất của sản phẩm. Riêng biệt trong ứng dụng mẹ. Mã sản phẩm phải bao gồm chữ thường (a – z), chữ số (0 – 9), dấu gạch dưới (_) và dấu chấm (.). Mã sản phẩm phải bắt đầu bằng một chữ cái viết thường hoặc số, đồng thời phải có độ dài từ 1 đến 40 ký tự (bao gồm). |
Tham số truy vấn
Thông số |
updateMask | string (FieldMask format) Bắt buộc. Danh sách các trường cần cập nhật. Đây là danh sách các tên trường đủ điều kiện được phân tách bằng dấu phẩy. Ví dụ: "user.displayName,photo" |
regionsVersion | object (RegionsVersion ) Bắt buộc. Phiên bản của những khu vực hiện có đang dùng cho gói thuê bao. |
allowMissing | boolean Không bắt buộc. Nếu bạn đặt chính sách này thành true (đúng) đồng thời gói thuê bao có packageName và productId đã cho không tồn tại, thì gói thuê bao sẽ được tạo. Nếu bạn tạo gói thuê bao mới, updateMask sẽ bị bỏ qua. |
latencyTolerance | enum (ProductUpdateLatencyTolerance ) Không bắt buộc. Dung sai về độ trễ khi truyền bản cập nhật sản phẩm này. Giá trị mặc định là phụ thuộc vào độ trễ. |
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Subscription
.
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 Subscription
.
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\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`"]]