# Subscription commands: resume, switch, unsubscribe

URL: /code/cli/subscription/verbs-resume · Id: `page:code/cli/subscription/verbs-resume`

> The Subscription Verbs resume, switch, unsubscribe as CLI commands, with inputs, result, refusals and an example.

Reference for [Subscription](/business/nouns/subscription), one group of [Subscription commands](/code/cli/subscription).

### Subscription.resume
Resume restarts billing and Entitlements on a paused Subscription before its pause ends. [Verb page](/business/nouns/subscription/resume?interface=cli).

```text
npx startup-builder do Subscription.resume --json '<input>' [--try | --send | --do]
```

Emits [`Subscription.resumed`](/business/events/Subscription.resumed).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The paused Subscription. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The active Subscription. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
npx startup-builder do Subscription.resume --json '{"subscription":"sub_0Ij6oxjf6k"}'
```

### Subscription.switch
Switch moves a Subscription to another Offer and prorates the current period. [Verb page](/business/nouns/subscription/switch?interface=cli).

```text
npx startup-builder do Subscription.switch --json '<input>' [--try | --send | --do]
```

Emits [`Subscription.switched`](/business/events/Subscription.switched).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription to move. |
| `offer` | [Offer](/business/nouns/offer) | Yes | The Offer to move to. |
| `effectiveAt` | `datetime` | No | When the move takes effect; moving existing Customers to a higher Price waits at least the notice period. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription on its new Offer. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The operation is part of an Offer the caller has not accepted or paid for. | [`payment-required`](/code/api/errors/payment-required) | Accept the Offer named in the response, then retry the call. | [Offer.accept](/business/nouns/offer/accept) |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
npx startup-builder do Subscription.switch --json '{"subscription":"sub_whVFaHKWIV","offer":"offer_2hzYe1ERo0"}'
```

### Subscription.unsubscribe
Unsubscribe ends a Subscription at the close of its current period, and the Customer keeps access until then. [Verb page](/business/nouns/subscription/unsubscribe?interface=cli).

```text
npx startup-builder do Subscription.unsubscribe --json '<input>' [--try | --send | --do]
```

Emits [`Subscription.unsubscribed`](/business/events/Subscription.unsubscribed).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription to end. |
| `reason` | `text` | No | Why the Customer leaves. |
| `comment` | `text` | No | The Customer’s own words, kept verbatim as the Evidence quote. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription, ending. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
npx startup-builder do Subscription.unsubscribe --json '{"subscription":"sub_whVFaHKWIV"}'
```