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

# applySubscription



**mutation** `applySubscription(input: ApplySubscriptionInput!): ApplySubscription!`

## Arguments

**`input`**: `ApplySubscriptionInput!` (required)

## Returns

`ApplySubscription!`

**`entitlements`**: `[Entitlement!]`

The list of feature entitlements granted to the customer.

> Deprecated: Use 'entitlementsV2' field instead to retrieve both feature and credit entitlements.

---

**`entitlementsUpdatedAt`**: `DateTime`

When these entitlements last changed. The latest of the entitlement, customer and subscription update times; always set, also when the list is empty.

---

**`entitlementsV2`**: `[EntitlementUnion!]`

The list of polymorphic entitlements (feature and credit) granted to the customer.

---

**`subscription`**: `CustomerSubscription`

The updated subscription

## Examples

```graphql Mutation
mutation ApplySubscription($input: ApplySubscriptionInput!) {
  applySubscription(input: $input) {
    entitlements {
      accessDeniedReason
      creditRate {
        amount
        costFormula
        currencyId
        customCurrencyId
      }
      currentUsage
      customerId
      displayNameOverride
      entitlementUpdatedAt
    }
    entitlementsUpdatedAt
    entitlementsV2 {
      __typename
      ... on CreditEntitlement {
        accessDeniedReason
        currency {
          __typename
        }
        currentUsage
        entitlementUpdatedAt
        hasSoftLimit
        isGranted
      }
    }
    subscription {
      additionalMetaData
      addons {
        addon {
          __typename
        }
        addonId
        createdAt
        id
        price {
          __typename
        }
        quantity
      }
      billingCycleAnchor
      billingId
      billingLinkUrl
      billingPeriod
    }
  }
}
```

```json Variables
{
  "input": {
    "customerId": "string",
    "planId": "string"
  }
}
```

```json Response
{
  "data": {
    "applySubscription": {
      "entitlements": [
        {
          "accessDeniedReason": "BudgetExceeded",
          "creditRate": {
            "amount": 1.5,
            "costFormula": "string",
            "currencyId": "string",
            "customCurrencyId": "value"
          },
          "currentUsage": 1.5,
          "customerId": "string",
          "displayNameOverride": "string",
          "entitlementUpdatedAt": "value"
        }
      ],
      "entitlementsUpdatedAt": "value",
      "entitlementsV2": [
        {
          "__typename": "CreditEntitlement",
          "accessDeniedReason": "BudgetExceeded",
          "currency": {
            "__typename": "EntitlementCurrency"
          },
          "currentUsage": 1.5,
          "entitlementUpdatedAt": "value",
          "hasSoftLimit": true,
          "isGranted": true
        }
      ],
      "subscription": {
        "additionalMetaData": "value",
        "addons": [
          {
            "addon": {
              "__typename": "Addon"
            },
            "addonId": "string",
            "createdAt": "value",
            "id": "value",
            "price": {
              "__typename": "Price"
            },
            "quantity": 1.5
          }
        ],
        "billingCycleAnchor": "value",
        "billingId": "string",
        "billingLinkUrl": "string",
        "billingPeriod": "ANNUALLY"
      }
    }
  }
}
```


## Related topics

- [ApplySubscription](https://docs.stigg.io/graphql-reference/types/ApplySubscription.md)
- [Node.js SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md)
- [Checkout](https://docs.stigg.io/documentation/snap-in-widgets/checkout.md)
- [Rate Limits](https://docs.stigg.io/api-and-sdks/integration/graphql/rate-limits.md)
- [ApplySubscriptionInput](https://docs.stigg.io/graphql-reference/types/ApplySubscriptionInput.md)


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