#Cjones-Subscription
1 messages ยท Page 1 of 1 (latest)
yes, as i understand the pre-sets are weekly, monthly yearly?
You can use a combination of https://stripe.com/docs/api/prices/create#create_price-recurring-interval and https://stripe.com/docs/api/prices/create#create_price-recurring-interval_count
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
For instance, you can set interval to week and interval_count to 2 for bi-weekly billing cycle.
and this works with metered billing too?
Yes
ok great thank you so much jack
No problem ๐
jack one more thing
if i set the interval count to say, 2
will it automatically set the billing anchor to the same time as instructed for a 1 week billing, + 1 more week
as we are currently setting custom anchors
The recurring interval and billing cycle anchor are two different things here
- The recurring interval tells Stripe how frequent the recurring payment is
- The billing cycle anchor tells Stripe when to start the billing
right ok, so if i set the interval_count to 2. will stripe make a draft /void or anything like that for the 1 interval before the 2nd ?
just wondering how it internally counts to that interval_count 2 if that makes senes
sense
https://stripe.com/docs/billing/subscriptions/upgrade-downgrade Stripe will attempt an immediate payment in this case. Let me walk you through an example here.
Like say you have a monthly subscription of USD 40
On the 1st week you want to change the interval to 2 weeks. so 4 weeks -> 2 weeks.
When the change happens, Stripe will perform a proration and charge your customer with the new plan immediately, the invoice will include
- The remaining 3 weeks of the old plan (-30 USD)
- The new plan (+20 USD)
= -10 USD will will be added to customer's credit balance.
sorry, i meant on creation
so when we set the interval, will it create a draft or void ? like this, say weekly and intrval count is 2
week 1 (draft), week 2 (invoice billed), week 3 (draft), week 4 (invoice billed)
or will this happen
week 2 (invoice billed), week 4 (invoice billed)
It'll be something like week 2 (invoice billed), week 4 (invoice billed)