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

# Get a list of credit grants

> Retrieves a paginated list of credit grants for a customer.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/stigg/openapi.documented.yml get /api/v1/credits/grants
openapi: 3.0.0
info:
  title: Stigg API
  description: Stigg API documentation
  version: 7.80.3
  contact: {}
servers:
  - url: https://api.stigg.io
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Customers
    description: Operations related to customers
  - name: Subscriptions
    description: Operations related to subscriptions
  - name: Coupons
    description: Operations related to coupons
  - name: Bulk Import
    description: Operations related to import of customers and subscriptions
  - name: Usage
    description: Operations related to usage & metering
  - name: Promotional Entitlements
    description: Operations related to promotional entitlements
  - name: Products
    description: Operations related to products
  - name: Features
    description: Operations related to features
  - name: Addons
    description: Operations related to addons
  - name: Plans
    description: Operations related to plans
  - name: Credit grants
    description: Operations related to credit grants
  - name: Credit ledger
    description: Operations related to credit ledger
  - name: Custom currencies
    description: Operations related to custom currencies
paths:
  /api/v1/credits/grants:
    get:
      tags:
        - Credit grants
      summary: Get a list of credit grants
      description: Retrieves a paginated list of credit grants for a customer.
      operationId: CreditGrantController_getCreditGrants
      parameters:
        - name: after
          required: false
          in: query
          description: Return items that come after this cursor
          schema:
            format: uuid
            type: string
        - name: before
          required: false
          in: query
          description: Return items that come before this cursor
          schema:
            format: uuid
            type: string
        - name: limit
          required: false
          in: query
          description: Maximum number of items to return
          schema:
            minimum: 1
            maximum: 100
            default: 20
            type: integer
        - name: customerId
          required: true
          in: query
          description: Filter by customer ID (required)
          schema:
            maxLength: 255
            type: string
        - name: resourceId
          required: false
          in: query
          description: >-
            Filter by resource ID. When omitted, only grants without a resource
            are returned
          schema:
            maxLength: 255
            type: string
        - name: currencyId
          required: false
          in: query
          description: Filter by currency ID
          schema:
            maxLength: 255
            type: string
        - name: createdAt
          required: false
          in: query
          description: 'Filter by creation date using range operators: gt, gte, lt, lte'
          schema:
            properties:
              gt:
                type: string
                format: date-time
                description: Greater than the specified createdAt value
              gte:
                type: string
                format: date-time
                description: Greater than or equal to the specified createdAt value
              lt:
                type: string
                format: date-time
                description: Less than the specified createdAt value
              lte:
                type: string
                format: date-time
                description: Less than or equal to the specified createdAt value
            additionalProperties: false
            type: object
        - name: X-ACCOUNT-ID
          in: header
          description: >-
            Account ID — optional when authenticating with a user JWT (Bearer
            token); falls back to the user's first membership. Ignored for
            API-key auth.
          required: false
          schema:
            type: string
        - name: X-ENVIRONMENT-ID
          in: header
          description: >-
            Environment ID — required when authenticating with a user JWT
            (Bearer token) on environment-scoped endpoints. Ignored for API-key
            auth (env is intrinsic to the key).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A paginated list of credit grant objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditGrantListResponseDto'
              examples:
                default:
                  value:
                    data:
                      - id: cred-grant-abc123
                        displayName: Monthly credits
                        amount: 1000
                        consumedAmount: 250
                        grantType: PROMOTIONAL
                        sourceType: null
                        priority: 1
                        effectiveAt: '2024-01-01T00:00:00.000Z'
                        expireAt: '2024-12-31T23:59:59.000Z'
                        voidedAt: null
                        metadata: {}
                        cost:
                          amount: 0
                          currency: usd
                        comment: null
                        customerId: customer-123
                        resourceId: null
                        currencyId: credits
                        invoiceId: null
                        latestInvoice: null
                        paymentCollection: NOT_REQUIRED
                        status: ACTIVE
                        createdAt: '2025-10-26T10:00:00.000Z'
                        updatedAt: '2025-10-26T10:00:00.000Z'
                    pagination:
                      next: c9b0a382-5b7d-4d32-9f62-8c4e1a7b3d9f
                      prev: a1d4e8f2-6c3b-4a9e-b5f7-2d8c9e0f1a3b
        '400':
          description: bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadInputErrorResponseDto'
        '401':
          description: User is not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedErrorResponseDto'
        '403':
          description: User is not allowed to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponseDto'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsErrorResponseDto'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Stigg from '@stigg/typescript';


            const client = new Stigg({
              apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const grantListResponse of
            client.v1.credits.grants.list({ customerId: 'customerId' })) {
              console.log(grantListResponse.id);
            }
        - lang: Python
          source: |-
            import os
            from stigg import Stigg

            client = Stigg(
                api_key=os.environ.get("STIGG_API_KEY"),  # This is the default and can be omitted
            )
            page = client.v1.credits.grants.list(
                customer_id="customerId",
            )
            page = page.data[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stiggio/stigg-go\"\n\t\"github.com/stiggio/stigg-go/option\"\n)\n\nfunc main() {\n\tclient := stigg.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.V1.Credits.Grants.List(context.TODO(), stigg.V1CreditGrantListParams{\n\t\tCustomerID: \"customerId\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: |-
            package io.stigg.example;

            import io.stigg.client.StiggClient;
            import io.stigg.client.okhttp.StiggOkHttpClient;
            import io.stigg.models.v1.credits.grants.GrantListPage;
            import io.stigg.models.v1.credits.grants.GrantListParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    StiggClient client = StiggOkHttpClient.fromEnv();

                    GrantListParams params = GrantListParams.builder()
                        .customerId("customerId")
                        .build();
                    GrantListPage page = client.v1().credits().grants().list(params);
                }
            }
        - lang: Ruby
          source: |-
            require "stigg"

            stigg = Stigg::Client.new(api_key: "My API Key")

            page = stigg.v1.credits.grants.list(customer_id: "customerId")

            puts(page)
        - lang: C#
          source: |-
            using System;
            using Stigg.Client;
            using Stigg.Client.Models.V1.Credits.Grants;

            StiggClient client = new();

            GrantListParams parameters = new() { CustomerID = "customerId" };

            var page = await client.V1.Credits.Grants.List(parameters);
            await foreach (var item in page.Paginate())
            {
                Console.WriteLine(item);
            }
        - lang: CLI
          source: |-
            stigg v1:credits:grants list \
              --api-key 'My API Key' \
              --customer-id customerId
