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

# Credit Grants

Retrieves a list of credit grants for a customer or environment.

## Query

<CodeGroup>
  ```graphql Query theme={null}
  query GetCreditGrants($input: GetCreditGrantsInput!) {
    creditGrants(input: $input) {
      edges {
        node {
          id
          amount
          status
          cadence
          expiryDate
          effectiveAt
          description
          createdAt
          customer {
            customerId
            name
          }
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
      totalCount
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "customerId": "customer-123"
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "creditGrants": {
        "edges": [
          {
            "node": {
              "id": "grant-123",
              "amount": 1000,
              "status": "ACTIVE",
              "cadence": "ONE_TIME",
              "expiryDate": "2024-12-31T23:59:59Z",
              "effectiveAt": "2024-01-01T00:00:00Z",
              "description": "Welcome bonus",
              "createdAt": "2024-01-01T00:00:00Z",
              "customer": {
                "customerId": "customer-123",
                "name": "Acme Corp"
              }
            }
          }
        ],
        "pageInfo": {
          "hasNextPage": false,
          "endCursor": "abc123"
        },
        "totalCount": 2
      }
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="input" type="GetCreditGrantsInput" required>
  Input parameters for credit grants query

  <Expandable title="properties">
    <ParamField body="customerId" type="String">
      Filter by customer ID
    </ParamField>

    <ParamField body="status" type="CreditGrantStatus">
      Filter by status: ACTIVE, PENDING, EXPIRED, VOID, EXHAUSTED
    </ParamField>

    <ParamField body="paging" type="CursorPaging">
      Pagination options
    </ParamField>

    <ParamField body="environmentId" type="UUID">
      Environment ID
    </ParamField>
  </Expandable>
</ParamField>

## Return Type

Returns a `CreditGrantConnection` with credit grant objects.

## Common Use Cases

<AccordionGroup>
  <Accordion title="Display grant history">
    Show customers their credit grant history.
  </Accordion>

  <Accordion title="Admin management">
    List and manage credit grants in admin interfaces.
  </Accordion>

  <Accordion title="Expiration tracking">
    Monitor grants approaching expiration.
  </Accordion>
</AccordionGroup>

## Related Operations

* [Credit Balance](/api-and-sdks/api-reference/queries/credit-balance) - Current balance
* [Create Credit Grant](/api-and-sdks/api-reference/mutations/create-credit-grant) - Grant credits
* [Void Credit Grant](/api-and-sdks/api-reference/mutations/void-credit-grant) - Void grant
