Method: purchases.subscriptionsv2.revoke
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
subscriptionsv2.revoke, उपयोगकर्ता की सदस्यता की खरीदारी रद्द करता है.
एचटीटीपी अनुरोध
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
packageName |
string
ज़रूरी है. उस ऐप्लिकेशन का पैकेज जिसके लिए यह सदस्यता खरीदी गई थी (उदाहरण के लिए, 'com.some.thing').
|
token |
string
ज़रूरी है. सदस्यता खरीदने पर, उपयोगकर्ता के डिवाइस को दिया गया टोकन.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में, नीचे दिए गए स्ट्रक्चर वाला डेटा होता है:
फ़ील्ड |
revocationContext |
object (RevocationContext )
ज़रूरी है. सदस्यता रद्द करने के बारे में ज़्यादा जानकारी.
|
जवाब का मुख्य भाग
अगर एपीआई सही से जुड़ जाता है, तो जवाब का मुख्य हिस्सा खाली होता है.
नमूना
अनुरोध का सैंपल यहां दिया गया है:
curl -X POST \
'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptionsv2/tokens/sample_purchase_token:revoke' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"revocationContext": {
"proratedRefund": {}
}
}'
अनुमति के दायरे
नीचे दिए गए OAuth के लिंक की ज़रूरत हाेती है:
https://www.googleapis.com/auth/androidpublisher
RevocationContext
purchases.subscriptionsv2.revoke API का रद्द करने का कॉन्टेक्स्ट.
JSON के काेड में दिखाना |
{
// Union field RefundType can be only one of the following:
"fullRefund": {
object (FullRefund )
},
"proratedRefund": {
object (ProratedRefund )
},
"itemBasedRefund": {
object (ItemBasedRefund )
}
// End of list of possible types for union field RefundType .
} |
फ़ील्ड |
यूनियन फ़ील्ड RefundType . इससे यह तय होता है कि किस तरह का रिफ़ंड दिया जाना चाहिए. मान्य अनुरोध के हिस्से के तौर पर, रिफ़ंड का टाइप बताना ज़रूरी है. RefundType इनमें से कोई एक हो सकता है: |
fullRefund |
object (FullRefund )
ज़रूरी नहीं. इसका इस्तेमाल तब किया जाता है, जब उपयोगकर्ताओं को सदस्यता के हर आइटम पर लगाए गए नए शुल्क का पूरा रिफ़ंड देना हो.
|
proratedRefund |
object (ProratedRefund )
ज़रूरी नहीं. इसका इस्तेमाल तब किया जाता है, जब उपयोगकर्ताओं को सदस्यता के लिए चुकाई गई रकम का रिफ़ंड दिया जाना हो. यह रिफ़ंड, सदस्यता के बचे हुए समय के आधार पर दिया जाता है.
|
itemBasedRefund |
object (ItemBasedRefund )
ज़रूरी नहीं. इसका इस्तेमाल तब किया जाता है, जब किसी सदस्यता में जोड़े गए आइटम के साथ किसी खास आइटम का रिफ़ंड दिया जाना हो.
|
FullRefund
इस टाइप में कोई फ़ील्ड नहीं है.
इसका इस्तेमाल यह तय करने के लिए किया जाता है कि RevocationContext में रिफ़ंड टाइप, पूरा रिफ़ंड है या नहीं.
ProratedRefund
इस टाइप में कोई फ़ील्ड नहीं है.
इसका इस्तेमाल यह तय करने के लिए किया जाता है कि RevocationContext में रिफ़ंड टाइप, प्रोरेटेड रिफ़ंड है या नहीं.
ItemBasedRefund
इसका इस्तेमाल यह तय करने के लिए किया जाता है कि एक से ज़्यादा आइटम वाली सदस्यता में से किस आइटम को रद्द करना है.
JSON के काेड में दिखाना |
{
"productId": string
} |
फ़ील्ड |
productId |
string
ज़रूरी है. अगर सदस्यता में ऐड-ऑन शामिल हैं, तो रद्द किए जाने वाले सदस्यता आइटम का प्रॉडक्ट आईडी.
|
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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\u003eRevoke a user's subscription purchase using the \u003ccode\u003esubscriptionsv2.revoke\u003c/code\u003e API.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires the package name and purchase token in the request path.\u003c/p\u003e\n"],["\u003cp\u003eYou can optionally specify a full or prorated refund in the request body.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful revocation results in an empty response body.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["This document outlines the process for revoking a user's subscription purchase via the `subscriptionsv2.revoke` API. The `POST` request, sent to `https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke`, requires the application's package name and the user's subscription token. The request body must include a `revocationContext`, specifying either a `fullRefund` or `proratedRefund`. Successful requests yield an empty response. This API action also needs the `androidpublisher` authorization scope.\n"],null,["# Method: purchases.subscriptionsv2.revoke\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [RevocationContext](#RevocationContext)\n - [JSON representation](#RevocationContext.SCHEMA_REPRESENTATION)\n- [FullRefund](#FullRefund)\n- [ProratedRefund](#ProratedRefund)\n- [ItemBasedRefund](#ItemBasedRefund)\n - [JSON representation](#ItemBasedRefund.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nsubscriptionsv2.revoke a subscription purchase for the user.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:revoke`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Required. 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 contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"revocationContext\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#RevocationContext) } } ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `revocationContext` | `object (`[RevocationContext](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#RevocationContext)`)` Required. Additional details around the subscription revocation. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Sample\n\nThe following is a sample request: \n\n```json\ncurl -X POST \\\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptionsv2/tokens/sample_purchase_token:revoke' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"revocationContext\": {\n \"proratedRefund\": {}\n }\n }'\n```\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nRevocationContext\n-----------------\n\nRevocation context of the purchases.subscriptionsv2.revoke API.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `RefundType` can be only one of the following: \"fullRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#FullRefund) }, \"proratedRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ProratedRefund) }, \"itemBasedRefund\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ItemBasedRefund) } // End of list of possible types for union field `RefundType`. } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `RefundType`. Determines the type of refund that should be granted. A refund type must be specified as part of a valid request. `RefundType` can be only one of the following: ||\n| `fullRefund` | `object (`[FullRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#FullRefund)`)` Optional. Used when users should be refunded the full amount of latest charge on each item in the subscription. |\n| `proratedRefund` | `object (`[ProratedRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ProratedRefund)`)` Optional. Used when users should be refunded a prorated amount they paid for their subscription based on the amount of time remaining in a subscription. |\n| `itemBasedRefund` | `object (`[ItemBasedRefund](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/revoke#ItemBasedRefund)`)` Optional. Used when a specific item should be refunded in a subscription with add-on items. |\n\nFullRefund\n----------\n\nThis type has no fields.\nUsed to determine if the refund type in the RevocationContext is a full refund.\n\nProratedRefund\n--------------\n\nThis type has no fields.\nUsed to determine if the refund type in the RevocationContext is a prorated refund.\n\nItemBasedRefund\n---------------\n\nUsed to determine what specific item to revoke in a subscription with multiple items.\n\n| JSON representation |\n|---------------------------------|\n| ``` { \"productId\": string } ``` |\n\n| Fields ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------|\n| `productId` | `string` Required. If the subscription is a subscription with add-ons, the product id of the subscription item to revoke. |"]]