#Jayy

1 messages ยท Page 1 of 1 (latest)

solid rockBOT
frail cove
#

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?

plucky crown
#

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)

frail cove
#

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?

plucky crown
#

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

frail cove
#

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.

plucky crown
#

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

frail cove
#

In this case you should set proration_behavior to none and add an new invoice item for the full amount.

plucky crown
#

does adding a new invoice change the billing cycle?

frail cove
#

No it won't,

plucky crown
#

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 ?

frail cove
plucky crown
#

Alright thank you so much Jack ๐Ÿ™‚

solid rockBOT
weak lion
#

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