Skip to main content
POST
/
api
/
v1
/
credits
/
grants
/
{id}
/
void
JavaScript
import Stigg from '@stigg/typescript';

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

const creditGrantResponse = await client.v1.events.credits.grants.void('x');

console.log(creditGrantResponse.data);
{
  "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": "2027-02-01T03:53:44.800Z",
    "updatedAt": "2027-02-01T03:53:44.801Z"
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Path Parameters

id
string
required

The unique identifier of the entity

Required string length: 1 - 255

Response

The voided credit grant object.

Response object

data
CreditGrant · object
required

Credit grant object representing allocated credits for a customer