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 版本,該 ID 只會與您應用程式中的使用者帳戶產生關聯。只有在使用 https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid 指定購買交易時,才會出現這個 ID。

obfuscatedExternalProfileId

string

經模糊處理的 ID 版本,只與應用程式中的使用者個人資料相關。只有在購買時才會使用 https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid 指定此 ID。

regionCode

string

使用者取得產品時的 ISO 3166-1 alpha-2 帳單地區代碼。

方法

acknowledge

確認購買應用程式內產品。

consume

消耗應用程式內產品。

get

檢查應用程式內產品的購買和使用狀態。