Add credits to metered entitlements via direct creation or paid purchase
Grants require Standard Billing (billingVersion: 1) and an active metered entitlement. See
Metered Entitlements for how entitlements are provisioned
automatically via subscription, and Billing Versions for
details on the two billing models.
Grants let you add credits to a customer’s metered entitlement outside the normal subscription cycle. Use them for mid-cycle top-ups, promotional credits, support adjustments, or self-serve credit purchases.There are two ways to create a grant:
Use direct creation when you want to credit a customer’s balance without requiring payment — promotional credits, support adjustments, or backend automation.
Unique key per entitlement to prevent duplicate grants. Max 255 characters.
effectiveAt
datetime
No
When the grant becomes effective. Defaults to the entitlement’s current period start.
expiresAt
datetime
No
When the grant expires. If omitted, the grant does not expire.
The idempotencyKey is scoped to the entitlement. Retrying a request with the same key returns the existing grant without creating a duplicate. If you retry with the same key but different parameters (for example, a different amount), the API returns a 409 Conflict.
Use grant purchases when a customer should pay for additional credits — self-serve top-up flows, credit packs, or on-demand capacity.The purchase endpoint creates an ad-hoc invoice with a payment session. Redirect the customer to the returned payment URL — once they complete payment, the grant is created automatically with no further action required on your end.
Credits to grant upon payment completion. Must be greater than 0.
price
string
Yes
Price in decimal format (e.g., "5.00"). Minimum "0.50".
idempotencyKey
string
Yes
Unique key for deduplication. Retrying with the same key returns the existing invoice. If you retry with the same key but different parameters, the API returns a 409 Conflict. Max 255 characters.
effectiveAt
datetime
No
When the grant becomes effective. Defaults to the entitlement’s current period start.
expiresAt
datetime
No
When the grant expires. If omitted, the grant does not expire.
successUrl
string
No
URL to redirect the customer to after successful payment.
cancelUrl
string
No
URL to redirect the customer to if they cancel payment.
paymentExpiresAt
datetime
No
When the payment session expires. Uses the default expiry if omitted.
The currency is always the merchant’s default currency. The amount in the payment session is in the currency’s minor unit (e.g., cents for USD), so a price of "5.00" appears as 500.
If the customer does not complete payment before the session expires, Paygentic automatically cancels the invoice. No grant is created and no charge is made.
Voiding removes the grant’s credits from the customer’s balance. This operation is idempotent — voiding an already-voided grant returns the grant without error.