View Source Stripe.PaymentLink (Striped v0.5.0) (generated)
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
Link to this section Summary
Types
When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
Behavior after the purchase is complete.
Configuration for automatic tax collection.
Configure fields to gather active consent from customers.
Display additional text for your customers using custom text.
Configuration when type=hosted_confirmation.
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
Controls phone number collection settings during checkout.
Configuration when type=redirect.
Configuration for collecting the customer's shipping address.
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.
The payment_link type.
Controls tax ID collection during checkout.
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
Functions
Creates a payment link.
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. There is also a URL where you can retrieve the full (paginated) list of line items.
Retrieve a payment link.
Updates a payment link.
Link to this section Types
@type adjustable_quantity() :: %{ optional(:enabled) => boolean(), optional(:maximum) => integer(), optional(:minimum) => integer() }
When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
@type after_completion() :: %{ optional(:hosted_confirmation) => hosted_confirmation(), optional(:redirect) => redirect(), optional(:type) => :hosted_confirmation | :redirect }
Behavior after the purchase is complete.
@type automatic_tax() :: %{optional(:enabled) => boolean()}
Configuration for automatic tax collection.
@type consent_collection() :: %{
optional(:promotions) => :auto | :none,
optional(:terms_of_service) => :none | :required
}
Configure fields to gather active consent from customers.
@type custom_text() :: %{ optional(:shipping_address) => shipping_address() | binary(), optional(:submit) => submit() | binary() }
Display additional text for your customers using custom text.
@type hosted_confirmation() :: %{optional(:custom_message) => binary()}
Configuration when type=hosted_confirmation.
@type line_items() :: %{ optional(:adjustable_quantity) => adjustable_quantity(), optional(:price) => binary(), optional(:quantity) => integer() }
@type payment_intent_data() :: %{
optional(:capture_method) => :automatic | :manual,
optional(:setup_future_usage) => :off_session | :on_session
}
A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in payment mode.
@type phone_number_collection() :: %{optional(:enabled) => boolean()}
Controls phone number collection settings during checkout.
We recommend that you review your privacy policy and check with your legal contacts.
@type redirect() :: %{optional(:url) => binary()}
Configuration when type=redirect.
@type shipping_address() :: %{optional(:message) => binary()}
@type shipping_address_collection() :: %{
optional(:allowed_countries) => [
:AC
| :AD
| :AE
| :AF
| :AG
| :AI
| :AL
| :AM
| :AO
| :AQ
| :AR
| :AT
| :AU
| :AW
| :AX
| :AZ
| :BA
| :BB
| :BD
| :BE
| :BF
| :BG
| :BH
| :BI
| :BJ
| :BL
| :BM
| :BN
| :BO
| :BQ
| :BR
| :BS
| :BT
| :BV
| :BW
| :BY
| :BZ
| :CA
| :CD
| :CF
| :CG
| :CH
| :CI
| :CK
| :CL
| :CM
| :CN
| :CO
| :CR
| :CV
| :CW
| :CY
| :CZ
| :DE
| :DJ
| :DK
| :DM
| :DO
| :DZ
| :EC
| :EE
| :EG
| :EH
| :ER
| :ES
| :ET
| :FI
| :FJ
| :FK
| :FO
| :FR
| :GA
| :GB
| :GD
| :GE
| :GF
| :GG
| :GH
| :GI
| :GL
| :GM
| :GN
| :GP
| :GQ
| :GR
| :GS
| :GT
| :GU
| :GW
| :GY
| :HK
| :HN
| :HR
| :HT
| :HU
| :ID
| :IE
| :IL
| :IM
| :IN
| :IO
| :IQ
| :IS
| :IT
| :JE
| :JM
| :JO
| :JP
| :KE
| :KG
| :KH
| :KI
| :KM
| :KN
| :KR
| :KW
| :KY
| :KZ
| :LA
| :LB
| :LC
| :LI
| :LK
| :LR
| :LS
| :LT
| :LU
| :LV
| :LY
| :MA
| :MC
| :MD
| :ME
| :MF
| :MG
| :MK
| :ML
| :MM
| :MN
| :MO
| :MQ
| :MR
| :MS
| :MT
| :MU
| :MV
| :MW
| :MX
| :MY
| :MZ
| :NA
| :NC
| :NE
| :NG
| :NI
| :NL
| :NO
| :NP
| :NR
| :NU
| :NZ
| :OM
| :PA
| :PE
| :PF
| :PG
| :PH
| :PK
| :PL
| :PM
| :PN
| :PR
| :PS
| :PT
| :PY
| :QA
| :RE
| :RO
| :RS
| :RU
| :RW
| :SA
| :SB
| :SC
| :SE
| :SG
| :SH
| :SI
| :SJ
| :SK
| :SL
| :SM
| :SN
| :SO
| :SR
| :SS
| :ST
| :SV
| :SX
| :SZ
| :TA
| :TC
| :TD
| :TF
| :TG
| :TH
| :TJ
| :TK
| :TL
| :TM
| :TN
| :TO
| :TR
| :TT
| :TV
| :TW
| :TZ
| :UA
| :UG
| :US
| :UY
| :UZ
| :VA
| :VC
| :VE
| :VG
| :VN
| :VU
| :WF
| :WS
| :XK
| :YE
| :YT
| :ZA
| :ZM
| :ZW
| :ZZ
]
}
Configuration for collecting the customer's shipping address.
@type shipping_options() :: %{optional(:shipping_rate) => binary()}
@type submit() :: %{optional(:message) => binary()}
@type subscription_data() :: %{ optional(:description) => binary(), optional(:trial_period_days) => integer() }
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.
@type t() :: %Stripe.PaymentLink{ active: boolean(), after_completion: term(), allow_promotion_codes: boolean(), application_fee_amount: integer() | nil, application_fee_percent: term() | nil, automatic_tax: term(), billing_address_collection: binary(), consent_collection: term() | nil, currency: binary(), custom_text: term(), customer_creation: binary(), id: binary(), line_items: term(), livemode: boolean(), metadata: term(), object: binary(), on_behalf_of: (binary() | Stripe.Account.t()) | nil, payment_intent_data: term() | nil, payment_method_collection: binary(), payment_method_types: term() | nil, phone_number_collection: term(), shipping_address_collection: term() | nil, shipping_options: term(), submit_type: binary(), subscription_data: term() | nil, tax_id_collection: term(), transfer_data: term() | nil, url: binary() }
The payment_link type.
activeWhether the payment link'surlis active. Iffalse, customers visiting the URL will be shown a page saying that the link has been deactivated.after_completionallow_promotion_codesWhether user redeemable promotion codes are enabled.application_fee_amountThe 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.application_fee_percentThis represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.automatic_taxbilling_address_collectionConfiguration for collecting the customer's billing address.consent_collectionWhen set, provides configuration to gather active consent from customers.currencyThree-letter ISO currency code, in lowercase. Must be a supported currency.custom_textcustomer_creationConfiguration for Customer creation during checkout.idUnique identifier for the object.line_itemsThe line items representing what is being sold.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.metadataSet 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.objectString representing the object's type. Objects of the same type share the same value.on_behalf_ofThe account on behalf of which to charge. See the Connect documentation for details.payment_intent_dataIndicates the parameters to be passed to PaymentIntent creation during checkout.payment_method_collectionConfiguration for collecting a payment method during checkout.payment_method_typesThe 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.phone_number_collectionshipping_address_collectionConfiguration for collecting the customer's shipping address.shipping_optionsThe shipping rate options applied to the session.submit_typeIndicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.subscription_dataWhen 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.tax_id_collectiontransfer_dataThe account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.urlThe public URL that can be shared with customers.
@type tax_id_collection() :: %{optional(:enabled) => boolean()}
Controls tax ID collection during checkout.
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.
Link to this section Functions
@spec create( client :: Stripe.t(), params :: %{ optional(:after_completion) => after_completion(), optional(:allow_promotion_codes) => boolean(), optional(:application_fee_amount) => integer(), optional(:application_fee_percent) => number(), optional(:automatic_tax) => automatic_tax(), optional(:billing_address_collection) => :auto | :required, optional(:consent_collection) => consent_collection(), optional(:currency) => binary(), optional(:custom_text) => custom_text(), optional(:customer_creation) => :always | :if_required, optional(:expand) => [binary()], optional(:line_items) => [line_items()], optional(:metadata) => %{optional(binary()) => binary()}, optional(:on_behalf_of) => binary(), optional(:payment_intent_data) => payment_intent_data(), optional(:payment_method_collection) => :always | :if_required, optional(:payment_method_types) => [ :affirm | :afterpay_clearpay | :alipay | :au_becs_debit | :bacs_debit | :bancontact | :blik | :boleto | :card | :eps | :fpx | :giropay | :grabpay | :ideal | :klarna | :konbini | :oxxo | :p24 | :paynow | :pix | :promptpay | :sepa_debit | :sofort | :us_bank_account | :wechat_pay ], optional(:phone_number_collection) => phone_number_collection(), optional(:shipping_address_collection) => shipping_address_collection(), optional(:shipping_options) => [shipping_options()], optional(:submit_type) => :auto | :book | :donate | :pay, optional(:subscription_data) => subscription_data(), optional(:tax_id_collection) => tax_id_collection(), optional(:transfer_data) => transfer_data() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a payment link.
Details
- Method:
post - Path:
/v1/payment_links
@spec list( client :: Stripe.t(), params :: %{ optional(:active) => boolean(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of your payment links.
Details
- Method:
get - Path:
/v1/payment_links
@spec list_line_items( client :: Stripe.t(), payment_link :: binary(), params :: %{ optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(Stripe.Item.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
Details
- Method:
get - Path:
/v1/payment_links/{payment_link}/line_items
@spec retrieve( client :: Stripe.t(), payment_link :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieve a payment link.
Details
- Method:
get - Path:
/v1/payment_links/{payment_link}
@spec update( client :: Stripe.t(), payment_link :: binary(), params :: %{ optional(:active) => boolean(), optional(:after_completion) => after_completion(), optional(:allow_promotion_codes) => boolean(), optional(:automatic_tax) => automatic_tax(), optional(:billing_address_collection) => :auto | :required, optional(:custom_text) => custom_text(), optional(:customer_creation) => :always | :if_required, optional(:expand) => [binary()], optional(:line_items) => [line_items()], optional(:metadata) => %{optional(binary()) => binary()}, optional(:payment_method_collection) => :always | :if_required, optional(:payment_method_types) => [ :affirm | :afterpay_clearpay | :alipay | :au_becs_debit | :bacs_debit | :bancontact | :blik | :boleto | :card | :eps | :fpx | :giropay | :grabpay | :ideal | :klarna | :konbini | :oxxo | :p24 | :paynow | :pix | :promptpay | :sepa_debit | :sofort | :us_bank_account | :wechat_pay ] | binary(), optional(:shipping_address_collection) => shipping_address_collection() | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates a payment link.
Details
- Method:
post - Path:
/v1/payment_links/{payment_link}