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