REST Resource: purchases.products

资源:ProductPurchase

ProductPurchase 资源用于指明用户购买应用内商品的状态。

JSON 表示法
{
  "kind": string,
  "purchaseTimeMillis": string,
  "purchaseState": integer,
  "consumptionState": integer,
  "developerPayload": string,
  "orderId": string,
  "purchaseType": integer,
  "acknowledgementState": integer,
  "purchaseToken": string,
  "productId": string,
  "quantity": integer,
  "obfuscatedExternalAccountId": string,
  "obfuscatedExternalProfileId": string,
  "regionCode": string
}
字段
kind

string

这种类型表示 androidpublisherservice 中的 inappPurchase 对象。

purchaseTimeMillis

string (int64 format)

购买商品的时间,以从公元纪年(1970 年 1 月 1 日)开始计算的毫秒数表示。

purchaseState

integer

订单的购买状态。可能的值包括:0。购买 1. 已取消 2. 待处理

consumptionState

integer

应用内商品的消耗状态。可能的值包括:0。尚未消耗 1. 已使用

developerPayload

string

开发者指定的字符串,其中包含关于订单的补充信息。

orderId

string

与购买应用内商品相关的订单 ID。

purchaseType

integer

应用内商品的购买类型。仅当购买交易不是使用标准的应用内购买结算流程完成时,系统才会设置此字段。可能的值包括:0。测试(即从许可测试帐号中购买的服务)1.促销(即使用促销代码购买)2.激励广告(即通过观看视频广告而不是付费)

acknowledgementState

integer

应用内商品的确认状态。可能的值包括:0。尚未确认 1. 已确认

purchaseToken

string

用于标识此购买交易的购买令牌。可能不存在。

productId

string

应用内商品 SKU。可能不存在。

quantity

integer

与购买应用内商品相关的数量。如果数量不存在,则数量为 1。

obfuscatedExternalAccountId

string

在应用中与用户帐号唯一关联的 ID 的模糊版本。仅当在购买交易中使用 https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid 进行指定时才存在。

obfuscatedExternalProfileId

string

在应用中与用户个人资料唯一关联的 ID 的混淆版本。仅当在购买交易中使用 https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid 指定时,才会存在。

regionCode

string

产品被授予时用户的 ISO 3166-1 alpha-2 结算区域代码。

方法

acknowledge

确认购买应用内商品。

consume

消耗应用内商品。

get

检查应用内商品的购买和消耗状态。