blob: fe3446888535587006c1803790270b5134a80569 [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>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070082<p class="firstline">Cancels a user's subscription purchase. The subscription remains valid until its expiration time.</p>
83<p class="toc_element">
84 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</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="#defer">defer(packageName, subscriptionId, token, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088<p class="firstline">Defers a user's subscription purchase until a specified future expiration time.</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="#get">get(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070091<p class="firstline">Checks whether a user's subscription purchase is valid and returns its expiry time.</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="#refund">refund(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094<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>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#revoke">revoke(packageName, subscriptionId, token, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097<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>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098<h3>Method Details</h3>
99<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700100 <code class="details" id="acknowledge">acknowledge(packageName, subscriptionId, token, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101 <pre>Acknowledges a subscription purchase.
102
103Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700104 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700106 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700107 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108 The object takes the form of:
109
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700110{ # Request for the purchases.subscriptions.acknowledge API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800111 &quot;developerPayload&quot;: &quot;A String&quot;, # Payload to attach to the purchase.
112}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700114 x__xgafv: string, V1 error format.
115 Allowed values
116 1 - v1 error format
117 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118</pre>
119</div>
120
121<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700122 <code class="details" id="cancel">cancel(packageName, subscriptionId, token, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700123 <pre>Cancels a user&#x27;s subscription purchase. The subscription remains valid until its expiration time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124
125Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700126 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700127 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700128 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700129 x__xgafv: string, V1 error format.
130 Allowed values
131 1 - v1 error format
132 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133</pre>
134</div>
135
136<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700137 <code class="details" id="close">close()</code>
138 <pre>Close httplib2 connections.</pre>
139</div>
140
141<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700142 <code class="details" id="defer">defer(packageName, subscriptionId, token, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700143 <pre>Defers a user&#x27;s subscription purchase until a specified future expiration time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700144
145Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700146 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700147 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700148 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800153 &quot;deferralInfo&quot;: { # 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.
154 &quot;desiredExpiryTimeMillis&quot;: &quot;A String&quot;, # The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current expiry time for the subscription.
155 &quot;expectedExpiryTimeMillis&quot;: &quot;A String&quot;, # 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.
156 },
157}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700159 x__xgafv: string, V1 error format.
160 Allowed values
161 1 - v1 error format
162 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700163
164Returns:
165 An object of the form:
166
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700167 { # Response for the purchases.subscriptions.defer API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800168 &quot;newExpiryTimeMillis&quot;: &quot;A String&quot;, # The new expiry time for the subscription in milliseconds since the Epoch.
169}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170</div>
171
172<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700173 <code class="details" id="get">get(packageName, subscriptionId, token, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700174 <pre>Checks whether a user&#x27;s subscription purchase is valid and returns its expiry time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175
176Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700177 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700178 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700179 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700180 x__xgafv: string, V1 error format.
181 Allowed values
182 1 - v1 error format
183 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184
185Returns:
186 An object of the form:
187
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700188 { # A SubscriptionPurchase resource indicates the status of a user&#x27;s subscription purchase.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800189 &quot;acknowledgementState&quot;: 42, # The acknowledgement state of the subscription product. Possible values are: 0. Yet to be acknowledged 1. Acknowledged
190 &quot;autoRenewing&quot;: True or False, # Whether the subscription will automatically be renewed when it reaches its current expiry time.
191 &quot;autoResumeTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription.
192 &quot;cancelReason&quot;: 42, # The reason why a subscription was canceled or is not auto-renewing. Possible values are: 0. User canceled the subscription 1. Subscription was canceled by the system, for example because of a billing problem 2. Subscription was replaced with a new subscription 3. Subscription was canceled by the developer
193 &quot;cancelSurveyResult&quot;: { # Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). # Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
194 &quot;cancelSurveyReason&quot;: 42, # The cancellation reason the user chose in the survey. Possible values are: 0. Other 1. I don&#x27;t use this service enough 2. Technical issues 3. Cost-related reasons 4. I found a better app
195 &quot;userInputCancelReason&quot;: &quot;A String&quot;, # The customized input cancel reason from the user. Only present when cancelReason is 0.
196 },
197 &quot;countryCode&quot;: &quot;A String&quot;, # ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
198 &quot;developerPayload&quot;: &quot;A String&quot;, # A developer-specified string that contains supplemental information about an order.
199 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user when the subscription was purchased. Only present for purchases made with &#x27;Subscribe with Google&#x27;.
200 &quot;expiryTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription will expire, in milliseconds since the Epoch.
201 &quot;externalAccountId&quot;: &quot;A String&quot;, # User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
202 &quot;familyName&quot;: &quot;A String&quot;, # The family name of the user when the subscription was purchased. Only present for purchases made with &#x27;Subscribe with Google&#x27;.
203 &quot;givenName&quot;: &quot;A String&quot;, # The given name of the user when the subscription was purchased. Only present for purchases made with &#x27;Subscribe with Google&#x27;.
204 &quot;introductoryPriceInfo&quot;: { # Contains the introductory price information for a subscription. # Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. This field does not indicate the subscription is currently in introductory price period.
205 &quot;introductoryPriceAmountMicros&quot;: &quot;A String&quot;, # Introductory price of the subscription, not including tax. The currency is the same as price_currency_code. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000.
206 &quot;introductoryPriceCurrencyCode&quot;: &quot;A String&quot;, # ISO 4217 currency code for the introductory subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is &quot;GBP&quot;.
207 &quot;introductoryPriceCycles&quot;: 42, # The number of billing period to offer introductory pricing.
208 &quot;introductoryPricePeriod&quot;: &quot;A String&quot;, # Introductory price period, specified in ISO 8601 format. Common values are (but not limited to) &quot;P1W&quot; (one week), &quot;P1M&quot; (one month), &quot;P3M&quot; (three months), &quot;P6M&quot; (six months), and &quot;P1Y&quot; (one year).
209 },
210 &quot;kind&quot;: &quot;A String&quot;, # This kind represents a subscriptionPurchase object in the androidpublisher service.
211 &quot;linkedPurchaseToken&quot;: &quot;A String&quot;, # The purchase token of the originating purchase if this subscription is one of the following: 0. Re-signup of a canceled but non-lapsed subscription 1. Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set.
212 &quot;obfuscatedExternalAccountId&quot;: &quot;A String&quot;, # An obfuscated version of the id that is uniquely associated with the user&#x27;s account in your app. Present for the following purchases: * If account linking happened as part of the subscription purchase flow. * It was specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.
213 &quot;obfuscatedExternalProfileId&quot;: &quot;A String&quot;, # An obfuscated version of the id that is uniquely associated with the user&#x27;s profile in your app. Only present if specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid when the purchase was made.
yoshi-code-botcb945f32021-06-08 00:36:03 -0700214 &quot;orderId&quot;: &quot;A String&quot;, # The order id of the latest recurring order associated with the purchase of the subscription. If the subscription was canceled because payment was declined, this will be the order id from the payment declined order.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800215 &quot;paymentState&quot;: 42, # The payment state of the subscription. Possible values are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending deferred upgrade/downgrade Not present for canceled, expired subscriptions.
yoshi-code-botab1d6dc2021-05-28 00:42:02 -0700216 &quot;priceAmountMicros&quot;: &quot;A String&quot;, # Price of the subscription, For tax exclusive countries, the price doesn&#x27;t include tax. For tax inclusive countries, the price includes tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800217 &quot;priceChange&quot;: { # Contains the price change information for a subscription that can be used to control the user journey for the price change in the app. This can be in the form of seeking confirmation from the user or tailoring the experience for a successful conversion. # The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned.
218 &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 accepted by the user.
219 &quot;currency&quot;: &quot;A String&quot;, # 3 letter Currency code, as defined by ISO 4217. See java/com/google/common/money/CurrencyCode.java
220 &quot;priceMicros&quot;: &quot;A String&quot;, # Price in 1/million of the currency base unit, represented as a string.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800221 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800222 &quot;state&quot;: 42, # The current state of the price change. Possible values are: 0. Outstanding: State for a pending price change waiting for the user to agree. In this state, you can optionally seek confirmation from the user using the In-App API. 1. Accepted: State for an accepted price change that the subscription will renew with unless it&#x27;s canceled. The price change takes effect on a future date when the subscription renews. Note that the change might not occur when the subscription is renewed next.
223 },
224 &quot;priceCurrencyCode&quot;: &quot;A String&quot;, # ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is &quot;GBP&quot;.
225 &quot;profileId&quot;: &quot;A String&quot;, # The Google profile id of the user when the subscription was purchased. Only present for purchases made with &#x27;Subscribe with Google&#x27;.
226 &quot;profileName&quot;: &quot;A String&quot;, # The profile name of the user when the subscription was purchased. Only present for purchases made with &#x27;Subscribe with Google&#x27;.
227 &quot;promotionCode&quot;: &quot;A String&quot;, # The promotion code applied on this purchase. This field is only set if a vanity code promotion is applied when the subscription was purchased.
228 &quot;promotionType&quot;: 42, # The type of promotion applied on this purchase. This field is only set if a promotion is applied when the subscription was purchased. Possible values are: 0. One time code 1. Vanity code
229 &quot;purchaseType&quot;: 42, # The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are: 0. Test (i.e. purchased from a license testing account) 1. Promo (i.e. purchased using a promo code)
230 &quot;startTimeMillis&quot;: &quot;A String&quot;, # Time at which the subscription was granted, in milliseconds since the Epoch.
231 &quot;userCancellationTimeMillis&quot;: &quot;A String&quot;, # The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0.
232}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700233</div>
234
235<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700236 <code class="details" id="refund">refund(packageName, subscriptionId, token, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700237 <pre>Refunds a user&#x27;s subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238
239Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700240 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700241 subscriptionId: string, &quot;The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700242 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700243 x__xgafv: string, V1 error format.
244 Allowed values
245 1 - v1 error format
246 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247</pre>
248</div>
249
250<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700251 <code class="details" id="revoke">revoke(packageName, subscriptionId, token, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700252 <pre>Refunds and immediately revokes a user&#x27;s subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700253
254Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700255 packageName: string, The package name of the application for which this subscription was purchased (for example, &#x27;com.some.thing&#x27;). (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700256 subscriptionId: string, The purchased subscription ID (for example, &#x27;monthly001&#x27;). (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700257 token: string, The token provided to the user&#x27;s device when the subscription was purchased. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700258 x__xgafv: string, V1 error format.
259 Allowed values
260 1 - v1 error format
261 2 - v2 error format
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700262</pre>
263</div>
264
265</body></html>