Method: partners.subscriptions.cancel
Stay organized with collections
Save and categorize content based on your preferences.
Cancels a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.
HTTP request
POST https://paymentsresellersubscription.googleapis.com/v1/{name=partners/*/subscriptions/*}:cancel
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
name |
string
Required. The name of the subscription resource to be cancelled. It will have the format of "partners/{partner_id}/subscriptions/{subscriptionId}"
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"cancellationReason": enum (CancellationReason ),
"cancelImmediately": boolean
} |
Fields |
cancellationReason |
enum (CancellationReason )
Specifies the reason for the cancellation.
|
cancelImmediately |
boolean
Optional. If true, Google will cancel the subscription immediately, and may or may not (based on the contract) issue a prorated refund for the remainder of the billing cycle. Otherwise, Google defers the cancelation at renewalTime, and will not issue a refund.
- YouTube subscriptions must use this option currently. However, the user will still have access to the subscription until the end of the billing cycle.
|
Response body
Response that contains the cancelled subscription resource.
If successful, the response body contains data with the following structure:
JSON representation |
{
"subscription": {
object (Subscription )
}
} |
Fields |
subscription |
object (Subscription )
The cancelled subscription resource.
|
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-03-12 UTC.
[null,null,["Last updated 2025-03-12 UTC."],[[["\u003cp\u003eEnables partners to cancel subscriptions for their customers, either immediately or at the end of the current billing cycle.\u003c/p\u003e\n"],["\u003cp\u003eRequires the partner to use service accounts for direct cancellation requests.\u003c/p\u003e\n"],["\u003cp\u003eCancellation can be performed immediately or deferred to the renewal time, depending on the \u003ccode\u003ecancelImmediately\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eProvides a cancellation reason through the \u003ccode\u003ecancellationReason\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eReturns the cancelled subscription resource upon successful execution.\u003c/p\u003e\n"]]],["Partners use a POST request to `https://paymentsresellersubscription.googleapis.com/v1/{name=partners/*/subscriptions/*}:cancel` to cancel a customer's subscription. The `name` parameter is the subscription's resource ID. The request body requires a `cancellationReason` and an optional `cancelImmediately` flag (boolean). If `cancelImmediately` is true, cancellation is immediate. The response body returns the canceled `subscription` resource upon successful completion.\n"],null,["# Method: partners.subscriptions.cancel\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 - [JSON representation](#body.CancelSubscriptionResponse.SCHEMA_REPRESENTATION)\n\nCancels a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.\n\n### HTTP request\n\n`POST https://paymentsresellersubscription.googleapis.com/v1/{name=partners/*/subscriptions/*}:cancel`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The name of the subscription resource to be cancelled. It will have the format of \"partners/{partner_id}/subscriptions/{subscriptionId}\" |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"cancellationReason\": enum (/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#CancellationReason), \"cancelImmediately\": boolean } ``` |\n\n| Fields ||\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cancellationReason` | `enum (`[CancellationReason](/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#CancellationReason)`)` Specifies the reason for the cancellation. |\n| `cancelImmediately` | `boolean` Optional. If true, Google will cancel the subscription immediately, and may or may not (based on the contract) issue a prorated refund for the remainder of the billing cycle. Otherwise, Google defers the cancelation at renewalTime, and will not issue a refund. - YouTube subscriptions must use this option currently. However, the user will still have access to the subscription until the end of the billing cycle. |\n\n### Response body\n\nResponse that contains the cancelled subscription resource.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"subscription\": { object (/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#Subscription) } } ``` |\n\n| Fields ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `subscription` | `object (`[Subscription](/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#Subscription)`)` The cancelled subscription resource. |"]]