Class PaymentLink

All Implemented Interfaces:
HasId, MetadataStore<PaymentLink>, StripeActiveObject, StripeObjectInterface

public class PaymentLink extends ApiResource implements HasId, MetadataStore<PaymentLink>
A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.

When a customer opens a payment link it will open a new checkout session to render the payment page. You can use checkout session events to track payments through payment links.

Related guide: Payment Links API

  • Constructor Details

    • PaymentLink

      public PaymentLink()
  • Method Details

    • getApplication

      public String getApplication()
      Get ID of expandable application object.
    • setApplication

      public void setApplication(String id)
    • getApplicationObject

      public Application getApplicationObject()
      Get expanded application.
    • setApplicationObject

      public void setApplicationObject(Application expandableObject)
    • getOnBehalfOf

      public String getOnBehalfOf()
      Get ID of expandable onBehalfOf object.
    • setOnBehalfOf

      public void setOnBehalfOf(String id)
    • getOnBehalfOfObject

      public Account getOnBehalfOfObject()
      Get expanded onBehalfOf.
    • setOnBehalfOfObject

      public void setOnBehalfOfObject(Account expandableObject)
    • create

      public static PaymentLink create(Map<String,Object> params) throws StripeException
      Creates a payment link.
      Throws:
      StripeException
    • create

      public static PaymentLink create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a payment link.
      Throws:
      StripeException
    • create

      public static PaymentLink create(PaymentLinkCreateParams params) throws StripeException
      Creates a payment link.
      Throws:
      StripeException
    • create

      public static PaymentLink create(PaymentLinkCreateParams params, RequestOptions options) throws StripeException
      Creates a payment link.
      Throws:
      StripeException
    • list

      public static PaymentLinkCollection list(Map<String,Object> params) throws StripeException
      Returns a list of your payment links.
      Throws:
      StripeException
    • list

      public static PaymentLinkCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Returns a list of your payment links.
      Throws:
      StripeException
    • list

      public static PaymentLinkCollection list(PaymentLinkListParams params) throws StripeException
      Returns a list of your payment links.
      Throws:
      StripeException
    • list

      public static PaymentLinkCollection list(PaymentLinkListParams params, RequestOptions options) throws StripeException
      Returns a list of your payment links.
      Throws:
      StripeException
    • listLineItems

      public LineItemCollection listLineItems() throws StripeException
      When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • listLineItems

      public LineItemCollection listLineItems(Map<String,Object> params) throws StripeException
      When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • listLineItems

      public LineItemCollection listLineItems(Map<String,Object> params, RequestOptions options) throws StripeException
      When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • listLineItems

      When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • listLineItems

      public LineItemCollection listLineItems(PaymentLinkListLineItemsParams params, RequestOptions options) throws StripeException
      When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
      Throws:
      StripeException
    • retrieve

      public static PaymentLink retrieve(String paymentLink) throws StripeException
      Retrieve a payment link.
      Throws:
      StripeException
    • retrieve

      public static PaymentLink retrieve(String paymentLink, RequestOptions options) throws StripeException
      Retrieve a payment link.
      Throws:
      StripeException
    • retrieve

      public static PaymentLink retrieve(String paymentLink, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieve a payment link.
      Throws:
      StripeException
    • retrieve

      public static PaymentLink retrieve(String paymentLink, PaymentLinkRetrieveParams params, RequestOptions options) throws StripeException
      Retrieve a payment link.
      Throws:
      StripeException
    • update

      public PaymentLink update(Map<String,Object> params) throws StripeException
      Updates a payment link.
      Specified by:
      update in interface MetadataStore<PaymentLink>
      Throws:
      StripeException
    • update

      public PaymentLink update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates a payment link.
      Specified by:
      update in interface MetadataStore<PaymentLink>
      Throws:
      StripeException
    • update

      public PaymentLink update(PaymentLinkUpdateParams params) throws StripeException
      Updates a payment link.
      Throws:
      StripeException
    • update

      public PaymentLink update(PaymentLinkUpdateParams params, RequestOptions options) throws StripeException
      Updates a payment link.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getActive

      public Boolean getActive()
      Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated.
    • getAfterCompletion

      public PaymentLink.AfterCompletion getAfterCompletion()
    • getAllowPromotionCodes

      public Boolean getAllowPromotionCodes()
      Whether user redeemable promotion codes are enabled.
    • getApplicationFeeAmount

      public Long getApplicationFeeAmount()
      The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
    • getApplicationFeePercent

      public BigDecimal getApplicationFeePercent()
      This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
    • getAutomaticTax

      public PaymentLink.AutomaticTax getAutomaticTax()
    • getBillingAddressCollection

      public String getBillingAddressCollection()
      Configuration for collecting the customer's billing address. Defaults to auto.

      One of auto, or required.

    • getConsentCollection

      public PaymentLink.ConsentCollection getConsentCollection()
      When set, provides configuration to gather active consent from customers.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getCustomFields

      public List<PaymentLink.CustomField> getCustomFields()
      Collect additional information from your customer using custom fields. Up to 3 fields are supported.
    • getCustomText

      public PaymentLink.CustomText getCustomText()
    • getCustomerCreation

      public String getCustomerCreation()
      Configuration for Customer creation during checkout.

      One of always, or if_required.

    • getInactiveMessage

      public String getInactiveMessage()
      The custom message to be displayed to a customer when a payment link is no longer active.
    • getInvoiceCreation

      public PaymentLink.InvoiceCreation getInvoiceCreation()
      Configuration for creating invoice for payment mode payment links.
    • getLineItems

      public LineItemCollection getLineItems()
      The line items representing what is being sold.
    • 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.
    • getObject

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

      Equal to payment_link.

    • getPaymentIntentData

      public PaymentLink.PaymentIntentData getPaymentIntentData()
      Indicates the parameters to be passed to PaymentIntent creation during checkout.
    • getPaymentMethodCollection

      public String getPaymentMethodCollection()
      Configuration for collecting a payment method during checkout. Defaults to always.

      One of always, or if_required.

    • getPaymentMethodTypes

      public List<String> getPaymentMethodTypes()
      The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings.
    • getPhoneNumberCollection

      public PaymentLink.PhoneNumberCollection getPhoneNumberCollection()
    • getRestrictions

      public PaymentLink.Restrictions getRestrictions()
      Settings that restrict the usage of a payment link.
    • getShippingAddressCollection

      public PaymentLink.ShippingAddressCollection getShippingAddressCollection()
      Configuration for collecting the customer's shipping address.
    • getShippingOptions

      public List<PaymentLink.ShippingOption> getShippingOptions()
      The shipping rate options applied to the session.
    • getSubmitType

      public String getSubmitType()
      Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.

      One of auto, book, donate, or pay.

    • getSubscriptionData

      public PaymentLink.SubscriptionData getSubscriptionData()
      When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data.
    • getTaxIdCollection

      public PaymentLink.TaxIdCollection getTaxIdCollection()
    • getTransferData

      public PaymentLink.TransferData getTransferData()
      The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
    • getUrl

      public String getUrl()
      The public URL that can be shared with customers.
    • setActive

      public void setActive(Boolean active)
      Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated.
    • setAfterCompletion

      public void setAfterCompletion(PaymentLink.AfterCompletion afterCompletion)
    • setAllowPromotionCodes

      public void setAllowPromotionCodes(Boolean allowPromotionCodes)
      Whether user redeemable promotion codes are enabled.
    • setApplicationFeeAmount

      public void setApplicationFeeAmount(Long applicationFeeAmount)
      The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
    • setApplicationFeePercent

      public void setApplicationFeePercent(BigDecimal applicationFeePercent)
      This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
    • setAutomaticTax

      public void setAutomaticTax(PaymentLink.AutomaticTax automaticTax)
    • setBillingAddressCollection

      public void setBillingAddressCollection(String billingAddressCollection)
      Configuration for collecting the customer's billing address. Defaults to auto.

      One of auto, or required.

    • setConsentCollection

      public void setConsentCollection(PaymentLink.ConsentCollection consentCollection)
      When set, provides configuration to gather active consent from customers.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setCustomFields

      public void setCustomFields(List<PaymentLink.CustomField> customFields)
      Collect additional information from your customer using custom fields. Up to 3 fields are supported.
    • setCustomText

      public void setCustomText(PaymentLink.CustomText customText)
    • setCustomerCreation

      public void setCustomerCreation(String customerCreation)
      Configuration for Customer creation during checkout.

      One of always, or if_required.

    • setId

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

      public void setInactiveMessage(String inactiveMessage)
      The custom message to be displayed to a customer when a payment link is no longer active.
    • setInvoiceCreation

      public void setInvoiceCreation(PaymentLink.InvoiceCreation invoiceCreation)
      Configuration for creating invoice for payment mode payment links.
    • setLineItems

      public void setLineItems(LineItemCollection lineItems)
      The line items representing what is being sold.
    • 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.
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
    • setObject

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

      Equal to payment_link.

    • setPaymentIntentData

      public void setPaymentIntentData(PaymentLink.PaymentIntentData paymentIntentData)
      Indicates the parameters to be passed to PaymentIntent creation during checkout.
    • setPaymentMethodCollection

      public void setPaymentMethodCollection(String paymentMethodCollection)
      Configuration for collecting a payment method during checkout. Defaults to always.

      One of always, or if_required.

    • setPaymentMethodTypes

      public void setPaymentMethodTypes(List<String> paymentMethodTypes)
      The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings.
    • setPhoneNumberCollection

      public void setPhoneNumberCollection(PaymentLink.PhoneNumberCollection phoneNumberCollection)
    • setRestrictions

      public void setRestrictions(PaymentLink.Restrictions restrictions)
      Settings that restrict the usage of a payment link.
    • setShippingAddressCollection

      public void setShippingAddressCollection(PaymentLink.ShippingAddressCollection shippingAddressCollection)
      Configuration for collecting the customer's shipping address.
    • setShippingOptions

      public void setShippingOptions(List<PaymentLink.ShippingOption> shippingOptions)
      The shipping rate options applied to the session.
    • setSubmitType

      public void setSubmitType(String submitType)
      Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.

      One of auto, book, donate, or pay.

    • setSubscriptionData

      public void setSubscriptionData(PaymentLink.SubscriptionData subscriptionData)
      When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data.
    • setTaxIdCollection

      public void setTaxIdCollection(PaymentLink.TaxIdCollection taxIdCollection)
    • setTransferData

      public void setTransferData(PaymentLink.TransferData transferData)
      The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
    • setUrl

      public void setUrl(String url)
      The public URL that can be shared with customers.
    • 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
    • getMetadata

      public Map<String,String> getMetadata()
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
      Specified by:
      getMetadata in interface MetadataStore<PaymentLink>