#patr0la_api

1 messages ¡ Page 1 of 1 (latest)

cunning bearBOT
ashen skiffBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

cunning bearBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1264895085892468808

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

bright flax
#

hi! hmm, I don't think it makes sense to specify the Discount ID again on the future phases. What I suggest you try is either

  • remove discounts in the second phase(then the discount will just keep applying, if it is "meant to" because the coupon has enough duration on it)
  • pass discounts[0][coupon] on the second phase instead

and then advance Test Clocks to see what happens. I think the first option is probably correct, but it depends on your use case and the exact coupon specifics.

oak lodge
#

remove discounts in the second phase(then the discount will just keep applying, if it is "meant to" because the coupon has enough duration on it)
but the error I am getting is for phase 0?

#

pass discounts[0][coupon] on the second phase instead
But won't that caouse invoice generated on update to not have discout?

oak lodge
#

Just to be clear what a I am trying to accomplish:

tenant has multiple module licences
each module license can have free trial (X months)
each module is separate subscription item with quanitiy(licence amount) and possible discount

when tenant decides to downgrade,
his subscription in converted to subscriptions schedule that will staring next cycle have reduced number of licences/canceled module

but at the same time it is possible that he will also have upgrade - new module or new licences - this should be billed immediately - when updating current phase

bright flax
#

hmm that's extremely complex

oak lodge
#

Yeah, I did not see any way to make this any easier. I could change to manually creating invoices, but that was something we wanted to avoid

bright flax
#

anyway I assume you get the error because your phase[0] doesn't actually match the existing state of the subscription(the phase has quantity 2 instead of 1) and thus the Discount ID can not reconcile with it; the first phase has to match the current state really, you can't change the subscription in the first phase, phase[0] is always just re-stating the existing state.

oak lodge
#

the first phase has to match the current state really
how should I then update current phase to trigger new invoice?

oak lodge
bright flax
cunning bearBOT
bright flax
#

if you want to bill immediately I wouldn't even use a SubscriptionScheudle, I'd just update the Subscription(with proration_behavior="always_invoice").

oak lodge
#

hmm, it could work tho

#

update subscription, invoice, migrate to subscription schedule