> ## Documentation Index
> Fetch the complete documentation index at: https://docs.outseta.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Give a subscription a fixed end date

> Create a subscription that ends on a set date, or set or remove the end date of an existing one.

A subscription ends on a fixed date when it has an `ExpirationDate`. Outseta doesn't
bill it past that date, and when the date arrives it ends the subscription and sets
its `EndDate` to the `ExpirationDate`.

> [!NOTE]
>
> **Send `ExpirationDate`, not `EndDate`.** Outseta sets `EndDate` itself when a
> subscription ends, and calculates `RenewalDate` itself. A subscription request
> that includes `EndDate` is rejected with *"The renewal date has to be null if the
> end date is set."*

This applies to subscriptions billed by Outseta. With Stripe Billing, Outseta does
not run the renewals that end the subscription: set a cancellation date on the
subscription in Stripe instead.

## New subscription

Add the subscription with [Add a subscription to an account for the first
time](https://docs.outseta.com/api-reference/billing/add-a-subscription-to-an-account-for-the-first-time.md)
and include `ExpirationDate`. Leave out `EndDate` and `RenewalDate`.

```json theme={null}
{
  "Account": { "Uid": "wZmNw7Q2" },
  "Plan": { "Uid": "nB8kRZ3w" },
  "BillingRenewalTerm": 1,
  "ExpirationDate": "2027-03-31T00:00:00Z"
}
```

Outseta keeps the `ExpirationDate` as sent. The subscription renews every billing
term until then, and its first `RenewalDate` is never later than the
`ExpirationDate`. On a free plan with `BillingRenewalTerm` `1` (monthly), that means
a monthly renewal at no charge until the end date.

Without an `ExpirationDate`, the plan decides:

* if the plan has an `ExpirationDate`, the subscription gets that date;
* otherwise `Plan.ExpiresAfterMonths` applies: `0` means the plan never expires
  subscriptions, and a value `N` above `0` gives an `ExpirationDate` of the start
  date plus the plan's trial days plus `N` months.

## Existing subscription

Use [Set the renewal date or expiration date of the current
subscription](https://docs.outseta.com/api-reference/crm/set-the-renewal-date-or-expiration-date-of-the-current-subscription.md)
on the account and send the new `ExpirationDate`.

```
PUT /api/v1/crm/accounts/{accountUid}/extend-renewal
```

```json theme={null}
{
  "ExpirationDate": "2027-03-31T00:00:00Z"
}
```

* It acts on the account's current subscription. The account must be in the
  Subscribing, Cancelling, Trialing, CancellingTrial or PastDue stage, and it can't
  have a plan change scheduled to start later.
* If the new `ExpirationDate` is before the current renewal date, the renewal date
  moves to the `ExpirationDate`.
* Every request sets the expiration date. Without `ExpirationDate`, the existing
  expiration date is removed, except when `ToDate` is later than it: then the
  expiration date moves to `ToDate`. To remove the expiration date, send an empty
  body (`{}`). To change the renewal date (`ToDate`) and keep an expiration date,
  send both.
* `ToDate` is checked with the time of day you send, while `ExpirationDate` is
  first set to the time of day of the subscription's start. Send `ToDate` with the
  time of day of the current `RenewalDate`, or a `ToDate` on the same day as the
  `ExpirationDate` may be rejected as later than it.

> [!NOTE]
>
> **Changing the subscription doesn't set its end date.** [Change a subscription
> on an account](https://docs.outseta.com/api-reference/billing/change-a-subscription-on-an-account.md) with
> the same plan, `BillingRenewalTerm` and quantity only changes add-ons. A change to
> another plan creates a new subscription record. An upgrade, or any change while
> the account is in a trial, starts immediately. Any other change is scheduled for
> the current renewal date; pass `startImmediately=true` to start it now. A free
> subscription added with `firsttimesubscription` puts the account in the Trialing
> stage, so a change from it starts immediately.

## Related

* [Add a subscription to an account for the first time](https://docs.outseta.com/api-reference/billing/add-a-subscription-to-an-account-for-the-first-time.md)
* [Change a subscription on an account](https://docs.outseta.com/api-reference/billing/change-a-subscription-on-an-account.md)
* [Set the renewal date or expiration date of the current subscription](https://docs.outseta.com/api-reference/crm/set-the-renewal-date-or-expiration-date-of-the-current-subscription.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.