Method: monetization.onetimeproducts.purchaseOptions.offers.batchUpdateStates

更新一批一次性產品方案狀態。

HTTP 要求

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

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

路徑參數

參數
packageName

string

必要欄位。更新後一次性產品優惠的父項應用程式 (套件名稱)。

productId

string

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

purchaseOptionId

string

必要欄位。如果所有更新的方案都屬於同一個購買選項,請提供父項購買選項的 ID。如果這批更新涵蓋多個購買選項,請將這個欄位設為「-」。

要求主體

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

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

object (UpdateOneTimeProductOfferStateRequest)

必要欄位。最多 100 個元素的要求更新清單。所有要求都必須更新不同的方案。

回應主體

offers.batchUpdateStates 的回應訊息。

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

JSON 表示法
{
  "oneTimeProductOffers": [
    {
      object (OneTimeProductOffer)
    }
  ]
}
欄位
oneTimeProductOffers[]

object (OneTimeProductOffer)

更新後的一次性產品優惠清單,順序與要求相同。

授權範圍

需要下列 OAuth 範圍:

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

UpdateOneTimeProductOfferStateRequest

要求訊息,用於更新一次性產品優惠的狀態。

JSON 表示法
{

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

object (ActivateOneTimeProductOfferRequest)

啟用優惠。啟用後,只要符合條件,使用者就能享有優惠。

cancelOneTimeProductOfferRequest

object (CancelOneTimeProductOfferRequest)

取消優惠。取消後,使用者就無法再享有這項優惠。與這項優惠相關的待處理訂單將會取消。這項狀態轉換僅適用於預購。

deactivateOneTimeProductOfferRequest

object (DeactivateOneTimeProductOfferRequest)

停用優惠。停用後,使用者就無法再享有這項優惠。這項狀態轉換僅適用於折扣優惠。

CancelOneTimeProductOfferRequest

offers.cancel 的要求訊息。

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

string

必要欄位。要取消的優惠所屬父項應用程式 (套件名稱)。

productId

string

必要欄位。要取消的方案所屬一次性產品 (ID)。

purchaseOptionId

string

必要欄位。要取消的優惠父項購買選項 (ID)。

offerId

string

必要欄位。要取消的優惠 ID。

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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

DeactivateOneTimeProductOfferRequest

offers.deactivate 的要求訊息。

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

string

必要欄位。要停用優惠的父項應用程式 (套件名稱)。

productId

string

必要欄位。要停用的方案所屬一次性產品 (ID)。

purchaseOptionId

string

必要欄位。要停用優惠的父項購買選項 (ID)。

offerId

string

必要欄位。要停用的優惠 ID。

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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