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

# createCreditGrant

> Create a new credit grant



**mutation** `createCreditGrant(input: CreditGrantInput!): CreditGrant!`

## Arguments

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

## Returns

`CreditGrant!`

**`additionalMetaData`**: `JSON`

Metadata associated with the entity

---

**`amount`**: `Float!`

The amount of the credit grant

---

**`automaticRechargeConfigurationId`**: `UUID`

The ID of the automatic recharge configuration that created this grant, if applicable

---

**`comment`**: `String`

The comment for the credit grant

---

**`consumedAmount`**: `Float!`

The amount of the credit grant that has been consumed

---

**`cost`**: `Money!`

The fiat cost of the credit grant

---

**`createdAt`**: `DateTime!`

Timestamp of when the record was created

---

**`currencyId`**: `String!`

The custom currency ID of the credit grant

---

**`customerId`**: `String!`

The customer ID of the credit grant

---

**`displayName`**: `String!`

The display name of the credit grant

---

**`effectiveAt`**: `DateTime!`

The effective date of the credit grant

---

**`expireAt`**: `DateTime`

The expiration date of the credit grant

---

**`grantId`**: `String!`

The auto-generated readable identifier for the credit grant

---

**`grantType`**: `CreditGrantType!`

The type of the credit grant

---

**`id`**: `UUID!`

Unique identifier for the entity

---

**`invoiceId`**: `String`

The invoice ID of the credit grant

---

**`latestInvoice`**: `CreditGrantInvoice`

The latest invoice information of the credit grant

---

**`paymentCollection`**: `PaymentCollection!`

The payment collection status of the credit grant

---

**`priority`**: `Float!`

Determines which grant is drawn down first when a customer has multiple active credit grants in the same currency (0-100). Lower numbers are consumed first. Defaults to 50, the same default used for recurring credits granted by a plan or price. When priority is equal, the grant closer to expiring is drawn down first.

---

**`resourceId`**: `String`

The resource ID of the credit grant

---

**`sourceType`**: `CreditGrantSourceType`

The source type of the credit grant (plan entitlement, addon entitlement, or price)

---

**`status`**: `CreditGrantStatus!`

The status of the credit grant

---

**`syncStates`**: `[SyncState!]`

The synchronization states of the entity with external systems

---

**`updatedAt`**: `DateTime!`

Timestamp of when the record was last updated

---

**`voidedAt`**: `DateTime`

The voided date of the credit grant

## Examples

```graphql Mutation
mutation CreateCreditGrant($input: CreditGrantInput!) {
  createCreditGrant(input: $input) {
    additionalMetaData
    amount
    automaticRechargeConfigurationId
    comment
    consumedAmount
    cost {
      amount
      currency
    }
  }
}
```

```json Variables
{
  "input": {
    "amount": 1.5,
    "currencyId": "string",
    "customerId": "string",
    "displayName": "string",
    "grantType": "PAID"
  }
}
```

```json Response
{
  "data": {
    "createCreditGrant": {
      "additionalMetaData": "value",
      "amount": 1.5,
      "automaticRechargeConfigurationId": "value",
      "comment": "string",
      "consumedAmount": 1.5,
      "cost": {
        "amount": 1.5,
        "currency": "AED"
      }
    }
  }
}
```


## Related topics

- [Create a credit grant](https://docs.stigg.io/api-reference/credit-grants/create-a-credit-grant.md)
- [Automation flows](https://docs.stigg.io/documentation/native-integrations/crm/salesforce/salesforce-create-automation-flows.md)
- [Credit grant created](https://docs.stigg.io/api-reference/credit-grants/credit-grant-created.md)
- [Recurring credits](https://docs.stigg.io/documentation/modeling-your-pricing-in-stigg/credits/recurring-credits.md)
- [Grant credits as entitlements in plans and add-ons](https://docs.stigg.io/guides/i-want-to/grant-credits-in-plans-and-add-ons.md)


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