Method: monetization.onetimeproducts.purchaseOptions.batchDelete
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
刪除一或多個一次性產品的購買選項。
根據預設,如果已刪除的購買選項下有任何現有優惠,這項作業就會失敗。使用 force 參數即可覆寫預設行為。
HTTP 要求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions:batchDelete
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
packageName |
string
必要欄位。要刪除的購買選項的上層應用程式 (套件名稱)。
|
productId |
string
必要欄位。如果所有要刪除的購買選項都屬於同一個一次性產品,請提供該產品的產品 ID。如果這批刪除作業涵蓋多個一次性產品,請將這個欄位設為「-」。
|
要求主體
要求主體的資料會採用以下結構:
欄位 |
requests[] |
object (DeletePurchaseOptionRequest )
必要欄位。最多 100 個元素的刪除要求清單。所有要求都必須刪除不同一次性產品的購買選項。
|
回應主體
如果成功,回應主體會是空白的 JSON 物件。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/androidpublisher
DeletePurchaseOptionRequest
JSON 表示法 |
{
"packageName": string,
"productId": string,
"purchaseOptionId": string,
"latencyTolerance": enum (ProductUpdateLatencyTolerance ),
"force": boolean
} |
欄位 |
packageName |
string
必要欄位。要刪除的購買選項的父項應用程式 (套件名稱)。
|
productId |
string
必要欄位。要刪除的購買選項的上層一次性產品 (ID)。
|
purchaseOptionId |
string
必要欄位。要刪除的購買選項 ID。
|
latencyTolerance |
enum (ProductUpdateLatencyTolerance )
(選用步驟) 這項產品更新的傳播延遲容許度。預設為延遲時間敏感。
|
force |
boolean
(選用步驟) 如果購買選項沒有相關優惠,這個欄位就不會生效。如果購買選項有相關聯的優惠:* 如果 force 設為 false (預設值),系統會傳回錯誤。* 如果 force 設為 true,系統會刪除購買選項下的所有相關聯優惠。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[],[],null,["# Method: monetization.onetimeproducts.purchaseOptions.batchDelete\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- [DeletePurchaseOptionRequest](#DeletePurchaseOptionRequest)\n - [JSON representation](#DeletePurchaseOptionRequest.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nDeletes purchase options across one or multiple one-time products.\n\nBy default this operation will fail if there are any existing offers under the deleted purchase options. Use the force parameter to override the default behavior.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions:batchDelete`\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 purchase options to delete. |\n| `productId` | `string` Required. The product ID of the parent one-time product, if all purchase options to delete belong to the same one-time product. If this batch delete spans multiple one-time products, set this field to \"-\". |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requests\": [ { object (/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions/batchDelete#DeletePurchaseOptionRequest) } ] } ``` |\n\n| Fields ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (`[DeletePurchaseOptionRequest](/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions/batchDelete#DeletePurchaseOptionRequest)`)` Required. A list of delete requests of up to 100 elements. All requests must delete purchase options from different one-time products. |\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nDeletePurchaseOptionRequest\n---------------------------\n\nRequest message for deleting a purchase option.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"packageName\": string, \"productId\": string, \"purchaseOptionId\": string, \"latencyTolerance\": enum (/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance), \"force\": boolean } ``` |\n\n| Fields ||\n|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Required. The parent app (package name) of the purchase option to delete. |\n| `productId` | `string` Required. The parent one-time product (ID) of the purchase option to delete. |\n| `purchaseOptionId` | `string` Required. The purchase option ID of the purchase option to delete. |\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| `force` | `boolean` Optional. This field has no effect for purchase options with no offers under them. For purchase options with associated offers: \\* If `force` is set to false (default), an error will be returned. \\* If `force` is set to true, any associated offers under the purchase option will be deleted. |"]]