Create a payment link
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.
- metadataobject
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_ percentfloatConnect only - automatic_
taxobject - billing_
address_ collectionenum - consent_
collectionobject - currencyenum
- custom_
fieldsarray of objects - custom_
textobject - customer_
creationenum - inactive_
messagestring - invoice_
creationobject - on_
behalf_ ofstringConnect only - payment_
intent_ dataobject - payment_
method_ collectionenum - 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.
Update a payment link
Updates a payment link.
Parameters
- activeboolean
Whether the payment link’s
url
is 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.
- metadataobject
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 - automatic_
taxobject - billing_
address_ collectionenum - custom_
fieldsarray of objects - custom_
textobject - customer_
creationenum - inactive_
messagestring - invoice_
creationobject - payment_
intent_ dataobject - payment_
method_ collectionenum - payment_
method_ typesarray of enums - restrictionsobject
- shipping_
address_ collectionobject - subscription_
dataobject
Returns
Updated payment link.
Retrieve a payment link's line items
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.
Parameters
No parameters.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
payment link line items, starting after Line Item starting_after
. Each entry in the array is a separate Line Item object. If no more line items are available, the resulting array will be empty.
Retrieve payment link
Retrieve a payment link.
Parameters
No parameters.
Returns
Returns the payment link.
List all payment links
Returns a list of your payment links.
Parameters
- activeboolean
Only return payment links that are active or inactive (e.g., pass
false
to list all inactive payment links).
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
payment links, starting after payment link starting_after
. Each entry in the array is a separate payment link object. If no more payment links are available, the resulting array will be empty. This request should never raise an error.