Creates a payment link.
Parameters
- line_
itemsarray of objectsRequired The 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_
completionobject - allow_
promotion_ codesboolean - application_
fee_ amountintegerConnect only - application_
fee_ percentnumberConnect only - automatic_
taxobject - billing_
address_ collectionenum - consent_
collectionobject - currencyenum
- custom_
fieldsarray of objects - custom_
textobject - customer_
creationenum - inactive_
messagestring - invoice_
creationobject - managed_
paymentsobject - name_
collectionobject - on_
behalf_ ofstringConnect only - optional_
itemsarray of objects - payment_
intent_ dataobject - payment_
method_ collectionenum - payment_
method_ optionsobject - payment_
method_ typesarray of enums - phone_
number_ collectionobject - restrictionsobject
- shipping_
address_ collectionobject - shipping_
optionsarray of objects - submit_
typeenum - subscription_
dataobject - tax_
id_ collectionobject - transfer_
dataobjectConnect 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"}Updates a payment link.
Parameters
- 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_
itemsarray of objects The 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_
completionobject - allow_
promotion_ codesboolean - application_
fee_ amountintegerConnect only - application_
fee_ percentnumberConnect only - automatic_
taxobject - billing_
address_ collectionenum - consent_
collectionobject - custom_
fieldsarray of objects - custom_
textobject - customer_
creationenum - inactive_
messagestring - invoice_
creationobject - name_
collectionobject - on_
behalf_ ofstringConnect only - optional_
itemsarray of objects - payment_
intent_ dataobject - payment_
method_ collectionenum - payment_
method_ optionsobject - payment_
method_ typesarray of enums - phone_
number_ collectionobject - restrictionsobject
- shipping_
address_ collectionobject - shipping_
optionsarray of objects - submit_
typeenum - subscription_
dataobject - tax_
id_ collectionobject - transfer_
dataobjectConnect only
Returns
Updated payment link.
curl https://api.stripe.com/v1/payment_links/{{PAYMENT_LINK_ID}} \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \ -d "metadata[order_id]=6735"{ "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": { "order_id": "6735" }, "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"}Retrieve a payment link.
Parameters
No parameters.
Returns
Returns the payment link.
curl https://api.stripe.com/v1/payment_links/{{PAYMENT_LINK_ID}} \ -u "sk_test_BQokikJOvBiI2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:"{ "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"}