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

# setExperimentOnCustomerSubscription



**mutation** `setExperimentOnCustomerSubscription(input: SetExperimentOnCustomerSubscriptionInput!): CustomerSubscription!`

## Arguments

**`input`**: `SetExperimentOnCustomerSubscriptionInput!` (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 Mutation
mutation SetExperimentOnCustomerSubscription($input: SetExperimentOnCustomerSubscriptionInput!) {
  setExperimentOnCustomerSubscription(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": {
    "id": "value",
    "relationId": "value"
  }
}
```

```json Response
{
  "data": {
    "setExperimentOnCustomerSubscription": {
      "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

- [SetExperimentOnCustomerSubscriptionInput](https://docs.stigg.io/graphql-reference/types/SetExperimentOnCustomerSubscriptionInput.md)
- [setExperimentOnCustomer](https://docs.stigg.io/graphql-reference/mutations/setExperimentOnCustomer.md)
- [SetExperimentOnCustomerInput](https://docs.stigg.io/graphql-reference/types/SetExperimentOnCustomerInput.md)
- [removeExperimentFromCustomerSubscription](https://docs.stigg.io/graphql-reference/mutations/removeExperimentFromCustomerSubscription.md)
- [RemoveExperimentFromCustomerSubscriptionInput](https://docs.stigg.io/graphql-reference/types/RemoveExperimentFromCustomerSubscriptionInput.md)


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