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
  }
}

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"
  }
}