v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-13171054.0 KB
subscriptions

Creates or transfer a subscription. Create a subscription for a customer's account that you ordered using the Order a new customer account method. For more information about creating a subscription for different payment plans, see manage subscriptions.\ If you did not order the customer's account using the customer insert method, use the customer's customerAuthToken when creating a subscription for that customer. If transferring a G Suite subscription with an associated Google Drive or Google Vault subscription, use the batch operation to transfer all of these subscriptions. For more information, see how to transfer subscriptions.

post/apps/reseller/v1/customers/{customerId}/subscriptions

Path parameters

customerIdstring required

This can be either the customer's primary domain name or the customer's unique identifier. If the domain name for a customer changes, the old domain name cannot be used to access the customer, but the customer's unique identifier (as returned by the API) can always be used. We recommend storing the unique identifier in your systems where applicable.

Query parameters

action'actionUnspecified' | 'buy' | 'switch'

The intented insert action. Advised to set this when the customer already has a subscription for a different SKU in the same product.

customerAuthTokenstring

The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center.

sourceSkuIdstring

The sku_id of the existing subscription to be upgraded or downgraded. This is required when action is SWITCH.

Request body

suspensionReasonsstring[]

Read-only field containing an enumerable of all the current suspension reasons for a subscription. It is possible for a subscription to have many concurrent, overlapping suspension reasons. A subscription's STATUS is SUSPENDED until all pending suspensions are removed. Possible options include: - PENDING_TOS_ACCEPTANCE - The customer has not logged in and accepted the G Suite Resold Terms of Services. - RENEWAL_WITH_TYPE_CANCEL - The customer's commitment ended and their service was cancelled at the end of their term. - RESELLER_INITIATED - A manual suspension invoked by a Reseller. - TRIAL_ENDED - The customer's trial expired without a plan selected. - OTHER - The customer is suspended for an internal Google reason (e.g. abuse or otherwise).

skuNamestring

Read-only external display name for a product's SKU assigned to a customer in the subscription. SKU names are subject to change at Google's discretion. For products and SKUs available in this version of the API, see Product and SKU IDs.

statusstring

This is an optional property.

customerDomainstring

Primary domain name of the customer

customerIdstring

This property will always be returned in a response as the unique identifier generated by Google. In a request, this property can be either the primary domain or the unique identifier generated by Google.

resourceUiUrlstring

URL to customer's Subscriptions page in the Admin console. The read-only URL is generated by the API service. This is used if your client application requires the customer to complete a task using the Subscriptions page in the Admin console.

skuIdstring

A required property. The skuId is a unique system identifier for a product's SKU assigned to a customer in the subscription. For products and SKUs available in this version of the API, see Product and SKU IDs.

purchaseOrderIdstring

This is an optional property. This purchase order (PO) information is for resellers to use for their company tracking usage. If a purchaseOrderId value is given it appears in the API responses and shows up in the invoice. The property accepts up to 80 plain text characters.

billingMethodstring

Read-only field that returns the current billing method for a subscription.

subscriptionIdstring

The subscriptionId is the subscription identifier and is unique for each customer. This is a required property. Since a subscriptionId changes when a subscription is updated, we recommend not using this ID as a key for persistent data. Use the subscriptionId as described in retrieve all reseller subscriptions.

creationTimestring int64

The creationTime property is the date when subscription was created. It is in milliseconds using the Epoch format. See an example Epoch converter.

dealCodestring

Google-issued code (100 char max) for discounted pricing on subscription plans. Deal code must be included in insert requests in order to receive discounted rate. This property is optional, regular pricing applies if left empty.

kindstring

Identifies the resource as a Subscription. Value: reseller#subscription

Response

Successful response