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

First billing-cycle start date the discount applies to. 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".

endDate
string<date> | null

Optional last cycle date the discount applies to. Null means the discount has no end.

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. On every billing cycle within its validity window, the discount is applied to the generated invoices as an invoice discount, 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

First billing cycle date the discount applies to.

endDate
string<date> | null
required

Last billing cycle date the discount applies to. Null when the discount has no end date.

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.