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.credits.grants.create({
amount: 0,
currencyId: 'currencyId',
customerId: 'customerId',
displayName: 'displayName',
grantType: 'PAID',
});
console.log(creditGrantResponse.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
credit_grant_response = client.v1.credits.grants.create(
amount=0,
currency_id="currencyId",
customer_id="customerId",
display_name="displayName",
grant_type="PAID",
)
print(credit_grant_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
creditGrantResponse, err := client.V1.Credits.Grants.New(context.TODO(), stigg.V1CreditGrantNewParams{
Amount: 0,
CurrencyID: "currencyId",
CustomerID: "customerId",
DisplayName: "displayName",
GrantType: stigg.V1CreditGrantNewParamsGrantTypePaid,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", creditGrantResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.credits.grants.CreditGrantResponse;
import io.stigg.models.v1.credits.grants.GrantCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
GrantCreateParams params = GrantCreateParams.builder()
.amount(0.0)
.currencyId("currencyId")
.customerId("customerId")
.displayName("displayName")
.grantType(GrantCreateParams.GrantType.PAID)
.build();
CreditGrantResponse creditGrantResponse = client.v1().credits().grants().create(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
credit_grant_response = stigg.v1.credits.grants.create(
amount: 0,
currency_id: "currencyId",
customer_id: "customerId",
display_name: "displayName",
grant_type: :PAID
)
puts(credit_grant_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Credits.Grants;
StiggClient client = new();
GrantCreateParams parameters = new()
{
Amount = 0,
CurrencyID = "currencyId",
CustomerID = "customerId",
DisplayName = "displayName",
GrantType = GrantType.Paid,
};
var creditGrantResponse = await client.V1.Credits.Grants.Create(parameters);
Console.WriteLine(creditGrantResponse);stigg v1:credits:grants create \
--api-key 'My API Key' \
--amount 0 \
--currency-id currencyId \
--customer-id customerId \
--display-name displayName \
--grant-type PAIDcurl --request POST \
--url https://api.stigg.io/api/v1/credits/grants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"displayName": "<string>",
"amount": 123,
"customerId": "<string>",
"currencyId": "<string>",
"priority": 50,
"effectiveAt": "2023-11-07T05:31:56Z",
"expireAt": "2023-11-07T05:31:56Z",
"metadata": {},
"comment": "<string>",
"resourceId": "<string>",
"awaitPaymentConfirmation": true,
"billingInformation": {
"isInvoicePaid": true,
"invoiceDaysUntilDue": 123,
"billingAddress": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
}
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/credits/grants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => '<string>',
'amount' => 123,
'customerId' => '<string>',
'currencyId' => '<string>',
'priority' => 50,
'effectiveAt' => '2023-11-07T05:31:56Z',
'expireAt' => '2023-11-07T05:31:56Z',
'metadata' => [
],
'comment' => '<string>',
'resourceId' => '<string>',
'awaitPaymentConfirmation' => true,
'billingInformation' => [
'isInvoicePaid' => true,
'invoiceDaysUntilDue' => 123,
'billingAddress' => [
'city' => '<string>',
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>',
'state' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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,
"syncStates": [
{
"vendorIdentifier": "STRIPE",
"status": "PENDING",
"syncedEntityId": null
}
],
"paymentCollection": "NOT_REQUIRED",
"status": "ACTIVE",
"createdAt": "2025-10-26T10:00:00.000Z",
"updatedAt": "2025-10-26T10:00:00.000Z"
}
}{
"message": "<string>",
"code": "BadUserInput"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Create a credit grant
Creates a new credit grant for a customer with specified amount, type, and optional billing configuration.
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.credits.grants.create({
amount: 0,
currencyId: 'currencyId',
customerId: 'customerId',
displayName: 'displayName',
grantType: 'PAID',
});
console.log(creditGrantResponse.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
credit_grant_response = client.v1.credits.grants.create(
amount=0,
currency_id="currencyId",
customer_id="customerId",
display_name="displayName",
grant_type="PAID",
)
print(credit_grant_response.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
creditGrantResponse, err := client.V1.Credits.Grants.New(context.TODO(), stigg.V1CreditGrantNewParams{
Amount: 0,
CurrencyID: "currencyId",
CustomerID: "customerId",
DisplayName: "displayName",
GrantType: stigg.V1CreditGrantNewParamsGrantTypePaid,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", creditGrantResponse.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.credits.grants.CreditGrantResponse;
import io.stigg.models.v1.credits.grants.GrantCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
GrantCreateParams params = GrantCreateParams.builder()
.amount(0.0)
.currencyId("currencyId")
.customerId("customerId")
.displayName("displayName")
.grantType(GrantCreateParams.GrantType.PAID)
.build();
CreditGrantResponse creditGrantResponse = client.v1().credits().grants().create(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
credit_grant_response = stigg.v1.credits.grants.create(
amount: 0,
currency_id: "currencyId",
customer_id: "customerId",
display_name: "displayName",
grant_type: :PAID
)
puts(credit_grant_response)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Credits.Grants;
StiggClient client = new();
GrantCreateParams parameters = new()
{
Amount = 0,
CurrencyID = "currencyId",
CustomerID = "customerId",
DisplayName = "displayName",
GrantType = GrantType.Paid,
};
var creditGrantResponse = await client.V1.Credits.Grants.Create(parameters);
Console.WriteLine(creditGrantResponse);stigg v1:credits:grants create \
--api-key 'My API Key' \
--amount 0 \
--currency-id currencyId \
--customer-id customerId \
--display-name displayName \
--grant-type PAIDcurl --request POST \
--url https://api.stigg.io/api/v1/credits/grants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"displayName": "<string>",
"amount": 123,
"customerId": "<string>",
"currencyId": "<string>",
"priority": 50,
"effectiveAt": "2023-11-07T05:31:56Z",
"expireAt": "2023-11-07T05:31:56Z",
"metadata": {},
"comment": "<string>",
"resourceId": "<string>",
"awaitPaymentConfirmation": true,
"billingInformation": {
"isInvoicePaid": true,
"invoiceDaysUntilDue": 123,
"billingAddress": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
}
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/credits/grants",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'displayName' => '<string>',
'amount' => 123,
'customerId' => '<string>',
'currencyId' => '<string>',
'priority' => 50,
'effectiveAt' => '2023-11-07T05:31:56Z',
'expireAt' => '2023-11-07T05:31:56Z',
'metadata' => [
],
'comment' => '<string>',
'resourceId' => '<string>',
'awaitPaymentConfirmation' => true,
'billingInformation' => [
'isInvoicePaid' => true,
'invoiceDaysUntilDue' => 123,
'billingAddress' => [
'city' => '<string>',
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>',
'state' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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,
"syncStates": [
{
"vendorIdentifier": "STRIPE",
"status": "PENDING",
"syncedEntityId": null
}
],
"paymentCollection": "NOT_REQUIRED",
"status": "ACTIVE",
"createdAt": "2025-10-26T10:00:00.000Z",
"updatedAt": "2025-10-26T10:00:00.000Z"
}
}{
"message": "<string>",
"code": "BadUserInput"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Body
Request body for creating a credit grant. Grants cannot be edited after creation — void and re-grant if the amount, priority, or expiration needs to change.
The display name for the credit grant
255The credit amount to grant
The type of credit grant (PAID, PROMOTIONAL)
PAID, PROMOTIONAL The customer ID to grant credits to (required)
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$The credit currency ID (required)
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$Determines which grant is drawn down first when the customer has multiple active 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 — so without setting this explicitly, draw order against plan-included credits falls back to expiration date and grant type. To have this grant consumed before or after plan-included credits, set a lower or higher priority than the plan/price credit configuration.
0 <= x <= 100The date when the credit grant becomes effective
The date when the credit grant expires
Additional metadata for the credit grant
Show child attributes
Show child attributes
The monetary cost of the credit grant
Show child attributes
Show child attributes
An optional comment on the credit grant
255The resource ID to scope the grant to
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$The payment collection method (CHARGE, INVOICE, NONE). Optional if the grant has no cost, since there is nothing to collect payment for. With NONE or CHARGE, the grant is active and its credits are usable right away (or as soon as the charge succeeds). With INVOICE, the grant stays pending — its credits are not usable — until the generated invoice is paid.
CHARGE, INVOICE, NONE Whether to wait for payment confirmation before returning (default: true). When false, the request returns immediately while payment (if any) is collected asynchronously; check the returned status to see whether the credits are already usable.
Billing information for the credit grant, used when the grant has a payment collection method that requires collecting payment (e.g. invoice due date, billing address).
Show child attributes
Show child attributes
Response
The newly created credit grant object.
Response object
Credit grant object representing allocated credits for a customer. Credit grants cannot be edited after creation via this API — void the grant to stop further consumption from it, then create a new grant with the corrected amount, priority, or expiration.
Show child attributes
Show child attributes
Related topics
Credit grant createdGrant credits as entitlements in plans and add-onsAdjust credit balanceMonetize my product using creditsCustom flows