#PSN - PaymentLink
1 messages ยท Page 1 of 1 (latest)
Hi
Give me a few minutes to try this.
Sure
You need to create a Price with custom_unit_amount in order to have custom amounts in PaymentLink
So first i need to pass enable true
and then the amount right?
Could you share an example request structure here>
?
In Node.JS it would look like this:
const price = await stripe.prices.create({
currency: "usd",
custom_unit_amount: {
enabled: true,
maximum: 10000, // optional
minimum: 1000, // optional
preset: 5000, // optional
},
product: "prod_xxx"
});
Then pass that price ID when creating the PaymentLink.
I still need to pass product?
My use case is :
I have custom priced products and I want my customers to pay using link
Yes, either pass a product ID, or you could create it on the fly on the price object like this:
product_data: {
name: "something"
// more optional parameters here
}
https://stripe.com/docs/api/prices/create?lang=node#create_price-product_data
I would recommend to:
- Create a product
- Create a price using that product
- Create a payment link using that price
Note that you can do all of that in the PAI or directly in the dashboard
Woops, API indeed ๐
But will it clutter the console products page?
Like every time I'm creating a payment link, a product will be created right?
It depends. If you reuse the same product ID, then no new product will be created.
Also note that once you create a PaymentLink, it can be reused many times, so you don't have to create a new one.
oh ok
Just to clarify my previous message:
- Create a product once
- Create a price using that product once
- Create a payment link using that price once
- Then send the payment link URL to as many user as needed
Cool!
I do have one more query
I have something similar happening for user subscription also
Like user can choose the payment cycle (monthly or yearly)
and choose a plan based on that
Like for basic monthly plan it will be 5$ every month.
But this can be overridden in the app
Like for first 2 months the admin can charge 2$ and last 3 months admin can charge 4$
Like the price is fully customisable.
Is this achievable using the same method?
or is there a better way?
@thick ether
Do you mean the admin can change the price of a specific subscription after the subscription was created?
Yes before payment ofc
Mostly admin will be setting the billing plans and stuff
user/customer will be having a call with sales team and basically the team will negotiate a plan.
It's not like user can choose the custom amount.
I'm still not sure I understand.
Do you want the admins to set the price for the subscription, and then create the Payment Link for that price? Or do you want customers to start a subscriptions with a Payment Link ,and then later update the price?
Just think of it like this.
Assume an admin from NetFlix team setting up a custom subscription plan for you. Like first 3 months you only have to pay 15$ and the 4th month onwards it will be 20$ .
Basically can we create custom amount for subscription and create future invoice based on that?
Ha got it! Then you need to use Subscription Schedules: https://stripe.com/docs/billing/subscriptions/subscription-schedules
That allow you to change the subscription price over time like you just described.
However that doesn't work with Payment Links.
Ok
Like first 3 months you only have to pay 15$ and the 4th month onwards it will be 20$ .
If you only need to change the price once (like in your example), then you could also use coupons. For example have a 20$ per month subscription with a 5$ off for the first 3 months. https://stripe.com/docs/api/coupons
ok
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
What do you mean by 'edit the payment'?
I'm confused, my colleague was talking about subscription schedules
And as they stated, they don't work with Payment Links
So what are you actually asking here?
Basically can we create custom amount for subscription and create future invoice based on that?
Payment Links do support custom amounts (https://stripe.com/docs/payments/checkout/pay-what-you-want) but they don't work with recurring payment right now
Learn how to accept tips and donations, or sell pay-what-you want products or services.
I was talking about this
@queen axle
Ok, then what is the question about that? That's just a generic PL creation flow
The user is able to change the payment amount when clicking on that link.
I can see a change amount button
see this link
@queen axle
Ok, because you must have created a price with the custom_unit_amount parameters: https://stripe.com/docs/api/prices/create#create_price-custom_unit_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Just use a different Price in the Payment Link
Ok thanks