Method: purchases.subscriptionsv2.defer

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 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 (DeferralContext)
  }
}
Fields
deferralContext

object (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 (ItemExpiryTimeDetails)
    }
  ]
}
Fields
itemExpiryTimeDetails[]

object (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 (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 (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".