Create a payment link
POST
/v1/payment_linksCreates a payment link.
Request
A list of items the customer is purchasing. Each line item represents an item being sold. Up to 20 line items are supported.
The ID of the Price object. The ID of the Price object. One of price or price_data is required.
Data used to generate a new Price object inline. One of price or price_data is required.
The quantity of the line item being purchased.
Behavior after the purchase is complete.
The specified behavior after the purchase is complete.
Configuration when type=hosted_confirmation.
Configuration when type=redirect.
Configuration for collecting the customer’s billing address.
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.
Controls phone number collection settings during checkout.
If true, a phone number will be collected during checkout.
Configuration for collecting the customer’s shipping address.
An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations.
{
"line_items": [
{
"price": "string",
"price_data": {},
"quantity": "string"
}
],
"after_completion": {
"type": "redirect",
"hosted_confirmation": {
"custom_message": "string"
},
"redirect": {
"url": "string"
}
},
"billing_address_collection": "auto",
"metadata": {},
"phone_number_collection": {
"enabled": true
},
"shipping_address_collection": {
"allowed_countries": [
"string"
]
}
}
Request samples
Responses
Unique identifier for the object, like 'plink_xxxx'.
"payment_link"
Whether the payment link’s url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated.
Behavior after the purchase is complete.
The specified behavior after the purchase is complete.
Configuration when type=hosted_confirmation.
Configuration when type=redirect.
Configuration for collecting the customer’s billing address.
Three-letter ISO currency code. Must be a supported currency.
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
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.
Controls phone number collection settings during checkout.
If true, a phone number will be collected during checkout.
Configuration for collecting the customer’s shipping address.
An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations.
The public URL that can be shared with customers.
The line items representing what is being sold. This field is not included by default. This field is not included by default. To include it in the response, expand the line_items field.
Time at which the object was created. Measured in seconds since the Unix epoch.
{
"id": "string",
"object": "string",
"active": true,
"after_completion": {
"type": "redirect",
"hosted_confirmation": {
"custom_message": "string"
},
"redirect": {
"url": "string"
}
},
"billing_address_collection": "auto",
"currency": "string",
"livemode": true,
"metadata": {},
"phone_number_collection": {
"enabled": true
},
"shipping_address_collection": {
"allowed_countries": [
"string"
]
},
"url": "string",
"line_items": {
"object": "\"list\"",
"url": "string",
"has_more": true,
"data": [
{
"id": "string",
"object": "string",
"amount_subtotal": "string",
"amount_total": "string",
"currency": "string",
"description": "string",
"price": {
"id": "string",
"object": "string",
"active": true,
"billing_scheme": "per_unit",
"created": 0,
"currency": "string",
"livemode": true,
"lookup_key": "string",
"metadata": {},
"nickname": "string",
"product": "string",
"type": "one_time",
"unit_amount": 0,
"recurring": {
"interval": "day",
"interval_count": 0,
"usage_type": "licensed"
},
"tiers": [
{
"up_to": "string",
"flat_amount": "string",
"unit_amount": "string"
}
]
},
"quantity": "string"
}
]
},
"created": 0
}