Method: monetization.onetimeproducts.purchaseOptions.offers.batchGet
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions/{purchaseOptionId}/offers:batchGet
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
packageName |
string
必要欄位。更新後優惠的父項應用程式 (套件名稱)。 必須等於所有更新的 OneTimeProductOffer 資源中的 packageName 欄位。
|
productId |
string
必要欄位。如果所有更新的方案都屬於同一項產品,請提供父項一次性產品的產品 ID。如果這項要求涵蓋多個一次性產品,請將這個欄位設為「-」。
|
purchaseOptionId |
string
必要欄位。要更新優惠的父項購買選項 (ID)。可指定為「-」,更新多個購買選項的方案。
|
要求主體
要求主體的資料會採用以下結構:
欄位 |
requests[] |
object (GetOneTimeProductOfferRequest )
必要欄位。最多 100 個元素的擷取要求清單。所有要求都必須擷取不同的優惠。
|
回應主體
offers.batchGet 端點的回應訊息。
如果成功,回應主體會含有以下結構的資料:
欄位 |
oneTimeProductOffers[] |
object (OneTimeProductOffer )
更新後的一次性產品方案清單,順序與要求相同。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/androidpublisher
GetOneTimeProductOfferRequest
GetOneTimeProductOffers 的要求訊息。
JSON 表示法 |
{
"packageName": string,
"productId": string,
"purchaseOptionId": string,
"offerId": string
} |
欄位 |
packageName |
string
必要欄位。要取得優惠的父項應用程式 (套件名稱)。
|
productId |
string
必要欄位。要取得的方案父項一次性產品 (ID)。
|
purchaseOptionId |
string
必要欄位。要取得的方案上層購買選項 (ID)。
|
offerId |
string
必要欄位。要取得的優惠專屬 ID。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[],[],null,["# Method: monetization.onetimeproducts.purchaseOptions.offers.batchGet\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 - [JSON representation](#body.BatchGetOneTimeProductOffersResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [GetOneTimeProductOfferRequest](#GetOneTimeProductOfferRequest)\n - [JSON representation](#GetOneTimeProductOfferRequest.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReads one or more one-time product offers.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions/{purchaseOptionId}/offers:batchGet`\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 updated offers. Must be equal to the packageName field on all the updated OneTimeProductOffer resources. |\n| `productId` | `string` Required. The product ID of the parent one-time product, if all updated offers belong to the same product. If this request spans multiple one-time products, set this field to \"-\". |\n| `purchaseOptionId` | `string` Required. The parent purchase option (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple purchase options. |\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.offers/batchGet#GetOneTimeProductOfferRequest) } ] } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (`[GetOneTimeProductOfferRequest](/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchGet#GetOneTimeProductOfferRequest)`)` Required. A list of get requests of up to 100 elements. All requests must retrieve different offers. |\n\n### Response body\n\nResponse message for the offers.batchGet endpoint.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"oneTimeProductOffers\": [ { object (/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers#OneTimeProductOffer) } ] } ``` |\n\n| Fields ||\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `oneTimeProductOffers[]` | `object (`[OneTimeProductOffer](/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers#OneTimeProductOffer)`)` The list of updated one-time product offers, in the same order as the request. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nGetOneTimeProductOfferRequest\n-----------------------------\n\nRequest message for GetOneTimeProductOffers.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"packageName\": string, \"productId\": string, \"purchaseOptionId\": string, \"offerId\": string } ``` |\n\n| Fields ||\n|--------------------|--------------------------------------------------------------------------|\n| `packageName` | `string` Required. The parent app (package name) of the offer to get. |\n| `productId` | `string` Required. The parent one-time product (ID) of the offer to get. |\n| `purchaseOptionId` | `string` Required. The parent purchase option (ID) of the offer to get. |\n| `offerId` | `string` Required. The unique offer ID of the offer to get. |"]]