Method: purchases.subscriptions.get

Desteği sonlandırıldı: Bunun yerine purchases.subscriptionsv2.get işlevini kullanın. Kullanıcının abonelik satın alma işleminin geçerli olup olmadığını kontrol eder ve aboneliğin geçerlilik süresini döndürür.

HTTP isteği

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

URL, gRPC Kod Dönüştürme söz dizimini kullanır.

Yol parametreleri

Parametreler
packageName

string

Bu aboneliğin satın alındığı uygulamanın paket adı (ör. "com.bir.şey").

subscriptionId

string

Satın alınan abonelik kimliği (ör. "monthly001").

token

string

Abonelik satın alındığında kullanıcının cihazına sağlanan jeton.

İstek içeriği

İstek metni boş olmalıdır.

Yanıt metni

Başarılıysa yanıt metni, SubscriptionPurchase öğesinin bir örneğini içerir.

Örnek

Aşağıda örnek bir istek verilmiştir:

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

Aşağıda örnek bir yanıt verilmiştir:

{
  "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
}

Yetkilendirme kapsamları

Aşağıdaki OAuth kapsamını gerektirir:

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