#B33fb0n3

1 messages ยท Page 1 of 1 (latest)

tawny tundraBOT
vernal creek
#

Hello, we like to start new threads after a certain amount of time. Can you tell me about where that thread left off?

marsh stone
vernal creek
#

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?

marsh stone
#

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

vernal creek
#

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

marsh stone
#

sure: promo_1MxBUOD4LgnRPd5tLW3fp5AK

vernal creek
#

It should only apply once if your coupon's duration is set to once

marsh stone
#

do you have my secret key? ๐Ÿค”

vernal creek
#

I actually cannot access it. We redact it very well here!

marsh stone
#

oh, what else do you need from me?

vernal creek
#

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

marsh stone
#

yeah, because every new subscription should have it for the first month

vernal creek
#

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

marsh stone
#

Do I need to create everytime I create a new subscription a new coupon than?

vernal creek
#

Nope, you can reuse the coupon and promotion code

marsh stone
#

oh ok now I got the difference between these ๐Ÿ˜ฎ
By the way I just tested it and it also works, thanks!

vernal creek
#

Nice!