View Source Stripe.PaymentLink (Striped v0.4.0)
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.
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 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_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 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(), 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.
active
Whether the payment link'surl
is active. Iffalse
, customers visiting the URL will be shown a page saying that the link has been deactivated.after_completion
allow_promotion_codes
Whether user redeemable promotion codes are enabled.application_fee_amount
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.application_fee_percent
This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.automatic_tax
billing_address_collection
Configuration for collecting the customer's billing address.consent_collection
When set, provides configuration to gather active consent from customers.currency
Three-letter ISO currency code, in lowercase. Must be a supported currency.customer_creation
Configuration for Customer creation during checkout.id
Unique identifier for the object.line_items
The line items representing what is being sold.livemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.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.object
String representing the object's type. Objects of the same type share the same value.on_behalf_of
The account on behalf of which to charge. See the Connect documentation for details.payment_intent_data
Indicates the parameters to be passed to PaymentIntent creation during checkout.payment_method_collection
Configuration for collecting a payment method during checkout.payment_method_types
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.phone_number_collection
shipping_address_collection
Configuration for collecting the customer's shipping address.shipping_options
The shipping rate options applied to the session.submit_type
Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.subscription_data
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
.tax_id_collection
transfer_data
The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.url
The 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(: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(: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}