blob: 1d92f04d2980cf4e3c7340e86b3da6e0eadeeaa7 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -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
Bu Sun Kimd059ad82020-07-22 17:02:09 -070075<h1><a href="androidpublisher_v3.html">Google Play Android Developer API</a> . <a href="androidpublisher_v3.purchases.html">purchases</a> . <a href="androidpublisher_v3.purchases.subscriptions.html">subscriptions</a></h1>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070078 <code><a href="#acknowledge">acknowledge(packageName, subscriptionId, token, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Acknowledges a subscription purchase.</p>
80<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070081 <code><a href="#cancel">cancel(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
82<p class="firstline">Cancels a user's subscription purchase. The subscription remains valid</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070084 <code><a href="#defer">defer(packageName, subscriptionId, token, body=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Defers a user's subscription purchase until a specified future expiration</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#get">get(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
88<p class="firstline">Checks whether a user's subscription purchase is valid and returns its</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070090 <code><a href="#refund">refund(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
91<p class="firstline">Refunds a user's subscription purchase, but the subscription remains valid</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070093 <code><a href="#revoke">revoke(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
94<p class="firstline">Refunds and immediately revokes a user's subscription purchase. Access to</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095<h3>Method Details</h3>
96<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070097 <code class="details" id="acknowledge">acknowledge(packageName, subscriptionId, token, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 <pre>Acknowledges a subscription purchase.
99
100Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700101 packageName: string, The package name of the application for which this subscription was
102purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700103 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700104 token: string, The token provided to the user&#x27;s device when the subscription was
105purchased. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700106 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 The object takes the form of:
108
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700109{ # Request for the purchases.subscriptions.acknowledge API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 &quot;developerPayload&quot;: &quot;A String&quot;, # Payload to attach to the purchase.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700111 }
112
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700113 x__xgafv: string, V1 error format.
114 Allowed values
115 1 - v1 error format
116 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117</pre>
118</div>
119
120<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700121 <code class="details" id="cancel">cancel(packageName, subscriptionId, token, x__xgafv=None)</code>
122 <pre>Cancels a user&#x27;s subscription purchase. The subscription remains valid
123until its expiration time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124
125Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700126 packageName: string, The package name of the application for which this subscription was
127purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700129 token: string, The token provided to the user&#x27;s device when the subscription was
130purchased. (required)
131 x__xgafv: string, V1 error format.
132 Allowed values
133 1 - v1 error format
134 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700135</pre>
136</div>
137
138<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700139 <code class="details" id="defer">defer(packageName, subscriptionId, token, body=None, x__xgafv=None)</code>
140 <pre>Defers a user&#x27;s subscription purchase until a specified future expiration
141time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142
143Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700144 packageName: string, The package name of the application for which this subscription was
145purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700146 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700147 token: string, The token provided to the user&#x27;s device when the subscription was
148purchased. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700149 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700150 The object takes the form of:
151
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700152{ # Request for the purchases.subscriptions.defer API.
153 &quot;deferralInfo&quot;: { # A SubscriptionDeferralInfo contains the data needed to defer a # The information about the new desired expiry time for the subscription.
154 # subscription purchase to a future expiry time.
155 &quot;desiredExpiryTimeMillis&quot;: &quot;A String&quot;, # The desired next expiry time to assign to the subscription, in
156 # milliseconds since the Epoch. The given time must be later/greater
157 # than the current expiry time for the subscription.
158 &quot;expectedExpiryTimeMillis&quot;: &quot;A String&quot;, # The expected expiry time for the subscription. If the current
159 # expiry time for the subscription is not the value specified
160 # here, the deferral will not occur.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 },
162 }
163
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700164 x__xgafv: string, V1 error format.
165 Allowed values
166 1 - v1 error format
167 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700168
169Returns:
170 An object of the form:
171
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700172 { # Response for the purchases.subscriptions.defer API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;newExpiryTimeMillis&quot;: &quot;A String&quot;, # The new expiry time for the subscription in milliseconds since the Epoch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700174 }</pre>
175</div>
176
177<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700178 <code class="details" id="get">get(packageName, subscriptionId, token, x__xgafv=None)</code>
179 <pre>Checks whether a user&#x27;s subscription purchase is valid and returns its
180expiry time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181
182Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700183 packageName: string, The package name of the application for which this subscription was
184purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700186 token: string, The token provided to the user&#x27;s device when the subscription was
187purchased. (required)
188 x__xgafv: string, V1 error format.
189 Allowed values
190 1 - v1 error format
191 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700192
193Returns:
194 An object of the form:
195
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700196 { # A SubscriptionPurchase resource indicates the status of a user&#x27;s
197 # subscription purchase.
198 &quot;priceChange&quot;: { # Contains the price change information for a subscription that can be used to # The latest price change information available. This is present only when
199 # there is an upcoming price change for the subscription yet to be applied.
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700201 # Once the subscription renews with the new price or the subscription is
202 # canceled, no price change information will be returned.
203 # control the user journey for the price change in the app. This can be in the
204 # form of seeking confirmation from the user or tailoring the experience for a
205 # successful conversion.
206 &quot;newPrice&quot;: { # Definition of a price, i.e. currency and units. # The new price the subscription will renew with if the price change is
207 # accepted by the user.
Bu Sun Kim65020912020-05-20 12:08:20 -0700208 &quot;currency&quot;: &quot;A String&quot;, # 3 letter Currency code, as defined by ISO 4217.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700209 # See java/com/google/common/money/CurrencyCode.java
210 &quot;priceMicros&quot;: &quot;A String&quot;, # Price in 1/million of the currency base unit, represented as a string.
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 },
212 &quot;state&quot;: 42, # The current state of the price change. Possible values are:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700213 # 0. Outstanding: State for a pending price change waiting for the user to
214 # agree. In this state, you can optionally seek confirmation from the
215 # user using the In-App API.
216 # 1. Accepted: State for an accepted price change that the subscription
217 # will renew with unless it&#x27;s canceled. The price change takes effect on
218 # a future date when the subscription renews. Note that the change might
219 # not occur when the subscription is renewed next.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700221 &quot;autoResumeTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription will be automatically resumed, in
222 # milliseconds since the Epoch. Only present if the user has requested to
223 # pause the subscription.
224 &quot;kind&quot;: &quot;A String&quot;, # This kind represents a subscriptionPurchase object in the androidpublisher
225 # service.
226 &quot;userCancellationTimeMillis&quot;: &quot;A String&quot;, # The time at which the subscription was canceled by the user, in
227 # milliseconds since the epoch. Only present if cancelReason is 0.
228 &quot;obfuscatedExternalAccountId&quot;: &quot;A String&quot;, # An obfuscated version of the id that is uniquely associated with the
229 # user&#x27;s account in your app. Present for the following purchases:
230 # * If account linking happened as part of the subscription purchase flow.
231 # * It was specified using
232 # https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid
233 # when the purchase was made.
234 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user when the subscription was purchased.
235 # Only present for purchases made with &#x27;Subscribe with Google&#x27;.
236 &quot;profileId&quot;: &quot;A String&quot;, # The Google profile id of the user when the subscription was purchased.
237 # Only present for purchases made with &#x27;Subscribe with Google&#x27;.
238 &quot;externalAccountId&quot;: &quot;A String&quot;, # User account identifier in the third-party service.
239 # Only present if account linking happened as part of the subscription
240 # purchase flow.
241 &quot;paymentState&quot;: 42, # The payment state of the subscription. Possible values are:
242 # 0. Payment pending
243 # 1. Payment received
244 # 2. Free trial
245 # 3. Pending deferred upgrade/downgrade
246 &quot;startTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription was granted, in milliseconds
247 # since the Epoch.
248 &quot;orderId&quot;: &quot;A String&quot;, # The order id of the latest recurring order associated with
249 # the purchase of the subscription.
250 &quot;linkedPurchaseToken&quot;: &quot;A String&quot;, # The purchase token of the originating purchase if this subscription
251 # is one of the following:
252 # 0. Re-signup of a canceled but non-lapsed subscription
253 # 1. Upgrade/downgrade from a previous subscription
254 #
255 # For example, suppose a user originally signs up and you receive
256 # purchase token X, then the user cancels and goes through the
257 # resignup flow (before their subscription lapses) and you receive
258 # purchase token Y, and finally the user upgrades their subscription
259 # and you receive purchase token Z. If you call this API with purchase
260 # token Z, this field will be set to Y. If you call this API with
261 # purchase token Y, this field will be set to X. If you call this API
262 # with purchase token X, this field will not be set.
263 &quot;autoRenewing&quot;: True or False, # Whether the subscription will automatically be renewed when it
264 # reaches its current expiry time.
265 &quot;promotionCode&quot;: &quot;A String&quot;, # The promotion code applied on this purchase. This field is only set if
266 # a vanity code promotion is applied when the subscription was purchased.
267 &quot;familyName&quot;: &quot;A String&quot;, # The family name of the user when the subscription was purchased.
268 # Only present for purchases made with &#x27;Subscribe with Google&#x27;.
269 &quot;acknowledgementState&quot;: 42, # The acknowledgement state of the subscription product. Possible values
270 # are:
271 # 0. Yet to be acknowledged
272 # 1. Acknowledged
273 &quot;obfuscatedExternalProfileId&quot;: &quot;A String&quot;, # An obfuscated version of the id that is uniquely associated with the
274 # user&#x27;s profile in your app. Only present if specified using
275 # https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid
276 # when the purchase was made.
277 &quot;profileName&quot;: &quot;A String&quot;, # The profile name of the user when the subscription was purchased.
278 # Only present for purchases made with &#x27;Subscribe with Google&#x27;.
279 &quot;givenName&quot;: &quot;A String&quot;, # The given name of the user when the subscription was purchased.
280 # Only present for purchases made with &#x27;Subscribe with Google&#x27;.
281 &quot;purchaseType&quot;: 42, # The type of purchase of the subscription. This field is only set if
282 # this purchase was not made using the standard in-app billing flow.
283 # Possible values are:
284 # 0. Test (i.e. purchased from a license testing account)
285 # 1. Promo (i.e. purchased using a promo code)
286 &quot;priceCurrencyCode&quot;: &quot;A String&quot;, # ISO 4217 currency code for the subscription price. For example,
287 # if the price is specified in British pounds sterling,
288 # price_currency_code is &quot;GBP&quot;.
289 &quot;developerPayload&quot;: &quot;A String&quot;, # A developer-specified string that contains supplemental
290 # information about an order.
291 &quot;priceAmountMicros&quot;: &quot;A String&quot;, # Price of the subscription, not including tax. Price is expressed
292 # in micro-units, where 1,000,000 micro-units represents one unit of
293 # the currency. For example, if the subscription price is &amp;euro;1.99,
294 # price_amount_micros is 1990000.
295 &quot;promotionType&quot;: 42, # The type of promotion applied on this purchase. This field is only set if
296 # a promotion is applied when the subscription was purchased. Possible
297 # values are:
298 # 0. One time code
299 # 1. Vanity code
300 &quot;countryCode&quot;: &quot;A String&quot;, # ISO 3166-1 alpha-2 billing country/region code of the user at the time
301 # the subscription was granted.
302 &quot;expiryTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription will expire, in milliseconds
303 # since the Epoch.
304 &quot;cancelReason&quot;: 42, # The reason why a subscription was canceled or is not auto-renewing.
305 # Possible values are:
306 # 0. User canceled the subscription
307 # 1. Subscription was canceled by the system,
308 # for example because of a billing problem
309 # 2. Subscription was replaced with a new subscription
310 # 3. Subscription was canceled by the developer
311 &quot;introductoryPriceInfo&quot;: { # Contains the introductory price information for a subscription. # Introductory price information of the subscription. This is only present
312 # when the subscription was purchased with an introductory price.
313 #
314 # This field does not indicate the subscription is currently in introductory
315 # price period.
316 &quot;introductoryPriceCurrencyCode&quot;: &quot;A String&quot;, # ISO 4217 currency code for the introductory subscription price.
317 # For example, if the price is specified in British pounds sterling,
318 # price_currency_code is &quot;GBP&quot;.
319 &quot;introductoryPriceCycles&quot;: 42, # The number of billing period to offer introductory pricing.
320 &quot;introductoryPriceAmountMicros&quot;: &quot;A String&quot;, # Introductory price of the subscription, not including tax.
321 # The currency is the same as price_currency_code. Price is
322 # expressed in micro-units, where 1,000,000 micro-units represents one unit
323 # of the currency. For example, if the subscription price is €1.99,
324 # price_amount_micros is 1990000.
325 &quot;introductoryPricePeriod&quot;: &quot;A String&quot;, # Introductory price period, specified in ISO 8601 format.
326 # Common values are (but not limited to) &quot;P1W&quot; (one
327 # week), &quot;P1M&quot; (one month), &quot;P3M&quot; (three months), &quot;P6M&quot; (six months),
328 # and &quot;P1Y&quot; (one year).
329 },
330 &quot;cancelSurveyResult&quot;: { # Information provided by the user when they complete the subscription # Information provided by the user when they complete the subscription
331 # cancellation flow (cancellation reason survey).
332 # cancellation flow (cancellation reason survey).
333 &quot;cancelSurveyReason&quot;: 42, # The cancellation reason the user chose in the survey.
334 # Possible values are:
335 # 0. Other
336 # 1. I don&#x27;t use this service enough
337 # 2. Technical issues
338 # 3. Cost-related reasons
339 # 4. I found a better app
340 &quot;userInputCancelReason&quot;: &quot;A String&quot;, # The customized input cancel reason from the user. Only present when
341 # cancelReason is 0.
342 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700343 }</pre>
344</div>
345
346<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700347 <code class="details" id="refund">refund(packageName, subscriptionId, token, x__xgafv=None)</code>
348 <pre>Refunds a user&#x27;s subscription purchase, but the subscription remains valid
349until its expiration time and it will continue to recur.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700350
351Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700352 packageName: string, The package name of the application for which this subscription was
353purchased (for example, &#x27;com.some.thing&#x27;). (required)
354 subscriptionId: string, &quot;The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
355 token: string, The token provided to the user&#x27;s device when the subscription was
356purchased. (required)
357 x__xgafv: string, V1 error format.
358 Allowed values
359 1 - v1 error format
360 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361</pre>
362</div>
363
364<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700365 <code class="details" id="revoke">revoke(packageName, subscriptionId, token, x__xgafv=None)</code>
366 <pre>Refunds and immediately revokes a user&#x27;s subscription purchase. Access to
367the subscription will be terminated immediately and it will stop recurring.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700368
369Args:
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700370 packageName: string, The package name of the application for which this subscription was
371purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700373 token: string, The token provided to the user&#x27;s device when the subscription was
374purchased. (required)
375 x__xgafv: string, V1 error format.
376 Allowed values
377 1 - v1 error format
378 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700379</pre>
380</div>
381
382</body></html>