#Alimot

1 messages · Page 1 of 1 (latest)

fallen quailBOT
coarse wharf
#

Hi! Let me help you with this.

#

What's the error that you're getting?

#

Maybe you could share the request ID req_...?

torn valve
#
return await this.stripe.subscriptions.update(subscriptionId, {
                    items: [
                        {
                            id: subscriptionItems.data[0].id,
                            price: priceId,
                        },
                    ],
                    payment_behavior: 'default_incomplete',
                    proration_behavior: 'always_invoice',
                    expand: ['latest_invoice.payment_intent'],
                    coupon: coupon,
                });

coarse wharf
#

Let me check that on my side.

#

Could you please share the subscription ID?

#

sub_...

#

I tried to reproduce on my end and the coupon was applied
I can investigate further if I get your subscription ID

torn valve
#

This is a subId

sub_1M6zvTGyOBDbEOMCJakMCgTV

#

Is it only works on active (paid) subscriptions or doesn't matter?

coarse wharf
#

I don't see the request with the coupon
Is this the correct subscription ID?

torn valve
#

Yes it's correct, but of course i'm not testing in the live mode. It's on the Test mode

torn valve
coarse wharf
#

Okay, I just confirmed that the coupon is applied before the proration is calculated (e.g. basic plan $10, pro plan $20, discount -$5, proration invoice in the middle of the period = ($20 - $5) / 2 - $10 / 2 = $2.5)

#

I guess that's what you meant in the very beginning, correct?
How do you want it to work?

torn valve
copper lintel
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!