1page.title=Administering In-app Billing
2parent.title=In-app Billing
3parent.link=index.html
4@jd:body
5
6<div id="qv-wrapper">
7<div id="qv">
8  <h2>In this document</h2>
9  <ol>
10    <li><a href="#billing-list-setup">Creating a Product List</a></li>
11    <li><a href="#pricing-template">Pricing Templates</a></li>
12    <li><a href="#billing-purchase-type">Choosing a Product Type</a></li>
13    <li><a href="#billing-refunds">Handling Refunds</a></li>
14    <li><a href="#billing-refunds">Working with Order Numbers</a></li>
15    <li><a href="#billing-testing-setup">Setting up Test Accounts</a></li>
16    <li><a href="#billing-support">Where to Get Support</a></li>
17  </ol>
18
19  </ol>
20  <h2>See also</h2>
21  <ol>
22    <li><a href="{@docRoot}google/play/billing/billing_overview.html">Overview of In-app
23    Billing</a></li>
24  </ol>
25</div>
26</div>
27
28<p>In-app billing frees you from processing financial transactions, but you still need to perform a
29few administrative tasks. These tasks include the following:</p>
30<ul>
31  <li>Setting up and maintaining your product list on the Google Play Developer Console.</li>
32  <li>Registering test accounts.</li>
33  <li>Handling refunds when necessary.</li>
34</ul>
35</p>
36
37<p>To register a test account, you must have a Google Play publisher account. If you
38already have a publisher account on Google Play, you can use your existing account. You do not
39need to register for a new account to support in-app billing. If you don't have a publisher
40account, you can register as a Google Play developer and set up a publisher account through the <a
41href="http://play.google.com/apps/publish">Google Play Developer Console</a>.</p>
42
43<p>If you want to create a product list and issue refunds to your users, you must have a
44Google payments merchant account. If you don't have a merchant account, you can
45register for one through the Developer Console.</p>
46
47<h2 id="billing-list-setup">Creating a Product List</h2>
48
49<p>The Google Play Developer Console provides a product list for each of your published
50apps. You can sell an item using Google Play's in-app billing feature only if the item is
51listed on an app's product list. Each app has its own product list; you cannot sell
52items that appear on another app's product list.</p>
53
54<p>You can access an app's product list by opening the <strong>In-app Products</strong>
55page for an app that is listed in your developer account. The link to the
56<strong>In-app Products</strong> page appears only if you have a Google payments merchant
57account and the app's manifest includes the
58<code>com.android.vending.BILLING</code> permission. For more information about this
59permission, see <a href="{@docRoot}google/play/billing/billing_integrate.html#billing-permission">
60Updating Your App's Manifest</a>.</p>
61
62<p>A product list specifies items you are selling in an app: in-app products,
63subscriptions, or a combination of both. For each item, the product list contains information
64such as product ID, product description, and price. You can create a product list for any
65published app, including apps published to the alpha and beta channels.</p>
66
67<p>The product list stores only metadata about the items you are selling in your app.
68It does not store any digital content. You are responsible for storing and delivering
69the digital content that you sell in your apps.</p>
70
71<p class="note"><strong>Note:</strong> Previously, you could test an app by
72uploading an unpublished draft version. This functionality is no longer
73supported; instead, you must publish it to the alpha or beta distribution
74channel. For more information, see <a
75href="{@docRoot}google/play/billing/billing_testing.html#draft_apps">Draft Apps
76are No Longer Supported</a>.
77
78<p>In addition, an app package can have only one product list. If you create a product
79list for an app, and you use the <a
80href="{@docRoot}google/play/publishing/multiple-apks.html">multiple APK feature</a> to distribute
81more than one APK for that app, the product list applies to all APK versions that are
82associated with the app listing. You cannot create individual product lists for each APK if
83you are using the multiple APK feature.</p>
84
85<p>You can add items to a product list two ways: you can add items one at a time on the <strong>In-app
86Products</strong> page, or you can add a batch of items by importing the items from a
87comma-separated values (CSV) file. Adding items one at a time is useful if your
88app has only a few in-app items or you are adding only a few items to a
89product list for testing purposes. The CSV file method is useful if your app has a large
90number of in-app items.</p>
91
92<p class="note"><strong>Note:</strong> Batch upload of product lists containing
93  subscriptions is not supported. Also, when updating existing items in a batch upload,
94  you cannot include changes to in-app products that are linked to a
95<a href="#pricing-template">pricing template</a>.</p>
96
97<h3 id="billing-form-add">Adding items one at a time to a product list</h3>
98
99<p>To add an item to a product list using the Developer Console UI, follow these steps:</p>
100
101<ol>
102  <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
103  <li>In the <strong>All applications</strong> panel, click on the
104  app name, then open the <strong>In-app Products</strong> page.</li>
105  <li><p>Click <strong>Add new product</strong>. After you provide the product type and ID for the item you are
106  selling, click <strong>Continue</strong>.</p>
107  <dl>
108      <dt>Product Type</dt>
109      <dd>
110        <p>The product type can be <strong>Managed product</strong> or <strong>Subscription</strong>. You cannot
111        change an item's product type after you create the item. For more information, see
112        <a href="#billing-purchase-type">Choosing a Product Type</a>.</p>
113        <p class="note"><strong>Note: </strong>For subscription items, you cannot change the
114        item's price once you have published the item.</p>
115      </dd>
116      <dt>Product ID</dt>
117      <dd>
118        <p>Product IDs are unique across an app's namespace. A product ID must start with a
119        lowercase letter or a number and must be composed of only lowercase letters (a-z), numbers
120        (0-9), underscores (_), and periods (.). The product ID <code>android.test</code> is reserved, as are all
121        product IDs that start with <code>android.test</code>.</p>
122        <p class="note"><strong>Note: </strong>Be sure to plan your product ID namespace carefully. You
123        cannot modify an item's product ID after the item is created, and you cannot reuse
124        a product ID within an app.</p>
125      </dd>
126    </dl>
127  </li>
128  <li><p>Enter additional information about the item, then click <strong>Save</strong>.</p>
129    <dl>
130      <dt>Publishing State</dt>
131      <dd>
132        <p>An item's publishing state can be <strong>Active</strong> or
133        <strong>Inactive</strong>. To be visible to a user during checkout, an item's publishing state must be set to
134        <strong>Active</strong>, and the item's app must be published on Google Play.</p>
135        <p class="note"><strong>Note:</strong> If you're using a test account, users can see active items
136        within unpublished apps, as well. For more information, see <a
137        href="{@docRoot}google/play/billing/billing_testing.html#billing-testing-real">Testing In-app
138        Billing</a>.</p>
139      </dd>
140      <dt>Languages and Translations</dt>
141      <dd>
142        <p>By default, in-app products inherit their default language from the parent app.</p>
143        <p>You can provide localized titles and descriptions for your in-app
144        products by selecting <strong>Add Translations</strong>. If you want Google
145        Play to translate your title and description for you, based on the title and
146        description in the default language, just choose the languages that you
147        want to offer. You can also provide custom translations in specific
148        languages.</p>
149      </dd>
150      <dt>Title</dt>
151      <dd>
152        The title is a short descriptor for the item. An example of a title is: "Sleeping potion."
153        Every item must have a title. The title is visible to users during checkout. For optimum appearance,
154        titles should be no longer than 25 characters; however, titles can be up to 55 characters in length.
155      </dd>
156      <dt>Description</dt>
157      <dd>
158        The description is a long descriptor for the item. An example of a description is:
159        "Instantly puts creatures to sleep. Does not work on angry elves." Every item must have a description.
160        Descriptions can be up to 80 characters in length.
161      </dd>
162      <dt>Price</dt>
163      <dd>
164        <p>Provide a price in your home currency, or link the price to an existing
165        pricing template. Based on the price you enter or the prices
166        from the pricing template, the system autofills country-specific prices for
167        different currencies. These generated prices use current exchange rates and
168        locally relevant pricing patterns (see figure 1).</p>
169        <p>You can also change prices for other currencies manually, but you can do
170          this only if a currency is used in one of the target countries for your
171          app. You can specify target countries for your app on the
172          <strong>Pricing &amp; Distribution</strong> page in the Google Play
173          Developer Console.</p>
174      </dd>
175    </dl>
176  </li>
177</ol>
178
179<figure id="fig-elp">
180  <img class="border-img" src="{@docRoot}images/in-app-billing/edit_local_prices.png"
181  width="700" alt="An item that costs 1.99 in USD usually costs a different
182  amount in AUD, EUR, or BOB. Some countries also add tax to the price.">
183  <figcaption>
184    <b>Figure 1. </b>Specifying additional currencies for an in-app product.
185  </figcaption>
186</figure>
187
188<h3 id="billing-bulk-add">Adding a batch of items to a product list</h3>
189
190<p>To add a batch of items to a product list using a CSV file, you first need to create your CSV
191file. The data values that you specify in the CSV file represent the same data values you specify
192manually through the In-app Products UI (see <a href="#billing-form-add">Adding items one at a time
193to a product list</a>).
194
195<p>If you are importing and exporting CSV files with in-app products, keep
196country-specific pricing in mind. If you use auto-fill, you can provide a
197tax-exclusive default price, and tax-inclusive prices will be auto-filled. If you
198do not use auto-fill, prices you provide must include tax.</p>
199
200<p class="note"><strong>Note:</strong> Batch upload of product lists containing
201subscriptions is not supported. Also, when updating existing items in a batch
202upload, you cannot include changes to in-app products that are linked to a
203<a href="#pricing-template">pricing template</a>.</p>
204
205<p>To import the items that are specified in your CSV file, do the following:</p>
206
207<ol>
208  <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
209  <li>In the <strong>All applications</strong> panel, select the app
210  name, then open the <strong>In-app Products</strong> page.</li>
211  <li>On the In-app Products List page, click <strong>Import/Export</strong>
212  &gt; <strong>Import in-app products from CSV file</strong>, then select your
213  CSV file.
214    <p>The CSV file must be on your local computer or on a local disk that is connected to your
215    computer.</p>
216  </li>
217  <li>Select the <strong>Overwrite</strong> checkbox if you want to overwrite existing items in
218  your product list.
219    <p>This option overwrites values of existing items only if the value of the <em>product_id</em>
220    in the CSV file matches the In-app Product ID for an existing item in the product list.
221    Overwriting doesn't delete items that are on a product list but not present in the CSV
222    file.</p>
223  </li>
224</ol>
225
226<p>You can also export an existing product list to a CSV file by clicking <strong>Export to CSV
227</strong> on the In-app Product List page. This is useful if you have manually added items to
228a product list and you want to start managing the product list through a CSV file.</p>
229
230<h4 id="billing-bulk-format">Formatting batches of items</h4>
231
232<p>The CSV file uses commas (,) and semicolons (;) to separate data values.
233Commas are used to separate primary data values, and semicolons are used to
234separate subvalues. For example, the syntax for the CSV file is as follows:</p>
235
236<p>"<em>product_id</em>","<em>publish_state</em>","<em>purchase_type</em>","<em>autotranslate</em>
237","<em>locale</em>; <em>title</em>; <em>description</em>","<em>autofill</em>","<em>country</em>;
238<em>price</em>"
239</p>
240
241<p>Descriptions and usage details are provided below.</p>
242
243<dl>
244  <dt>product_id</dt>
245  <dd>
246    This is equivalent to the In-app Product ID setting in the In-app Products UI. If you specify
247    a <em>product_id</em> that already exists in a product list, and you choose to overwrite
248    the product list while importing the CSV file, the data for the existing item is overwritten with
249    the values specified in the CSV file. The overwrite feature does not delete items that are on a
250    product list but not present in the CSV file.
251  </dd>
252  <dt>publish_state</dt>
253  <dd>
254    This is equivalent to the Publishing State setting in the In-app Products UI. Can be <code>
255    published</code> or <code>unpublished</code>.
256  </dd>
257  <dt>purchase_type</dt>
258  <dd>
259    This is equivalent to the Product Type setting in the In-app Products UI. Can be <code>
260    managed_by_android</code>, which is equivalent to <strong>Managed per user account
261    </strong> in the In-app Products UI, or <code>managed_by_publisher</code>, which is equivalent
262    to <strong>Unmanaged</strong> in the In-app Products UI.
263  </dd>
264  <dt>autotranslate</dt>
265  <dd>
266    This is equivalent to selecting the <strong>Fill fields with auto translation</strong>
267    checkbox in the In-app Products UI. Can be <code>true</code> or <code>false</code>.
268  </dd>
269  <dt>locale</dt>
270  <dd>
271    <p>This is equivalent to the Language setting in the In-app Products UI. You must have an entry
272    for the default locale. The default locale must be the first entry in the list of
273    locales, and it must include a <em>title</em> and <em>description</em>. If you want to provide
274    translated versions of the <em>title</em> and <em>description</em> in addition to the default,
275    you must use the following syntax rules:</p>
276    <ul>
277      <li>
278      <p>If <em>autotranslate</em> is <code>true</code>, you must specify the default locale,
279      default title, default description, and other locales using the following format:</p>
280      <p>"true,"<em>default_locale</em>; <em>default_locale_title</em>;
281      <em>default_locale_description</em>; <em>locale_2</em>;    <em>locale_3</em>, ..."</p>
282      </li>
283      <li>
284      <p>If <em>autotranslate</em> is <code>false</code>, you must specify the default locale,
285      default title, and default description as well as the translated titles and descriptions using
286      the following format:</p>
287      <p>"false,"<em>default_locale</em>; <em>default_locale_title</em>;
288      <em>default_locale_description</em>; <em>locale_2</em>; <em>locale_2_title</em>;
289      <em>local_2_description</em>; <em>locale_3</em>; <em>locale_3_title</em>;
290       <em>locale_3_description</em>; ..."</p>
291      </li>
292    </ul>
293    <p>See table 1 for a list of the language codes you can use with the <em>locale</em> field.</p>
294  </dd>
295  <dt>title</dt>
296  <dd>
297    This is equivalent to the Title setting in the In-app Products UI. If the <em>title</em>
298    contains a semicolon, it must be escaped with a backslash (for example, <code>\;</code>). Also, a backslash
299    must be escaped with a backslash (for example, <code>\\</code>).
300  </dd>
301  <dt>description</dt>
302  <dd>
303    This is equivalent to the Description in the In-app Products UI. If the <em>description</em>
304    contains a semicolon, it must be escaped with a backslash (for example, <code>\;</code>). Also, a backslash
305    must be escaped with a backslash (for example, <code>\\</code>).
306  </dd>
307  <dt>autofill</dt>
308  <dd>
309    <p>This is equivalent to clicking <strong>Auto Fill</strong> in the In-app Products UI. Can be
310    <code>true</code> or <code>false</code>. The syntax for specifying the <em>country</em>
311    and <em>price</em> varies depending on which <em>autofill</em> setting you use:</p>
312    <ul>
313      <li>
314        <p>If <em>autofill</em> is set to <code>true</code>, you need to specify only the default
315        price in your home currency, and you must use this syntax:</p>
316        <p>"true","<em>default_price_in_home_currency</em>"
317      </li>
318      <li>
319        <p>If <em>autofill</em> is set to <code>false</code>, you need to specify a <em>country</em>
320        and a <em>price</em> for each currency, and you must use the following syntax:</p>
321        <p>"false", "<em>home_country</em>; <em>default_price_in_home_currency</em>; <em>country_2</em>;
322        <em>country_2_price</em>; <em>country_3</em>; <em>country_3_price</em>; ..."</p>
323      </li>
324    </ul>
325    <p class="note"><strong>Note: </strong>If you use an <em>autofill</em> value of <code>false</code>
326    and set country prices manually, you must incorporate country-specific
327    pricing patterns, including tax rates, into the prices you provide.</p>
328  </dd>
329  <dt>country</dt>
330  <dd>
331    The country for which you are specifying a price. You can only list countries that your
332    app is targeting. The country codes are two-letter uppercase
333    ISO country codes (such as "US"), as defined by
334    <a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-2</a>.
335  </dd>
336  <dt>price</dt>
337  <dd>
338    This is equivalent to the Price in the In-app Products UI. The price must be specified in
339    micro-units. To convert a currency value to micro-units, you multiply the real value by
340    1,000,000.
341    For example, if you want to sell an in-app item for $1.99, you specify <code>1990000</code> in the
342    <em>price</em> field.
343  </dd>
344</dl>
345
346<p class="table-caption" id="language-table"><strong>Table 1.</strong> Language codes you can use
347with the <em>locale</em> field.</p>
348
349<table>
350
351<tr>
352<th>Language</th>
353<th>Code</th>
354<th>Language</th>
355<th>Code</th>
356</tr>
357<tr>
358<td>Chinese</td>
359<td>zh_TW</td>
360<td>Italian</td>
361<td>it_IT</td>
362</tr>
363<tr>
364<td>Czech</td>
365<td>cs_CZ</td>
366<td>Japanese</td>
367<td>ja_JP</td>
368</tr>
369<tr>
370<td>Danish</td>
371<td>da_DK</td>
372<td>Korean</td>
373<td>ko_KR</td>
374</tr>
375<tr>
376<td>Dutch</td>
377<td>nl_NL</td>
378<td>Norwegian</td>
379<td>no_NO</td>
380</tr>
381<tr>
382<td>English</td>
383<td>en_US</td>
384<td>Polish</td>
385<td>pl_PL</td>
386</tr>
387<tr>
388<td>French</td>
389<td>fr_FR</td>
390<td>Portuguese</td>
391<td>pt_PT</td>
392</tr>
393<tr>
394<td>Finnish</td>
395<td>fi_FI</td>
396<td>Russian</td>
397<td>ru_RU</td>
398</tr>
399<tr>
400<td>German</td>
401<td>de_DE</td>
402<td>Spanish</td>
403<td>es_ES</td>
404</tr>
405<tr>
406<td>Hebrew</td>
407<td>iw_IL</td>
408<td>Swedish</td>
409<td>sv_SE</td>
410</tr>
411<tr>
412<td>Hindi</td>
413<td>hi_IN</td>
414<td>--</td>
415<td>--</td>
416</tr>
417</table>
418
419<h2 id="pricing-template">
420  Pricing Templates
421</h2>
422
423<p>
424  If you sell multiple apps at the same price, or if you sell multiple in-app
425  products at the same price across one or more apps, you can add <em>pricing
426  templates</em>. These templates make it easier to manage shared prices.
427</p>
428
429<h3 id="add-pricing-template">
430  Adding a pricing template
431</h3>
432
433<p>
434  When creating a pricing template, you provide new pricing information that you
435  can apply to paid apps and in-app products. To add a pricing template, do the
436  following:
437</p>
438
439<ol>
440  <li>
441    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
442    account.
443  </li>
444
445  <li>In the <strong>Settings</strong> panel, open the <strong>Pricing
446  template</strong> page.
447  </li>
448
449  <li>
450    <p>
451      If you are adding your first pricing template, the <strong>Add a Pricing
452      Template</strong> banner appears. Select <strong>Add template</strong> to
453      create a new template. The new template's <em>Pricing</em> tab appears.
454    </p>
455
456    <p>
457      Otherwise, you see a list of your pricing templates. Select <strong>New
458      pricing template</strong>. The new template's <em>Pricing</em> tab
459      appears.
460    </p>
461  </li>
462
463  <li>
464    <p>
465      Provide details about the template. These details include the name, the
466      price, and whether to include tax as part of your country-specific
467      prices.
468    </p>
469    <p>
470      Based on the price and tax option you provide, the Developer Console
471      generates prices for international currencies using current exchange
472      rates and country-specific pricing patterns.
473    </p>
474  </li>
475  <li>Select <strong>Create template</strong> to finish adding the template.
476  </li>
477</ol>
478
479<h3 id="link-pricing-template">
480  Linking a pricing template
481</h3>
482
483<p>
484  You can create links between pricing templates and sets of paid apps and
485  in-app products that share the same price. After completing this linking
486  process, any changes you make to the pricing template are applied to the
487  prices of items that you've linked to the template. To complete the linking
488  process, use either the pricing template's <em>Linked Items</em> tab or the
489  Price section within a paid app or in-app product's pricing page.
490</p>
491
492<p class="note">
493  <strong>Note:</strong> Since a subscription within your app has a constant
494  price, you cannot link a subscription with a pricing template. You can,
495  however, import the prices from a pricing template and apply them to a new
496  subscription.
497</p>
498
499<h4>
500  Linking a pricing template to in-app products and paid apps
501</h4>
502
503<p>
504  To link a pricing template to an in-app product, do the following:
505</p>
506
507<ol>
508  <li>
509    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
510    account.
511  </li>
512
513  <li>In the <strong>Settings</strong> panel, open the <strong>Pricing
514  template</strong> page. This page shows the list of pricing templates you have
515  created for your account.
516  </li>
517
518  <li>Choose an existing pricing template that you want to link to an in-app
519  product, then select the template's <em>Linked Items</em> tab. This tab shows
520  options to link your pricing template to in-app products and paid apps
521  (see figure 2).
522  </li>
523
524  <li>In the Link In-App Products section of the tab, enter or choose the name
525  of an app. This app should contain the in-app product that you want to link
526  to your pricing template.
527  </li>
528
529  <li>Based on the app that you selected, you see a list of in-app products
530  that are active and are not yet linked to a pricing template. Choose the
531  in-app product that you want to link to the pricing template by selecting the
532  <strong>Link</strong> button that appears in the same row as the in-app
533  product.
534  </li>
535
536  <li>The price of the in-app product is now linked to your pricing template.
537  Any changes you make to the prices within your pricing template affect the
538  prices of the linked in-app product.
539  </li>
540</ol>
541
542<p>
543  To link a pricing template to the price of a paid app, you follow a similar
544  process. On the pricing template's <em>Linked Items</em> tab, choose a paid
545  app in the Link Paid Apps section.
546</p>
547
548<figure id="fig-lpt">
549  <img class="border-img"
550  src="{@docRoot}images/in-app-billing/link_pricing_template.png" width="700"
551  alt="The Sleeping Potion in-app product is linked to the Basic Inventory item,
552  but the Invisibility Potion is not.">
553  <figcaption>
554    <b>Figure 2. </b>On a pricing template's <em>Linked Items</em> tab, you can
555    change which in-app products and paid apps are linked to the pricing
556    template.
557  </figcaption>
558</figure>
559
560<h4>
561  Linking an in-app product or paid app to a pricing template
562</h4>
563
564<p>
565  To link an in-app product to a pricing template, do the following:
566</p>
567
568<ol>
569  <li>
570    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
571    account.
572  </li>
573
574  <li>In the <strong>All applications</strong> panel, select the app name, then
575  open the <strong>In-app Products</strong> page.
576  </li>
577
578  <li>Choose the in-app product that you want to link to a pricing template.
579  The item's details page appears.
580  </li>
581
582  <li>In the Pricing section, choose the pricing template that you want to link
583  to the price of this in-app product.
584  </li>
585
586  <li>The price of the in-app product is now linked to the pricing template you
587  selected. Any changes you make to the prices within your pricing template
588  affect the prices of this in-app product.
589  </li>
590</ol>
591
592<p>
593  To link the price of a paid app to a pricing template, you follow a similar
594  process on the app's <strong>Pricing &amp; Distribution</strong> page.
595</p>
596
597<h3 id="delete-linked-item">
598  Deleting an item that is linked to a pricing template
599</h3>
600
601<p>
602  As your app evolves, you may find it useful to remove older versions of
603  in-app products or unpublish paid apps, some of which may be linked to pricing
604  templates. To delete an in-app product or unpublish a paid app that is linked
605  to a pricing template, complete the following steps. You don't need to unlink
606  the in-app product or paid app from the pricing template beforehand.
607</p>
608
609<h4>
610  Deleting an in-app product that is linked to a template
611</h4>
612
613<p>
614  To delete an in-app product that is linked to a template, do the following:
615</p>
616
617<ol>
618  <li>
619    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
620    account.
621  </li>
622
623  <li>Select the app that contains the in-app product you want to delete.
624  </li>
625
626  <li>Open the app's <strong>In-app Products</strong> page.
627  </li>
628
629  <li>Choose the in-app product that you want to delete.
630  </li>
631
632  <li>Select the button that indicates whether the in-app product is active or
633  inactive (enclosed in a box within figure 3). The drop-down menu includes a
634  <strong>Delete</strong> option.
635  </li>
636  <li>Select <strong>Delete</strong>, then choose <strong>Yes</strong> in the
637  confirmation dialog that appears.
638  </li>
639</ol>
640
641<figure id="fig-diap">
642  <img class="border-img" src="{@docRoot}images/in-app-billing/delete_iap.png"
643  width="500" alt="">
644  <figcaption>
645    <b>Figure 3. </b>Deleting an in-app product that is linked to a pricing
646    template.
647  </figcaption>
648</figure>
649
650<h4>
651  Unpublishing a paid app that is linked to a template
652</h4>
653
654<div class="figure-right">
655  <figure id="fig-upa">
656    <img src="{@docRoot}images/in-app-billing/unpublish_paid_app.png"
657    width="700" alt="">
658    <figcaption>
659      <b>Figure 4. </b>Unpublishing an app that has already been published and is
660      linked to a pricing template.
661    </figcaption>
662  </figure>
663</div>
664
665<p>
666  To unpublish a paid app that is already published and is linked to a template,
667  do the following:
668</p>
669
670<ol>
671  <li>
672    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
673    account.
674  </li>
675
676  <li>Select the app that you want to unpublish.
677  </li>
678
679  <li>Select <strong>Unpublish app</strong> (enclosed in a box within figure 4),
680  then choose <strong>Unpublish</strong> in the confirmation dialog that
681  appears.
682  </li>
683</ol>
684
685<h3 id="delete-pricing-template">
686  Deleting a pricing template
687</h3>
688
689<p>
690  If you no longer need a pricing template, you can delete it by completing the
691  following steps:
692</p>
693
694<ol>
695  <li>
696    <a href="http://play.google.com/apps/publish">Log in</a> to your publisher
697    account.
698  </li>
699
700  <li>In the <strong>Settings</strong> panel, open the <strong>Pricing
701  template</strong> page, which shows the list of pricing templates you have
702  created for your account.
703  </li>
704
705  <li>Select the pricing template that you wish to delete.
706  </li>
707
708  <li>On the pricing template's <em>Linked Items</em> tab, unlink all in-app
709  products that are linked to the template.</li>
710
711  <li>Select <strong>Delete template</strong>.
712  </li>
713</ol>
714
715<h2 id="billing-purchase-type">Choosing a Product Type</h3>
716
717<p>An item's product type controls how Google Play manages the purchase of the item. The supported
718product types include "managed product" and "subscription." Since support for different product
719types can vary among versions of the In-app Billing API, make sure that you choose a product
720type that's valid for the version of the In-app Billing API that your app uses. </p>
721
722<p>For details, refer to the documentation for the <a
723href="{@docRoot}google/play/billing/api.html#producttype">In-app Billing API</a>.
724
725<h2 id="billing-refunds">Handling Refunds</h2>
726
727<p>In-app billing does not allow users to send a refund request to Google Play. Refunds for
728in-app purchases must be directed to you (the app developer). You can then process the
729refund through your Google payments merchant account. When you do this, Google Play receives a
730refund notification from Google payments, and Google Play sends a refund message to your
731app. For more information, see <a
732href="{@docRoot}google/play/billing/v2/api.html#billing-action-notify">Handling
733IN_APP_NOTIFY messages</a> and <a
734href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">
735In-app Billing Pricing</a>.</p>
736
737<p class="caution"><strong>Important:</strong> You cannot use the API to issue
738refunds or cancel In-app Billing transactions. You must do this manually through your Google
739payments merchant account. However, you can use the API to retrieve order
740information.</p>
741
742<h2 id="orderId">Working with Order Numbers</h2>
743
744<p>When a user purchases an in-app item, Google assigns the transaction
745a unique and permanent order number. Google Play provides that order number to
746you at the conclusion of the purchase flow, as the value of the
747<code>orderId</code> field of the <code>PURCHASE_STATE_CHANGED</code>
748intent.</p>
749
750<p class="note">
751  <strong>Note:</strong> When a user completes a test purchase, the
752  <code>orderId</code> field remains blank. To track test transactions, use
753  the <code>purchaseToken</code> field instead. For more information about
754  working with test purchases, see <a
755  href="{@docRoot}google/play/billing/billing_testing.html">Testing In-app
756  Billing</a>.
757</p>
758
759<p>In your app, you can use the order number as a general-purpose identifier for
760the in-app purchase transaction. After the purchase, you can use the order
761number as a means of tracking the transaction in reconciliation reports and for
762customer support.</p>
763
764<p>The order number itself is a string consisting of numbers only, with a format
765assigned and managed by Google.</p>
766
767<p>For transactions dated 5 December 2012 or later, Google payments assigns a
768Merchant Order Number (rather than a Google Order Number) and reports the Merchant
769Order Number as the value of <code>orderID</code>. Here's an
770example:</p>
771
772<pre>"orderId" : "GPA.1234-5678-9012-34567"</pre>
773
774<p>For transactions dated previous to 5 December 2012, Google checkout assigned
775a Google Order Number and reported that number as the value of
776<code>orderID</code>. Here's an example of an <code>orderID</code> holding a
777Google Order Number:</p>
778
779<pre>"orderId" : "556515565155651"</pre>
780
781<h2 id="billing-testing-setup">Setting Up Test Accounts</h2>
782
783<p>The Google Play Developer Console lets you set up one or more test accounts.
784A test account is a regular Google account that you register on the Developer
785Console as a test account. Test accounts are authorized to make in-app purchases
786from apps that you have uploaded to the Google Play Developer Console
787but have not yet published.</p>
788
789<p>You can use any Google account as a test account. Test accounts are useful if you want to let
790multiple people test In-app Billing on apps without giving them access to your publisher
791account's sign-in credentials. If you want to own and control the test accounts, you can create the
792accounts yourself and distribute the credentials to your developers or testers.</p>
793
794<p>Test accounts have three limitations:</p>
795
796<ul>
797  <li>Test account users can make purchase requests only within apps that are already
798  uploaded to your publisher account (although the app doesn't need to be published).</li>
799  <li>Test accounts can only be used to purchase items that are listed (and published) in an
800  app's product list.</li>
801  <li>Test account users do not have access to your publisher account and cannot upload apps
802  to your publisher account.</li>
803</ul>
804
805<p>To add test accounts to your publisher account, follow these steps:</p>
806
807<ol>
808  <li><a href="http://play.google.com/apps/publish">Log in</a> to your publisher account.</li>
809  <li>Click the <strong>Settings</strong> icon.</li>
810  <li>Locate the License Testing panel.</li>
811  <li>Add the email addresses for the test accounts you want to register,
812  separating each account with a comma.</li>
813  <li>Click <strong>Save</strong> to save your profile changes.</li>
814</ol>
815
816<h3 id="license_key">Getting an app's license key</h3>
817
818<p>The Google Play Developer Console provides a public licensing key for each
819app.</p>
820
821<p>To locate the key for an app, follow these steps:</p>
822<ol>
823  <li>Open the <strong>All applications</strong> panel.</li>
824  <li>Click on the app name, then open the <strong>Services &amp; APIs</strong>
825  page.</li>
826  <li>Scroll down to the section of the page labeled Your License Key for This
827  Application, as shown in figure 5.</li>
828</ol>
829<p>Previously, the Developer Console provided a single public key per developer
830account. To transition apps to the new per-app public key, the Developer Console
831sets the app-specific key as the former developer key. This ensures compatibility
832for apps that depend on the (former) developer key. </p>
833
834<figure id="fig-bak">
835  <img class="border-img" src="{@docRoot}images/in-app-billing/billing_app_key.png"
836  width="700" alt="">
837  <figcaption>
838    <b>Figure 5. </b>You can find the license key for each app on the
839    <strong>Services &amp; APIs</strong> page.
840  </figcaption>
841</figure>
842
843<h2 id="billing-support">Where to Get Support</h2>
844
845<p>If you have questions or encounter problems while implementing In-app Billing, contact the
846support resources listed in the following table (see table 2). By directing your queries to the
847correct forum, you can get the support you need more quickly.</p>
848
849<p class="table-caption" id="support-table"><strong>Table 2.</strong> Developer support resources
850for Google Play In-app Billing.</p>
851
852<table>
853
854<tr>
855<th>Support Type</th>
856<th>Resource</th>
857<th>Range of Topics</th>
858</tr>
859<tr>
860<td rowspan="2">Development and testing issues</td>
861<td>Google Groups: <a
862href="http://groups.google.com/group/android-developers">android-developers</a> </td>
863<td rowspan="2">In-app billing integration questions, user experience ideas, handling of responses,
864obfuscating code, IPC, test environment setup.</td>
865</tr>
866<tr>
867<td>Stack Overflow: <a
868href="http://stackoverflow.com/questions/tagged/android">http://stackoverflow.com/questions/tagged/
869android</a></td>
870</tr>
871<tr>
872<td>Billing issue tracker</td>
873<td><a href="http://code.google.com/p/marketbilling/issues/">Billing
874project issue tracker</a></td>
875<td>Bug and issue reports related specifically to In-app Billing sample code.</td>
876</tr>
877</table>
878
879<p>For general information about how to post to the groups listed above, see <a
880href="{@docRoot}resources/community-groups.html">Developer Forums</a> document in the Resources
881tab.</p>
882