Method: monetization.onetimeproducts.purchaseOptions.batchUpdateStates

啟用或停用一或多個一次性產品的購買選項。

HTTP 要求

POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions:batchUpdateStates

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
packageName

string

必要欄位。更新後購買選項的父項應用程式 (套件名稱)。

productId

string

必要欄位。如果所有更新的購買選項都屬於同一個一次性產品,請提供父項一次性產品的產品 ID。如果這批更新包含多個一次性產品,請將這個欄位設為「-」。

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "requests": [
    {
      object (UpdatePurchaseOptionStateRequest)
    }
  ]
}
欄位
requests[]

object (UpdatePurchaseOptionStateRequest)

必要欄位。最多 100 個元素的要求更新清單。所有要求都必須更新不同的購買選項。

回應主體

purchaseOptions.batchUpdateStates 的回應訊息。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "oneTimeProducts": [
    {
      object (OneTimeProduct)
    }
  ]
}
欄位
oneTimeProducts[]

object (OneTimeProduct)

更新後的一次性產品清單。這份清單會與要求一一對應,順序也相同。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/androidpublisher

UpdatePurchaseOptionStateRequest

要求訊息,用於更新一次性產品購買選項的狀態。

JSON 表示法
{

  // Union field state_transition_type can be only one of the following:
  "activatePurchaseOptionRequest": {
    object (ActivatePurchaseOptionRequest)
  },
  "deactivatePurchaseOptionRequest": {
    object (DeactivatePurchaseOptionRequest)
  }
  // End of list of possible types for union field state_transition_type.
}
欄位
聯集欄位 state_transition_type。要套用的狀態轉換類型,必須設定一個。state_transition_type 只能是下列其中一項:
activatePurchaseOptionRequest

object (ActivatePurchaseOptionRequest)

啟用購買選項。啟用後,購買選項就會生效。

deactivatePurchaseOptionRequest

object (DeactivatePurchaseOptionRequest)

停用購買選項。停用後,購買選項就會失效。

ActivatePurchaseOptionRequest

UpdatePurchaseOptionState 的要求訊息。

JSON 表示法
{
  "packageName": string,
  "productId": string,
  "purchaseOptionId": string,
  "latencyTolerance": enum (ProductUpdateLatencyTolerance)
}
欄位
packageName

string

必要欄位。要啟用的購買選項所屬父項應用程式 (套件名稱)。

productId

string

必要欄位。要啟用的購買選項所屬一次性產品 (ID)。

purchaseOptionId

string

必要欄位。要啟用的購買選項 ID。

latencyTolerance

enum (ProductUpdateLatencyTolerance)

(選用步驟) 這項產品更新的傳播延遲容許度。預設為延遲時間敏感。

DeactivatePurchaseOptionRequest

UpdatePurchaseOptionState 的要求訊息。

JSON 表示法
{
  "packageName": string,
  "productId": string,
  "purchaseOptionId": string,
  "latencyTolerance": enum (ProductUpdateLatencyTolerance)
}
欄位
packageName

string

必要欄位。要停用購買選項的父項應用程式 (套件名稱)。

productId

string

必要欄位。要停用購買選項的父項一次性產品 (ID)。

purchaseOptionId

string

必要欄位。要停用的購買選項 ID。

latencyTolerance

enum (ProductUpdateLatencyTolerance)

(選用步驟) 這項產品更新的傳播延遲容許度。預設為延遲時間敏感。