Create plan credit grant

Authentication

X-Schematic-Api-Keystring
API Key authentication via header

Request

This endpoint expects an object.
credit_amountlongRequired0-9999999999
credit_idstringRequired
plan_idstringRequired
reset_cadenceenumRequired
reset_startenumRequired
apply_to_existingboolean or nullOptional
arrears_anchorenum or nullOptional

Which boundary closes a monthly arrears window: the subscription’s own recurrence (billing_period_start) or the calendar month (month_end). Only applies when arrears_cadence is monthly; defaults to billing_period_start.

arrears_cadenceenum or nullOptional

How often postpaid charges are closed and invoiced: end_of_billing_period (the default) or monthly. Quarterly is not available for postpaid charges.

auto_topup_amountlong or nullOptional>=1
auto_topup_amount_typeenum or nullOptional
auto_topup_availabilityenum or nullOptional
auto_topup_enabledboolean or nullOptional
auto_topup_expiry_typeenum or nullOptional
auto_topup_expiry_unitenum or nullOptional
auto_topup_expiry_unit_countlong or nullOptional>=1
auto_topup_self_serviceboolean or nullOptional
auto_topup_threshold_creditslong or nullOptional>=0
auto_topup_threshold_percentlong or nullOptional1-100
billing_modeenum or nullOptional

Whether the credits are included in the plan price (granted) or billed as their own subscription line at a price per credit (billed). Billed is only available on custom plans. Defaults to granted.

company_credit_amountlong or nullOptional0-9999999999

Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.

expiry_typeenum or nullOptional
expiry_unitenum or nullOptional
expiry_unit_countlong or nullOptional>=1
license_idstring or nullOptional

The license whose quantity scales this grant. Required when scaling is per_license.

overdraft_limitdouble or nullOptional

Optional limit on how far the balance may go below zero, in credits. It is a floor on the balance rather than an allowance per invoice window: the balance may run down to minus this figure, and beyond it the flag check denies the same way an exhausted balance does with postpaid off. Nothing resets when an invoice window rolls, so a company that reaches the limit stays denied until a new grant lands or the negative balance is settled. Omit for no limit.

plan_version_idstring or nullOptional
postpaid_enabledboolean or nullOptional

Whether consumption may continue past a zero balance. When false (the default) the flag check denies once the balance is exhausted, which is the existing behavior. When true, consumption continues and accrues at postpaid_rate_per_unit, settled on arrears_cadence. Intended for invoice-billed customers on net terms, who have no card for auto top-up to charge.

postpaid_rate_per_unitlong or nullOptional>=0

Amount charged per credit consumed past a zero balance, in the currency’s minor unit. Optional: defaults to the credit’s own cost basis (price_per_unit) when postpaid_enabled is true.

postpaid_rate_per_unit_decimalstring or nullOptional

Decimal string form of postpaid_rate_per_unit, for rates finer than one minor unit (for example 0.0002). Takes precedence over postpaid_rate_per_unit when both are set, matching how the credit’s own price_per_unit_decimal behaves.

price_tierslist of objects or nullOptional

Tier table pricing the credits on this grant, cheapest bound first, the last tier unbounded. Give this instead of unit_price to charge a rate that changes with the number of credits on the invoice. Requires tier_mode.

reset_typeenum or nullOptional
rollover_percentagelong or nullOptional0-100

Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again. Defaults to 0.

scalingenum or nullOptional
Whether the grant is a fixed amount per company, or issued once per license the company holds. Defaults to fixed.
tier_modeenum or nullOptional

How price_tiers apply: volume prices every credit at the rate of the tier the total lands in, graduated prices each tier’s own credits at its own rate. Required with price_tiers.

unit_pricelong or nullOptional>=0

Price per credit in the plan currency’s smallest unit. Required when billing_mode is billed, unless unit_price_decimal or price_tiers is set.

unit_price_decimalstring or nullOptional
Price per credit as a decimal in the plan currency's smallest unit, for prices below one cent.
can_buy_bundlesboolean or nullOptionalDeprecated

Deprecated: use compatible_plan_ids on credit bundles instead. Still accepted; writes through to the credit’s bundle compatibility.

Response

Created
dataobject
paramsobject
Input parameters

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error