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

此种类表示 androidpublisher 服务中的 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

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