components:
  schemas:
    CreditGrantListResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                maxLength: 255
                description: The unique readable identifier of the credit grant
              displayName:
                type: string
                maxLength: 255
                description: The display name of the credit grant
              amount:
                type: number
                description: The total credits granted
              consumedAmount:
                type: number
                description: The total credits consumed from this grant
              grantType:
                type: string
                enum:
                  - PAID
                  - PROMOTIONAL
                  - RECURRING
                  - OVERDRAFT
                description: The type of credit grant (PAID, PROMOTIONAL, RECURRING)
              sourceType:
                type: string
                enum:
                  - PRICE
                  - PLAN_ENTITLEMENT
                  - ADDON_ENTITLEMENT
                nullable: true
                description: >-
                  The source type of the grant (PRICE, PLAN_ENTITLEMENT,
                  ADDON_ENTITLEMENT)
              priority:
                type: number
                description: >-
                  The priority of the credit grant (lower number = higher
                  priority)
              effectiveAt:
                type: string
                format: date-time
                description: The date when the credit grant becomes effective
              expireAt:
                type: string
                format: date-time
                description: The date when the credit grant expires
                nullable: true
              voidedAt:
                type: string
                format: date-time
                description: The date when the credit grant was voided
                nullable: true
              metadata:
                type: object
                additionalProperties:
                  type: string
                description: Metadata associated with the entity
              cost:
                type: object
                properties:
                  amount:
                    type: number
                    description: The cost amount
                  currency:
                    type: string
                    maxLength: 255
                    description: The currency code
                required:
                  - amount
                  - currency
                description: The monetary cost of the credit grant
              comment:
                type: string
                maxLength: 255
                description: An optional comment on the credit grant
                nullable: true
              customerId:
                type: string
                maxLength: 255
                description: The customer ID this grant belongs to
              resourceId:
                type: string
                maxLength: 255
                description: The resource ID this grant is scoped to
                nullable: true
              currencyId:
                type: string
                maxLength: 255
                description: The currency identifier for this grant
              invoiceId:
                type: string
                maxLength: 255
                description: The billing invoice ID associated with this grant
                nullable: true
              latestInvoice:
                type: object
                properties:
                  billingId:
                    type: string
                    maxLength: 255
                    description: The billing provider invoice ID
                  status:
                    type: string
                    enum:
                      - OPEN
                      - PAID
                      - CANCELED
                    description: The invoice status
                  createdAt:
                    type: string
                    format: date-time
                    description: The invoice creation date
                  updatedAt:
                    type: string
                    format: date-time
                    description: The invoice last update date
                  dueDate:
                    type: string
                    format: date-time
                    description: The invoice due date
                    nullable: true
                  requiresAction:
                    type: boolean
                    description: Whether the invoice requires user action
                  billingReason:
                    type: string
                    enum:
                      - MANUAL
                      - OTHER
                    nullable: true
                    description: The billing reason for the invoice
                  paymentUrl:
                    type: string
                    maxLength: 255
                    description: The payment URL for settling the invoice
                    nullable: true
                  errorMessage:
                    type: string
                    maxLength: 255
                    description: Error message if payment failed
                    nullable: true
                  pdfUrl:
                    type: string
                    maxLength: 255
                    description: The PDF URL of the invoice
                    nullable: true
                  currency:
                    type: string
                    maxLength: 255
                    description: The invoice currency
                    nullable: true
                  subTotal:
                    type: number
                    description: The subtotal amount before tax
                    nullable: true
                  total:
                    type: number
                    description: The total amount including tax
                    nullable: true
                  tax:
                    type: number
                    description: The tax amount
                    nullable: true
                required:
                  - billingId
                  - status
                  - createdAt
                  - updatedAt
                  - dueDate
                  - requiresAction
                  - billingReason
                  - paymentUrl
                  - errorMessage
                  - pdfUrl
                  - currency
                  - subTotal
                  - total
                  - tax
                title: CreditGrantInvoice
                description: The latest invoice details for this grant
                nullable: true
              paymentCollection:
                type: string
                enum:
                  - NOT_REQUIRED
                  - PROCESSING
                  - FAILED
                  - ACTION_REQUIRED
                description: The payment collection status
              status:
                type: string
                enum:
                  - PAYMENT_PENDING
                  - ACTIVE
                  - EXPIRED
                  - VOIDED
                  - SCHEDULED
                description: The effective status of the credit grant
              createdAt:
                type: string
                format: date-time
                description: Timestamp of when the record was created
              updatedAt:
                type: string
                format: date-time
                description: Timestamp of when the record was last updated
            required:
              - id
              - displayName
              - amount
              - consumedAmount
              - grantType
              - sourceType
              - priority
              - effectiveAt
              - expireAt
              - voidedAt
              - metadata
              - cost
              - comment
              - customerId
              - resourceId
              - currencyId
              - invoiceId
              - latestInvoice
              - paymentCollection
              - status
              - createdAt
              - updatedAt
            title: CreditGrant
            description: Credit grant object representing allocated credits for a customer
        pagination:
          type: object
          properties:
            next:
              type: string
              format: uuid
              description: >-
                Cursor for fetching the next page of results, or null if no
                additional pages exist
              nullable: true
            prev:
              type: string
              format: uuid
              description: >-
                Cursor for fetching the previous page of results, or null if at
                the beginning
              nullable: true
          required:
            - next
            - prev
          description: Pagination metadata including cursors for navigating through results
      required:
        - data
        - pagination
      title: ListResponse
      description: Response list object
    BadInputErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - BadUserInput
            - DuplicateIntegrationNotAllowed
            - EntityIsArchivedError
            - IntegrityViolation
            - FreePlanCantHaveCompatiblePackageGroupError
            - SubscriptionMustHaveSinglePlanError
            - AddonIsCompatibleWithPlan
            - AddonIsCompatibleWithGroup
            - DuplicateAddonProvisionedError
            - ScheduledMigrationAlreadyExistsError
            - SubscriptionAlreadyOnLatestPlan
            - EntityIdDifferentFromRefIdError
            - UnsupportedFeatureType
            - UnsupportedVendorIdentifier
            - UnsupportedSubscriptionScheduleType
            - InvalidEntitlementResetPeriod
            - IncompatibleSubscriptionAddon
            - UnPublishedPackage
            - MeteringNotAvailableForFeatureType
            - AuthCustomerMismatch
            - AuthCustomerReadonly
            - FetchAllCountriesPricesNotAllowed
            - MemberInvitationError
            - PlansCircularDependencyError
            - NoFeatureEntitlementInSubscription
            - CheckoutIsNotSupported
            - UnsupportedParameter
            - PricingModelNotSupportedByBillingIntegration
            - BillingIntegrationMissing
            - BillingIntegrationAlreadyExistsError
            - InvalidMemberDelete
            - PackageAlreadyPublished
            - DraftPlanCantBeArchived
            - DraftAddonCantBeArchived
            - PlanWithChildCantBeDeleted
            - PlanCannotBePublishWhenBasePlanIsDraft
            - PlanCannotBePublishWhenCompatibleAddonIsDraft
            - PlanIsUsedAsDefaultStartPlan
            - PlanIsUsedAsDowngradePlan
            - InvalidAddressError
            - InvalidQuantity
            - BillingPeriodMissingError
            - DowngradeBillingPeriodNotSupportedError
            - CustomerAlreadyUsesCouponError
            - CustomerAlreadyHaveCustomerCoupon
            - SubscriptionAlreadyCanceledOrExpired
            - TrialMustBeCancelledImmediately
            - SubscriptionDoesNotHaveBillingPeriod
            - InvalidCancellationDate
            - FailedToImportCustomer
            - FailedToImportSubscriptions
            - PackagePricingTypeNotSet
            - InvalidSubscriptionStatus
            - InvalidArgumentError
            - EditAllowedOnDraftPackageOnlyError
            - ResyncAlreadyInProgress
            - ArchivedCouponCantBeApplied
            - ImportAlreadyInProgress
            - AddonHasToHavePriceError
            - SelectedBillingModelDoesntMatchImportedItemError
            - CannotArchiveProductError
            - CannotUnarchiveProductError
            - CannotDeleteCustomerError
            - CannotRemovePaymentMethodFromCustomerError
            - CannotDeleteFeatureError
            - CannotArchiveFeatureError
            - InvalidUpdatePriceUnitAmountError
            - ExperimentAlreadyRunning
            - ExperimentStatusError
            - OperationNotAllowedDuringInProgressExperiment
            - EntitlementsMustBelongToSamePackage
            - CanNotUpdateEntitlementsFeatureGroup
            - MeterMustBeAssociatedToMeteredFeature
            - CannotEditPackageInNonDraftMode
            - CannotAddOverrideEntitlementToPlan
            - MissingEntityIdError
            - NoProductsAvailable
            - PromotionCodeNotForCustomer
            - PromotionCodeNotActive
            - PromotionCodeMaxRedemptionsReached
            - PromotionCodeMinimumAmountNotReached
            - PromotionCodeCustomerNotFirstPurchase
            - AddonWithDraftCannotBeDeletedError
            - CannotReportUsageForEntitlementWithMeterError
            - RecalculateEntitlementsError
            - ImportSubscriptionsBulkError
            - InvalidMetadataError
            - CannotUpsertToPackageThatHasDraft
            - IntegrationValidationError
            - AwsMarketplaceIntegrationValidationError
            - AwsMarketplaceIntegrationError
            - DataExportIntegrationError
            - HubspotIntegrationError
            - DuplicateProductValidationError
            - AmountTooLarge
            - CustomerHasNoEmailAddress
            - MergeEnvironmentValidationError
            - EntitlementLimitExceededError
            - EntitlementUsageOutOfRangeError
            - UsageMeasurementDiffOutOfRangeError
            - AddonQuantityExceedsLimitError
            - AddonDependencyMissingError
            - PackageGroupMinItemsError
            - CannotUpdateUnitTransformationError
            - SingleSubscriptionCantBeAutoCancellationTargetError
            - MultiSubscriptionCantBeAutoCancellationSourceError
            - ChangingPayingCustomerIsNotSupportedError
            - RequiredSsoAuthenticationError
            - InvalidDoggoSignatureError
            - InvalidReceivedSignatureError
            - CannotDeleteDefaultIntegration
            - CannotChangeBillingIntegration
            - FailedToResolveBillingIntegration
            - WorkflowTriggerNotFound
            - DeprecatedEstimateSubscriptionError
            - FeatureConfigurationExceededLimitError
            - FeatureNotBelongToFeatureGroupError
            - FeatureGroupMissingFeaturesError
            - VersionExceedsMaxValueError
            - CannotUpdateExpireAtForExpiredCreditGrantError
            - ExpireAtMustBeLaterThanEffectiveAtError
            - OfferAlreadyExists
            - DraftAlreadyExists
            - CreditGrantAlreadyVoided
            - CreditGrantCannotBeVoided
            - InvalidTaxId
            - ObjectAlreadyBeingUsedByAnotherRequestError
            - TooManySubscriptionsPerCustomer
            - TooManyCustomCurrencies
            - StripeError
            - SchedulingAtEndOfBillingPeriod
            - ApiKeyExpired
            - ApiKeyHasExpiry
          nullable: true
      required:
        - message
        - code
    UnauthenticatedErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - Unauthenticated
          nullable: true
      required:
        - message
        - code
    ForbiddenErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - IdentityForbidden
            - AccessDeniedError
            - NoFeatureEntitlementError
          nullable: true
      required:
        - message
        - code
    TooManyRequestsErrorResponseDto:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
          enum:
            - RateLimitExceeded
          nullable: true
      required:
        - message
        - code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Server API Key

````