Skip to main content
POST
JavaScript

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

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-ID
string

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

application/json

Request body for creating a credit grant

displayName
string
required

The display name for the credit grant

Maximum string length: 255
amount
number
required

The credit amount to grant

grantType
enum<string>
required

The type of credit grant (PAID, PROMOTIONAL)

Available options:
PAID,
PROMOTIONAL
customerId
string
required

The customer ID to grant credits to (required)

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
currencyId
string
required

The credit currency ID (required)

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
priority
integer

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

Required range: 0 <= x <= 100
effectiveAt
string<date-time>

The date when the credit grant becomes effective

expireAt
string<date-time>

The date when the credit grant expires

metadata
object

Additional metadata for the credit grant

cost
Money · object

The monetary cost of the credit grant

comment
string

An optional comment on the credit grant

Maximum string length: 255
resourceId
string

The resource ID to scope the grant to

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
paymentCollectionMethod
enum<string>

The payment collection method (CHARGE, INVOICE, NONE)

Available options:
CHARGE,
INVOICE,
NONE
awaitPaymentConfirmation
boolean

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

billingInformation
CreditGrantBillingInfo · object

Billing information for the credit grant

Response

The newly created credit grant object.

Response object

data
CreditGrant · object
required

Credit grant object representing allocated credits for a customer