Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Scotalia's avatar

Cashier / Stripe - Can not set trialDays() to less than 4 days

I am trying to create a weekly subscription for a project I am working on to be used as a low-cost 'trial' of the service (to avoid attracting free-member tire-kickers and uninterested subscribers).

I have set up the week subscription plan with 1-day trial in Stripe. I have created a different thread for original problem of failed subscriptions with trialDays() set to 0 or NULL (further details & errors can be seen here: https://laracasts.com/discuss/channels/laravel/cashier-stripe-issue-with-trialday-and-empty-trial-period-zero-days, but no answers yet). Since that thread I have been trying to set different values for trialDays() and have seen charges go through with any value of 4 or higher.

Can anyone explain to me or point me in the direction of an explanation for why i can not use NULL,0,1,2, or 3 for the trialDays() value? For a weekly subscription, I would prefer not to have a trial period at all (this throws errors) but i think a 4 day trial period for a weekly subscription is excessive. Any thoughts on how to get a 0 or 1-day trial working in Cashier/Stripe?

I have tried omitting the ->trialDays(#) method from the new subscription as well, but still get the error.

This is the error i receive for any ->trialDays() using Null, 0, 1, 2, or 3:

Stripe\Exception\InvalidRequestException
Invalid timestamp: must be an integer Unix timestamp in the future.

and this is my subscription :

$newMember = $user->newSubscription('eurotripr', $stripePlanId)->trialDays($numTrialDays)->create($stripeToken, [
                'email' => $request['membership-email'],
            ]);

Thanks for anyone that can provide assistance - this is really causing me to lose sanity :)

0 likes
1 reply
Scotalia's avatar
Scotalia
OP
Best Answer
Level 7

I am so dumb: My VirtualBox server time was not in sync with my host machine and was 4 days behind. So it looked like the values i was using were in the past 1, 2, and 3 days.

Note to self: it's always the simplest things I forget to test/check that take the longest to debug and cause the most stress.

Please or to participate in this conversation.