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)

產品的購買時間,自 Epoch 紀元時間 (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

查看應用程式內產品的購買和消費狀態。