Why subscription ending_at fails with invalid_date when set to today
Last updated: May 27, 2026
Setting ending_at on a subscription via PUT /api/v1/subscriptions/:external_id fails with an invalid_date error when the date is set to the current calendar day, even if the timestamp is technically in the future. Lago's ending_at validation compares dates, not datetimes. An ending_at value of "tonight at 11 PM" fails if today's calendar date matches the date portion.
How it works
Lago enforces two constraints on ending_at using date-level (not datetime-level) comparison:
ending_atmust be strictly after today's calendar date. A timestamp later today returnsinvalid_date.ending_atmust be strictly aftersubscription_at's date, requiring at minimum a 1-day gap between subscription start and end.
This means the minimum valid ending_at is tomorrow's date at the earliest, regardless of the time of day.
How to resolve the issue
Set ending_at to a date that is at least one full calendar day in the future relative to both today and the subscription start date. If you need a subscription to end within hours, there is no supported workaround using ending_at alone. Use the termination endpoint (DELETE /api/v1/subscriptions/:external_id) instead, which takes effect immediately.
This article reflects guidance drawn from customer case resolutions. It is not officially supported documentation and may not apply to all situations.