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"
}
}Voids an existing credit grant, preventing further consumption of the remaining credits.
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"
}
}Server API Key
The unique identifier of the entity
1 - 255The voided credit grant object.
Response object
Credit grant object representing allocated credits for a customer
Show child attributes