> ## 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.

# getSubscription

> Get subscription



**query** `getSubscription(input: GetSubscriptionInput!): CustomerSubscription!`

## Arguments

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

## Returns

`CustomerSubscription!`

**`additionalMetaData`**: `JSON`

---

**`addons`**: `[SubscriptionAddon!]`

**Arguments:**

- `filter`: `SubscriptionAddonFilter` = {} — Specify to filter the records returned.
- `sorting`: `[SubscriptionAddonSort!]` = [{direction: DESC, field: createdAt}] — Specify to sort results.

---

**`billingCycleAnchor`**: `DateTime`

Billing cycle anchor date

---

**`billingId`**: `String`

---

**`billingLinkUrl`**: `String`

---

**`billingPeriod`**: `BillingPeriod`

The billing period of the subscription

---

**`billingSyncError`**: `String`

---

**`budget`**: `BudgetConfiguration`

Budget configuration

---

**`budgetExceeded`**: `Boolean`

Indicates if the budget has been exceeded

---

**`cancelReason`**: `SubscriptionCancelReason`

---

**`cancellationDate`**: `DateTime`

---

**`contract`**: `SubscriptionContractDTO`

---

**`contractId`**: `String`

---

**`coupon`**: `SubscriptionCoupon`

Active coupon for this subscription

---

**`coupons`**: `[SubscriptionCoupon!]`

List of coupons for this subscription

---

**`createdAt`**: `DateTime`

---

**`crmId`**: `String`

---

**`crmLinkUrl`**: `String`

---

**`currentBillingPeriodEnd`**: `DateTime`

---

**`currentBillingPeriodStart`**: `DateTime`

---

**`customer`**: `Customer!`

---

**`customerId`**: `UUID`

---

**`effectiveEndDate`**: `DateTime`

---

**`endDate`**: `DateTime`

---

**`entitlements`**: `[SubscriptionEntitlementUnion!]`

The list of entitlements (feature and credit) associated with the subscription

---

**`environment`**: `Environment!`

---

**`environmentId`**: `UUID!`

---

**`experiment`**: `Experiment`

---

**`experimentInfo`**: `experimentInfo`

---

**`freeItems`**: `[FreeSubscriptionItem!]`

---

**`futureUpdates`**: `[SubscriptionFutureUpdate!]!`

---

**`id`**: `UUID!`

---

**`isCustomPriceSubscription`**: `Boolean`

> Deprecated: Use paymentCollectionMethod field and look for 'None' value

---

**`lastUsageInvoice`**: `SubscriptionInvoice`

---

**`latestInvoice`**: `SubscriptionInvoice`

---

**`minimumSpend`**: `SubscriptionMinimumSpend`

Minimum spend configuration

---

**`oldBillingId`**: `String`

---

**`outdatedPricePackages`**: `[String!]`

---

**`payingCustomer`**: `Customer`

---

**`payingCustomerId`**: `UUID`

---

**`paymentCollection`**: `PaymentCollection!`

---

**`paymentCollectionMethod`**: `PaymentCollectionMethod`

Payment collection method of the subscription

---

**`plan`**: `Plan!`

---

**`prices`**: `[SubscriptionPrice!]`

**Arguments:**

- `filter`: `SubscriptionPriceFilter` = {billingModel: {neq: MINIMUM_SPEND}} — Specify to filter the records returned.
- `sorting`: `[SubscriptionPriceSort!]` = [{direction: DESC, field: createdAt}] — Specify to sort results.

---

**`pricingType`**: `PricingType!`

---

**`refId`**: `String!`

> Deprecated: Renamed to subscriptionId

---

**`resource`**: `CustomerResource`

---

**`resourceId`**: `UUID`

---

**`salesforceId`**: `String`

---

**`scheduledUpdates`**: `[SubscriptionScheduledUpdate!]`

---

**`startDate`**: `DateTime!`

---

**`status`**: `SubscriptionStatus!`

---

**`subscriptionEntitlements`**: `[SubscriptionEntitlement!]`

> Deprecated: Use entitlements field instead which includes both feature and credit entitlements

**Arguments:**

- `filter`: `SubscriptionEntitlementFilter` = {} — Specify to filter the records returned.
- `sorting`: `[SubscriptionEntitlementSort!]` = [{direction: DESC, field: createdAt}] — Specify to sort results.

---

**`subscriptionId`**: `String!`

---

**`syncStates`**: `[SyncState!]`

---

**`totalPrice`**: `CustomerSubscriptionTotalPrice`

---

**`trialConfiguration`**: `TrialConfiguration`

Trial configuration

---

**`trialEndDate`**: `DateTime`

---

**`wasInTrial`**: `Boolean`

## Examples

```graphql Query
query GetSubscription($input: GetSubscriptionInput!) {
  getSubscription(input: $input) {
    additionalMetaData
    addons {
      addon {
        additionalMetaData
        billingId
        billingLinkUrl
        createdAt
        dependencies {
          __typename
        }
        description
      }
      addonId
      createdAt
      id
      price {
        billingCadence
        billingCountryCode
        billingId
        billingModel
        billingPeriod
        blockSize
      }
      quantity
    }
    billingCycleAnchor
    billingId
    billingLinkUrl
    billingPeriod
  }
}
```

```json Variables
{
  "input": {
    "subscriptionId": "string"
  }
}
```

```json Response
{
  "data": {
    "getSubscription": {
      "additionalMetaData": "value",
      "addons": [
        {
          "addon": {
            "additionalMetaData": "value",
            "billingId": "string",
            "billingLinkUrl": "string",
            "createdAt": "value",
            "dependencies": [
              {
                "__typename": "Addon"
              }
            ],
            "description": "string"
          },
          "addonId": "string",
          "createdAt": "value",
          "id": "value",
          "price": {
            "billingCadence": "ONE_OFF",
            "billingCountryCode": "string",
            "billingId": "string",
            "billingModel": "CREDIT_BASED",
            "billingPeriod": "ANNUALLY",
            "blockSize": 1.5
          },
          "quantity": 1.5
        }
      ],
      "billingCycleAnchor": "value",
      "billingId": "string",
      "billingLinkUrl": "string",
      "billingPeriod": "ANNUALLY"
    }
  }
}
```


## Related topics

- [Node.js SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md)
- [JavaScript SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/javascript.md)
- [Go SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/go.md)
- [JavaScript](https://docs.stigg.io/api-and-sdks/integration/frontend/javascript.md)
- [API Client (JS)](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/api-client-js.md)


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