#Jayy
1 messages ยท Page 1 of 1 (latest)
but what if the client purchases something on the last 2 days of the month? will they be charged $0.6 for the 2 days only? -> I don't understand this part, can you elaborate?
if my billing cycle is on the 1st of each month, and i purchase something on the 28th. with the proration and invoicing the charge itself would be 60 cents (for a $10/month) product. stripe will charge me 30cents + 2.9% which means the transaction wont be feasible for the business
Also is the following possible:
they purchase something, regardless of what time of the month it is. we charge them the full amount and credit their account with the rest so that it's deducted on their next billing cycle. for example:
My monthly charge is $20 atm, i purhcase productB on the 15th (or what ever date) I invoice he customer for $10, and credit him with $5 on his next invoice (or what's not used of the month)
purchases something on the last 2 days -> what I don't understand is how your customer purchase it? is it a new invoice item? or a new report usage?
we update their subscriptions with a new item
await stripe.subscriptions.update(
stripeMonthlySubscriptionId!,
{
items: [
...addonsToAdd.map((m) => ({
price: m.price,
quantity: m.quantity,
})),
],
billing_cycle_anchor: 'unchanged',
proration_behavior: 'always_invoice',
}
)
that's how we handle it currently.
we just update their current subscription rather than creating a new one, which is better for our customer invoicing
Ok. your code looks good to me. So basically you immediately invoice your customer for the subscription change.
I'd suggest you to go ahead and try it out, and come back if the result is not what you are expecting.
I did try it ๐ what's happening now is we invoice them for what's left of their billing cycle
what i want to achieve is rather than charging what's left i want to charge the full amount for the product and possibly credit them fullamount - what's left. would it be possible and not too complex to achieve ?
as i'm not sure if stripe already has that option. i've been going through the documentations but thought i'd also ask here
In this case you should set proration_behavior to none and add an new invoice item for the full amount.
About the credit calculation, you can use https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice the upcoming invoice API to see what't the prorated amount, and use that to calculate the appropriate credit amount that you wish to apply for the customer.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
does adding a new invoice change the billing cycle?
No it won't,
alright so basically invoice the customer using:
https://stripe.com/docs/api/invoices/create
calculate the credit and then use this to issue a credit for the customer:
https://stripe.com/docs/api/credit_notes/create ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No, you should create an invoice item on the upcoming invoice https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Alright thank you so much Jack ๐
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!