# Subscription methods: resume, switch, unsubscribe

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

> The Subscription Verbs resume, switch, unsubscribe as typed SDK methods, with inputs, result, refusals and an example.

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

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

```ts
interface SubscriptionVerbs {
  resume(input: SubscriptionResumeInput, options?: SB.CallOptions): SB.Call<Subscription>
}
```

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**

```ts
import { $ } from 'startup-builder'

const subscription = await $.Subscription.resume({ subscription: 'sub_0Ij6oxjf6k' })
```

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

```ts
interface SubscriptionVerbs {
  switch(input: SubscriptionSwitchInput, options?: SB.CallOptions): SB.Call<Subscription>
}
```

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**

```ts
import { $ } from 'startup-builder'

const subscription = await $.Subscription.switch({ 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=sdk).

```ts
interface SubscriptionVerbs {
  unsubscribe(input: SubscriptionUnsubscribeInput, options?: SB.CallOptions): SB.Call<Subscription>
}
```

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**

```ts
import { $ } from 'startup-builder'

const subscription = await $.Subscription.unsubscribe({ subscription: 'sub_whVFaHKWIV' })
```