1d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypage.title=Google Play Developer API
2d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypage.tags="In-app Billing", "Google Play", "inapp billing", "in app billing", "iab", "billing", "publishing"
357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty@jd:body
657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
757bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<div id="qv-wrapper">
857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<div id="qv">
957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <h2>In this document</h2>
10d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <!-- TODO: Update TOC -->
1157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <ol>
12d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="#publishing_api_overview">Publishing API</a>
13d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="#subscriptions_api_overview">Subscriptions and In-App
14d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay          Purchases API</a></li>
15d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="#using">Using the API</a>
16d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="#edits">Staged Edits</a></li>
17d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="#practices">Using the API Efficiently</a>
18d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay      <ol>
19d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay        <li><a href="#quota">Quota</a></li>
20d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay      </ol>
21d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    </li>
2257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  </ol>
23d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
2457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <h2>See also</h2>
2557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <ol>
26d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="https://developers.google.com/android-publisher/">Google Play
27d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay        Developer API</a> documentation</li>
28d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    <li><a href="https://support.google.com/googleplay/android-developer/answer/6071616">Google
29d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay        Help Center</a> overview of the Google Play Developer API</li>
3057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  </ol>
3157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty</div>
3257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty</div>
3357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
34d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>The Google Play Developer API is a REST-based web service that allows you to perform publishing
35d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayand app-management tasks. You can use this API to integrate your publishing
36d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayoperations with your release-management process.</p>
37d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
38d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Not all developers will need to use these APIs&mdash;in most cases you will
39d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaycontinue to manage your apps directly using the Google Play Developer Console.
40d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayHowever, if you have a large number of APKs to manage, or have to track user
41d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypurchases and subscriptions, you may find this API very useful.</p>
42d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
43d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Using the Google Play Developer API, you can automate a variety of
44d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayapp-management tasks, including:</p>
45d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
46d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ul>
47d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Uploading and releasing new versions of your app</li>
48d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Editing your app Google Play Store listings, including localized text and
49d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    graphics</li>
50d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Managing your in-app product catalog, your products purchase status and your
51d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay    app subscriptions</li>
52d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</li>
53d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</ul>
54d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
5557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
5657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
57d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>The Google Play Developer API lets you focus on designing and developing your
58d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayapp, while spending less time and effort managing your releases, even as you
59d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaygrow to new markets.</p>
60d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
61d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>The Google Play Developer API includes two components:</p>
62d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
63d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ul>
64d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>The <a href="#publishing_api_overview">Publishing API</a> lets you upload and publish
65d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  apps, and perform other publishing-related tasks.</li>
66d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>The <a href="#subscriptions_api_overview">Subscriptions and In-App Purchases
67d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  API</a> lets you manage in-app purchases and subscriptions. (This was
68d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  previously known as the "Purchase Status API".)</li>
69d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</ul>
70d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
71d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<h2 id="publishing_api_overview">Publishing API</h2>
72d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
73d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>
74d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayThe Google Play Developer Publishing API allows you to automate frequent tasks
75d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayhaving to do with app distribution. This provides functions
76d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaysimilar to those available to a developer through the Google Play
77d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayDeveloper Console, such
78d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayas:
79d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</p>
80d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
81d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ul><li>Uploading new versions of an app</li>
82d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Releasing apps, by assigning APKs to various <em>Tracks</em> (alpha, beta,
83d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  staged rollout, or production)</li>
84d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Creating and modifying Google Play Store listings, including localized text
85d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  and graphics and multi-device screenshots</li></ul>
86d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
87d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Those tasks are performed using the
88d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="#edits">edits</a>
89d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayfunctionality, which takes a transactional approach to making changes &mdash;
90d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayyou bundle several changes into a single draft edit, then commit the changes all
91d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayat once. (None of the changes take effect until the edit is committed.)</p>
92d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
93d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p class="note"><strong>Note:</strong> Not all developers will need to use this
94d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayAPI. All the functionality provided by the API is also available through the
95d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayGoogle Play
96d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayDeveloper Console. However, this API lets you integrate your app and listing
97d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayupdate process with your existing tools, which will be very useful for some
98d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaydevelopers. In particular, if you have a large number of APKs to manage, or
99d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaylocalized listings in many different locales, you may find this API invaluable.
100d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</p>
101d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
102d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<h2 id="subscriptions_api_overview">Subscriptions and In-App Purchases API</h2>
103d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
104d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>The API allows you to manage your app's catalog of in-app products and
105d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaysubscriptions. In addition, with the Subscriptions and In-App Purchases API you
106d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaycan quickly retrieve the
107d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaydetails of any purchase using a standard GET request. In the request you supply
108d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayinformation about the purchase &mdash; app package name, purchase or
109d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaysubscription ID, and the purchase token. The server responds with a JSON object
110d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaydescribing the associated purchase details, order status, developer payload, and
111d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayother information.</p>
11257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
11357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<p>You can use the Purchase Status API in several ways, such as for reporting
11457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Doughertyand reconciliation of individual orders and for verifying purchases and
11557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Doughertysubscription expirations. You can also use the API to learn about cancelled
11657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Doughertyorders and confirm whether in-app products have been consumed, including
11757bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Doughertywhether they were consumed before being cancelled.</p>
11857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
119d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p class="note"><strong>Note:</strong> The Subscriptions and In-App
120d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayPurchases API does not use the new, transactional "edits" functionality used by
121d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaythe <a href="#publishing_api_overview">Publishing API</a>. Methods for the
122d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="https://developers.google.com/android-publisher/api-ref/inappproducts">Inappproducts</a>,
123d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="https://developers.google.com/android-publisher/api-ref/purchases/products">Purchases.products</a>,
124d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayand <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions">Purchases.subscriptions</a>
125d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayresources take effect immediately. Each resource's API reference page notes
126d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayspecifically whether the methods for that resource use the "edits"
127d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaymodel.</p>
12857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
12957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<p>The Purchase Status API is part of the <a
130d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayhref="https://developers.google.com/android-publisher/">Google Play Developer
131d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayAPI</a> v. 2.0, available through the Google Developers Console.</p>
13257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
13357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<h2 id="using">Using the API</h2>
13457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
135d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>To start making API calls, you’ll set up and manage the Google Play Developer
136d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayAPI directly from the <a href="https://play.google.com/apps/publish/">Google
137d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayPlay Developer Console</a>. The API can only be managed by the owner of your
138d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayGoogle Play Developer account.</p>
13957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
140d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>To access the API, you'll need to:</p>
14157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
142d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ol><li>Set up a new or existing API project</li>
143d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<li>Set up one or more authorized clients, which can be either:
144d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ul>
145d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li><a href="https://developers.google.com/accounts/docs/OAuth2">OAuth
146d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay      clients</a></li>
147d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li><a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount">
148d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay      service account</a></li>
149d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</ul></li></ol>
15057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
151d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>For full details, see the Google Play Developer API
152d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="https://developers.google.com/android-publisher/getting_started">Getting
153d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayStarted</a> page.</p>
15457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
155d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<h2 id="edits">Staged Edits</h2>
15657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
157d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>The Google Play Developer Publishing API Edits methods allow you to prepare
158d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayand commit changes to your Google Play apps. Once your update is ready to go,
159d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayyou can deploy it with a single operation. The changes you can make include:</p>
16057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
161d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<ul>
162d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li>Uploading one or more APKs</li>
163d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li>Assigning different APKs to different “tracks”: alpha, beta, staged
164d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay      rollout, and production</li>
165d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li>Creating and modifying localized store listings for the app</li>
166d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li>Uploading screenshots and other images for the app’s store listings</li>
167d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay</ul>
16857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
169d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Once all the desired changes have been staged, they are all committed with a
170d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaysingle operation.</p>
17157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
172d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>For full details on staged edits, see the Google Play Developer API
173d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="https://developers.google.com/android-publisher/edits/">Edits</a>
174d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypage.</p>
17557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
176d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p class="note"><strong>Note:</strong> The new, transactional "edits"
177d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayfunctionality is only used by the <a href="#publishing_api_overview">Publishing
178d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayAPI</a>. Methods for the <a href="#subscriptions_api_overview">Subscriptions and
179d28470e87a6521ff0fe7da843259657d9b1f661cAndrew SolovayIn-App Purchases API</a> take effect immediately. Each resource's API reference
180d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypage notes specifically whether the methods for that resource use the "edits"
181d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaymodel.</p>
18257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
18357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<h2 id="practices">Using the API Efficiently</h2>
18457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
185d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Access to the Google Play Developer API is regulated to help ensure a
186d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayhigh-performance environment for all applications that use it (as described in
187d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<a href="#quota">Quota</a>). While you can
18857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Doughertyrequest a higher daily quota for your application, we highly recommend that you
189d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayminimize your access using these techniques: </p>
19057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
19157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<ul>
192d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  <li><em>Limit the number of app updates</em> &mdash; Do not publish alpha or beta
193d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  updates more frequently than once a day. (Production apps should be updated
194d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  even less frequently than that.) Every update costs your users time and
195d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  possibly money. If you update too frequently, users will start ignoring
196d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  updates, or even uninstall the product. (Of course, if there's a major problem
197d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay  with your app, go ahead and fix it.)</li>
19857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <li><em>Query the Purchase Status API for new purchases only</em> &mdash; At
19957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  purchase, your app can pass the purchase token and other details to your backend
20057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  servers, which can use the Purchase Status API to verify the purchase.</li>
20157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <li><em>Cache purchase details on your servers</em> &mdash; To the extent possible,
20257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  cache the purchase details for in-app products and subscriptions on your backend
20357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  servers. If your app contacts your backend servers at runtime to verify purchase
20457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  validity, your server can verify the purchase based on the cached details, to
20557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  minimize use of the Purchase Status API and to provide the fastest possible response
20657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  (and best experience) for the user.</li>
20757bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <li><em>Store subscription expiry on your servers</em> &mdash; Your servers should
20857bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  use the Purchase Status API to query the expiration date for new subscription tokens,
20957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  then store the expiration date locally. This allows you to check the status of
21057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  subscriptions only at or after the expiration (see below).</li>
21157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  <li><em>Query for subscription status only at expiration</em> &mdash; Once your
21257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  server has retrieved the expiration date of subscription tokens, it should not query
21357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  the Google Play servers for the subscription status again until the subscription is
21457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  reaching or has passed the expiration date. Typically, your servers would run a batch
21557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  query each day to check the status of expiring subscriptions, then update the database.
21657bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  Note that:
21757bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty    <ul>
218a9dcc3345918dbb289503d76cab6c40cee673b2cDirk Dougherty      <li>Your servers should not query all subscriptions every day.</li>
21957bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty      <li>Your servers should never query subscription status dynamically, based on
22057bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty      individual requests from your Android application.</li>
22157bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty    </ul>
22257bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty  </li>
22357bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty</ul>
22457bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty
22557bb89f0b267140ae7f50e31ec0e3023e8836639Dirk Dougherty<p>By following those general guidelines, your implementation will offer the
226d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaybest possible performance for users.</p>
227d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
228d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<h3 id="quota">Quota</h3>
229d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
230d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>Applications using the Google Play Developer API are limited to an
231d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayinitial courtesy usage quota of <strong>200,000 requests per day</strong> (per
232d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovayapplication). This should provide enough access for publishing activities and
233d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaynormal subscription-validation needs.</p>
234d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay
235d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovay<p>If you need to request a higher limit for your application, use the "Request
236d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaymore" link on the <strong>Quotas</strong>
237d28470e87a6521ff0fe7da843259657d9b1f661cAndrew Solovaypane of the Google Developers Console.</p>
238