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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-26 UTC"],[[["This operation checks the purchase and consumption status of an in-app product."],["It requires an HTTP GET request to a specific URL with the package name, product ID, and purchase token."],["The request body must be empty, and the response provides details about the product purchase."],["This functionality requires authorization with the `https://www.googleapis.com/auth/androidpublisher` scope."]]],["This document outlines the process to check the status of an in-app purchase. It uses a `GET` HTTP request to a specific URL, structured with `packageName`, `productId`, and `token` as path parameters. The request body must be empty. A successful request returns a `ProductPurchase` instance in the response body. The operation requires the `https://www.googleapis.com/auth/androidpublisher` OAuth scope for authorization. It includes instructions to obtain a purchase status.\n"]]