# Google Play Developer API . purchases

## Instance Methods

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

Checks whether a user's subscription purchase is valid and returns its expiry time.

### Method Details

`cancel(packageName, subscriptionId, token)`

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

    Args:
      packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
      subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
      token: string, The token provided to the user's device when the subscription was purchased. (required)

`get(packageName, subscriptionId, token)`

    Checks whether a user's subscription purchase is valid and returns its expiry time.

    Args:
      packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
      subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
      token: string, The token provided to the user's device when the subscription was purchased. (required)

    Returns:
      An object of the form:

        { # A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
        "initiationTimestampMsec": "A String", # Time at which the subscription was granted, in milliseconds since the Epoch.
        "kind": "androidpublisher#subscriptionPurchase", # This kind represents a subscriptionPurchase object in the androidpublisher service.
        "autoRenewing": True or False, # Whether the subscription will automatically be renewed when it reaches its current expiry time.
        "validUntilTimestampMsec": "A String", # Time at which the subscription will expire, in milliseconds since the Epoch.
      }