1<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
75<h1><a href="paymentsresellersubscription_v1.html">Payments Reseller Subscription API</a> . <a href="paymentsresellersubscription_v1.partners.html">partners</a> . <a href="paymentsresellersubscription_v1.partners.subscriptions.html">subscriptions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#cancel">cancel(name, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Used by partners to cancel a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.</p>
80<p class="toc_element">
81  <code><a href="#close">close()</a></code></p>
82<p class="firstline">Close httplib2 connections.</p>
83<p class="toc_element">
84  <code><a href="#create">create(parent, body=None, subscriptionId=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Used by partners to create a subscription for their customers. The created subscription is associated with the end user inferred from the end user credentials. This API must be authorized by the end user using OAuth.</p>
86<p class="toc_element">
87  <code><a href="#entitle">entitle(name, body=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Used by partners to entitle a previously provisioned subscription to the current end user. The end user identity is inferred from the authorized credential of the request. This API must be authorized by the end user using OAuth.</p>
89<p class="toc_element">
90  <code><a href="#extend">extend(name, body=None, x__xgafv=None)</a></code></p>
91<p class="firstline">Used by partners to extend a subscription service for their customers on an ongoing basis for the subscription to remain active and renewable. It should be called directly by the partner using service accounts.</p>
92<p class="toc_element">
93  <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
94<p class="firstline">Used by partners to get a subscription by id. It should be called directly by the partner using service accounts.</p>
95<p class="toc_element">
96  <code><a href="#provision">provision(parent, body=None, subscriptionId=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Used by partners to provision a subscription for their customers. This creates a subscription without associating it with the end user account. EntitleSubscription must be called separately using OAuth in order for the end user account to be associated with the subscription. It should be called directly by the partner using service accounts.</p>
98<p class="toc_element">
99  <code><a href="#undoCancel">undoCancel(name, body=None, x__xgafv=None)</a></code></p>
100<p class="firstline">Used by partners to revoke the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.</p>
101<h3>Method Details</h3>
102<div class="method">
103    <code class="details" id="cancel">cancel(name, body=None, x__xgafv=None)</code>
104  <pre>Used by partners to cancel a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.
105
106Args:
107  name: string, Required. The name of the subscription resource to be cancelled. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
108  body: object, The request body.
109    The object takes the form of:
110
111{
112  &quot;cancelImmediately&quot;: True or False, # Optional. If true, the subscription will be cancelled immediately. Otherwise, the subscription will be cancelled at renewal_time, and therefore no prorated refund will be issued for the rest of the cycle.
113  &quot;cancellationReason&quot;: &quot;A String&quot;, # Specifies the reason for the cancellation.
114}
115
116  x__xgafv: string, V1 error format.
117    Allowed values
118      1 - v1 error format
119      2 - v2 error format
120
121Returns:
122  An object of the form:
123
124    {
125  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The cancelled subscription resource.
126    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
127      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
128    },
129    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
130    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
131    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
132    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
133    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
134    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
135    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
136    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
137      &quot;A String&quot;,
138    ],
139    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
140      &quot;A String&quot;,
141    ],
142    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
143    &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
144    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
145      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
146      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
147    },
148    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
149    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
150    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
151      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
152      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
153    },
154  },
155}</pre>
156</div>
157
158<div class="method">
159    <code class="details" id="close">close()</code>
160  <pre>Close httplib2 connections.</pre>
161</div>
162
163<div class="method">
164    <code class="details" id="create">create(parent, body=None, subscriptionId=None, x__xgafv=None)</code>
165  <pre>Used by partners to create a subscription for their customers. The created subscription is associated with the end user inferred from the end user credentials. This API must be authorized by the end user using OAuth.
166
167Args:
168  parent: string, Required. The parent resource name, which is the identifier of the partner. It will have the format of &quot;partners/{partner_id}&quot;. (required)
169  body: object, The request body.
170    The object takes the form of:
171
172{ # A Subscription resource managed by 3P Partners.
173  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
174    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
175  },
176  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
177  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
178  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
179  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
180  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
181  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
182  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
183  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
184    &quot;A String&quot;,
185  ],
186  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
187    &quot;A String&quot;,
188  ],
189  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
190  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
191  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
192    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
193    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
194  },
195  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
196  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
197  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
198    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
199    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
200  },
201}
202
203  subscriptionId: string, Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription was previously created with the same subscription_id, we will directly return that one.
204  x__xgafv: string, V1 error format.
205    Allowed values
206      1 - v1 error format
207      2 - v2 error format
208
209Returns:
210  An object of the form:
211
212    { # A Subscription resource managed by 3P Partners.
213  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
214    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
215  },
216  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
217  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
218  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
219  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
220  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
221  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
222  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
223  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
224    &quot;A String&quot;,
225  ],
226  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
227    &quot;A String&quot;,
228  ],
229  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
230  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
231  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
232    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
233    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
234  },
235  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
236  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
237  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
238    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
239    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
240  },
241}</pre>
242</div>
243
244<div class="method">
245    <code class="details" id="entitle">entitle(name, body=None, x__xgafv=None)</code>
246  <pre>Used by partners to entitle a previously provisioned subscription to the current end user. The end user identity is inferred from the authorized credential of the request. This API must be authorized by the end user using OAuth.
247
248Args:
249  name: string, Required. The name of the subscription resource that is entitled to the current end user. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
250  body: object, The request body.
251    The object takes the form of:
252
253{ # Partner request for entitling the previously provisioned subscription to an end user. The end user identity is inferred from the request OAuth context.
254}
255
256  x__xgafv: string, V1 error format.
257    Allowed values
258      1 - v1 error format
259      2 - v2 error format
260
261Returns:
262  An object of the form:
263
264    {
265  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The subscription that has user linked to it.
266    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
267      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
268    },
269    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
270    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
271    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
272    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
273    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
274    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
275    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
276    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
277      &quot;A String&quot;,
278    ],
279    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
280      &quot;A String&quot;,
281    ],
282    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
283    &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
284    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
285      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
286      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
287    },
288    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
289    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
290    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
291      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
292      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
293    },
294  },
295}</pre>
296</div>
297
298<div class="method">
299    <code class="details" id="extend">extend(name, body=None, x__xgafv=None)</code>
300  <pre>Used by partners to extend a subscription service for their customers on an ongoing basis for the subscription to remain active and renewable. It should be called directly by the partner using service accounts.
301
302Args:
303  name: string, Required. The name of the subscription resource to be extended. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;. (required)
304  body: object, The request body.
305    The object takes the form of:
306
307{ # Request message for extending a Subscription resource. A new recurrence will be made based on the subscription schedule defined by the original product.
308  &quot;extension&quot;: { # Describes the details of an extension request. # Required. Specifies details of the extension. Currently, the duration of the extension must be exactly one billing cycle of the original subscription.
309    &quot;duration&quot;: { # Describes the length of a period of a time. # Specifies the period of access the subscription should grant.
310      &quot;count&quot;: 42, # number of duration units to be included.
311      &quot;unit&quot;: &quot;A String&quot;, # The unit used for the duration
312    },
313    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system.
314  },
315  &quot;requestId&quot;: &quot;A String&quot;, # Required. Restricted to 36 ASCII characters. A random UUID is recommended. The idempotency key for the request. The ID generation logic is controlled by the partner. request_id should be the same as on retries of the same request. A different request_id must be used for a extension of a different cycle. A random UUID is recommended.
316}
317
318  x__xgafv: string, V1 error format.
319    Allowed values
320      1 - v1 error format
321      2 - v2 error format
322
323Returns:
324  An object of the form:
325
326    {
327  &quot;cycleEndTime&quot;: &quot;A String&quot;, # The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. Example, &quot;cycleEndTime&quot;:&quot;2019-08-31T17:28:54.564Z&quot;
328  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # End of the free trial period, in ISO 8061 format. UTC timezone. Example, &quot;freeTrialEndTime&quot;:&quot;2019-08-31T17:28:54.564Z&quot; This time will be set the same as initial subscription creation time if no free trial period is offered to the partner.
329  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
330}</pre>
331</div>
332
333<div class="method">
334    <code class="details" id="get">get(name, x__xgafv=None)</code>
335  <pre>Used by partners to get a subscription by id. It should be called directly by the partner using service accounts.
336
337Args:
338  name: string, Required. The name of the subscription resource to retrieve. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
339  x__xgafv: string, V1 error format.
340    Allowed values
341      1 - v1 error format
342      2 - v2 error format
343
344Returns:
345  An object of the form:
346
347    { # A Subscription resource managed by 3P Partners.
348  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
349    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
350  },
351  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
352  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
353  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
354  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
355  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
356  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
357  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
358  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
359    &quot;A String&quot;,
360  ],
361  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
362    &quot;A String&quot;,
363  ],
364  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
365  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
366  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
367    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
368    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
369  },
370  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
371  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
372  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
373    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
374    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
375  },
376}</pre>
377</div>
378
379<div class="method">
380    <code class="details" id="provision">provision(parent, body=None, subscriptionId=None, x__xgafv=None)</code>
381  <pre>Used by partners to provision a subscription for their customers. This creates a subscription without associating it with the end user account. EntitleSubscription must be called separately using OAuth in order for the end user account to be associated with the subscription. It should be called directly by the partner using service accounts.
382
383Args:
384  parent: string, Required. The parent resource name, which is the identifier of the partner. It will have the format of &quot;partners/{partner_id}&quot;. (required)
385  body: object, The request body.
386    The object takes the form of:
387
388{ # A Subscription resource managed by 3P Partners.
389  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
390    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
391  },
392  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
393  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
394  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
395  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
396  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
397  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
398  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
399  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
400    &quot;A String&quot;,
401  ],
402  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
403    &quot;A String&quot;,
404  ],
405  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
406  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
407  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
408    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
409    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
410  },
411  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
412  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
413  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
414    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
415    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
416  },
417}
418
419  subscriptionId: string, Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription was previously created with the same subscription_id, we will directly return that one.
420  x__xgafv: string, V1 error format.
421    Allowed values
422      1 - v1 error format
423      2 - v2 error format
424
425Returns:
426  An object of the form:
427
428    { # A Subscription resource managed by 3P Partners.
429  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
430    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
431  },
432  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
433  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
434  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
435  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
436  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
437  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
438  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
439  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
440    &quot;A String&quot;,
441  ],
442  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
443    &quot;A String&quot;,
444  ],
445  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
446  &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
447  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
448    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
449    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
450  },
451  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
452  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
453  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
454    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
455    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
456  },
457}</pre>
458</div>
459
460<div class="method">
461    <code class="details" id="undoCancel">undoCancel(name, body=None, x__xgafv=None)</code>
462  <pre>Used by partners to revoke the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.
463
464Args:
465  name: string, Required. The name of the subscription resource whose pending cancellation needs to be undone. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
466  body: object, The request body.
467    The object takes the form of:
468
469{ # Request to revoke a cancellation request.
470}
471
472  x__xgafv: string, V1 error format.
473    Allowed values
474      1 - v1 error format
475      2 - v2 error format
476
477Returns:
478  An object of the form:
479
480    { # Response that contains the updated subscription resource.
481  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The updated subscription resource.
482    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
483      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
484    },
485    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
486    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
487    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
488    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
489    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
490    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
491    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
492    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
493      &quot;A String&quot;,
494    ],
495    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
496      &quot;A String&quot;,
497    ],
498    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
499    &quot;renewalTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be renewed by Google - a new charge will be incurred and the service entitlement will be renewed. A non-immediate cancellation will take place at this time too, before which, the service entitlement for the end user will remain valid. UTC timezone in ISO 8061 format. For example: &quot;2019-08-31T17:28:54.564Z&quot;
500    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
501      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
502      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
503    },
504    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
505    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
506    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
507      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
508      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
509    },
510  },
511}</pre>
512</div>
513
514</body></html>