# Restart subscription

POST `https://app.iteras.dk/api/customers/restartsubscription/`

The API key must allow "Change subscriber data".

Restarts a stopped subscription, or takes back a stop set for the future. The customer may be invoiced.

The subscription must either be stopped already or marked for a future stop.

A restart computes how much of the interrupted period went unused and, when that is a meaningful fraction, starts the new period with that remaining length instead of a full period. The first period is invoiced for the same fraction, so the customer is not charged twice for time already paid for. When the unused remainder is negligible, the restart creates a full period instead.

## Parameters

- `id` (string, required): ID of the customer the subscription belongs to.
- `subscription_id` (string, required): ID of the subscription to restart.
- `exclude_from_webhooks` (bool, Defaults to `false`): Set to `true` to keep every event the request causes from being sent to webhooks, invoice and payment events included, e.g. `"exclude_from_webhooks": true`. The events are still added to the history.

## Examples

```http
POST /api/customers/restartsubscription/ HTTP/1.1
Content-Type: application/json
```

```json
{
  "id": "12345",
  "subscription_id": "32142532"
}
```

## Return value

On success the endpoint returns the ID of the restarted subscription:

```json
{ "subscription_id": "32142532" }
```

## Errors

Invalid requests due to programming error, e.g. invalid JSON, returns 400.

A well-formed operation where a supplied value is invalid is not executed and returns an HTTP 422 error. Errors that are not specific to a field are returned with the empty string as key, e.g. an unknown subscription or a subscription that can't be restarted:

```json
{
  "": ["The subscription can't be restarted."]
}
```