Method: purchases.products.get

ตรวจสอบสถานะการซื้อและการบริโภคของไอเทมที่ซื้อในแอป

คำขอ HTTP

GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}

URL ใช้ไวยากรณ์การแปลง gRPC

พารามิเตอร์เส้นทาง

พารามิเตอร์
packageName

string

ชื่อแพ็กเกจของแอปพลิเคชันที่จำหน่ายไอเทมที่ซื้อในแอป (เช่น "com.some.thing")

productId

string

SKU ของไอเทมที่ซื้อในแอป (เช่น "com.some.thing.inapp1")

token

string

โทเค็นที่ส่งไปยังอุปกรณ์ของผู้ใช้เมื่อซื้อไอเทมที่ซื้อในแอป

เนื้อความของคำขอ

เนื้อหาของคำขอต้องว่างเปล่า

เนื้อหาการตอบกลับ

หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ ProductPurchase

ตัวอย่าง

ตัวอย่างคําขอมีดังนี้

curl \
  -X GET \
  'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/products/exampleSKU/tokens/exampleToken' \
  -H 'Accept: application/json'

ตัวอย่างคำตอบมีดังนี้

{
  "kind": "androidpublisher#productPurchase",
  "purchaseTimeMillis": "1678886400000",
  "purchaseState": 0,
  "consumptionState": 0,
  "developerPayload": "sample developer payload",
  "orderId": "GPA.1234-5678-9012-34567",
  "purchaseType": 0,
  "acknowledgementState": 0,
  "productId": "com.example.app.productId",
  "purchaseToken": "purchase token",
  "quantity": 1,
  "refundableQuantity": 1,
  "regionCode": "US",
  "obfuscatedExternalAccountId": "obfuscated external account id",
  "obfuscatedExternalProfileId": "obfuscated external profile id"
}

ขอบเขตการให้สิทธิ์

ต้องใช้ขอบเขต OAuth ต่อไปนี้

  • https://www.googleapis.com/auth/androidpublisher