Price with wrong trial time, how to fix existing accounts that are already using this catalog?

60 views
Skip to first unread message

Pereira

unread,
Jul 7, 2021, 1:50:55 PM7/7/21
to Kill Bill users mailing-list
Hi, I created a product in a catalog but I set a wrong trial time, I set 6 months instead of 3 months.

Some accounts were created using this price, and when I uploaded the new version of the product (catalog), it's still using the old catalog with 6 months trial (I believe because of the effective date) instead of using the 3 months trial

How could I change the trial time of existing accounts? There are too many records, KAUI would not be an option to fix that

Thanks

stephane brossier

unread,
Jul 9, 2021, 7:04:51 PM7/9/21
to Pereira, Kill Bill users mailing-list
Create a new catalog entry with the 3-month trial and do a change of plan -- using a script to iterate over all account subscriptions exhibiting the issue.

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/54ff5e7d-eddb-4af2-8d9d-02926f4029aan%40googlegroups.com.
Message has been deleted
Message has been deleted

Pereira

unread,
Jul 12, 2021, 4:51:06 PM7/12/21
to Kill Bill users mailing-list
Got it, you're suggesting changing plans, in this case, let me elaborate a little bit more on my question:

I have 1 plan "SKU_123" with 2 versions (different effective dates)
Version 1 -> 6 Month Trial: Some accounts were created using this wrong version
Version 2 -> 3 Month Trial: Some accounts were created using this right version

In KAUI, when I check the accounts that were created using Version 1 I can't change their plan to Version 2, because they have the same name, I can't see the 2 versions, so how I'm supposed to change the plan to the newest version?

Thanks!

Pereira

unread,
Jul 12, 2021, 5:09:31 PM7/12/21
to Kill Bill users mailing-list
So considering that it doesn't seem possible to change a plan from one subscription to a newer version (same plan), considering we have a plan with different versions and we want to change to a newer version (the right one).

Is there any way to do this? Changing some date in the database to use the most current version?

stephane brossier

unread,
Jul 12, 2021, 8:06:13 PM7/12/21
to Pereira, Kill Bill users mailing-list
Changing plan with the same name -- e.g to pick a newer version -- is certainly supported using the api. I did not check Kaui, I would think it is supported too, but perhaps not.


Pereira

unread,
Jul 12, 2021, 11:54:44 PM7/12/21
to Kill Bill users mailing-list
Unfortunately, I can't see this option in KAUI or existing APIs. 

Is there any way to change some date (the effective date of some entity) for the KB to start using the newer version?

Because as I understand it, the plan is the same for both subscriptions versions (old and new), but I don't know based on what date the KB decides which version to use for that subscription, if I knew that I might be able to change it and have the expected result.

Would you have some input on that?
Thanks!

stephane brossier

unread,
Jul 13, 2021, 9:16:12 PM7/13/21
to Pereira, Kill Bill users mailing-list
Each catalog version has an effective date - Kill Bill will choose the right version based on the effective date:

   V1 | Cr | V2 | Chg

  • first catalog effeDt = V1
  • CREATE subscription will use V1
  • second catalog effeDt = V2 (Same Plan name but with new attributes)
  • CHANGE of PLAN will pick V2

Hope this helps.


Pereira

unread,
Jul 14, 2021, 10:07:24 AM7/14/21
to Kill Bill users mailing-list
We realized there's a table "subscription_events" in KB, looks like it basically stores the "plan phases" for a given account.
When we create an account with 6 months free plan, there are 2 entries

  • [...]A-trial entry: That basically tells when the trial phase starts (the same date when the account was created in our case)
  • [...]A-fixedterm entry: That basically tells when the "billing" phase starts, if we check, it only starts 6 months after the trial phase (previous record)

With this in mind, our approach was to modify the [...]A-fixedterm entry by subtracting 3 months, so that the billing phase will start 3 months earlier, so we will have the expected result of having only 3 months free

update subscription_events set effective_date = (effective_date - interval '3 month') where account_record_id = XXX and phase_name = 'XXXX_A-fixedterm';

Apparently, it worked, by advancing months we could see the "billing phase" starts 3 months early.
Can you think of any side effects with this approach?

stephane brossier

unread,
Jul 14, 2021, 7:03:37 PM7/14/21
to Pereira, Kill Bill users mailing-list
Modifying the state in the tables directly is quite dangerous - you are playing with fire. Perhaps it works, perhaps it does not... Using the api the way I suggested is a much safer approach.

Reply all
Reply to author
Forward
0 new messages