1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<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.subscriptionsv2.html">subscriptionsv2</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#cancel">cancel(packageName, token, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Cancel a subscription purchase for the user.</p>
<p class="toc_element">
<code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
<code><a href="#get">get(packageName, token, x__xgafv=None)</a></code></p>
<p class="firstline">Get metadata about a subscription</p>
<p class="toc_element">
<code><a href="#revoke">revoke(packageName, token, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Revoke a subscription purchase for the user.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="cancel">cancel(packageName, token, body=None, x__xgafv=None)</code>
<pre>Cancel a subscription purchase for the user.
Args:
packageName: string, Required. The package of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
token: string, Required. The token provided to the user's device when the subscription was purchased. (required)
body: object, The request body.
The object takes the form of:
{ # Request for the purchases.subscriptionsv2.cancel API.
"cancellationContext": { # Cancellation context of the purchases.subscriptionsv2.cancel API. # Required. Additional details around the subscription revocation.
"cancellationType": "A String", # Required. The type of cancellation for the purchased subscription.
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response for the purchases.subscriptionsv2.cancel API.
}</pre>
</div>
<div class="method">
<code class="details" id="close">close()</code>
<pre>Close httplib2 connections.</pre>
</div>
<div class="method">
<code class="details" id="get">get(packageName, token, x__xgafv=None)</code>
<pre>Get metadata about a subscription
Args:
packageName: string, The package of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
token: string, Required. The token provided to the user's device when the subscription was purchased. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Indicates the status of a user's subscription purchase.
"acknowledgementState": "A String", # The acknowledgement state of the subscription.
"canceledStateContext": { # Information specific to a subscription in the SUBSCRIPTION_STATE_CANCELED or SUBSCRIPTION_STATE_EXPIRED state. # Additional context around canceled subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_CANCELED or SUBSCRIPTION_STATE_EXPIRED.
"developerInitiatedCancellation": { # Information specific to cancellations initiated by developers. # Subscription was canceled by the developer.
},
"replacementCancellation": { # Information specific to cancellations caused by subscription replacement. # Subscription was replaced by a new subscription.
},
"systemInitiatedCancellation": { # Information specific to cancellations initiated by Google system. # Subscription was canceled by the system, for example because of a billing problem.
},
"userInitiatedCancellation": { # Information specific to cancellations initiated by users. # Subscription was canceled by user.
"cancelSurveyResult": { # Result of the cancel survey when the subscription was canceled by the user. # Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
"reason": "A String", # The reason the user selected in the cancel survey.
"reasonUserInput": "A String", # Only set for CANCEL_SURVEY_REASON_OTHERS. This is the user's freeform response to the survey.
},
"cancelTime": "A String", # The time at which the subscription was canceled by the user. The user might still have access to the subscription after this time. Use line_items.expiry_time to determine if a user still has access.
},
},
"externalAccountIdentifiers": { # User account identifier in the third-party service. # User account identifier in the third-party service.
"externalAccountId": "A String", # User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
"obfuscatedExternalAccountId": "A String", # An obfuscated version of the id that is uniquely associated with the user'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.
"obfuscatedExternalProfileId": "A String", # An obfuscated version of the id that is uniquely associated with the user'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.
},
"kind": "A String", # This kind represents a SubscriptionPurchaseV2 object in the androidpublisher service.
"latestOrderId": "A String", # Deprecated: Use line_items.latest_successful_order_id instead. The order id of the latest order associated with the purchase of the subscription. For autoRenewing subscription, this is the order id of signup order if it is not renewed yet, or the last recurring order id (success, pending, or declined order). For prepaid subscription, this is the order id associated with the queried purchase token.
"lineItems": [ # Item-level info for a subscription purchase. The items in the same purchase should be either all with AutoRenewingPlan or all with PrepaidPlan.
{ # Item-level info for a subscription purchase.
"autoRenewingPlan": { # Information related to an auto renewing plan. # The item is auto renewing.
"autoRenewEnabled": True or False, # If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription
"installmentDetails": { # Information to a installment plan. # The installment plan commitment and state related info for the auto renewing plan.
"initialCommittedPaymentsCount": 42, # Total number of payments the user is initially committed for.
"pendingCancellation": { # This is an indicator of whether there is a pending cancellation on the virtual installment plan. The cancellation will happen only after the user finished all committed payments. # If present, this installment plan is pending to be canceled. The cancellation will happen only after the user finished all committed payments.
},
"remainingCommittedPaymentsCount": 42, # Total number of committed payments remaining to be paid for in this renewal cycle.
"subsequentCommittedPaymentsCount": 42, # Total number of payments the user will be committed for after each commitment period. Empty means the installment plan will fall back to a normal auto-renew subscription after initial commitment.
},
"priceChangeDetails": { # Price change related information of a subscription item. # The information of the last price change for the item since subscription signup.
"expectedNewPriceChargeTime": "A String", # The renewal time at which the price change will become effective for the user. This is subject to change(to a future time) due to cases where the renewal time shifts like pause. This field is only populated if the price change has not taken effect.
"newPrice": { # Represents an amount of money with its currency type. # New recurring price for the subscription item.
"currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
"nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
"units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
},
"priceChangeMode": "A String", # Price change mode specifies how the subscription item price is changing.
"priceChangeState": "A String", # State the price change is currently in.
},
"priceStepUpConsentDetails": { # Information related to a price step-up that requires user consent. # The information of the latest price step-up consent.
"consentDeadlineTime": "A String", # The deadline by which the user must provide consent. If consent is not provided by this time, the subscription will be canceled.
"newPrice": { # Represents an amount of money with its currency type. # The new price which requires user consent.
"currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
"nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
"units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
},
"state": "A String", # Output only. The state of the price step-up consent.
},
"recurringPrice": { # Represents an amount of money with its currency type. # The current recurring price of the auto renewing plan. Note that the price does not take into account discounts and does not include taxes for tax-exclusive pricing, please call orders.get API instead if transaction details are needed.
"currencyCode": "A String", # The three-letter currency code defined in ISO 4217.
"nanos": 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
"units": "A String", # The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
},
},
"deferredItemRemoval": { # Information related to deferred item replacement. # Information for deferred item removal.
},
"deferredItemReplacement": { # Information related to deferred item replacement. # Information for deferred item replacement.
"productId": "A String", # The product_id going to replace the existing product_id.
},
"expiryTime": "A String", # Time at which the subscription expired or will expire unless the access is extended (ex. renews).
"latestSuccessfulOrderId": "A String", # The order id of the latest successful order associated with this item. Not present if the item is not owned by the user yet (e.g. the item being deferred replaced to).
"offerDetails": { # Offer details information related to a purchase line item. # The offer details for this item.
"basePlanId": "A String", # The base plan ID. Present for all base plan and offers.
"offerId": "A String", # The offer ID. Only present for discounted offers.
"offerTags": [ # The latest offer tags associated with the offer. It includes tags inherited from the base plan.
"A String",
],
},
"prepaidPlan": { # Information related to a prepaid plan. # The item is prepaid.
"allowExtendAfterTime": "A String", # If present, this is the time after which top up purchases are allowed for the prepaid plan. Will not be present for expired prepaid plans.
},
"productId": "A String", # The purchased product ID (for example, 'monthly001').
"signupPromotion": { # The promotion applied on this item when purchased. # Promotion details about this item. Only set if a promotion was applied during signup.
"oneTimeCode": { # A single use promotion code. # A one-time code was applied.
},
"vanityCode": { # A multiple use, predefined promotion code. # A vanity code was applied.
"promotionCode": "A String", # The promotion code.
},
},
},
],
"linkedPurchaseToken": "A String", # The purchase token of the old subscription if this subscription is one of the following: * Re-signup of a canceled but non-lapsed subscription * Upgrade/downgrade from a previous subscription. * Convert from prepaid to auto renewing subscription. * Convert from an auto renewing subscription to prepaid. * Topup a prepaid subscription.
"pausedStateContext": { # Information specific to a subscription in paused state. # Additional context around paused subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_PAUSED.
"autoResumeTime": "A String", # Time at which the subscription will be automatically resumed.
},
"regionCode": "A String", # ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
"startTime": "A String", # Time at which the subscription was granted. Not set for pending subscriptions (subscription was created but awaiting payment during signup).
"subscribeWithGoogleInfo": { # Information associated with purchases made with 'Subscribe with Google'. # User profile associated with purchases made with 'Subscribe with Google'.
"emailAddress": "A String", # The email address of the user when the subscription was purchased.
"familyName": "A String", # The family name of the user when the subscription was purchased.
"givenName": "A String", # The given name of the user when the subscription was purchased.
"profileId": "A String", # The Google profile id of the user when the subscription was purchased.
"profileName": "A String", # The profile name of the user when the subscription was purchased.
},
"subscriptionState": "A String", # The current state of the subscription.
"testPurchase": { # Whether this subscription purchase is a test purchase. # Only present if this subscription purchase is a test purchase.
},
}</pre>
</div>
<div class="method">
<code class="details" id="revoke">revoke(packageName, token, body=None, x__xgafv=None)</code>
<pre>Revoke a subscription purchase for the user.
Args:
packageName: string, Required. The package of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
token: string, Required. The token provided to the user's device when the subscription was purchased. (required)
body: object, The request body.
The object takes the form of:
{ # Request for the purchases.subscriptionsv2.revoke API.
"revocationContext": { # Revocation context of the purchases.subscriptionsv2.revoke API. # Required. Additional details around the subscription revocation.
"fullRefund": { # Used to determine if the refund type in the RevocationContext is a full refund. # Optional. Used when users should be refunded the full amount of latest charge on each item in the subscription.
},
"itemBasedRefund": { # Used to determine what specific item to revoke in a subscription with multiple items. # Optional. Used when a specific item should be refunded in a subscription with add-on items.
"productId": "A String", # Required. If the subscription is a subscription with add-ons, the product id of the subscription item to revoke.
},
"proratedRefund": { # Used to determine if the refund type in the RevocationContext is a prorated refund. # Optional. Used when users should be refunded a prorated amount they paid for their subscription based on the amount of time remaining in a subscription.
},
},
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response for the purchases.subscriptionsv2.revoke API.
}</pre>
</div>
</body></html>
|