Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/resources/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,24 @@ export interface AmountDiscount {

export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';

export type Discount = PercentageDiscount | TrialDiscount | Discount.UsageDiscount | AmountDiscount;

export namespace Discount {
export interface UsageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;

discount_type: 'usage';

/**
* Only available if discount_type is `usage`. Number of usage units that this
* discount is for
*/
usage_discount: number;

reason?: string | null;
}
export type Discount = PercentageDiscount | TrialDiscount | UsageDiscount | AmountDiscount;

export interface UsageDiscount {
/**
* List of price_ids that this discount applies to. For plan/plan phase discounts,
* this can be a subset of prices.
*/
applies_to_price_ids: Array<string>;

discount_type: 'usage';

/**
* Only available if discount_type is `usage`. Number of usage units that this
* discount is for
*/
usage_discount: number;

reason?: string | null;
}

export type InvoiceLevelDiscount = PercentageDiscount | AmountDiscount | TrialDiscount;
Expand Down
Loading