credits

Create billing plan credit grant

Changed on
post/billing/credits/plan-grants

Request

  • Base URL
    https://api.schematichq.com
  • URL
    https://api.schematichq.com/billing/credits/plan-grants
  • Auth
    API key in header X-Schematic-Api-Key

Request body

apply_to_existingboolean nullable
arrears_anchor'billing_period_start' | 'month_end'
arrears_cadence'end_of_billing_period' | 'monthly' | 'quarterly'
auto_topup_amountinteger nullable
auto_topup_amount_type'credit'
auto_topup_availability'off' | 'automatic' | 'user_controlled'
auto_topup_enabledboolean nullable
auto_topup_expiry_type'duration' | 'end_of_billing_period' | 'end_of_next_billing_period' | 'end_of_trial' | 'no_expiry'
auto_topup_expiry_unit'billing_periods' | 'days'
auto_topup_expiry_unit_countinteger nullable
auto_topup_self_serviceboolean nullable
auto_topup_threshold_creditsinteger nullable
auto_topup_threshold_percentinteger nullable
billing_mode'granted' | 'billed'
can_buy_bundlesboolean nullable

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

company_credit_amountinteger nullable

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

credit_amountinteger required
credit_idstring required
expiry_type'duration' | 'end_of_billing_period' | 'end_of_next_billing_period' | 'end_of_trial' | 'no_expiry'
expiry_unit'billing_periods' | 'days'
expiry_unit_countinteger nullable
license_idstring nullable

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

overdraft_limitnumber double nullable

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_idstring required
plan_version_idstring nullable
postpaid_enabledboolean nullable

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_unitinteger nullable

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 nullable

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.

reset_cadence'daily' | 'every_6_months' | 'monthly' | 'quarterly' | 'weekly' | 'yearly' required
reset_start'billing_period' | 'first_of_month' required
reset_type'no_reset' | 'plan_period'
rollover_percentageinteger nullable

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.

scaling'fixed' | 'per_license'
tier_mode'graduated' | 'volume'
unit_priceinteger nullable

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 nullable

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

Response

Created

paramsobject required

Input parameters

Changes

    • info

      added the new optional request property

    • info

      added the required property / to the response with the status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status