#letscode_api

1 messages ยท Page 1 of 1 (latest)

deep meadowBOT
#

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

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

tropic yarrowBOT
granite bridge
#

hello there?

astral blade
#

Hi, let me help you with this.

#

What are you trying to achieve exactly?

granite bridge
#

We are giving our customers to pay amount in installments. EX: for 2000$, customer can pay 500$ every 2 months in 4 intervals

#

to achive this, we belive Stripe will work and created Subscription with Amount 500, iteration 2 months, and intervals 4

#

onces all intervals complited, expected to end the subscription (we are doing via our code, to check all installments done, then cancel the subscription)

#

Now we got an issue with last installment of every subscription: EX: sub_1OspxoFG3Dh3H5V4Y1ehm7G5

#

the last invoice showing only $8.20 instead of $500

#

i'm done, please go ahead

#

@astral blade are you there? Let me know if you need any more information

astral blade
#

It seems like the Subscription doesn't go through 4 complete cycles. Why are you setting backdate_start_date, billing_cycle_anchor exactly?

#

I would recommend listening to invoice.paid webhook event and count when 1 Subscription has 4 of those. After that you can mark the Subscription as cancel_at_period_end: true.

granite bridge
#

sometimes the payment was initiated what we expected. Lets in this case, the user needs to pay on Mar 1st. But the user paid on 9th. So in our case backdate can help on this and upcomming invoices

#

means raised first on any date, but next invoice should be Mar 1st + 2 months, May 1st

astral blade
#

Okay. In any case, the approach I described above would prevent any prorations.

granite bridge
#

it's not about subscription cancel, it's about last invoice raising only few cents

astral blade
#

I understand that. It's because the Subscription ends before the last month completes, so the customer is only charged for 1 day in the last month.

#

If you mark it as cancel_at_period_end instead, during the last month, it will charge the customer for the complete month, as expected.

granite bridge
#

got it

#

thank you. I'll try and let u know

astral blade
#

Happy to help.

granite bridge
#

I set .setCancelAtPeriodEnd(true)

#

but still showing the subscription sub_1Ot7IvFG3Dh3H5V4vGlQb0MA end date Sep 1st

astral blade
#

This Subscription seems to be managed by a SubscriptionSchedule. So you shouldn't be able to update it directly.

#

For the workflow I suggested, you don't need to use Subscription Schedules.

deep meadowBOT
sudden heath
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

granite bridge
#

If subscpritonschedule not work, how we can raise invoice? As my knowledge, subscriptions helps to customers do setup onetime payment and upcomming invoices will be pay without worry about customer to enter details

#

please correct if i'm wrong. We are looking, customer can enter details one time, and as EMI model

sudden heath
#

would you mind summarizing the context and what are you trying to achieve?

granite bridge
#

We are giving our customers to pay amount in installments. EX: for 2000$, customer can pay 500$ every 2 months in 4 intervals
to achive this, we belive Stripe will work and created Subscription with Amount 500, iteration 2 months, and intervals 4
onces all intervals complited, expected to end the subscription (we are doing via our code, to check all installments done, then cancel the subscription)
Now we got an issue with last installment of every subscription: EX: sub_1OspxoFG3Dh3H5V4Y1ehm7G5

#

vanya_stripe suggested add cancel_at_period_end, but it's not working: ID:sub_1Ot7IvFG3Dh3H5V4vGlQb0MA

#

let me know if you need any more information @sudden heath

sudden heath
#

iteration 2 months, and intervals 4
it's interval 2 months and iteration 4

granite bridge
#

my bad.. yes

sudden heath
granite bridge
#

Okay.. but what about only portion of amount generated for last invoice?

#

sub_1Ot7IvFG3Dh3H5V4vGlQb0MA

sudden heath
#

I'm not sure what do you mean

granite bridge
#

Please check subscption: sub_1Ot7IvFG3Dh3H5V4vGlQb0MA

#

it's showing, last invoice amount 8$ instead of $500

sudden heath
#

can you try to create a new subscription schedule