Home | History | Annotate | Download | only in billing
      1 page.title=In-App Subscriptions
      2 parent.title=In-app Billing
      3 parent.link=index.html
      4 page.metaDescription=Subscriptions let you sell content or features in your app with automated, recurring billing.
      5 page.image=/images/play_dev.jpg
      6 page.tags="subscriptions, billing, inapp, iap"
      7 meta.tags="monetization, inappbilling, subscriptions"
      8 @jd:body
      9 
     10 <div id="qv-wrapper">
     11 <div id="qv">
     12   <h2>Quickview</h2>
     13   <ul>
     14     <li>Subscriptions let you sell products with automated, recurring billing
     15         at a variety of intervals.</li>
     16     <li>You can offer a configurable trial period for monthly and
     17         annual subscriptions.</li>
     18     <li>You can manage subscriptions through the Developer Console, or by using
     19         the
     20         <a href="https://developers.google.com/android-publisher/">Google Play
     21         Developer API</a>.</li>
     22     <li>Users purchase your subscriptions from inside your apps, rather than
     23         directly from Google Play.</li>
     24     <li>You can defer billing for a particular user's subscription, to manage
     25         accounts or offer rewards.</li>
     26   </ul>
     27   <h2>In this document</h2>
     28   <ol>
     29     <li><a href="#overview">Overview of Subscriptions</a></li>
     30     <li><a href="#administering">Configuring Subscriptions Items</a></li>
     31     <li><a href="#cancellation">Subscription Cancellation</a></li>
     32     <li><a href="#payment">Payment Processing and Policies</a></li>
     33     <li><a href="#strategies">Purchase Verification Strategies</a></li>
     34     <li><a href="#play-dev-api">Google Play Developer API</a></li>
     35   </ol>
     36   <h2>See also</h2>
     37   <ol>
     38     <li><a href="{@docRoot}google/play/billing/billing_integrate.html#Subs">Implementing Subscriptions (V3)</a></li>
     39     <li><a href="https://developers.google.com/android-publisher/">Google Play Developer API</a></li>
     40   </ol>
     41 </div>
     42 </div>
     43 
     44 <p>Subscriptions let you sell content, services, or features in your app with
     45 automated, recurring billing. You can easily adapt an existing In-app Billing 
     46 implementation to sell subscriptions.</p>
     47 <p>This document is focused on highlighting implementation details that are 
     48 specific to subscriptions, along with some strategies for the associated billing 
     49 and business models.</p>
     50 
     51 <h2 id="overview">Overview of Subscriptions</h2>
     52 <p>A <em>subscription</em> is a product type offered in In-app Billing that 
     53 lets you sell content, services, or features to users from inside your app with 
     54 recurring, automated billing at the interval you specify. You can sell subscriptions to almost
     55 any
     56 type of digital content, from any type of app or game.</p>
     57 
     58 <p>As with other in-app products, you configure and publish subscriptions using
     59 the Developer Console and then sell them from inside apps installed on 
     60 Android devices. In the Developer console, you create subscription
     61 products and add them to a product list, then set a price and optional trial
     62 period for each, choose a billing interval, and then
     63 publish. For more information about using the Developer Console, see 
     64 <a href="#administering">Configuring Subscription Items</a>.</p>
     65 
     66 <p>When users purchase subscriptions in your apps, Google Play handles all 
     67 checkout details so your apps never have to directly process any financial 
     68 transactions. Google Play processes all payments for subscriptions through 
     69 Google Wallet, just as it does for standard in-app products and app purchases. 
     70 This ensures a consistent and familiar purchase flow for your users.</p>
     71 
     72 <img src="{@docRoot}images/in-app-billing/v3/billing_subscription_v3.png" style="float:right; border:4px solid ddd;">
     73 
     74 <p>After users have purchased subscriptions, they can view the subscriptions and 
     75 cancel them from the <strong>My Apps</strong> screen in the Play Store app or 
     76 from the app's product details page in the Play Store app. For more information 
     77 about handling user cancellations, see <a href="#cancellation">Subscription Cancellation</a>.</p>
     78 
     79 <p>In addition to client-side API calls, you can use the server-side API for 
     80 In-app Billing to provide subscription purchasers with extended access to 
     81 content (for example, from your web site or another service).
     82 The server-side API lets you validate the status of a subscription when users
     83 sign into your other services. For more information about the API, see <a
     84 href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google Play Developer API</a>. </p>
     85 
     86 <p>You can also build on your existing external subscriber base from inside your
     87 Android apps.</p>
     88 <ul>
     89 <li>If you sell subscriptions on a web site, for example, you can add
     90 your own business logic to your Android app to determine whether the user has
     91 already purchased a subscription elsewhere, then allow access to your content if
     92 so or offer a subscription purchase from Google Play if not.</li>
     93 <li>You can implement your own solution for sharing subscriptions across as 
     94 many different apps or products as you want. For example, you could sell a 
     95 subscription that gives a subscriber access to an entire collection of apps, 
     96 games, or other content for a monthly or annual fee. To implement this solution, 
     97 you could add your own business logic to your app to determine whether the user 
     98 has already purchased a given subscription and if so, allow access to your 
     99 content.</li>
    100 </ul>
    101 </p>
    102 
    103 <p>In general the same basic policies and terms apply to subscriptions as to
    104 standard in-app products, however there are some differences. For complete
    105 information about the current policies and terms, please read the <a
    106 href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en
    107 &answer=140504">policies document</a>.</p>
    108 
    109 <p>To learn about the minimum system requirements for 
    110 subscriptions, see the <a href="{@docRoot}google/play/billing/versions.html#Subs">Version Notes</a>.</p>
    111 
    112 <h2 id="administering">Configuring Subscription Items</h2>
    113 
    114 <p>To create and manage subscriptions, you can use the Developer Console to set
    115 up a
    116 product list for the app, then configure these attributes for each subscription 
    117 product:</p>
    118 
    119 <ul>
    120 <li>Purchase Type: always set to <strong>Subscription</strong></li>
    121 <li>Subscription ID:  An identifier for the subscription</li>
    122 <li>Publishing State: Unpublished/Published</li>
    123 <li>Language: The default language for displaying the subscription</li>
    124 <li>Title: The title of the subscription product</li>
    125 <li>Description: Details that tell the user about the subscription</li>
    126 <li>Price: Default price of subscription per recurrence</li>
    127 <li>Recurrence: Interval of billing recurrence</li>
    128 <li>Additional currency pricing (can be auto-filled)</li>
    129 </ul>
    130 
    131 <p>For details on how to add and configure products in the Developer Console, 
    132 see <a href="{@docRoot}google/play/billing/billing_admin.html">Administering
    133 In-app Billing</a>.</p>
    134 
    135 <p>You can also create and manage subscriptions using the
    136 <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">
    137 Google Play Developer API</a>.</p>
    138 
    139 <h3 id="pricing">Subscription pricing</h3>
    140 
    141 <p>When you create a subscription in the Developer Console, you can set a price
    142 for it in any available currencies. Each subscription must have a non-zero
    143 price. You can price multiple subscriptions for the same content differently
    144 &mdash; for example you could offer a discount on an annual subscription
    145 relative to the monthly equivalent. </p>
    146 
    147 <p class="caution"><strong>Important</strong>: To change the price of a 
    148 subscription, you can publish a new subscription product ID at a new price, 
    149 then offer it in your app instead of the original product. Users who have 
    150 already purchased will continue to be charged at the 
    151 original price, but new users will be charged at the new price.</p>
    152 
    153 <h3 id="user-billing">User billing</h3>
    154 
    155 <p>In the Developer Console, you can configure subscription products with 
    156 automated recurring billing at your choice of intervals:</p>
    157 
    158 <ul>
    159   <li>Monthly &mdash; Google Play bills the customers Google Wallet account at
    160   the time of purchase and monthly subsequent to the purchase date (exact billing
    161   intervals can vary slightly over time).</li>
    162   <li>Annually &mdash; Google Play bills the customer's Google Wallet account at
    163   the time of purchase and again on the same date in subsequent years.</li>
    164 
    165   <li>Seasonal &mdash; Google Play bills the customer's Google Wallet account at
    166   the beginning of each "season" (you specify the season beginning and end
    167   dates). This
    168   is intended for annual purchases of seasonal content (such as sports-related
    169   content). The subscription runs through the end of the season, and restarts
    170   the next year at the start of the season.</li>
    171 
    172 </ul>
    173 
    174 <p>Billing continues indefinitely at the interval and price specified for the
    175 subscription. At each subscription renewal, Google Play charges the user account
    176 automatically, then notifies the user of the charges afterward by email. For
    177 monthly and annual subscriptions, billing cycles will always match subscription
    178 cycles, based on the purchase date. (Seasonal subscriptions are charged
    179 annually, on the first day of the season.)</p>
    180 
    181 <p>Over the life of a subscription, the form of payment billed remains the same
    182 &mdash; Google Play always bills the same form of payment (such as credit card
    183 or by Direct Carrier Billing) that was originally used to purchase the
    184 subscription.</p>
    185 
    186 <p>When the subscription payment is approved by Google Wallet, Google Play
    187 provides a purchase token back to the purchasing app through the In-app Billing
    188 API. Your apps can store the token locally or pass it to your backend servers, 
    189 which can then use it to validate or cancel the subscription remotely using the
    190 <a
    191 href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google Play Developer API</a>.</p>
    192 
    193 <p>If a recurring payment fails (for example, because the customers credit
    194 card has become invalid), the subscription does not renew. How your app is 
    195 notified depends on the In-app Billing API version that you are using:</p>
    196 <ul>
    197 <li>With In-app Billing Version 3, the failed or expired subscription is no longer 
    198 returned when you call {@code getPurchases}.</li>
    199 <li>With In-app Billing Version 2, Google Play notifies your app at the end of 
    200 the active cycle that the purchase state of the subscription is now "Expired". 
    201 </li>
    202 </ul>
    203 
    204 <p class="note"><strong>Recommendation</strong>: Include business logic in your 
    205 app to notify your backend servers of subscription purchases, tokens, and any 
    206 billing errors that may occur. Your backend servers can use the server-side API 
    207 to query and update your records and follow up with customers directly, if needed.</p>
    208 
    209 <h3 id="deferred-billing">Deferred Billing</h3>
    210 
    211 <p>Using the
    212 <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google
    213 Play Developer API</a>, you can defer the next billing date for a
    214 subscriber. The user continues to be subscribed to the content, and has full
    215 access to it, but is not charged during the deferral period. This allows you
    216 to do things like:</p>
    217 
    218 <ul>
    219   <li>Give users free access as part of a bundle or a special offer (for
    220     example, giving free access to web content to users who subscribe to a
    221     print magazine)</li>
    222   <li>Give free access to customers as a goodwill gesture</li>
    223 </ul>
    224 
    225 <p>The longest you can defer billing is for one year per call. Of course, you
    226 can call the API again before the year is up to defer billing further.</p>
    227 
    228 <p>For example, Darcy has a monthly subscription to online content for the
    229 <em>Fishing Gentleman</em> app. He is normally
    230 billed 1.25 on the first of each month.
    231 On March 10, he participates in an online survey for the app publisher. The
    232 publisher rewards him by deferring his next payment until June 1. Darcy is not
    233 charged on April 1 or May 1, but still has access to the content as normal. On
    234 June 1, he is charged his normal 1.25 subscription fee.</p>
    235 
    236 <p class="note"><strong>Note:</strong> The API always defers the billing date
    237 by a whole number of days. If you request a deferral period that includes a
    238 fractional number of days, the API rounds the period up to the next full day.
    239 For example, if a user's subscription is set to renew on 15 June 2015 at
    240 14:00:00 UTC, and you use the API to defer the renewal date to 15 August 2015 at
    241 02:00:00 UTC, the API will round up to the next full day and set the renewal
    242 date to 15 August 2015 14:00:00 UTC.</p>
    243 
    244 <p>You can also offer free trials to new subscribers, as described in
    245 <a href="#trials">Free trials</a>.</p>
    246 
    247 <h3 id="trials">Free trials</h3>
    248 
    249 <p>In the Developer Console, you can set up a free trial period that lets users
    250 try your subscription content before buying it. The trial period runs for the 
    251 period of time that you set and then automatically converts to a full 
    252 subscription managed according to the subscription's billing interval and 
    253 price. Free trials are supported for monthly and annual subscriptions only, and are not supported for seasonal subscriptions.</p>
    254 
    255 <p>To take advantage of a free trial, a user must "purchase" the full
    256 subscription through the standard In-app Billing flow, providing a valid form of
    257 payment to use for billing and completing the normal purchase transaction.
    258 However, the user is not charged any money, because the initial period
    259 corresponds
    260 to the free trial. Instead, Google Play records a transaction of $0.00 and the
    261 subscription is marked as purchased for the duration of the trial period or
    262 until cancellation. When the transaction is complete, Google Play notifies users
    263 by email that they have purchased a subscription that includes a free trial
    264 period and that the initial charge was $0.00. </p>
    265 
    266 <p>When the trial period ends, Google Play automatically initiates billing
    267 against the credit card that the user provided during the initial purchase, at 
    268 the amount set
    269 for the full subscription, and continuing at the subscription interval. If
    270 necessary, the user can cancel the subscription at any time during the trial
    271 period. In this case, Google Play <em>marks the subscription as expired immediately</em>,
    272 rather than waiting until the end of the trial period. The user has not
    273 paid for the trial period and so is not entitled to continued access after
    274 cancellation.</p>
    275 
    276 <p>You can set up a trial period for a subscription in the Developer Console,
    277 without needing to modify or update your APK. Just locate and edit the
    278 subscription in your product list, set a valid number of days for the trial
    279 (must be 7 days or longer), and publish. You can change the period any time,
    280 although note that Google Play does not apply the change to users who have
    281 already "purchased" a trial period for the subscription. Only new subscription
    282 purchases will use the updated trial period. You can create one free trial
    283 period per subscription product.</p>
    284 
    285 <h3 id="publishing">Subscription publishing</h3>
    286 
    287 <p>When you have finished configuring your subscription product details in the
    288 Developer Console or via the API,
    289 you can publish the subscription in the app product list.</p>
    290 
    291 <p>In the product list, you can add subscriptions, in-app products, or both. You
    292 can add multiple subscriptions that give access to different content or
    293 services, or you can add multiple subscriptions that give access to the same
    294 content but for different intervals or different prices, such as for a
    295 promotion. For example, a news outlet might decide to offer both monthly and
    296 annual subscriptions to the same content, with annual having a discount. You can
    297 also offer in-app purchase equivalents for subscription products, to ensure that
    298 your content is available to users of older devices that do not support
    299 subscriptions.</p>
    300 
    301 <p>After you add a subscription or in-app product to the product list, you must
    302 publish the product before Google Play can make it available for purchase. Note
    303 that you must also publish the app itself before Google Play will make the
    304 products available for purchase inside the app. </p>
    305 
    306 <p class="caution"><strong>Important</strong>: You can remove the subscription 
    307 product from the product list offered in your app to prevent users from seeing 
    308 or purchasing it.</p>
    309 
    310 <h2 id="cancellation">Subscription Cancellation</h2>
    311 
    312 <p>Users can view the status of all of their subscriptions and cancel them if
    313 necessary from the <strong>My Apps</strong> screen in the Play Store app. 
    314 Currently, the In-app Billing API does not provide support for programatically 
    315 canceling subscriptions from inside the purchasing app.</p>
    316 
    317 <p>When the user cancels a subscription, Google Play does not offer a refund for
    318 the current billing cycle. Instead, it allows the user to have access to the
    319 cancelled subscription until the end of the current billing cycle, at which time
    320 it terminates the subscription. For example, if a user purchases a monthly
    321 subscription and cancels it on the 15th day of the cycle, Google Play will
    322 consider the subscription valid until the end of the 30th day (or other day,
    323 depending on the month).</p>
    324 
    325 <p>In some cases, the user may contact you directly to request cancellation of a
    326 subscription. In this and similar cases, you can use the server-side API to
    327 query and directly cancel the users subscription from your servers.
    328 
    329 <p class="caution"><strong>Important:</strong> In all cases, you must continue
    330 to offer the content that your subscribers have purchased through their
    331 subscriptions, as long any user is able to access it. That is, you must
    332 not remove any content while any user still has an active
    333 subscription to it, even if that subscription will terminate at the end of the
    334 current billing cycle. Alternatively, you can use the <a href="#refunds">refund
    335 and revoke</a> API to revoke each subscriber's subscription (one by one) and
    336 refund their subscription payments.
    337 Removing content that any subscriber is entitled to access
    338 will result in penalties. Please see the <a
    339 href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies document</a> for more information. </p>
    340 
    341 <h3 id="uninstall">App uninstallation</h3>
    342 
    343 <p>When the user uninstalls an app that includes purchased subscriptions, the 
    344 Play Store app will notify the user that there are active subscriptions. If the 
    345 user chooses to continue with the uninstallation, the app is removed and the 
    346 subscriptions remain active and recurring billing continues. The user can return 
    347 to cancel the associated subscriptions at any time in the <strong>My Apps</strong> 
    348 screen of the Play Store app. If the user chooses to cancel the uninstallation, 
    349 the app and subscriptions remain as they were.</p>
    350 
    351 <h3 id="refunds">Refunding and revoking subscriptions</h3>
    352 
    353 <p>With subscriptions, Google Play does not provide a refund window, so users
    354 will need to request a refund. They can request a refund from the <strong>My
    355 Orders</strong> page in the Play Store, or by contacting you directly.</p>
    356 
    357 <p>If you receive requests for refunds, you can use the
    358 <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google Play
    359 Developer API</a> or the Merchant Center to cancel the subscription, verify that it
    360 is already cancelled, or refund the user's payment without cancelling it. You
    361 can also use the
    362 <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google
    363 Play Developer API</a> to <em>refund and revoke</em> a
    364 user's subscription. If you refund and revoke a subscription, the user's
    365 subscription is immediately cancelled, and the user's most recent subscription
    366 payment is refunded. (If you want to refund more than the most recent payment,
    367 you can process additional refunds through the Merchant Center.)</p>
    368 
    369 <p class="caution"><strong>Important:</strong> Partial refunds are not available
    370 at this time.</p>
    371 
    372 <h2 id="payment">Payment Processing and Policies</h2>
    373 
    374 <p>In general, the terms of Google Play allow you to sell in-app subscriptions
    375 only through the standard payment processor, Google Wallet. For purchases of 
    376 any subscription products, the transaction fee is the same as the transaction 
    377 fee for application purchases (30%).</p>
    378 
    379 <p>Apps published on Google Play that are selling subscriptions must use In-app
    380 Billing to handle the transaction and may not provide links to a purchase flow
    381 outside of the app and Google Play (such as to a web site).</p>
    382 
    383 <p>For complete details about terms and policies, see the <a
    384 href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=140504">policies
    385 document</a>.</p>
    386 
    387 <h3 id="orderId">Subscription order numbers</h3>
    388 
    389 <p>To help you track transactions relating to a given subscription, Google
    390 Wallet provides a base Merchant Order Number for all recurrences of the 
    391 subscription and denotes
    392 each recurring transaction by appending an integer as follows: </p>
    393 
    394 <p><span style="color:#777"><code style="color:#777">12999556515565155651.5565135565155651</code> (base order number)</span><br />
    395 <code>12999556515565155651.5565135565155651..0</code> (first recurrence orderID)<br />
    396 <code>12999556515565155651.5565135565155651..1</code> (second recurrence orderID)<br />
    397 <code>12999556515565155651.5565135565155651..2</code> (third recurrence orderID)<br />
    398 ...<br /></p>
    399 
    400 <p>Google Play provides the order number as the value of the 
    401 {@code orderId} field of the {@code INAPP_PURCHASE_DATA} JSON field (in V3) 
    402 or the {@code PURCHASE_STATE_CHANGED} intent (in V2).</p>
    403 
    404 <h2 id="strategies">Purchase Verification Strategies</h2>
    405 
    406 <p>In a typical scenario, your app verifies the order status for new purchases
    407 to ensure that they are valid before granting access to the purchased
    408 content.</p>
    409 
    410 <p>To verify a purchase, the app passes the purchase token and other details up
    411 to your backend servers, which verifies them directly with Google Play using the
    412 Google Play Developer API.  If the backend server determines that the purchase is
    413 valid, it notifies the app and grants access to the content.</p>
    414 
    415 <p>Keep in mind that users will want the ability to use your app at any time,
    416 including when there may be no network connection available. Make sure that your
    417 approach to purchase verification accounts for the offline use-case.</p>
    418 
    419 <h2 id="play-dev-api">Google Play Developer API</h2>
    420 
    421 <p>Google Play offers an HTTP-based API that lets you perform such tasks as:</p>
    422   <ul>
    423     <li>Remotely query the validity of a specific subscription at any time</li>
    424     <li>Cancel a subscription</li>
    425     <li>Defer a subscription's next billing date</li>
    426     <li>Refund a subscription payment without cancelling the subscription</li>
    427     <li>Refund and revoke a subscription</li>
    428   </ul>
    429 
    430 <p>The API is designed to be used from your backend servers as a way of securely
    431 managing subscriptions, as well as extending and integrating subscriptions with
    432 other services.</p>
    433 
    434 <p>For complete information, see
    435 <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google Play
    436 Developer API</a>.</p>
    437