Skip to main content
Retrieves a list of credit grants for a customer or environment.

Query

query GetCreditGrants($input: GetCreditGrantsInput!) {
  creditGrants(input: $input) {
    edges {
      node {
        id
        amount
        status
        cadence
        expiryDate
        effectiveAt
        description
        createdAt
        customer {
          customerId
          name
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}
{
  "input": {
    "customerId": "customer-123"
  }
}
{
  "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
    }
  }
}

Parameters

input
GetCreditGrantsInput
required
Input parameters for credit grants query

Return Type

Returns a CreditGrantConnection with credit grant objects.

Common Use Cases

Show customers their credit grant history.
List and manage credit grants in admin interfaces.
Monitor grants approaching expiration.