Payment Links Fresh
Create shareable payment links without writing any code. Payment Links use Stripe Checkout under the hood — all Checkout features apply.
Create a payment link
Via Dashboard
Create a payment link in Dashboard → Payment Links → New.
Via API
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1"javascript
const paymentLink = await stripe.paymentLinks.create({
line_items: [{ price: 'price_1234', quantity: 1 }],
});
// paymentLink.url is the shareable linkLimit payment count
Restrict how many times a link can be paid (e.g., for limited inventory):
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1" \
-d "restrictions[completed_sessions][limit]=100"When the limit is reached, the link automatically deactivates. You can customize the deactivation message:
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1" \
-d "restrictions[completed_sessions][limit]=50" \
--data-urlencode "inactive_message=Sorry, we're sold out!"Collect customer information
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1" \
-d "phone_number_collection[enabled]=true" \
-d "billing_address_collection=required" \
-d "shipping_address_collection[allowed_countries][0]=US" \
-d "shipping_address_collection[allowed_countries][1]=CA"Apply promotions
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1" \
-d "allow_promotion_codes=true"Configure after-payment behavior
Redirect customers to a custom URL after payment:
bash
curl https://api.stripe.com/v1/payment_links \
-u "sk_test_YOUR_KEY:" \
-d "line_items[0][price]=price_1234" \
-d "line_items[0][quantity]=1" \
-d "after_completion[type]=redirect" \
-d "after_completion[redirect][url]=https://example.com/thank-you"Or show a custom confirmation message:
bash
-d "after_completion[type]=hosted_confirmation" \
-d "after_completion[hosted_confirmation][custom_message]=Thanks for your purchase!"Subscription payment links
Create a link for recurring subscriptions:
javascript
const paymentLink = await stripe.paymentLinks.create({
line_items: [{ price: 'price_monthly_plan', quantity: 1 }],
// mode defaults to 'subscription' when price is recurring
subscription_data: {
trial_period_days: 14, // 14-day free trial
},
});Update a payment link
javascript
const paymentLink = await stripe.paymentLinks.update('plink_123', {
active: false, // Deactivate
});Retrieve payment link payments
javascript
const sessions = await stripe.checkout.sessions.list({
payment_link: 'plink_123',
});Fulfill orders
Payment Links use Checkout Sessions. Listen for checkout.session.completed webhook events — same as with direct Checkout integrations:
javascript
if (event.type === 'checkout.session.completed') {
const session = event.data.object;
if (session.payment_link) {
// This was from a Payment Link
await fulfillOrder(session);
}
}