v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-13145259.5 KB
partners

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.

post/v1/{+parent}/subscriptions

Path parameters

parentstring required

Required. The parent resource name, which is the identifier of the partner. It will have the format of "partners/{partner_id}".

Query parameters

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

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"

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}'.

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.

endUserEntitledboolean

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

partnerUserTokenstring

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

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).

updateTimestring google-datetime

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

createTimestring google-datetime

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

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}'.

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.

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.

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.

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"

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.

Response

Successful response