Method: purchases.subscriptionsv2.get
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
subscriptionsv2.get metadata about a subscription
एचटीटीपी अनुरोध
GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
packageName |
string
उस ऐप्लिकेशन का पैकेज जिसके लिए यह सदस्यता खरीदी गई थी (उदाहरण के लिए, 'com.some.thing').
|
token |
string
ज़रूरी है. सदस्यता खरीदने पर, उपयोगकर्ता के डिवाइस को दिया गया टोकन.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य हिस्सा
कामयाब रहने पर, जवाब के मुख्य हिस्से में SubscriptionPurchaseV2
का एक इंस्टेंस शामिल किया जाता है.
नमूना
अनुरोध का सैंपल यहां दिया गया है:
curl -X GET \
'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/subscriptionsv2/tokens/sample-token-123' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
यहां जवाब का एक सैंपल दिया गया है:
{
"kind": "androidpublisher#subscriptionPurchaseV2",
"regionCode": "US",
"startTime": "2024-01-15T10:00:00Z",
"subscriptionState": "SUBSCRIPTION_STATE_ACTIVE",
"latestOrderId": "GPA.3345-1234-5678-90123",
"linkedPurchaseToken": null,
"pausedStateContext": null,
"canceledStateContext": null,
"testPurchase": null,
"acknowledgementState": "ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED",
"externalAccountIdentifiers": {
"externalAccountId": "user-ext-acc-88765",
"obfuscatedExternalAccountId": " obfuscated-acc-id-aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789",
"obfuscatedExternalProfileId": "obfuscated-prof-id-9876543210zYxWvUtSrQpOnMlKjIhGfEdCbA"
},
"subscribeWithGoogleInfo": {
"profileId": "109876543210987654321",
"profileName": "Alex Smith",
"emailAddress": "alex.smith.swg@example.com",
"givenName": "Alex",
"familyName": "Smith"
},
"lineItems": [
{
"productId": "premium_monthly_v2",
"expiryTime": "2025-01-15T10:00:00Z",
"autoRenewingPlan": {
"autoRenewEnabled": true,
"recurringPrice": {
"units": "12",
"nanos": 990000000,
"currencyCode": "USD"
},
"priceChangeDetails": null,
"installmentDetails": null
},
"prepaidPlan": null,
"offerDetails": {
"basePlanId": "premium-monthly",
"offerId": "intro-offer-7day",
"offerTags": [
"initial_discount",
"seasonal_promo"
]
},
"deferredItemReplacement": null,
"signupPromotion": null
}
]
}
अनुमति के दायरे
नीचे दिए गए OAuth के लिंक की ज़रूरत हाेती है:
https://www.googleapis.com/auth/androidpublisher
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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) को अपडेट किया गया."],[[["\u003cp\u003eRetrieves metadata for a specific subscription purchase within a given application's package.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the application package name and the purchase token in the request URL.\u003c/p\u003e\n"],["\u003cp\u003eReturns detailed information about the subscription, such as purchase status, start/end times, and payment details, if successful.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication is necessary using the \u003ccode\u003eandroidpublisher\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This document outlines the process for retrieving metadata about a subscription using the `subscriptionsv2.get` method. This is done via a `GET` HTTP request to a specific URL containing the application's package name and a purchase token. The request body must be empty. The response, if successful, contains subscription details in the `SubscriptionPurchaseV2` format. This process requires the `https://www.googleapis.com/auth/androidpublisher` OAuth scope for authorization. The path parameters are package name and token.\n"],null,["# Method: purchases.subscriptionsv2.get\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nsubscriptionsv2.get metadata about a subscription\n\n### HTTP request\n\n`GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|--------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` The package of the application for which this subscription was purchased (for example, 'com.some.thing'). |\n| `token` | `string` Required. The token provided to the user's device when the subscription was purchased. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [SubscriptionPurchaseV2](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2#SubscriptionPurchaseV2).\n\n### Sample\n\nThe following is a sample request: \n\n```json\ncurl -X GET \\\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/subscriptionsv2/tokens/sample-token-123' \\\n -H 'Accept: application/json' \\\n -H 'Authorization: Bearer \u003cYOUR_ACCESS_TOKEN\u003e'\n```\n\nThe following is a sample response: \n\n```json\n{\n \"kind\": \"androidpublisher#subscriptionPurchaseV2\",\n \"regionCode\": \"US\",\n \"startTime\": \"2024-01-15T10:00:00Z\",\n \"subscriptionState\": \"SUBSCRIPTION_STATE_ACTIVE\",\n \"latestOrderId\": \"GPA.3345-1234-5678-90123\",\n \"linkedPurchaseToken\": null,\n \"pausedStateContext\": null,\n \"canceledStateContext\": null,\n \"testPurchase\": null,\n \"acknowledgementState\": \"ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED\",\n \"externalAccountIdentifiers\": {\n \"externalAccountId\": \"user-ext-acc-88765\",\n \"obfuscatedExternalAccountId\": \" obfuscated-acc-id-aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789\",\n \"obfuscatedExternalProfileId\": \"obfuscated-prof-id-9876543210zYxWvUtSrQpOnMlKjIhGfEdCbA\"\n },\n \"subscribeWithGoogleInfo\": {\n \"profileId\": \"109876543210987654321\",\n \"profileName\": \"Alex Smith\",\n \"emailAddress\": \"alex.smith.swg@example.com\",\n \"givenName\": \"Alex\",\n \"familyName\": \"Smith\"\n },\n \"lineItems\": [\n {\n \"productId\": \"premium_monthly_v2\",\n \"expiryTime\": \"2025-01-15T10:00:00Z\",\n \"autoRenewingPlan\": {\n \"autoRenewEnabled\": true,\n \"recurringPrice\": {\n \"units\": \"12\",\n \"nanos\": 990000000,\n \"currencyCode\": \"USD\"\n },\n \"priceChangeDetails\": null,\n \"installmentDetails\": null\n },\n \"prepaidPlan\": null,\n \"offerDetails\": {\n \"basePlanId\": \"premium-monthly\",\n \"offerId\": \"intro-offer-7day\",\n \"offerTags\": [\n \"initial_discount\",\n \"seasonal_promo\"\n ]\n },\n \"deferredItemReplacement\": null,\n \"signupPromotion\": null\n }\n ]\n}\n```\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`"]]