#sayori_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1313252697356632176
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, you should be able to set the coupon for eligibile products only, https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#set-eligible-products.
Then, after you create the promotion code, it should only apply to that product that is eligible to get the discount.
Right, I understand I can use the applies_to field to apply to a specific product. However, I have two prices on the same product; one is monthly and one is yearly. How can I create a promo code/coupon that only applies to the yearly price on that product?
Ah, you did say that on your initial ask. It sounds like you've already tried a few options. Let me look
Yeah, there is not an easy way here, you can't pass a restriction for a price when creating the promo code. As a work around, I think an amount would work better since it's the same product.
An amount? Can you expand on that?
oh, are you talking about this? https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#set-a-minimum-amount
didn't notice this earlier, but it does seem like it'd work as well
No, you pass an amount off when you create the coupon: https://docs.stripe.com/api/coupons/create#create_coupon-amount_off
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hmmm. If the coupon can't be restricted to either monthly or yearly price, then I imagine a flat amount_off price (e.g. $25 off) that would make sense for the yearly price would result in a $0 monthly price?
Yes, but you can offer those to the customer who will buy both monthly and yearly subscriptions. I think the easiest solution is to put them on two separate products and limit the coupon/ promo by the product.