Method: purchases.subscriptions.get

הוצאה משימוש: במקום זאת, צריך להשתמש ב-purchases.subscriptionsv2.get. הפונקציה בודקת אם רכישת המינוי של משתמש תקפה ומחזירה את זמן התפוגה שלו.

בקשת HTTP

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

כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.

פרמטרים של נתיב

פרמטרים
packageName

string

שם החבילה של האפליקציה שבה נרכש המנוי (לדוגמה, 'com.some.thing').

subscriptionId

string

מזהה המינוי שנרכש (לדוגמה, 'monthly001').

token

string

האסימון שסופק למכשיר של המשתמש כשהמינוי נרכש.

גוף הבקשה

גוף הבקשה חייב להיות ריק.

גוף התשובה

אם הפעולה מצליחה, גוף התגובה מכיל מופע של SubscriptionPurchase.

דוגמה

דוגמה לבקשה:

curl -X GET \
  'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/subscriptions/monthly.premium/tokens/abcdefghijklmnopqrstuvwxyz.0123456789' \
  -H 'Accept: application/json'

זוהי דוגמה לתגובה:

{
  "kind": "androidpublisher#subscriptionPurchase",
  "startTimeMillis": "1678886400000",
  "expiryTimeMillis": "1710470400000",
  "autoRenewing": true,
  "priceCurrencyCode": "USD",
  "priceAmountMicros": "9990000",
  "introductoryPriceInfo": {
    "introductoryPriceCurrencyCode": "USD",
    "introductoryPriceAmountMicros": "4990000",
    "introductoryPricePeriod": "P1M",
    "introductoryPriceCycles": 1
  },
  "countryCode": "US",
  "developerPayload": "{\"userId\": \"user12345\", \"source\": \"app-promo\"}",
  "paymentState": 1,
  "cancelReason": 0,
  "userCancellationTimeMillis": "1709251200000",
  "cancelSurveyResult": {
    "cancelSurveyReason": 3,
    "userInputCancelReason": null
  },
  "orderId": "GPA.3344-5566-7788-99001",
  "linkedPurchaseToken": null,
  "purchaseType": 0,
  "priceChange": null,
  "profileName": "Jane Doe",
  "emailAddress": "jane.doe@example.com",
  "givenName": "Jane",
  "familyName": "Doe",
  "profileId": "109876543210987654321",
  "acknowledgementState": 1,
  "externalAccountId": "user-jane-doe-app-id",
  "promotionType": 1,
  "promotionCode": "WELCOME20",
  "obfuscatedExternalAccountId": "obfUaCcOunTId123",
  "obfuscatedExternalProfileId": "obfPrOfiLeId456",
  "autoResumeTimeMillis": null
}

היקפי הרשאה

נדרשת הרשאת OAuth ברמה הבאה:

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