# Method: partners.subscriptions.cancel

- [HTTP request](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.request_body)
  - [JSON representation](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.response_body)
  - [JSON representation](https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions/cancel#body.CancelSubscriptionResponse.SCHEMA_REPRESENTATION)

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](https://google.aip.dev/127) 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 (`https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#CancellationReason`), "cancelImmediately": boolean } ``` |

| Fields ||
|---|---|
| `cancellationReason` | ``enum (`https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#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 cancellation 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 (`https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#Subscription`) } } ``` |

| Fields ||
|---|---|
| `subscription` | ``object (`https://developers.google.com/payments/reseller/subscription/reference/rest/v1/partners.subscriptions#Subscription`)`` The cancelled subscription resource. |