# Method: purchases.subscriptionsv2.defer

- [HTTP request](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.request_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.response_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.DeferSubscriptionPurchaseResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#body.aspect)
- [DeferralContext](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#DeferralContext)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#DeferralContext.SCHEMA_REPRESENTATION)
- [ItemExpiryTimeDetails](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#ItemExpiryTimeDetails)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#ItemExpiryTimeDetails.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#try-it)

Defers the renewal of a subscription.

### HTTP request

`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}:defer`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) 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:

| JSON representation |
|---|
| ``` { "deferralContext": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#DeferralContext`) } } ``` |

| Fields ||
|---|---|
| `deferralContext` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#DeferralContext`)`` Required. Details about the subscription deferral. |

### Response body

Response for the v2 purchases.subscriptions.defer API.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "itemExpiryTimeDetails": [ { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#ItemExpiryTimeDetails`) } ] } ``` |

| Fields ||
|---|---|
| `itemExpiryTimeDetails[]` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/defer#ItemExpiryTimeDetails`)`` The new expiry time for each subscription items. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/androidpublisher`

## DeferralContext

Deferral context of the purchases.subscriptionsv2.defer API.

| JSON representation |
|---|
| ``` { "etag": string, "deferDuration": string, "validateOnly": boolean } ``` |

| Fields ||
|---|---|
| `etag` | `string` Required. The API will fail if the etag does not match the latest etag for this subscription. The etag is retrieved from purchases.subscriptionsv2.get: <https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptionsv2/get> |
| `deferDuration` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Required. The duration by which all subscription items should be deferred. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `validateOnly` | `boolean` If set to "true", the request is a dry run to validate the effect of subscriptionsv2.defer, the subscription would not be impacted. |

## ItemExpiryTimeDetails

Expiry time details of a subscription item.

| JSON representation |
|---|
| ``` { "productId": string, "expiryTime": string } ``` |

| Fields ||
|---|---|
| `productId` | `string` The product ID of the subscription item (for example, 'premium_plan'). |
| `expiryTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The new expiry time for this subscription item. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |