blob: f77d1ce9a9ad80582c44638e7009fcf10f93e5dc [file] [log] [blame]
Craig Citro065b5302014-08-14 00:47:23 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Nathaniel Manista4f877e52015-06-15 16:44:50 +000075<h1><a href="androidpublisher_v2.html">Google Play Developer API</a> . <a href="androidpublisher_v2.purchases.html">purchases</a> . <a href="androidpublisher_v2.purchases.subscriptions.html">subscriptions</a></h1>
Craig Citro065b5302014-08-14 00:47:23 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#cancel">cancel(packageName, subscriptionId, token)</a></code></p>
79<p class="firstline">Cancels a user's subscription purchase. The subscription remains valid until its expiration time.</p>
80<p class="toc_element">
Craig Citro0e5b9bf2014-10-15 10:26:14 -070081 <code><a href="#defer">defer(packageName, subscriptionId, token, body)</a></code></p>
82<p class="firstline">Defers a user's subscription purchase until a specified future expiration time.</p>
83<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070084 <code><a href="#get">get(packageName, subscriptionId, token)</a></code></p>
85<p class="firstline">Checks whether a user's subscription purchase is valid and returns its expiry time.</p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070086<p class="toc_element">
87 <code><a href="#refund">refund(packageName, subscriptionId, token)</a></code></p>
88<p class="firstline">Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.</p>
89<p class="toc_element">
90 <code><a href="#revoke">revoke(packageName, subscriptionId, token)</a></code></p>
91<p class="firstline">Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.</p>
Craig Citro065b5302014-08-14 00:47:23 -070092<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="cancel">cancel(packageName, subscriptionId, token)</code>
95 <pre>Cancels a user's subscription purchase. The subscription remains valid until its expiration time.
96
97Args:
98 packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
99 subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
100 token: string, The token provided to the user's device when the subscription was purchased. (required)
101</pre>
102</div>
103
104<div class="method">
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700105 <code class="details" id="defer">defer(packageName, subscriptionId, token, body)</code>
106 <pre>Defers a user's subscription purchase until a specified future expiration time.
107
108Args:
109 packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
110 subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
111 token: string, The token provided to the user's device when the subscription was purchased. (required)
112 body: object, The request body. (required)
113 The object takes the form of:
114
115{
116 "deferralInfo": { # A SubscriptionDeferralInfo contains the data needed to defer a subscription purchase to a future expiry time. # The information about the new desired expiry time for the subscription.
117 "expectedExpiryTimeMillis": "A String", # The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not occur.
118 "desiredExpiryTimeMillis": "A String", # The desired next expiry time for the subscription in milliseconds since Epoch. The given time must be after the current expiry time for the subscription.
119 },
120 }
121
122
123Returns:
124 An object of the form:
125
126 {
127 "newExpiryTimeMillis": "A String", # The new expiry time for the subscription in milliseconds since the Epoch.
128 }</pre>
129</div>
130
131<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700132 <code class="details" id="get">get(packageName, subscriptionId, token)</code>
133 <pre>Checks whether a user's subscription purchase is valid and returns its expiry time.
134
135Args:
136 packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
137 subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
138 token: string, The token provided to the user's device when the subscription was purchased. (required)
139
140Returns:
141 An object of the form:
142
143 { # A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
144 "expiryTimeMillis": "A String", # Time at which the subscription will expire, in milliseconds since Epoch.
145 "kind": "androidpublisher#subscriptionPurchase", # This kind represents a subscriptionPurchase object in the androidpublisher service.
146 "autoRenewing": True or False, # Whether the subscription will automatically be renewed when it reaches its current expiry time.
147 "startTimeMillis": "A String", # Time at which the subscription was granted, in milliseconds since Epoch.
148 }</pre>
149</div>
150
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700151<div class="method">
152 <code class="details" id="refund">refund(packageName, subscriptionId, token)</code>
153 <pre>Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.
154
155Args:
156 packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
157 subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
158 token: string, The token provided to the user's device when the subscription was purchased. (required)
159</pre>
160</div>
161
162<div class="method">
163 <code class="details" id="revoke">revoke(packageName, subscriptionId, token)</code>
164 <pre>Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.
165
166Args:
167 packageName: string, The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
168 subscriptionId: string, The purchased subscription ID (for example, 'monthly001'). (required)
169 token: string, The token provided to the user's device when the subscription was purchased. (required)
170</pre>
171</div>
172
Craig Citro065b5302014-08-14 00:47:23 -0700173</body></html>