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

# Create Credit Grant

Grants credits to a customer's account.

## Mutation

<CodeGroup>
  ```graphql Mutation theme={null}
  mutation CreateCreditGrant($input: CreditGrantInput!) {
    createCreditGrant(input: $input) {
      id
      amount
      status
      cadence
      expiryDate
      effectiveAt
      description
      createdAt
    }
  }
  ```

  ```json Variables theme={null}
  {
    "input": {
      "customerId": "customer-123",
      "amount": 1000,
      "cadence": "ONE_TIME",
      "expiryDate": "2024-12-31T23:59:59Z",
      "description": "Welcome bonus credits"
    }
  }
  ```

  ```json Response theme={null}
  {
    "data": {
      "createCreditGrant": {
        "id": "grant-123",
        "amount": 1000,
        "status": "ACTIVE",
        "cadence": "ONE_TIME",
        "expiryDate": "2024-12-31T23:59:59Z",
        "effectiveAt": "2024-01-15T10:30:00Z",
        "description": "Welcome bonus credits",
        "createdAt": "2024-01-15T10:30:00Z"
      }
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="input" type="CreditGrantInput" required>
  Input for creating a credit grant

  <Expandable title="properties">
    <ParamField body="customerId" type="String" required>
      Customer reference ID
    </ParamField>

    <ParamField body="amount" type="Float" required>
      Credit amount to grant
    </ParamField>

    <ParamField body="cadence" type="CreditGrantCadence">
      ONE\_TIME, MONTHLY, or YEARLY
    </ParamField>

    <ParamField body="expiryDate" type="DateTime">
      When credits expire
    </ParamField>

    <ParamField body="effectiveAt" type="DateTime">
      When credits become available
    </ParamField>

    <ParamField body="description" type="String">
      Description/reason for grant
    </ParamField>

    <ParamField body="resourceId" type="String">
      Resource ID
    </ParamField>

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

## Cadence Options

| Cadence    | Description       |
| ---------- | ----------------- |
| `ONE_TIME` | Single grant      |
| `MONTHLY`  | Recurring monthly |
| `YEARLY`   | Recurring yearly  |

## Examples

### One-Time Grant

```json theme={null}
{
  "input": {
    "customerId": "customer-123",
    "amount": 1000,
    "cadence": "ONE_TIME",
    "description": "Welcome bonus"
  }
}
```

### Recurring Monthly

```json theme={null}
{
  "input": {
    "customerId": "customer-123",
    "amount": 500,
    "cadence": "MONTHLY",
    "description": "Monthly credit allowance"
  }
}
```

### Future-Dated Grant

```json theme={null}
{
  "input": {
    "customerId": "customer-123",
    "amount": 2000,
    "effectiveAt": "2024-02-01T00:00:00Z",
    "expiryDate": "2024-12-31T23:59:59Z"
  }
}
```

<Warning>
  The `OVERDRAFT` grant type is system-generated only. Attempting to create a credit grant with `grantType: OVERDRAFT` via the API will return a validation error. Overdraft grants are created automatically when a customer's credit consumption exceeds their available balance.
</Warning>

## Related Operations

* [Credit Balance](/api-and-sdks/api-reference/queries/credit-balance) - Check balance
* [Void Credit Grant](/api-and-sdks/api-reference/mutations/void-credit-grant) - Cancel grant
