#Trapov
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
We want to have dynamic products for each payment link and it's going to be hard for us to create products on the fly for each payment link.
Maybe I'm missing something and there is another way to create payment links or something like that.
👋 taking over for my colleague. Let me catch up.
If you want to create links on the fly it is much better to use Checkout Sessions: https://stripe.com/docs/payments/checkout/how-checkout-works
Here you can specify an amount or use line_items.price_data: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Does it support standard account?
What do you mean by "standard account"?
Oh, it's not Stripe Connect
It's stripe checkout
I mean our platform is not the merchant we provide to our merchant methods for creation of invoices and want to use Stripe for paying-out
Sure, every type of account can create Checkout Sessions.
just like invoice2go
With checkout sessions we need to create products anyway :/
Or we don't need to pass items there?
Just set the amount and we good?
Sorry, my bad, I misunderstood.
What you can do with CheckoutSessions is use price_data, where you dynamically specify the price for an item: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
No, you can specify product_data inside of price_data, like this:
const session = await stripe.checkout.sessions.create({
...,
line_items: [{
price_data: {
unit_amount: 1000,
currency: 'usd',
product_data: {
name: 'Product name'
}
},
quantity: 1
}],
})
hmm
No products/prices will be created in your Dashboard
yeah, that's what I need I think
Oh, wait
But I can't use linked accounts with that?
That's only for my account?
You can, by specifying the Stripe-Account header/stripeAccount property: https://stripe.com/docs/connect/authentication
I understand, you are talking about Stripe Connect?
yeah
It will look like this, if you're using Node.js SDK:
const session = await stripe.checkout.sessions.create({
...,
line_items: [{
price_data: {
unit_amount: 1000,
currency: 'usd',
product_data: {
name: 'Product name'
}
},
quantity: 1
}],
}, { stripeAccount: '{{CONNECTED_ACCOUNT_ID}}' })
great
and it returns the url to the checkout/payment page
that's what I need
thank you
Happy to help. Let me know if you have any other questions.