Method: purchases.subscriptionsv2.cancel
Stay organized with collections
Save and categorize content based on your preferences.
subscriptionsv2.cancel a subscription purchase for the user.
HTTP request
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:cancel
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
packageName |
string
Required. The package of the application for which this subscription was purchased (for example, 'com.some.thing').
|
token |
string
Required. The token provided to the user's device when the subscription was purchased.
|
Request body
The request body contains data with the following structure:
Fields |
cancellationContext |
object (CancellationContext )
Required. Additional details around the subscription revocation.
|
Response body
If successful, the response body is empty.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/androidpublisher
CancellationContext
Cancellation context of the purchases.subscriptionsv2.cancel API.
Fields |
cancellationType |
enum (CancellationType )
Required. The type of cancellation for the purchased subscription.
|
CancellationType
The type of cancellation requested by the developer.
Enums |
CANCELLATION_TYPE_UNSPECIFIED |
Cancellation type unspecified. |
USER_REQUESTED_STOP_RENEWALS |
Cancellation requested by the user, and the subscription can be restored. It only stops the subscription's next renewal. For an installment subscription, users still need to finish the commitment period. For more details on renewals and payments, see https://developer.android.com/google/play/billing/subscriptions#installments |
DEVELOPER_REQUESTED_STOP_PAYMENTS |
Cancellation requested by the developer, and the subscription cannot be restored. It stops the subscription's next payment. For an installment subscription, users will not need to pay the next payment and finish the commitment period. For more details on renewals and payments, see https://developer.android.com/google/play/billing/subscriptions#installments |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-11 UTC."],[],[],null,["- [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- [CancellationContext](#CancellationContext)\n - [JSON representation](#CancellationContext.SCHEMA_REPRESENTATION)\n- [CancellationType](#CancellationType)\n- [Try it!](#try-it)\n\nsubscriptionsv2.cancel a subscription purchase for the user.\n\nHTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath 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\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"cancellationContext\": { object (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/cancel#CancellationContext) } } ``` |\n\n| Fields ||\n|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cancellationContext` | `object (`[CancellationContext](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/cancel#CancellationContext)`)` Required. Additional details around the subscription revocation. |\n\nResponse body\n\nIf successful, the response body is empty.\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nCancellationContext Cancellation context of the purchases.subscriptionsv2.cancel API.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"cancellationType\": enum (/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/cancel#CancellationType) } ``` |\n\n| Fields ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cancellationType` | `enum (`[CancellationType](/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/cancel#CancellationType)`)` Required. The type of cancellation for the purchased subscription. |\n\nCancellationType The type of cancellation requested by the developer.\n\n| Enums ||\n|-------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CANCELLATION_TYPE_UNSPECIFIED` | Cancellation type unspecified. |\n| `USER_REQUESTED_STOP_RENEWALS` | Cancellation requested by the user, and the subscription can be restored. It only stops the subscription's next renewal. For an installment subscription, users still need to finish the commitment period. For more details on renewals and payments, see \u003chttps://developer.android.com/google/play/billing/subscriptions#installments\u003e |\n| `DEVELOPER_REQUESTED_STOP_PAYMENTS` | Cancellation requested by the developer, and the subscription cannot be restored. It stops the subscription's next payment. For an installment subscription, users will not need to pay the next payment and finish the commitment period. For more details on renewals and payments, see \u003chttps://developer.android.com/google/play/billing/subscriptions#installments\u003e |"]]