Credit grants

Create a credit grant

Changed on

Creates a new credit grant for a customer with specified amount, type, and optional billing configuration.

post/api/v1/credits/grants

Request

  • Base URL
    https://api.stigg.io
  • URL
    https://api.stigg.io/api/v1/credits/grants
  • Auth
    API key in header X-API-KEY

Headers

X-ACCOUNT-IDstring

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-IDstring

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).

Request body

displayNamestring required

The display name for the credit grant

amountnumber required

The credit amount to grant

grantType'PAID' | 'PROMOTIONAL' required

The type of credit grant (PAID, PROMOTIONAL)

priorityinteger

The priority of the credit grant (lower number = higher priority)

effectiveAtstring date-time

The date when the credit grant becomes effective

expireAtstring date-time

The date when the credit grant expires

metadataobject

Additional metadata for the credit grant

commentstring

An optional comment on the credit grant

customerIdstring required

The customer ID to grant credits to (required)

resourceIdstring

The resource ID to scope the grant to

currencyIdstring required

The credit currency ID (required)

paymentCollectionMethod'CHARGE' | 'INVOICE' | 'NONE'

The payment collection method (CHARGE, INVOICE, NONE)

awaitPaymentConfirmationboolean

Whether to wait for payment confirmation before returning (default: true)

Response

The newly created credit grant object.

Changes

    • warning

      added the new CreditOveragePriceCurrencyNotFound enum value to the response property for the response status

    • warning

      added the new InvalidCreditOverageBillingModel enum value to the response property for the response status

    • warning

      added the new InvoicePreviewNotAvailableForDraftContract enum value to the response property for the response status

    • warning

      added the new OveragePriceNotSupportedOnAddon enum value to the response property for the response status

    • warning

      added the new OveragePriceRequiresUsageLimit enum value to the response property for the response status

    • info

      removed the InvoicePreviewNotAvailableForDraftContract enum value from the response property for the response status

    • info

      added the required property / to the response with the status