#Matt P
1 messages · Page 1 of 1 (latest)
Hi there! Could you share an example subscription ID?
Does the coupon you're using apply to any of the items on the subscription?
it does apply to the sub but not the amount they first pay
cus_MyZEpnoGsY2ZOn
sub_1N3452JyFlemKh0g9QUbe8vC
And I have confirmed that the coupon is applied to the sub before I checkout
Okay, so I see the subscription was created with a 20% off coupon first and the invoice was finalized with that 20% off coupon. the request to update the subscription with the new 30% off coupon comes after the invoice was finalized
but we are calling to update the coupon before we checkout
That doesn't matter in this case. If a subscription's collection_method is charge_automatically, a subscription's first invoice will be automatically finalized and paid when the subscription is created
Out of curiosity, why is the 30% off coupon not being added initially?
Because we want the user to be able to add and modify their sub coupon before they checkout
for this particular sub we automatically add a 20% coupon
so the sub is in an incomplete when I call to update the coupon
Roadrunner, what can we change the collection_method to so that it will not finalize the invoice until the user completes their checkout?
There are a few ways around this automatic finalization of the first invoice:
- You can create the subscription with
collection_method: send_invoice. This will give you a ~1hr period where the first invoice is in draft and you can update the coupon. If you go this route, you can update thecollection_methodafter the first payment is complete so the next payment is automatic
- If you want to keep
collection_method: charge_automaticallywith the first invoice, you can create a subscription with atrial_endset a few seconds into the future. The first invoice will be created for $0, and once the trial period is over in a few seconds, a second non-zero invoice will be created. This second invoice will have a ~1hr draft period and the coupon you update on the subscription should apply to this second invoice
- If you want to keep
collection_method: charge_automaticallywith the first invoice, you can create the subscription using a subscription schedule: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#start-subscription-future
When the schedule starts, the subscription will be active but the first invoice will be in draft state, and you'll have ~1hr before it's automatically finalized.
If the second method works for us I think that's the easiest. I'll work on implementing that in our back end. Thank you.