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,
  "refundableQuantity": integer
}
字段
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 的混淆版本,与用户在您的账号中唯一关联的 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 结算地区代码。

refundableQuantity

integer

符合退款条件的数量,即尚未退款的数量。该值反映了基于数量的部分退款和全额退款。

方法

acknowledge

确认购买应用内商品。

consume

购买应用内商品。

get

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