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
Attributes
- idstring
Unique identifier for the object.
- activeboolean
Whether the payment link’s
urlis active. Iffalse, customers visiting the URL will be shown a page saying that the link has been deactivated. - line_
items objectIncludableThe line items representing what is being sold.
- metadatamap
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.
- urlstring
The public URL that can be shared with customers.
More attributes
- objectstring, value is "payment_link"
- after_
completion object - allow_
promotion_ booleancodes - applicationnullable stringExpandableConnect only
- application_
fee_ nullable integerConnect onlyamount - application_
fee_ nullable numberConnect onlypercent - automatic_
tax object - billing_
address_ enumcollection - consent_
collection nullable object - currencyenum
- custom_
fields array of objects - custom_
text object - customer_
creation enum - inactive_
message nullable string - invoice_
creation nullable object - livemodeboolean
- managed_
payments nullable object - name_
collection nullable object - on_
behalf_ nullable stringExpandableConnect onlyof - optional_
items nullable array of objectsIncludable - payment_
intent_ nullable objectdata - payment_
method_ enumcollection - payment_
method_ nullable objectoptions - payment_
method_ nullable array of enumstypes - phone_
number_ objectcollection - restrictionsnullable object
- shipping_
address_ nullable objectcollection - shipping_
options array of objects - submit_
type enum - subscription_
data nullable object - tax_
id_ objectcollection - transfer_
data nullable objectConnect only
{ "id": "plink_1MoC3ULkdIwHu7ixZjtGpVl2", "object": "payment_link", "active": true, "after_completion": { "hosted_confirmation": { "custom_message": null }, "type": "hosted_confirmation" }, "allow_promotion_codes": false, "application_fee_amount": null, "application_fee_percent": null, "automatic_tax": { "enabled": false, "liability": null }, "billing_address_collection": "auto", "consent_collection": null, "currency": "usd", "custom_fields": [], "custom_text": { "shipping_address": null, "submit": null }, "customer_creation": "if_required", "invoice_creation": { "enabled": false, "invoice_data": { "account_tax_ids": null, "custom_fields": null, "description": null, "footer": null, "issuer": null, "metadata": {}, "rendering_options": null } }, "livemode": false, "metadata": {}, "on_behalf_of": null, "payment_intent_data": null, "payment_method_collection": "always", "payment_method_types": null, "phone_number_collection": { "enabled": false }, "shipping_address_collection": null, "shipping_options": [], "submit_type": "auto", "subscription_data": { "description": null, "invoice_settings": { "issuer": { "type": "self" } }, "trial_period_days": null }, "tax_id_collection": { "enabled": false }, "transfer_data": null, "url": "https://buy.stripe.com/test_cN25nr0iZ7bUa7meUY"}Creates a payment link.
Parameters
- line_
items array of objectsRequiredThe line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
- metadatamap
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata. Metadata associated with this Payment Link will automatically be copied to checkout sessions created by this payment link.
More parameters
- after_
completion object - allow_
promotion_ booleancodes - application_
fee_ integerConnect onlyamount - application_
fee_ numberConnect onlypercent - automatic_
tax object - billing_
address_ enumcollection - consent_
collection object - currencyenum
- custom_
fields array of objects - custom_
text object - customer_
creation enum - inactive_
message string - invoice_
creation object - managed_
payments object - name_
collection object - on_
behalf_ stringConnect onlyof - optional_
items array of objects - payment_
intent_ objectdata - payment_
method_ enumcollection - payment_
method_ objectoptions - payment_
method_ array of enumstypes - phone_
number_ objectcollection - restrictionsobject
- shipping_
address_ objectcollection - shipping_
options array of objects - submit_
type enum - subscription_
data object - tax_
id_ objectcollection - transfer_
data objectConnect only
Returns
Returns the payment link.
curl https://api.stripe.com/v1/payment_links \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1"{ "id": "plink_1MoC3ULkdIwHu7ixZjtGpVl2", "object": "payment_link", "active": true, "after_completion": { "hosted_confirmation": { "custom_message": null }, "type": "hosted_confirmation" }, "allow_promotion_codes": false, "application_fee_amount": null, "application_fee_percent": null, "automatic_tax": { "enabled": false, "liability": null }, "billing_address_collection": "auto", "consent_collection": null, "currency": "usd", "custom_fields": [], "custom_text": { "shipping_address": null, "submit": null }, "customer_creation": "if_required", "invoice_creation": { "enabled": false, "invoice_data": { "account_tax_ids": null, "custom_fields": null, "description": null, "footer": null, "issuer": null, "metadata": {}, "rendering_options": null } }, "livemode": false, "metadata": {}, "on_behalf_of": null, "payment_intent_data": null, "payment_method_collection": "always", "payment_method_types": null, "phone_number_collection": { "enabled": false }, "shipping_address_collection": null, "shipping_options": [], "submit_type": "auto", "subscription_data": { "description": null, "invoice_settings": { "issuer": { "type": "self" } }, "trial_period_days": null }, "tax_id_collection": { "enabled": false }, "transfer_data": null, "url": "https://buy.stripe.com/test_cN25nr0iZ7bUa7meUY"}