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

> [!WARNING]
> This item is deprecated!

Deprecated: Use purchases.subscriptionsv2.defer instead. Defers a user's subscription purchase until a specified future expiration time.

### HTTP request

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

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `packageName` | `string` The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). |
| `subscriptionId` | `string` The purchased subscription ID (for example, 'monthly001'). |
| `token` | `string` 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 |
|---|
| ``` { "deferralInfo": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/defer#SubscriptionDeferralInfo`) } } ``` |

| Fields ||
|---|---|
| `deferralInfo` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions/defer#SubscriptionDeferralInfo`)`` The information about the new desired expiry time for the subscription. |

### Response body

Response for the purchases.subscriptions.defer API.

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

| JSON representation |
|---|
| ``` { "newExpiryTimeMillis": string } ``` |

| Fields ||
|---|---|
| `newExpiryTimeMillis` | `string (https://developers.google.com/discovery/v1/type-format format)` The new expiry time for the subscription in milliseconds since the Epoch. |

### Sample

The following is a sample request:

```json
curl -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "deferralInfo": {
      "desiredExpiryTimeMillis": "1735689600000",
      "expectedExpiryTimeMillis": "1704067200000"
    }
  }' \
  'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.myapp/purchases/subscriptions/monthly.premium.v1/tokens/aBcDeFgHiJkLmNoPqRsTuVwXyZaBcDeFgHiJkLmNoPqRsTuVwXyZ.1234567890:defer'
```

The following is a sample response:

```json
{
  "newExpiryTimeMillis": "1776004800000"
}
```

### Authorization scopes

Requires the following OAuth scope:

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

## SubscriptionDeferralInfo

A SubscriptionDeferralInfo contains the data needed to defer a subscription purchase to a future expiry time.

| JSON representation |
|---|
| ``` { "expectedExpiryTimeMillis": string, "desiredExpiryTimeMillis": string } ``` |

| Fields ||
|---|---|
| `expectedExpiryTimeMillis` | `string (https://developers.google.com/discovery/v1/type-format format)` The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not occur. |
| `desiredExpiryTimeMillis` | `string (https://developers.google.com/discovery/v1/type-format format)` The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current expiry time for the subscription. |