#some1ataplace
1 messages · Page 1 of 1 (latest)
Hello some1ataplace, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• https://discord.com/channels/841573134531821608/1163953716379000923, 2 days ago, 15 messages
• https://discord.com/channels/841573134531821608/1163904071812517898, 2 days ago, 4 messages
• https://discord.com/channels/841573134531821608/1163885668380987463, 2 days ago, 14 messages
• https://discord.com/channels/841573134531821608/1163877541942153217, 2 days ago, 4 messages
• https://discord.com/channels/841573134531821608/1163702730070708294, 2 days ago, 12 messages
• https://discord.com/channels/841573134531821608/1163629119238590545, 2 days ago, 55 messages
• https://discord.com/channels/841573134531821608/1163466479916830820, 3 days ago, 61 messages
• https://discord.com/channels/841573134531821608/1163285889041059842, 3 days ago, 6 messages
• https://discord.com/channels/841573134531821608/1162494998399422534, 6 days ago, 82 messages
• https://discord.com/channels/841573134531821608/1162484543773741118, 6 days ago, 13 messages
• https://discord.com/channels/841573134531821608/1162020266830991380, 7 days ago, 51 messages
Yeah I understand your needs but unfortunately we can only limit to the Product Ids for now
Would making one Price per Product feasible for you?
Ah darn what a shame thank you though. I was thinking of doing that or maybe just giving free trials instead idk.
It kind of stinks though because I have 1 subscription product which is basically the same thing but 2 different prices
But different intervals - year versus monthly subscription
Thank you though. I may come back in about 1-2 hours to ask something else but idk yet.
Yes feel free to. I do agree it makes more sense to have one Product if that represents your business better. Going that path, you would need to control the Price Coupon can apply to from your end (like writing a conditional logic before applying coupon)
Just thought of something: Can a user buy the cheaper monthly coupon promo code but then use it on the more expensive yearly price id subscription since it comes from the same product?
Can they "buy" promo code? I thought promocode is something you give to them
Yes that is right. They sort of buy the coupon and get a promo code created for that coupon that they can use like a gift card.
Ah okie I see. Yeah that would work (test it!)
Yea but I just worry if they buy the coupon for the same product id they can use the cheaper one on a more expensive subscription
Yes that would be possible to them (test in on Test mode 😅) Like you gave them 20% off Coupon for a Product X, and it can be applied to both Price A monthly and Price B annual
unless maybe I use metadata to specify which one the coupon is for - yearly or monthly.
Yes that's right I have to account for that scenario
So you want to prevent them before applying
Yep
Store the Price Id in metadata, and matching them before applying
I will give it a try. Thanks. Maybe I will talk to you later if something comes up lol.
So when using stripe checkout with the coupon promo code with the metadata of which price id it is, how would I differentiate in checkout or throw an error or something if the user who receives the gift promo code tries using the wrong coupon promo code for the price id?
Before creating the Checkout Session, you have the Price Id and the Coupon Id, right? Compare that Price Id and the metadata inside the Coupon
ahh makes sense ty
But now I am wondering though and am confused. I have both the price id and coupon id from the stripe dashboard. Not every user will provide a coupon code in their checkout session. That would imply I have the user enter the promo code twice? Once before the checkout session and during the checkout session?
The user selects the monthly membership from a form though as of right now
Coupon and Promotion code are 2 things. You can pre-select a Coupon when you create a CheckoutSession, and your customer can input a promotion code during the session. If you want to have full control, just use Coupon and disable Promotion Code
Right that makes sense. I just don't know how to do the comparison before creating the checkout session
Retrieve Coupon API, get its metadata's Price Id, then compare with the Price Id you are about to create the CheckoutSession
coupon = stripe.Coupon.retrieve("Z4OV52SU")
coupon_price_id = coupon.metadata.price_id
if coupon_price_id = 'yearly price id':
stripe.checkout.Session.create(
success_url="https://example.com/success",
line_items=[
{
"price": 'yearly price id',
},
],
mode="payment",
)
I did not test this but something like this?
It just feels weird to me to do it that way
Yeah, just play around in Test mode 🙂