Method: monetization.subscriptions.patch
Tetap teratur dengan koleksi Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memperbarui langganan yang sudah ada.
Permintaan HTTP
PATCH https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{subscription.packageName}/subscriptions/{subscription.productId}
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
subscription.packageName | string Tidak dapat diubah. Nama paket aplikasi induk. |
subscription.productId | string Tidak dapat diubah. ID unik produk dari produk. Unik dalam aplikasi induk. ID produk harus terdiri dari huruf kecil (a-z), angka (0-9), garis bawah (_), dan titik (.). ID produk harus dimulai dengan huruf atau angka kecil, dan panjangnya antara 1 dan 40 (inklusif). |
Parameter kueri
Parameter |
updateMask | string (FieldMask format) Wajib. Daftar kolom yang akan diperbarui. Ini adalah daftar yang dipisahkan koma yang berisi nama-nama kolom yang sepenuhnya memenuhi syarat. Contoh: "user.displayName,photo" . |
regionsVersion | object (RegionsVersion ) Wajib. Versi wilayah yang tersedia yang digunakan untuk langganan. |
allowMissing | boolean Opsional. Jika disetel ke benar (true), dan langganan dengan packageName dan productId yang ditentukan tidak ada, langganan akan dibuat. Jika langganan baru dibuat, updateMask akan diabaikan. |
latencyTolerance | enum (ProductUpdateLatencyTolerance ) Opsional. Toleransi latensi untuk penerapan update produk ini. Setelan defaultnya adalah sensitif terhadap latensi. |
Isi permintaan
Isi permintaan memuat instance Subscription
.
Isi respons
Jika berhasil, isi respons akan berisi instance Subscription
.
Cakupan otorisasi
Memerlukan cakupan OAuth berikut ini:
https://www.googleapis.com/auth/androidpublisher
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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`"]]