Create a payment link
POST / v1 / payment_links
Creates a payment link.
Parameters
- line _ items array of objects Required The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.
- metadata map 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 _ codes boolean
- application _ fee _ amount integer Connect only
- application _ fee _ percent number Connect only
- automatic _ tax object
- billing _ address _ collection enum
- consent _ collection object
- currency enum
- 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 _ of string Connect only
- optional _ items array of objects
- payment _ intent _ data object
- payment _ method _ collection enum
- payment _ method _ options object
- payment _ method _ types array of enums
- phone _ number _ collection object
- restrictions object
- shipping _ address _ collection object
- shipping _ options array of objects
- submit _ type enum
- subscription _ data object
- tax _ id _ collection object
- transfer _ data object Connect only
Returns
Returns the payment link.
Response
{ "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"}
Update a payment link
POST / v1 / payment_links /:id
Updates a payment link.
Parameters
- active boolean 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 array 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.
- metadata map 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 _ codes boolean
- application _ fee _ amount integer Connect only
- application _ fee _ percent number Connect only
- automatic _ tax object
- billing _ address _ collection enum
- consent _ collection object
- custom _ fields array of objects
- custom _ text object
- customer _ creation enum
- inactive _ message string
- invoice _ creation object
- name _ collection object
- on _ behalf _ of string Connect only
- optional _ items array of objects
- payment _ intent _ data object
- payment _ method _ collection enum
- payment _ method _ options object
- payment _ method _ types array of enums
- phone _ number _ collection object
- restrictions object
- shipping _ address _ collection object
- shipping _ options array of objects
- submit _ type enum
- subscription _ data object
- tax _ id _ collection object
- transfer _ data object Connect only
Returns
Updated payment link.
Response
{ "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 payment link
GET / v1 / payment_links /:id
Retrieve a payment link.
Parameters
No parameters.
Returns
Returns the payment link.
Response
{ "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"}
