Package com.stripe.model
Class PaymentLink
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.PaymentLink
- All Implemented Interfaces:
HasId
,MetadataStore<PaymentLink>
,StripeActiveObject
,StripeObjectInterface
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
The URL the customer will be redirected to after the purchase is complete.static class
Get expandedaccount
.static class
Determines the position and visibility of the payment method reuse agreement in the UI.static class
The minimum character length requirement for the customer's input.static class
Text may be up to 1200 characters in length.static class
How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.static class
static class
static class
The maximum number of checkout sessions that can be completed for thecompleted_sessions
restriction to be met.static class
static class
static class
Indicates how the subscription should change when the trial ends if the user did not provide a payment method.static class
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static PaymentLink
create
(PaymentLinkCreateParams params) Creates a payment link.static PaymentLink
create
(PaymentLinkCreateParams params, RequestOptions options) Creates a payment link.static PaymentLink
Creates a payment link.static PaymentLink
create
(Map<String, Object> params, RequestOptions options) Creates a payment link.boolean
Whether the payment link'surl
is active.Whether user redeemable promotion codes are enabled.Get ID of expandableapplication
object.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.This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.Get expandedapplication
.Configuration for collecting the customer's billing address.When set, provides configuration to gather active consent from customers.Three-letter ISO currency code, in lowercase.Configuration for Customer creation during checkout.Collect additional information from your customer using custom fields.getId()
Unique identifier for the object.The custom message to be displayed to a customer when a payment link is no longer active.Configuration for creating invoice for payment mode payment links.The line items representing what is being sold.Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.Set of key-value pairs that you can attach to an object.String representing the object's type.Get ID of expandableonBehalfOf
object.Get expandedonBehalfOf
.Indicates the parameters to be passed to PaymentIntent creation during checkout.Configuration for collecting a payment method during checkout.The list of payment method types that customers can use.Settings that restrict the usage of a payment link.Configuration for collecting the customer's shipping address.The shipping rate options applied to the session.Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.When creating a subscription, the specified configuration data will be used.The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.getUrl()
The public URL that can be shared with customers.int
hashCode()
static PaymentLinkCollection
list
(PaymentLinkListParams params) Returns a list of your payment links.static PaymentLinkCollection
list
(PaymentLinkListParams params, RequestOptions options) Returns a list of your payment links.static PaymentLinkCollection
Returns a list of your payment links.static PaymentLinkCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of your payment links.When retrieving a payment link, there is an includable line_items property containing the first handful of those items.When retrieving a payment link, there is an includable line_items property containing the first handful of those items.listLineItems
(PaymentLinkListLineItemsParams params, RequestOptions options) When retrieving a payment link, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params) When retrieving a payment link, there is an includable line_items property containing the first handful of those items.listLineItems
(Map<String, Object> params, RequestOptions options) When retrieving a payment link, there is an includable line_items property containing the first handful of those items.static PaymentLink
Retrieve a payment link.static PaymentLink
retrieve
(String paymentLink, RequestOptions options) Retrieve a payment link.static PaymentLink
retrieve
(String paymentLink, PaymentLinkRetrieveParams params, RequestOptions options) Retrieve a payment link.static PaymentLink
Retrieve a payment link.void
Whether the payment link'surl
is active.void
setAfterCompletion
(PaymentLink.AfterCompletion afterCompletion) void
setAllowPromotionCodes
(Boolean allowPromotionCodes) Whether user redeemable promotion codes are enabled.void
setApplication
(String id) 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.void
setApplicationFeePercent
(BigDecimal applicationFeePercent) This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.void
setApplicationObject
(Application expandableObject) void
setAutomaticTax
(PaymentLink.AutomaticTax automaticTax) void
setBillingAddressCollection
(String billingAddressCollection) Configuration for collecting the customer's billing address.void
setConsentCollection
(PaymentLink.ConsentCollection consentCollection) When set, provides configuration to gather active consent from customers.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCustomerCreation
(String customerCreation) Configuration for Customer creation during checkout.void
setCustomFields
(List<PaymentLink.CustomField> customFields) Collect additional information from your customer using custom fields.void
setCustomText
(PaymentLink.CustomText customText) void
Unique identifier for the object.void
setInactiveMessage
(String inactiveMessage) The custom message to be displayed to a customer when a payment link is no longer active.void
setInvoiceCreation
(PaymentLink.InvoiceCreation invoiceCreation) Configuration for creating invoice for payment mode payment links.void
setLineItems
(LineItemCollection lineItems) The line items representing what is being sold.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
String representing the object's type.void
setOnBehalfOf
(String id) void
setOnBehalfOfObject
(Account expandableObject) void
setPaymentIntentData
(PaymentLink.PaymentIntentData paymentIntentData) Indicates the parameters to be passed to PaymentIntent creation during checkout.void
setPaymentMethodCollection
(String paymentMethodCollection) Configuration for collecting a payment method during checkout.void
setPaymentMethodTypes
(List<String> paymentMethodTypes) The list of payment method types that customers can use.void
setPhoneNumberCollection
(PaymentLink.PhoneNumberCollection phoneNumberCollection) void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
setRestrictions
(PaymentLink.Restrictions restrictions) Settings that restrict the usage of a payment link.void
setShippingAddressCollection
(PaymentLink.ShippingAddressCollection shippingAddressCollection) Configuration for collecting the customer's shipping address.void
setShippingOptions
(List<PaymentLink.ShippingOption> shippingOptions) The shipping rate options applied to the session.void
setSubmitType
(String submitType) Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.void
setSubscriptionData
(PaymentLink.SubscriptionData subscriptionData) When creating a subscription, the specified configuration data will be used.void
setTaxIdCollection
(PaymentLink.TaxIdCollection taxIdCollection) 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.void
The public URL that can be shared with customers.update
(PaymentLinkUpdateParams params) Updates a payment link.update
(PaymentLinkUpdateParams params, RequestOptions options) Updates a payment link.Updates a payment link.update
(Map<String, Object> params, RequestOptions options) Updates a payment link.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
PaymentLink
public PaymentLink()
-
-
Method Details
-
getApplication
Get ID of expandableapplication
object. -
setApplication
-
getApplicationObject
Get expandedapplication
. -
setApplicationObject
-
getOnBehalfOf
Get ID of expandableonBehalfOf
object. -
setOnBehalfOf
-
getOnBehalfOfObject
Get expandedonBehalfOf
. -
setOnBehalfOfObject
-
create
Creates a payment link.- Throws:
StripeException
-
create
public static PaymentLink create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a payment link.- Throws:
StripeException
-
create
Creates a payment link.- Throws:
StripeException
-
create
public static PaymentLink create(PaymentLinkCreateParams params, RequestOptions options) throws StripeException Creates a payment link.- Throws:
StripeException
-
list
Returns a list of your payment links.- Throws:
StripeException
-
list
public static PaymentLinkCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your payment links.- Throws:
StripeException
-
list
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
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(Map<String, Object> params, RequestOptions options) throws StripeExceptionWhen 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) 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(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
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 StripeExceptionRetrieve 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
Updates a payment link.- Specified by:
update
in interfaceMetadataStore<PaymentLink>
- Throws:
StripeException
-
update
Updates a payment link.- Specified by:
update
in interfaceMetadataStore<PaymentLink>
- Throws:
StripeException
-
update
Updates a payment link.- Throws:
StripeException
-
update
public PaymentLink update(PaymentLinkUpdateParams params, RequestOptions options) throws StripeException Updates a payment link.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObject
Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getActive
Whether the payment link'surl
is active. Iffalse
, customers visiting the URL will be shown a page saying that the link has been deactivated. -
getAfterCompletion
-
getAllowPromotionCodes
Whether user redeemable promotion codes are enabled. -
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
This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. -
getAutomaticTax
-
getBillingAddressCollection
Configuration for collecting the customer's billing address. Defaults toauto
.One of
auto
, orrequired
. -
getConsentCollection
When set, provides configuration to gather active consent from customers. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
getCustomText
-
getCustomerCreation
Configuration for Customer creation during checkout.One of
always
, orif_required
. -
getInactiveMessage
The custom message to be displayed to a customer when a payment link is no longer active. -
getInvoiceCreation
Configuration for creating invoice for payment mode payment links. -
getLineItems
The line items representing what is being sold. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
payment_link
. -
getPaymentIntentData
Indicates the parameters to be passed to PaymentIntent creation during checkout. -
getPaymentMethodCollection
Configuration for collecting a payment method during checkout. Defaults toalways
.One of
always
, orif_required
. -
getPaymentMethodTypes
The list of payment method types that customers can use. Whennull
, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. -
getPhoneNumberCollection
-
getRestrictions
Settings that restrict the usage of a payment link. -
getShippingAddressCollection
Configuration for collecting the customer's shipping address. -
getShippingOptions
The shipping rate options applied to the session. -
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
, orpay
. -
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 usesubscription_data
. -
getTaxIdCollection
-
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
The public URL that can be shared with customers. -
setActive
Whether the payment link'surl
is active. Iffalse
, customers visiting the URL will be shown a page saying that the link has been deactivated. -
setAfterCompletion
-
setAllowPromotionCodes
Whether user redeemable promotion codes are enabled. -
setApplicationFeeAmount
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
This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. -
setAutomaticTax
-
setBillingAddressCollection
Configuration for collecting the customer's billing address. Defaults toauto
.One of
auto
, orrequired
. -
setConsentCollection
When set, provides configuration to gather active consent from customers. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCustomFields
Collect additional information from your customer using custom fields. Up to 3 fields are supported. -
setCustomText
-
setCustomerCreation
Configuration for Customer creation during checkout.One of
always
, orif_required
. -
setId
Unique identifier for the object. -
setInactiveMessage
The custom message to be displayed to a customer when a payment link is no longer active. -
setInvoiceCreation
Configuration for creating invoice for payment mode payment links. -
setLineItems
The line items representing what is being sold. -
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
setMetadata
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
String representing the object's type. Objects of the same type share the same value.Equal to
payment_link
. -
setPaymentIntentData
Indicates the parameters to be passed to PaymentIntent creation during checkout. -
setPaymentMethodCollection
Configuration for collecting a payment method during checkout. Defaults toalways
.One of
always
, orif_required
. -
setPaymentMethodTypes
The list of payment method types that customers can use. Whennull
, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. -
setPhoneNumberCollection
-
setRestrictions
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
The shipping rate options applied to the session. -
setSubmitType
Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.One of
auto
,book
,donate
, orpay
. -
setSubscriptionData
When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to usesubscription_data
. -
setTaxIdCollection
-
setTransferData
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. -
setUrl
The public URL that can be shared with customers. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
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 interfaceMetadataStore<PaymentLink>
-