Stop writing boilerplate. Describe what you want, and let AI configure your Stripe payments instantly.
Try the DemoEnter a natural language payment request
See how Stripe AI simplifies payment configuration
const stripe = require('stripe')(process.env.STRIPE_KEY);
async function createSubscription() {
// First, create a product
const product = await stripe.products.create({
name: 'Pro Plan',
description: 'Monthly subscription'
});
// Then create a price
const price = await stripe.prices.create({
product: product.id,
unit_amount: 2900,
currency: 'usd',
recurring: { interval: 'month' }
});
// Create payment link with trial
const paymentLink = await stripe.paymentLinks.create({
line_items: [{ price: price.id, quantity: 1 }],
subscription_data: {
trial_period_days: 14
}
});
return paymentLink.url;
}
"Set up a subscription at $29/month with 14-day trial"