partners

POST /v1/partners/{partnersId}/subscriptions:provision

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.

Request

Path parameters

partnersIdstring required

Query parameters

cycleOptions.initialCycleDuration.countinteger

number of duration units to be included.

cycleOptions.initialCycleDuration.unit'UNIT_UNSPECIFIED' | 'MONTH' | 'DAY' | 'HOUR'

The unit used for the duration

subscriptionIdstring

Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription with the same ID already exists, the creation fails with an ALREADY_EXISTS error.

Request body

createTimestring google-datetime

Output only. System generated timestamp when the subscription is created. UTC timezone.

cycleEndTimestring google-datetime

Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: "2019-08-31T17:28:54.564Z"

endUserEntitledboolean

Output only. Indicates if the subscription is entitled to the end user.

freeTrialEndTimestring google-datetime

Output only. End of the free trial period, in ISO 8061 format. For example, "2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free trial promotion is specified.

namestring

Identifier. Resource name of the subscription. It will have the format of "partners/{partner_id}/subscriptions/{subscription_id}". This is available for authorizeAddon, but otherwise is response only.

partnerUserTokenstring

Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.

processingState'PROCESSING_STATE_UNSPECIFIED' | 'PROCESSING_STATE_CANCELLING' | 'PROCESSING_STATE_RECURRING' | 'PROCESSING_STATE_RESUMING' | 'PROCESSING_STATE_SUSPENDING'

Output only. Describes the processing state of the subscription. See more details at the lifecycle of a subscription.

productsstring[]

Optional. Deprecated: consider using line_items as the input. Required. Resource name that identifies the purchased products. The format will be 'partners/{partner_id}/products/{product_id}'.

promotionsstring[]

Optional. Deprecated: consider using the top-level promotion_specs as the input. 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 'partners/{partner_id}/promotions/{promotion_id}'.

purchaseTimestring google-datetime

Optional. The timestamp when the user transaction was made with the Partner. Specify for the case of "bundle with choice", and it must be before the provision_time (when the user makes a selection).

redirectUristring

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.

renewalTimestring google-datetime

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: "2019-08-31T17:28:54.564Z"

state'STATE_UNSPECIFIED' | 'STATE_CREATED' | 'STATE_ACTIVE' | 'STATE_CANCELLED' | 'STATE_IN_GRACE_PERIOD' | 'STATE_CANCEL_AT_END_OF_CYCLE' | 'STATE_SUSPENDED'

Output only. Describes the state of the subscription. See more details at the lifecycle of a subscription.

updateTimestring google-datetime

Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.

Response

Successful response

createTimestring google-datetime

Output only. System generated timestamp when the subscription is created. UTC timezone.

cycleEndTimestring google-datetime

Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: "2019-08-31T17:28:54.564Z"

endUserEntitledboolean

Output only. Indicates if the subscription is entitled to the end user.

freeTrialEndTimestring google-datetime

Output only. End of the free trial period, in ISO 8061 format. For example, "2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free trial promotion is specified.

namestring

Identifier. Resource name of the subscription. It will have the format of "partners/{partner_id}/subscriptions/{subscription_id}". This is available for authorizeAddon, but otherwise is response only.

partnerUserTokenstring

Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.

processingState'PROCESSING_STATE_UNSPECIFIED' | 'PROCESSING_STATE_CANCELLING' | 'PROCESSING_STATE_RECURRING' | 'PROCESSING_STATE_RESUMING' | 'PROCESSING_STATE_SUSPENDING'

Output only. Describes the processing state of the subscription. See more details at the lifecycle of a subscription.

productsstring[]

Optional. Deprecated: consider using line_items as the input. Required. Resource name that identifies the purchased products. The format will be 'partners/{partner_id}/products/{product_id}'.

promotionsstring[]

Optional. Deprecated: consider using the top-level promotion_specs as the input. 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 'partners/{partner_id}/promotions/{promotion_id}'.

purchaseTimestring google-datetime

Optional. The timestamp when the user transaction was made with the Partner. Specify for the case of "bundle with choice", and it must be before the provision_time (when the user makes a selection).

redirectUristring

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.

renewalTimestring google-datetime

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: "2019-08-31T17:28:54.564Z"

state'STATE_UNSPECIFIED' | 'STATE_CREATED' | 'STATE_ACTIVE' | 'STATE_CANCELLED' | 'STATE_IN_GRACE_PERIOD' | 'STATE_CANCEL_AT_END_OF_CYCLE' | 'STATE_SUSPENDED'

Output only. Describes the state of the subscription. See more details at the lifecycle of a subscription.

updateTimestring google-datetime

Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.

Changes

No recorded changes to this operation across all 4 revisions of this API.