Method: partners.userSessions.generate

This API replaces user authorized OAuth consent based APIs (Create, Entitle). Generates a short-lived token for a user session based on the user intent. You can use the session token to redirect the user to Google to finish the signup flow. You can re-generate new session token repeatedly for the same request if necessary, regardless of the previous tokens being expired or not.

HTTP request

POST https://paymentsresellersubscription.googleapis.com/v1/{parent=partners/*}/userSessions:generate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The parent, the partner that can resell. Format: partners/{partner}

Request body

The request body contains data with the following structure:

JSON representation
{
  "intentPayload": {
    object (IntentPayload)
  }
}
Fields
intentPayload

object (IntentPayload)

The user intent to generate the user session.

Response body

[Preview only] Response that contains the details for generated user session.

If successful, the response body contains data with the following structure:

JSON representation
{
  "userSession": {
    object (UserSession)
  }
}
Fields
userSession

object (UserSession)

The generated user session. The token size is proportional to the size of the intent payload.

IntentPayload

The payload that describes the user intent.

JSON representation
{

  // Union field request can be only one of the following:
  "createIntent": {
    object (CreateSubscriptionIntent)
  },
  "entitleIntent": {
    object (EntitleSubscriptionIntent)
  }
  // End of list of possible types for union field request.
}
Fields
Union field request. The intent types. request can be only one of the following:
createIntent

object (CreateSubscriptionIntent)

The request to create a subscription.

entitleIntent

object (EntitleSubscriptionIntent)

The request to entitle a subscription.

CreateSubscriptionIntent

Intent message for creating a Subscription resource.

JSON representation
{
  "parent": string,
  "subscription": {
    object (Subscription)
  },
  "subscriptionId": string
}
Fields
parent

string

Required. The parent resource name, which is the identifier of the partner.

subscription

object (Subscription)

Required. The Subscription to be created.

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 subscriptionId, we will directly return that one.

EntitleSubscriptionIntent

Intent for entitling the previously provisioned subscription to an end user.

JSON representation
{
  "name": string
}
Fields
name

string

Required. The name of the subscription resource that is entitled to the current end user.