#taviksha-akar_api

1 messages ยท Page 1 of 1 (latest)

hazy stagBOT
#

๐Ÿ‘‹ 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/1278350984610840728

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

soft oriole
#

Hi, I have a use case that I'm unable so solve, here is what is happening.

  1. We're a subscription based business.
  2. At the time of creating a scheduled subscription, we only take 10% of the first invoice (first billing cycle) of the subscription.
  3. We then collection the reminder 90% 48 hours prior to subscription start date.

Now to achieve this, I've tried the following approaches -

Approach 1:

Assume subscription start date is 10th of Sep.
Phase 1:
Duration: 28th Aug - 8th Sep
Product: ProductA/monthly
Price: <using price override> to pass the value of 10%.
Needs to raise a invoice and collection payment for the 90%
Phase 2:
Duration: 8th Sep - 10th Sep
<At the point the reminder 90% amount needs to be collected>
Product: ProductAB/monthly
Price: <using price override> to pass the value of 90%.
Needs to raise a invoice and collection payment for the 90%
Phase 3:
Duration: 10th Sep - Forever
Product: ProductABA/monthly
Price: Default
Next billing should be on 10th Oct assuming it's a monthly subscription.
I tested this via simulation, it fails after phase 2, because after the execution of phase 2, it sets the subscription billing period to be 8th Sep - 8th Oct, rather then 10th of Sep - 10th of Oct. What am I doing wrong?

fallen saffron
#

Hello
If you reset billing cycle anchor and generate an invoice on 8th September then it is expected that the monthly billing cycle will be from 8th Sep to 8th Oct

#

I don't really grasp your flow.. Taking a step back;

What's your end goal? Is it to make sure you have 100% of the payment captured 2 days before the subscription starts?

soft oriole
#

if we don't reset it then bill is not raised on the 8th of Sep to collect the 90%

#

So how can I collect the 90% in the second phase and ensure the subscription start date is the date defined in phase 3

#

The goal is, take 10% payment of the first monthly invoice at the time of subscription creation, and reminder 90% 48 hours before the start date of the subscription

fallen saffron
#

Thinking out loud one option could be to reset the anchor one more time using trial days, you can add 2 trial days should move the anchor by 2 days

soft oriole
#

when setting up Phase 2, there is no option to offer free trial days

fallen saffron
#

Can you share the exact code you're using in your tests?

hazy stagBOT
#

๐Ÿง‘โ€๐Ÿ’ป How to format code on Discord

Inline code: wrap in single backticks (`)

This:

The variable `foo` contains the value `bar`.

Will turn into this:

The variable foo contains the value bar.

Code blocks: wrap in three backticks (```)

Also, you can specify the language after the first three backticks to get syntax highlighting.

This:

```javascript
function foo() {
return 'bar';
}
```

Will turn into this:

function foo() {
  return 'bar';
}```

Notes about **code blocks**:
- Specifying the language is optional (e.g., you can omit `javascript` in the example above)
  - If you don't specify the language you won't get syntax highlighting
- When you're inside a code block (after you type \`\`\`) the `Return`/`Enter` key will add a new line instead of sending your message
  - Once you end the code block `Return`/`Enter` works normally again

You can [read more about message formatting on Discord's website.](https://support.discord.com/hc/en-us/articles/210298617)
soft oriole
hazy stagBOT
soft oriole
#

No we are trying this via UI first.

fallen saffron
#

Umm that's just creating the subscription schedule though..
How exactly are you charging the 10 + 90 percent amount?

soft oriole
#

We have created two products for 10 and 90 percent and when creating subscription, we will override the price based on the 10 and 90% amounts. And then using those products when creating subscription using phases.

wooden laurel
#

Hello, hanzo is stepping out but I can help. I read through the thread but am not quite sure what exactly you are trying to figure out at the moment. I get what you are overall trying to do with your billing flow, can you tell me the exact issue within that that you are trying to solve right now?

vital plinth
#

Hi @wooden laurel - so our goal is -

  1. We want to create a scheduled subscription where we take 10% of the first monthly billing at the time of order creation and reminder 90% of the first monthly billing 48 hours ahead of subscription start date.

  2. We've tried to achieve this via Phases.

Phase 1:
Duration: 28th Aug - 8th Sep
Product: ProductA/monthly
Price: <using price override> to pass the value of 10%.
Needs to raise a invoice and collection payment for the 90%

Phase 2:
Duration: 8th Sep - 10th Sep
<At the point the reminder 90% amount needs to be collected>
Product: ProductAB/monthly
Price: <using price override> to pass the value of 90%.
Needs to raise a invoice and collection payment for the 90%

Phase 3:
Duration: 10th Sep - Forever
Product: ProductABA/monthly
Price: Default
Next billing should be on 10th Oct assuming it's a monthly subscription.

The problem arises in Phase 2. Since we need to bill for 90% at the start of Phase 2, we set the Reset Billing - True in the Stripe UI. This then means, the subscription start date now becomes the Phase 2 start date. Instead it ought to be Phase 3 start date.

wooden laurel
#

Thank you, that is very helpful. In phase 3 you can set the billing cycle anchor to be phase_start which would tell Stripe to set the billing cycle anchor to Sept 10th when it gets there.
https://docs.stripe.com/api/subscription_schedules/object#subscription_schedule_object-phases-billing_cycle_anchor
One thing to keep in mind is that by default we would try to bill for a fill new month at that point because that is how our subscriptions act when the cycle changes. So you will want to either include a one time 100% off coupon in phase 3 or add a negative invoice item via the phase's add_invoice_items parameter so that the invoice goes in to a paid state immediately without charging the user.
https://docs.stripe.com/api/subscription_schedules/object#subscription_schedule_object-phases-discounts
https://docs.stripe.com/api/subscription_schedules/object#subscription_schedule_object-phases-add_invoice_items