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

# checkoutState



**query** `checkoutState(input: CheckoutStateInput!): CheckoutState!`

## Arguments

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

## Returns

`CheckoutState!`

**`activeSubscription`**: `CustomerSubscription`

The current active subscription

---

**`billingIntegration`**: `CheckoutBillingIntegration!`

Current billing integration

---

**`configuration`**: `CheckoutConfiguration`

The checkout configuration

---

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

The customer

---

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

The selected plan

---

**`resource`**: `CustomerResource`

The resource

---

**`setupSecret`**: `String!`

The billing setup secret

> Deprecated: Use billingIntegration.billingCredentials.setupSecret instead

## Examples

```graphql Query
query CheckoutState($input: CheckoutStateInput!) {
  checkoutState(input: $input) {
    activeSubscription {
      additionalMetaData
      addons {
        addon {
          __typename
        }
        addonId
        createdAt
        id
        price {
          __typename
        }
        quantity
      }
      billingCycleAnchor
      billingId
      billingLinkUrl
      billingPeriod
    }
    billingIntegration {
      billingCredentials {
        __typename
        ... on AirwallexCheckoutCredentials {
          __typename
        }
      }
      billingIdentifier
      credentials {
        accountId
        publicKey
      }
    }
    configuration {
      content {
        collectPhoneNumber
      }
      customCss
      palette {
        backgroundColor
        borderColor
        primary
        summaryBackgroundColor
        textColor
      }
      typography {
        body {
          __typename
        }
        fontFamily
        h1 {
          __typename
        }
        h2 {
          __typename
        }
        h3 {
          __typename
        }
      }
    }
    customer {
      additionalMetaData
      awsMarketplaceCustomerId
      billingCurrency
      billingId
      billingLinkUrl
      coupon {
        additionalMetaData
        amountsOff {
          __typename
        }
        billingId
        billingLinkUrl
        createdAt
        customers {
          __typename
        }
      }
    }
    plan {
      additionalMetaData
      awsMarketplacePlanDimension
      basePlan {
        __typename
      }
      billingId
      billingLinkUrl
      compatibleAddons {
        additionalMetaData
        billingId
        billingLinkUrl
        createdAt
        dependencies {
          __typename
        }
        description
      }
    }
    resource {
      createdAt
      customer {
        additionalMetaData
        awsMarketplaceCustomerId
        billingCurrency
        billingId
        billingLinkUrl
        coupon {
          __typename
        }
      }
      environmentId
      resourceId
      subscriptions {
        additionalMetaData
        addons {
          __typename
        }
        billingCycleAnchor
        billingId
        billingLinkUrl
        billingPeriod
      }
    }
  }
}
```

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

```json Response
{
  "data": {
    "checkoutState": {
      "activeSubscription": {
        "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"
      },
      "billingIntegration": {
        "billingCredentials": {
          "__typename": "AirwallexCheckoutCredentials"
        },
        "billingIdentifier": "RECEIVED",
        "credentials": {
          "accountId": "string",
          "publicKey": "string"
        }
      },
      "configuration": {
        "content": {
          "collectPhoneNumber": true
        },
        "customCss": "string",
        "palette": {
          "backgroundColor": "string",
          "borderColor": "string",
          "primary": "string",
          "summaryBackgroundColor": "string",
          "textColor": "string"
        },
        "typography": {
          "body": {
            "__typename": "FontVariant"
          },
          "fontFamily": "string",
          "h1": {
            "__typename": "FontVariant"
          },
          "h2": {
            "__typename": "FontVariant"
          },
          "h3": {
            "__typename": "FontVariant"
          }
        }
      },
      "customer": {
        "additionalMetaData": "value",
        "awsMarketplaceCustomerId": "string",
        "billingCurrency": "AED",
        "billingId": "string",
        "billingLinkUrl": "string",
        "coupon": {
          "additionalMetaData": "value",
          "amountsOff": [
            {
              "__typename": "Money"
            }
          ],
          "billingId": "string",
          "billingLinkUrl": "string",
          "createdAt": "value",
          "customers": [
            {
              "__typename": "Customer"
            }
          ]
        }
      },
      "plan": {
        "additionalMetaData": "value",
        "awsMarketplacePlanDimension": "string",
        "basePlan": {
          "__typename": "Plan"
        },
        "billingId": "string",
        "billingLinkUrl": "string",
        "compatibleAddons": [
          {
            "additionalMetaData": "value",
            "billingId": "string",
            "billingLinkUrl": "string",
            "createdAt": "value",
            "dependencies": [
              {
                "__typename": "Addon"
              }
            ],
            "description": "string"
          }
        ]
      },
      "resource": {
        "createdAt": "value",
        "customer": {
          "additionalMetaData": "value",
          "awsMarketplaceCustomerId": "string",
          "billingCurrency": "AED",
          "billingId": "string",
          "billingLinkUrl": "string",
          "coupon": {
            "__typename": "Coupon"
          }
        },
        "environmentId": "value",
        "resourceId": "string",
        "subscriptions": [
          {
            "additionalMetaData": "value",
            "addons": [
              {
                "__typename": "SubscriptionAddon"
              }
            ],
            "billingCycleAnchor": "value",
            "billingId": "string",
            "billingLinkUrl": "string",
            "billingPeriod": "ANNUALLY"
          }
        ]
      }
    }
  }
}
```


## Related topics

- [CheckoutState](https://docs.stigg.io/graphql-reference/types/CheckoutState.md)
- [CheckoutStateInput](https://docs.stigg.io/graphql-reference/types/CheckoutStateInput.md)
- [Checkout](https://docs.stigg.io/documentation/snap-in-widgets/checkout.md)
- [JavaScript SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/javascript.md)
- [Embed SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/embed.md)


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