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)

可选。相应更新的传播延迟容忍度。默认设置为对延迟敏感。