Skip to main content
Grants credits to a customer’s account.

Mutation

mutation CreateCreditGrant($input: CreditGrantInput!) {
  createCreditGrant(input: $input) {
    id
    amount
    status
    cadence
    expiryDate
    effectiveAt
    description
    createdAt
  }
}
{
  "input": {
    "customerId": "customer-123",
    "amount": 1000,
    "cadence": "ONE_TIME",
    "expiryDate": "2024-12-31T23:59:59Z",
    "description": "Welcome bonus credits"
  }
}
{
  "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"
    }
  }
}

Parameters

input
CreditGrantInput
required
Input for creating a credit grant

Cadence Options

CadenceDescription
ONE_TIMESingle grant
MONTHLYRecurring monthly
YEARLYRecurring yearly

Examples

One-Time Grant

{
  "input": {
    "customerId": "customer-123",
    "amount": 1000,
    "cadence": "ONE_TIME",
    "description": "Welcome bonus"
  }
}

Recurring Monthly

{
  "input": {
    "customerId": "customer-123",
    "amount": 500,
    "cadence": "MONTHLY",
    "description": "Monthly credit allowance"
  }
}

Future-Dated Grant

{
  "input": {
    "customerId": "customer-123",
    "amount": 2000,
    "effectiveAt": "2024-02-01T00:00:00Z",
    "expiryDate": "2024-12-31T23:59:59Z"
  }
}
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.