I’m using Stripe’s API to create two subscriptions for the same customer, and I need both to:
- Have the same billing cycle date.
- Generate invoices at the exact same time (it's related I believe to my previous bullet).
I've tried setting the billing_cycle_anchor
of the second subscription to match the first one's period end date. The subscriptions are created on different days rather than simultaneously.
builder = builder.setBillingCycleAnchor(new Date(firstSubscription.getCurrentPeriodEnd() * 1000).toInstant().getEpochSecond());
Despite these efforts, there's a slight delay in invoice creation. It's odd because the first set of invoices in December had the same creation date, but the subsequent pairs in January and February were created a day apart (as shown in the screenshot below).
My only hunch is that it might be related to timezones — for example, if the subscription's billing cycle is close to midnight UTC.