#brent-atmb_api

1 messages · Page 1 of 1 (latest)

sour shellBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272442428028354614

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

covert sandalBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

balmy bridge
#

Hi there, no you can't set BillingCycleAnchor to a past date

#

Can you tell why you want to set BillingCycleAnchor to an earlier date?

lean hinge
#

we want to be able to generate invoices on a specific window e.g. 12 AM to 5 AM, but the billing period would be from the actual subscription start date 12:00 AM to the day before the invoices are generated 11:59:59 PM

balmy bridge
#

So the objective is to generate invoices at a specific time between 12 AM to 5 AM? (for example 1am ) on a certain day in every 3 months?

lean hinge
#

yes

#

sorry for whatever billing cycle e.g. Monthly, Yearly

balmy bridge
#

Ok, in this case you should define the BillingCycleAnchor to the future timestamp, for example 2024-09-12-01:00:00, and Stripe will create invoice at 1am on the 12th day every month.

lean hinge
#

so would that mean that the first invoice will still be generated e.g. today 12 August 2024 even if the BillingCycleAnchor would start on 2024-09-12-01:00:00?

#

and would that incur some pro-rated charges to the customer, given that the billing anchor date does not exactly match the subscription creation date by a few hours and minutes?

balmy bridge
#

Yes you are right, and yes it'll be prorated. You can also turn off proration if you want.

lean hinge
#

oh, so if we turn off the proration, the customer would just incur the same subscription fee within a month/year, just that the invoice would be able to be generated within our (merchant company) preferred window of 12:01 to 5 AM?

balmy bridge
#

Yes you are right. You can test it out in test mode with test clocks

lean hinge
#

ok thanks jack_stripe!

#

hi, our developer has tried it out

#

unfortunately, it did not work: "Turning off proration doesn't charge on the first cycle. It starts from the future billing anchor date."

balmy bridge
#

Ah, that's because

details here: https://docs.stripe.com/billing/subscriptions/billing-cycle#configure-proration-behavior

Ok, you need to use subscription schedule with 2 phases, and let schedule set the billing_cycle_anchor and turn off proration in 2nd phase.

    {
      items:[
        {
          price: YOUR_PRICE
          quantity:1
        }
      ],
      end_date: THE_DESIRED_BILLING_CYCLE_ANCHOR_IN_FUTURE
      
    },{
      billing_cycle_anchor: 'phase_start',
      items:[
        {
          price: YOUR_PRICE,
          quantity:1
        }
      ],
      proration_behavior: 'none'
    }
  ]```