#[LBG] India - sub field

1 messages · Page 1 of 1 (latest)

south crow
#

What version of the API are you using?

woven minnow
#

What's the default one ?Latest ?

south crow
#

Nah it'll depend when you join

#

Also on the dashboard

woven minnow
#

I'm on 2019-05-16

#

I can upgrade

south crow
#

Since you are on an earlier version than 2019-12-02, it is appearing

#

No need to upgrade though unless you want to

woven minnow
#

I also noticed another difference for a subscription object created from a Checkout Session in subscription mode VS a subscription created via API call : the "billing" field

#

Is that a field for backward compatibility as well?

south crow
#

Hm can you share an example id?

woven minnow
#

sub_1KnNMILJLkeHRLt1u8fDfPId

#

"billing": "charge_automatically",

graceful plover
#

Hello! I'm taking over and catching up now...

woven minnow
#

Hi

graceful plover
woven minnow
#

evt_1KnOerLJLkeHRLt1PzfkaZCs

graceful plover
#

Thanks! It looks like you're seeing that in the event data itself at the top, but that's not what was actually sent to your webhook endpoint. If you look at the event data that was sent to your endpoint below you can see the field has been renamed to "collection_method": "charge_automatically",

woven minnow
#

Oh ok my bad

#

Thanks

graceful plover
#

This is likely due to a mismatch between your default API version 2019-05-16 and your webhook endpoint's API version 2020-08-27

woven minnow
#

I'll upgrade the API version to the latest tomorrow

graceful plover
woven minnow
#

Ok, I think it's time to upgrade as we are updating all our Stripe workflows

#

Other question : we are currently migrating the subscription creation from an API call to a Session in subscription mode. For a subscription that is active (after a trial of X days), we cannot adjust the trial end, that is logic, so how can we offer customers a subscription ? Let's say I want to offer a month, for free, to a customer that has an active sub

#

What would be the best way ?

graceful plover
#

So you're saying a Susbcription started with a trial, the trial ended so now the Subscription is active, and now you want to give them another trial period?

woven minnow
#

Not a trial

#

But a way to offer the customer a month

#

For free

graceful plover
#

Usually we would recommend using a trial for that, but you could also use a Customer credit balance or a coupon/discount for it as well.

woven minnow
#

You can create a new trial period for an existing and active subscription ? 😮

graceful plover
#

Yep!

woven minnow
#

So let say a customer as an active subscription and paid 4 months of subscription already. The trial started January 1st and ended the 10th of January (10 days). The billing cycle would be on the 10th of the month then. He paid for 4 months, Jan-Feb, Feb-Mar, Mar-Apr and Apr-May. If I want to offer him a month for free, I can update the trial that started the 1st of January to end the 10th of June ? So the customer does not pay May-June

#

Seems weird as it breaks the trial "history" no ?

graceful plover
#

Yes, it would overwrite the previous trial history. When you set trial_end on an existing Subscription it begins the trial immediately and sets it to end at the trial_end timestamp you specify. If you want to keep track of historial trial information I recommend you store that information in your own system.

#

So in your example you would likely want to update the Subscription with a new trial_end timestamp on May 1st and set the trial_end timestamp to be on June 1st.

woven minnow
#

Really clear, noted

#

What if I want to use Credit Balance ?

#

Does a subscription created through a Session would first check if a Credit Balance > 0 and first pay this balance ?

#

An integer amount in cents that represents the customer’s current balance, which affect the customer’s future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.

#

If a customer has -10€ in Credit Balance and has to pay a subscription 34,80€ (including vat), will he pay 24.80€ ?

graceful plover
#

Yep, the Customer's credit balance will automatically be applied to their next Invoice.

#

Including Invoices generated by a Subscription.

#

Yep, that's correct.

woven minnow
#

Ok thanks ! I'll run tests and will come back if more questions

#

Thank you 🙂