stripe-java: billing_cycle_anchor cannot be later than next natural billing date

Hi Team, I am using 2018-02-06 LATEST version on Stripe API in my integration. I am trying to achieve trial with Combining trials with billing cycle anchor feature for my subscriptions. My plan is created with monthly interval and 30 day free trial. So when I subscribe to a plan with customer profile I pass “trial_end” to next 30 days of current date. So from current date (lets say 21 feb 2018) i add up 30 days it becomes 23 march 2018. I set my billing_cycle_anchor to 1 april 2018. What i want is the user to have trial till 23 march and then i create a prorated billing for next 24 to 31 march 2018. Then my billing cycle to start from 1 april 2018. My next billing date is becoming 21 march 2018 where for 30 days trial it should be 23 march. But I get error when I make subscription call

{ "trial_end": "1521809805", "items": { "0": { "quantity": "1", "plan": "thanks-1000-emp-monthly" } }, "prorate": "true", "billing_cycle_anchor": "1522587405", "customer": "cus_CMgW8WDANR2Nx0", "billing": "charge_automatically" }

Response Body { "error": { "type": "invalid_request_error", "message": "billing_cycle_anchor cannot be later than next natural billing date (1521637005) for plan", "param": "billing_cycle_anchor" } } Can you help me what is wrong in my understanding?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@mjain1990 did you find a resolution to this? I have been using it with similar context for awhile.

don’t need help, I use trial to delay the subscription for now. to you and support team, if this issue has been opened here that’s because the doc is not clear and looks like a bug. so please modify the doc to be less confused and less people will be confused.

There should be an easier way to manage this. I understand one way to solve this. Set billing_cycle_anchor to current-date And set trial_end_date to billing-cycle-start-date

I guess this should solve it. But I still feel it could be better to just set any anchor date in future. For example, we are not providing any trial, its just that subscription starts 2 months from now, and I need to collect weekly payment. I am forced to use the trial field when it doesn’t make sense at all in my case.

@remi-stripe so why in stripe api doc it says: billing_cycle_anchor: “A future timestamp to anchor the subscription’s billing cycle. This is used to determine the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. The timestamp is in UTC format.” if we cannot set billing_cycle_anchor to a future timestamp when the doc says it’s possible?