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 表示法
{

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "activateOneTimeProductOfferRequest": {
    object (ActivateOneTimeProductOfferRequest)
  },
  "cancelOneTimeProductOfferRequest": {
    object (CancelOneTimeProductOfferRequest)
  },
  "deactivateOneTimeProductOfferRequest": {
    object (DeactivateOneTimeProductOfferRequest)
  }
  // End of mutually exclusive fields.
}
欄位
要套用的狀態轉換類型,必須設定一個。以下列出互斥欄位。回應中最多會設定下列其中一個欄位:
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)

(選用步驟) 這項更新傳播的延遲容許值。預設為「latency-sensitive」。

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)

(選用步驟) 這項更新傳播的延遲容許值。預設為「latency-sensitive」。