Skip to main content
POST
Create contract recurring discount

Authorizations

X-API-KEY
string
header
required

API Key Authentication.

Path Parameters

id
string<uuid>
required

Unique identifier for the contract.

Body

application/json
method
enum<string>
required

Discount method: "fixed" (amount in cents) or "percentage" (basis points).

Available options:
fixed,
percentage
amount
number
required

Amount in cents when method is "fixed", or basis points (1-10000, where 10000 = 100%) when method is "percentage".

Required range: x >= 1Must be a multiple of 1
description
string
required

Display text of the discount as it appears on invoices.

Minimum string length: 1
startDate
string<date>
required

Billing-cycle start date the discount starts at. Must match a valid cycle date of the contract.

targetScope
enum<string>
required

Where the discount applies: "invoice", "plan", or "contract_minimum_amount".

Available options:
invoice,
plan,
contract_minimum_amount
planId
string<uuid> | null

Optional plan to scope the discount to. Required when targetScope is "plan".

invoiceCount
number | null

Optional number of invoices the discount applies to, counted from startDate over the open invoices that bill its target; already-issued invoices are frozen and do not consume the count. Null means the discount applies until deactivated.

Required range: 1 <= x <= 1200Must be a multiple of 1
distributionMode
enum<string>
default:proportional

For split invoices: "proportional" divides a fixed discount across invoices; "full" applies it in full to each.

Available options:
proportional,
full

Response

Schema representing a recurring discount configured on a contract. Starting at startDate's billing cycle, the discount is applied to the next invoiceCount invoices that bill its target (all of them when invoiceCount is null), as long as it is active (see isActive).

id
string<uuid>
required

The unique identifier of the recurring discount in our system.

planId
string<uuid> | null
required

The unique identifier of the plan targeted by the discount, for plan and metric target scopes. Null for invoice and contract_minimum_amount scopes.

targetScope
enum<string>
required

What the discount applies to on each generated invoice: invoice (the whole invoice), plan (the line item group of the targeted plan), metric (the line item of the targeted usage charge), or contract_minimum_amount (the contract minimum commitment line item).

Available options:
invoice,
plan,
metric,
contract_minimum_amount
method
enum<string>
required

How amount is interpreted: fixed subtracts a monetary amount; percentage subtracts a percentage of the targeted amount.

Available options:
fixed,
percentage
amount
number
required

Value of the discount, as a positive integer: whole cents when method is fixed; basis points when method is percentage (1 basis point = 0.01%; maximum 10000 = 100%).

Required range: x >= 1Must be a multiple of 1
description
string
required

Display text of the discount as it appears on invoices.

Minimum string length: 1
startDate
string<date>
required

Billing cycle date the discount starts at. From there it applies to the next invoiceCount invoices that bill its target.

invoiceCount
number | null
required

How many invoices the discount applies to, counted from startDate over the open invoices that bill its target; already-issued invoices are frozen and do not consume the count. Null means the discount applies until deactivated.

Required range: x >= 1Must be a multiple of 1
distributionMode
enum<string>
required

For fixed discounts on contracts that split invoices across payment accounts: full applies the whole amount on each invoice of the cycle; proportional splits the amount across the cycle's invoices in proportion to their totals. Percentage discounts always apply per invoice.

Available options:
proportional,
full
isActive
boolean
required

Whether the discount is applied to new billing cycles. Inactive discounts are kept for history but no longer applied.