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

# Update subscription

> Change the plan, billing cycle, seats or add-ons of an account; returns what changed, or a checkout URL when the change needs payment.

`updateSubscription(input: UpdateSubscriptionInput!): SubscriptionChange!`

Requires account.billing.manage.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`UpdateSubscriptionInput!`](https://veryfront.com/docs/cloud/graphql/types/updatesubscriptioninput) | Yes |

## Input fields

### input

[`UpdateSubscriptionInput`](https://veryfront.com/docs/cloud/graphql/types/updatesubscriptioninput)

| Field | Type | Required | Description |
| - | - | - | - |
| `type` | [`SubscriptionType!`](https://veryfront.com/docs/cloud/graphql/types/subscriptiontype) | Yes | |
| `cycle` | [`SubscriptionCycle!`](https://veryfront.com/docs/cloud/graphql/types/subscriptioncycle) | Yes | |
| `quantity` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | Seat quantity for licensed subscriptions |
| `serverQuantity` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | Recurring server add-on quantity |
| `sandboxQuantity` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | Recurring sandbox add-on quantity |
| `successUrl` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | URL to redirect to after successful payment |
| `cancelUrl` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | URL to redirect to if payment is canceled. |

## Response

Returns [`SubscriptionChange!`](https://veryfront.com/docs/cloud/graphql/types/subscriptionchange). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `status` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | One of subscription\_updated, seats\_updated, add\_ons\_updated or checkout\_created |
| `amount` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | Exact decimal amount due, without a currency suffix. Null when no amount is due or known. |
| `currency` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | ISO 4217 currency of amount in upper case. Null without an amount. |
| `checkoutUrl` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | Stripe checkout session URL when payment is required. Null when the change was applied in place. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation UpdateSubscription($input: UpdateSubscriptionInput!) {
  updateSubscription(input: $input) {
    status
    amount
    checkoutUrl
    currency
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "type": "free",
    "cycle": "monthly"
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


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