Class Session

All Implemented Interfaces:
HasId, StripeActiveObject, StripeObjectInterface

public class Session extends ApiResource implements HasId
The Billing customer portal is a Stripe-hosted UI for subscription and billing management.

A portal configuration describes the functionality and features that you want to provide to your customers through the portal.

A portal session describes the instantiation of the customer portal for a particular customer. By visiting the session's URL, the customer can manage their subscriptions and billing details. For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. Create sessions on-demand when customers intend to manage their subscriptions and billing details.

Related guide: Customer management

  • Constructor Details

    • Session

      public Session()
  • Method Details

    • getConfiguration

      public String getConfiguration()
      Get ID of expandable configuration object.
    • setConfiguration

      public void setConfiguration(String id)
    • getConfigurationObject

      public Configuration getConfigurationObject()
      Get expanded configuration.
    • setConfigurationObject

      public void setConfigurationObject(Configuration expandableObject)
    • create

      public static Session create(Map<String,Object> params) throws StripeException
      Creates a session of the customer portal.
      Throws:
      StripeException
    • create

      public static Session create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a session of the customer portal.
      Throws:
      StripeException
    • create

      public static Session create(SessionCreateParams params) throws StripeException
      Creates a session of the customer portal.
      Throws:
      StripeException
    • create

      public static Session create(SessionCreateParams params, RequestOptions options) throws StripeException
      Creates a session of the customer portal.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Quantity for this item that the customer should subscribe to through this flow.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCustomer

      public String getCustomer()
      The ID of the customer for this session.
    • getFlow

      public Session.Flow getFlow()
      Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getLocale

      public String getLocale()
      The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used.

      One of auto, bg, cs, da, de, el, en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-SG, es, es-419, et, fi, fil, fr, fr-CA, hr, hu, id, it, ja, ko, lt, lv, ms, mt, nb, nl, pl, pt, pt-BR, ro, ru, sk, sl, sv, th, tr, vi, zh, zh-HK, or zh-TW.

    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to billing_portal.session.

    • getOnBehalfOf

      public String getOnBehalfOf()
      The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays.
    • getReturnUrl

      public String getReturnUrl()
      The URL to redirect customers to when they click on the portal's link to return to your website.
    • getUrl

      public String getUrl()
      The short-lived URL of the session that gives customers access to the customer portal.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCustomer

      public void setCustomer(String customer)
      The ID of the customer for this session.
    • setFlow

      public void setFlow(Session.Flow flow)
      Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setLocale

      public void setLocale(String locale)
      The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used.

      One of auto, bg, cs, da, de, el, en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-SG, es, es-419, et, fi, fil, fr, fr-CA, hr, hu, id, it, ja, ko, lt, lv, ms, mt, nb, nl, pl, pt, pt-BR, ro, ru, sk, sl, sv, th, tr, vi, zh, zh-HK, or zh-TW.

    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to billing_portal.session.

    • setOnBehalfOf

      public void setOnBehalfOf(String onBehalfOf)
      The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays.
    • setReturnUrl

      public void setReturnUrl(String returnUrl)
      The URL to redirect customers to when they click on the portal's link to return to your website.
    • setUrl

      public void setUrl(String url)
      The short-lived URL of the session that gives customers access to the customer portal.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId