pawel.podsiadly
pawel.podsiadly

Reputation: 171

Configuring Stripe subscriptions

I have a following use case I'm trying to configure in Stripe.

  1. I have a physical product that is delivered on Mondays every 2 weeks or once a month depending on the subscription option
  2. User during registration selects the first date of delivery

I want to charge the user right away and create a Stripe subscription during registration process, but later I want to charge only on Mondays.

So lets say a user registers on 09.09 (Wednesday) and selects 21.09 (Monday) as first delivery date, and chooses every 2 weeks option.

I would like him to pay for the first subscription right away, and charge him on 05.10 (Monday, two weeks after 21.09) for the next delivery.

I tried setting BillingCycleAnchor = 2020/09/21, but it prorates the first invoice. I also tried ProrationBehavior = "none", but then it doesn't charge at all until 2020/09/21

Is it possible to configure what I described above?

Upvotes: 0

Views: 491

Answers (1)

Nolan H
Nolan H

Reputation: 7409

You can achieve this by creating the subscription without the billing cycle anchor to bill for the first iteration today and then subsequently updating the subscription to adjust the future billing date(s).

Because the billing_cycle_anchor only allows setting to now during an update, you can achieve the shift alternatively by introducing a trial period until the next desired billing date. When the trial period ends, the subscription will bill again for the next period, and the date of the trial end becomes the billing anchor.

So you can make an update via the API like the following:

curl https://api.stripe.com/v1/subscriptions/sub_123 \
  -u sk_test_456: \
  -d trial_end=1600678800 \
  -d proration_behavior=none

Make sure you use proration_behavior=none to avoid giving the customer a credit for the trial period.

Upvotes: 2

Related Questions