#B33fb0n3
1 messages ยท Page 1 of 1 (latest)
Hello, we like to start new threads after a certain amount of time. Can you tell me about where that thread left off?
sure. Thats one of the last messages: #1115254862159040512 message
Can you see the thread? ๐
Yep I can see it. Do you have a question about how to create these subscriptions? Or how to add a promotion code while doing so?
no. I integrated it now and my creation looks like this:
const session = await stripe.checkout.sessions.create({
success_url: 'https://o.....de/ichoose?status=succeed',
cancel_url: 'https://o.....de/ichoose?status=canceled',
line_items: [
{price: 'price_1NErxE...', quantity: 1},
],
discounts: [
{
promotion_code: "promo_1MxBU...",
},
],
payment_method_collection: "always",
mode: 'subscription',
});
But the promotion code is applied to every month, not just the first
Can you give me the full ID of the promo code? IDs are safe to share here, other users can't do anything with them unless they have your secret key
sure: promo_1MxBUOD4LgnRPd5tLW3fp5AK
It should only apply once if your coupon's duration is set to once
do you have my secret key? ๐ค
I actually cannot access it. We redact it very well here!
oh, what else do you need from me?
It looks like you have that coupon's duration set to forever
Oh I can still look up info about your objects, I just meant that I cannot make API calls for you
yeah, because every new subscription should have it for the first month
ah ok, got it
The duration actually means the duration for each subscription
So having a duration of once means that every subscription can only use it once
Wheras forever means every subscription can use it forever
You can limit uses overal but that is a different setting
Do I need to create everytime I create a new subscription a new coupon than?
Nope, you can reuse the coupon and promotion code
There is a separate setting for the amount of times a coupon can be used https://stripe.com/docs/api/coupons/object#coupon_object-max_redemptions
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh ok now I got the difference between these ๐ฎ
By the way I just tested it and it also works, thanks!
Nice!