Is there a way to a pull a report of upcoming charges in Stripe? - stripe-payments

I have a Stripe account and all my customers pay me through it, I have a monthly subscription, recurring payment, everything was set up. What I need is a way to forecast or project the upcoming charges for next month based on the recurring payments or subscriptions. Stripe is not providing that report so I was wondering if there is a way to pull this data and know what to expect to get paid for the next month.

Stripe can't provide you with a report on potential income as it's impossible to know if all your subscriptions' invoices will be paid on time.
If you want to get a rough estimate you could list all your active subscriptions and tally up the monthly amount of each Price linked to those subscriptions.

You can export a CSV of all active subscriptions by going to https://dashboard.stripe.com/subscriptions. I then imported it into Google Sheets, filtered out the subscriptions that are canceling. I then filtered for subscriptions with a Current Period End of today to the end of the month. So for example: with today being June 9, I filtered for subscriptions from June 9 - June 30. What's left is my expected subscription charges for the rest of the month. "Expected" being the keyword here because any of those subscribers could cancel at any time.

Related

Stripe subscription set billing date as first of each month

I'm using Stripe Checkout flow to collect the users' payment details and automatically collect the subscription. I have also implemented webhooks to listen to checkout.session.completed so that I can edit the subscription. What I want is as follows:
Say, the user registers on January 15th. I'm using metered billing, so the user pays $0.00 on the first invoice.
In webhooks, I apply a trial period of 7 days to the subscription like so stripe.subscriptions.update([id], {trial_end: [seven_days_into_future]}). So the billing anchor date on the subscription becomes the 22nd of each month.
However, I would like to set the billing anchor date as the first day of each month. So I would like the user to receive the first invoice for January 22-31 (prorated), and then get invoices for full calendar months onwards.
How do I achieve that?
I cannot set the billing_cycle_anchor to the desired date because it accepts only now and unchanged values...
If you're working with already created subscriptions, then you'll need to add trial periods to shift the billing_cycle_anchor:
https://stripe.com/docs/billing/subscriptions/billing-cycle#using-a-trial-to-change-the-billing-cycle
If you know exactly how you want to structure your trial and billing_cycle_anchor at the time the subscription is being created, then you can future-date the billing_cycle_anchor during creation:
https://stripe.com/docs/billing/subscriptions/billing-cycle#new-subscriptions

Pausing and unpausing a payment collection on stripe

I'm working on stripe subscription and trying to build a flow using which admin can pause and unpause the payment collection of customers.
To achieve this I'm using this from stripe documentations.
Now the major issue which I'm facing with this method is.
Suppose a customer is on monthly subscription and is billed on 1st of every month.
Admin has paused the customer's billing on 15th October and Unpaused it on 15th November.
Now the upcoming invoice shows that customer will be billed on 1st December for the upcoming cycle.
My questions are:
Is there any way I can charge customer for the period of 16th-30th November which customer used.(Somehow adjusting amount on the 1st December invoice)
And the period of 16th-31st October, for which Customer has already paid on 1st October, can be uncharged/adjusted somehow.
Thanks
Instead of pausing, which does not take into account prorated amounts or credits, I recommend canceling the Subscription instead of pausing it. You can use the prorate parameter when canceling Subscriptions to issue a credit to the Customer for the unused time.
Later, when you want to resume payments, create a new Subscription for the Customer and specify a billing_cycle_anchor set to the first of the month. That will charge them for the partial month up front followed by full monthly Invoices starting on the first of every month.

Stripe Start Date

How do you set the start date for a subscription? Many of our customers began using our service a few days before we could collect their payment information so we'd like to charge them for these additional days.
This is not something that the Subscriptions API supports today. You would need to charge your customer the full amount and then put them on a trial period until their next billing date.
The flow would look like this:
Create a Customer with the card token
Create an invoice item for the plan amount
Create a subscription and set them on a trial period until their next billing date using trial_end
The last step will create an invoice for the trial, automatically pull the pending invoice item into the invoice and charge the customer for that amount. Then, they won't be charged until the date you set in trial_end and each month moving forward on that date.

Stripe monthly subscription with annual payment?

What is the best way to subscribe my users to a plan that renews monthly yet bills yearly using stripe subscriptions, as i contacted Stripe's support and they said a plan with an interval of month and interval_count of 12 will not generate any events (ex: customer.subscription.updated event) until the end of the 12 months interval while i need these events to be generated on monthly basis.
The best solution here would be to subscribe the customer to a $0 monthly plan. This ensures that, each month, a new billing cycle starts and a new invoice is created. The invoice will be for $0 but send an invoice.created event to your webhook endpoint.
There, you can decide whether you need to bill the customer anything or not. If you don't, you simply ignore the event and the customer won't be charged anything. If you do, you will simply add an invoice item for the correct amount to this invoice. This is covered in the Invoices section of Stripe's documentation.
For the first invoice, you would add the invoice item first which means three steps:
Create the customer
Create the invoice item for the correct price
Create the subscription to the $0 monthly plan
The last step will automatically pull the invoice item in the invoice and charge them that amount as expected.
If you have follow up questions, I'd recommend talking to Stripe's support here.

Recurring billing with Stripe - will Subscriptions suffice?

My application allows a customer to purchase credits for later in-app use.
I want to enable customers to buy credits throughout the month, and only get billed at the end of the month.
Should I be using a Stripe Subscription at an amount that equals the price of one credit, and change the quantity according to the number of credits the customer purchased?
(After a successful invoice - I'll reset the subscription quantity to 0)
Is there a better solution? Perhaps some clever method of using Stripe Checkout?
Your proposed approach sounds reasonable.
I've not tried it but an alternative I can think of would use a free plan and the Invoice Items part of the API.
Create a free plan with amount with amount field set to 0. As far as I can see from the docs, all the subscription lifecycle webhooks should be triggered for Customers who're subscribed to the plan.
Through the month, create InvoiceItems for the Customer. According to the docs, at the end of the billing cycle, those InvoiceItems are added to the customer's invoice.
Sometimes you want to add a charge or credit to a customer but only actually charge the customer's card at the end of a regular billing cycle. This is useful for combining several charges to minimize per-transaction fees or having Stripe tabulate your usage-based billing totals.
Beyond that, you'll want to consider if you should have Stripe generate/email your invoices.
I don't think this is the way to go, because subscriptions are billed the first time among other things.
The recommanded way is: stripe doc: Place a hold on a card
summary
You first ask authorization for a certain amount (the max amount). Eg: 1000$
Your custommer buy 50 credits in the month
At the end of the month you charge the customer for 50$ (it can not be greater that the maximum you authorized in the first step)
That's all :)

Resources