You may need to take management actions on subscriptions or one-time purchases as part of day-to-day business. For example, your customer service may need to issue total or partial refunds for users, or you might need to revoke entitlements in certain cases. You can manage orders from the Play Console, or if you want to manage them from your own system, you can do so by using the Google Play Developer API.
Cancel subscriptions
Users can cancel a Google Play subscription at any time using the Play Store, though you must also provide an option for users to cancel their subscriptions in your app and on your website if applicable.
The easiest way to enable users to cancel voluntarily is by deep linking to the PlayStore, where they can view and manage their subscription.
You may also need to trigger cancellations from your backend.
The purchases.subscriptions.cancel
method lets you cancel a subscription purchase.
For example, you could use this method to turn down a legacy service.
Canceling a subscription does not issue a refund, and the user continues to
have access until the end of their current billing period. Canceling a
subscription with this method prevents the user from restoring the subscription
in the Play Store, but users can still sign up again through your app if they
need to.
Taking this action triggers a SUBSCRIPTION_CANCELED
Real-time developer
notification. Handle these cancellations as described in
Cancellations.
Defer billing
Use subscriptions.defer
to extend the entitlement period for a subscription. During the deferral period,
the user remains subscribed to your content though is not charged for the extra
time. When you defer billing for a subscription, the status information is
updated accordingly and you see it reflected in the expiryTime
field in the
purchase status information:
- For active recurring subscriptions, deferred billing extends the next renewal date.
- For prepaid plans, deferred billing extends the expiration time.
Some examples on how you could use deferred billing are:
- Give users no-cost access as a special offer, such as giving one week free to existing subscribers for filling out a feedback survey.
- Give customers no-cost access as a customer-care action, for example after an extended outage that might have affected their ability to use your service.
Billing can be deferred by as little as one day and up to a year per API call. To defer the end of the entitlement even further, call the API again before the new expiration date arrives.
Taking this action triggers a SUBSCRIPTION_DEFERRED
Real-time developer
notification. See Defer billing for a subscriber in About subscriptions to learn how to handle these events.
Example:
FitnessGoals streaming service wants to run a promotion to encourage regular exercise in February.
They decide to offer an additional one month of service to any subscriber who exercises with FitnessGoals at least 10 times during the month of February.
They track the challenge's results, and on March 1st, they call the
subscriptions.defer
API for every active subscription purchase belonging to users that met the challenge in February.These users get the benefit of an extra full month of regular exercise videos at no cost, and the users tell all their friends how FitnessGoals helps them stay healthy!
Issue refunds and revocations
There are many situations where you may want to issue a refund for or revoke access to a subscription or one-time purchase.
Fully refund an order by order ID
With the orders.refund
API, you can issue full refunds for any order within three years of purchase.
The orders.refund
method receives a revoke parameter indicating whether or not
access should be revoked in addition to providing the refund.
If you issue a revocation with the refund call for subscription purchase, the
subscription is immediately terminated and it triggers aSUBSCRIPTION_REVOKED
Real Time Developer Notification. Read the subscription lifecycle management
guide Revocations section
to learn how to handle these events.
Example:
To celebrate the beginning of the new world cup, the e-sports app Football-Not-Soccer decides to raffle off free virtual jerseys for all users who purchase new team kits in the first 24 hours.
Football-Not-Soccer uses the
orders.refund
API without passing a revoke parameter to refund the jersey purchases to the winners.
Revoke and refund a subscription by purchase token
For certain use cases you might need to revoke access to a user's subscription
and provide a refund. Play Billing offers revocation methods including full
refunds and prorated refunds through the subscriptionsv2.revoke
API. With this endpoint, you can specify revocationContext
to determine how the refund is calculated.
Taking this action triggers a SUBSCRIPTION_REVOKED
Real Time Developer
Notification. Your app should handle these cancellations as described in
Revocations.
Example:
- Purchase with purchase token
1a2b3c4d5e6f7g8h9i0j
- Application with the package name
com.your.app
- Intent of issuing a prorated refund
HTTP POST request:
https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.your.app/purchases/subscriptionsv2/tokens/1a2b3c4d5e6f7g8h9i0j:revoke
Request body:
{
"revocationContext": {
"proratedRefund": {}
}
}
Full refunds
If you need to terminate a subscription and refund the full amount of the
current billing period, issue a full refund. Use the
purchases.subscriptionsv2.revoke
function, and set "fullRefund": {}
as the refund type.
Example:
Maria has an auto-renewing 30-day subscription to SuperMovies streaming monthly plan. Maria encountered some technical issues that prevent her from accessing the content. She contacts customer service on day 3 of her billing cycle stating that she never got access to the subscription.
Customer service locates Maria's subscription purchase details in their system and triggers a call to
purchases.subscriptionsv2.revoke
requesting a full refund.Customer service tells Maria she should get 100% of her subscription price refunded and she is not subscribed to the plan anymore.
Prorate refunds
If you need to terminate a subscription and partially refund the remaining
entitlement time, issue a prorated refund. Use the
purchases.subscriptionsv2.revoke
function, and set "proratedRefund": {}
as the refund type.
Example:
Maria has an auto-renewing 30-day subscription to SuperMovies streaming monthly plan. She has happily used the service for some time. Maria contacts customer service on day 15 of her billing cycle stating that she is moving abroad and won't be able to use the service anymore starting the next day.
Customer service locates Maria's subscription purchase details in their system and triggers a call to
purchases.subscriptionsv2.revoke
requesting a prorated refund.Customer service tells Maria she should get about 50% of her subscription price refunded and that access to the service terminated immediately.