# Subscription routes: keep, pause, renew, resize

URL: /code/api/subscription/verbs · Id: `page:code/api/subscription/verbs`

> The Subscription Verbs keep, pause, renew, resize as api.sb routes, with inputs, result, refusals and an example.

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

### Subscription.keep
Keep takes back a cancel before the period closes, so the Subscription renews on its date at the same terms. [Verb page](/business/nouns/subscription/keep?interface=api).

```text
POST /{namespace}/subscriptions/{subscription}/keep
```

Path: `subscription`. Body, as JSON: the other inputs. Emits [`Subscription.kept`](/business/events/Subscription.kept).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The ending Subscription. |
| `offer` | [Offer](/business/nouns/offer) | No | The Offer to renew on, when the Customer took the save offer. |

**Returns**

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

**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. |
| Once the period has closed; a canceled Subscription starts again as a new one | [`refused`](/code/api/errors/refused) | Clear what the check names, then call it again. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV/keep \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "subscription": {
    "$id": "https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV",
    "$type": "Subscription",
    "status": "active"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Subscription.keep",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Subscription.pause
Pause stops billing and Entitlements on a Subscription until a date, without ending it. [Verb page](/business/nouns/subscription/pause?interface=api).

```text
POST /{namespace}/subscriptions/{subscription}/pause
```

Path: `subscription`. Body, as JSON: the other inputs. Emits [`Subscription.paused`](/business/events/Subscription.paused).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The active Subscription. |
| `until` | `date` | Yes | When billing resumes on its own. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The paused 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
curl -X POST https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV/pause \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"until":"2026-10-22"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "subscription": {
    "$id": "https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV",
    "$type": "Subscription",
    "status": "paused"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Subscription.pause",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Subscription.renew
Renew starts a Subscription’s next period and bills it at the Offer Version the Customer accepted. [Verb page](/business/nouns/subscription/renew?interface=api).

```text
POST /{namespace}/subscriptions/{subscription}/renew
```

Path: `subscription`. Emits [`Subscription.renewed`](/business/events/Subscription.renewed).

**Inputs**

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

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `invoice` | [Invoice](/business/nouns/invoice) | Yes | The Invoice for the new period. |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription in its new period. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| 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. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/subscriptions/sub_zgJUx08kwY/renew \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "invoice": {
    "$id": "https://api.sb/leaseline.app/invoices/inv_Ez0sMX4WOW",
    "$type": "Invoice",
    "total": {
      "amount": 29,
      "currency": "USD"
    },
    "due": "2026-10-22"
  },
  "subscription": {
    "$id": "https://api.sb/leaseline.app/subscriptions/sub_zgJUx08kwY",
    "$type": "Subscription",
    "status": "trialing"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Subscription.renew",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Subscription.resize
Resize changes how many units a Subscription holds and prorates the current period. [Verb page](/business/nouns/subscription/resize?interface=api).

```text
POST /{namespace}/subscriptions/{subscription}/resize
```

Path: `subscription`. Body, as JSON: the other inputs. Emits [`Subscription.resized`](/business/events/Subscription.resized).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `subscription` | [Subscription](/business/nouns/subscription) | Yes | The Subscription to change. |
| `quantity` | `integer` | Yes | The new unit count. |

**Returns**

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

**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
curl -X POST https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV/resize \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quantity":1}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "subscription": {
    "$id": "https://api.sb/leaseline.app/subscriptions/sub_whVFaHKWIV",
    "$type": "Subscription",
    "status": "active"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Subscription.resize",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```