Method: purchases.subscriptions.cancel

Cancels a user's subscription purchase. The subscription remains valid until its expiration time.

HTTP request

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

The URL uses gRPC Transcoding 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
{
  "cancellationType": enum (CancellationType)
}
Fields
cancellationType

enum (CancellationType)

Optional. The type of cancellation for the purchased subscription.

Response body

If successful, the response body is empty.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/androidpublisher

CancellationType

The type of cancellation requested by the developer.

Enums
CANCELLATION_TYPE_UNSPECIFIED Cancellation type unspecified.
USER_REQUESTED_STOP_RENEWALS Cancellation requested by the user, and the subscription can be restored. It only stops subscription's next renewal. For an installment subscription, users still need to finish the commitment period. For more details on renewals and payments, see https://developer.android.com/google/play/billing/subscriptions#installments
DEVELOPER_REQUESTED_STOP_PAYMENTS Cancellation requested by the developer, and the subscription cannot be restored. It stops the subscription's next payment. For an installment subscription, users will not need to pay the next payment and finish the commitment period. For more details on renewals and payments, see https://developer.android.com/google/play/billing/subscriptions#installments This is the default behavior when no cancellation type is specified.