3
votes

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?

2

2 Answers

0
votes

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.

  1. 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.

  2. 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.

0
votes

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 :)