#WhySoAsync-invoices-coupons

1 messages · Page 1 of 1 (latest)

ripe bramble
#

So it sounds like the Subscription had already been paid for in this case. Are you updating a Subscription or creating a new one?

storm ridge
#

So when user is selecting the plan, i'm creating the subscription.

The subscription will have status Incompleted and will expire if it's not paid in 1 day.
I get the client secret, user fills the form with his data and he can apply a coupon.

When he applies coupon i'm just showing him a preview of the price.
When he presses pay,i'm updating first the subscription with coupon, trying to update the invoice so he wil pay 50% discount and after that i'm using client secret to pay the subscription.

#

The subscription update with coupon works, the invoice update doens't work.

ripe bramble
#

Do you have a request ID for the request that gave you the error?

storm ridge
#

req_OFoe9dQmK8xmlx

cursive crow
#

👋 stepping in as two-shoes has to step away.

#

So yeah, to accomplish what you want you should pass the coupon with the Subscription creation

storm ridge
#

Then i will need to get the priceId when the user selects a plan

Use it for invoice preview

And when user presses pay, it will create the subscription with the coupon , get the clientSecret and then pay the invoice right?

cursive crow
#

Yep