Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 93
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4df283466fdce46e787565c6480138896b1d7ed98d68a79d5eb3438bed191276.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5b28e83c3230be7d858ce20741c7b5debdad3e7720e2fa6e3a2d1774ca02a337.yml
308 changes: 308 additions & 0 deletions src/resources/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2325,6 +2325,8 @@ export interface SubscriptionCreateParams {
| SubscriptionCreateParams.OverrideGroupedAllocationPrice
| SubscriptionCreateParams.OverrideGroupedWithProratedMinimumPrice
| SubscriptionCreateParams.OverrideBulkWithProrationPrice
| SubscriptionCreateParams.OverrideUnitWithProrationPrice
| SubscriptionCreateParams.OverrideTieredWithProrationPrice
> | null;

start_date?: string | null;
Expand Down Expand Up @@ -3740,6 +3742,158 @@ export namespace SubscriptionCreateParams {
usage_discount?: number | null;
}
}

export interface OverrideUnitWithProrationPrice {
id: string;

model_type: 'unit_with_proration';

unit_with_proration_config: Record<string, unknown>;

/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;

/**
* The currency of the price. If not provided, the currency of the plan will be
* used.
*/
currency?: string | null;

/**
* The subscription's override discount for the plan.
*/
discount?: OverrideUnitWithProrationPrice.Discount | null;

/**
* The starting quantity of the price, if the price is a fixed price.
*/
fixed_price_quantity?: number | null;

/**
* The subscription's override maximum amount for the plan.
*/
maximum_amount?: string | null;

/**
* The subscription's override minimum amount for the plan.
*/
minimum_amount?: string | null;
}

export namespace OverrideUnitWithProrationPrice {
/**
* The subscription's override discount for the plan.
*/
export interface Discount {
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';

/**
* Only available if discount_type is `amount`.
*/
amount_discount?: string | null;

/**
* 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> | null;

/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount?: number | null;

/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;

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

export interface OverrideTieredWithProrationPrice {
id: string;

model_type: 'tiered_with_proration';

tiered_with_proration_config: Record<string, unknown>;

/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;

/**
* The currency of the price. If not provided, the currency of the plan will be
* used.
*/
currency?: string | null;

/**
* The subscription's override discount for the plan.
*/
discount?: OverrideTieredWithProrationPrice.Discount | null;

/**
* The starting quantity of the price, if the price is a fixed price.
*/
fixed_price_quantity?: number | null;

/**
* The subscription's override maximum amount for the plan.
*/
maximum_amount?: string | null;

/**
* The subscription's override minimum amount for the plan.
*/
minimum_amount?: string | null;
}

export namespace OverrideTieredWithProrationPrice {
/**
* The subscription's override discount for the plan.
*/
export interface Discount {
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';

/**
* Only available if discount_type is `amount`.
*/
amount_discount?: string | null;

/**
* 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> | null;

/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount?: number | null;

/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;

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

export interface SubscriptionUpdateParams {
Expand Down Expand Up @@ -6862,6 +7016,8 @@ export interface SubscriptionSchedulePlanChangeParams {
| SubscriptionSchedulePlanChangeParams.OverrideGroupedAllocationPrice
| SubscriptionSchedulePlanChangeParams.OverrideGroupedWithProratedMinimumPrice
| SubscriptionSchedulePlanChangeParams.OverrideBulkWithProrationPrice
| SubscriptionSchedulePlanChangeParams.OverrideUnitWithProrationPrice
| SubscriptionSchedulePlanChangeParams.OverrideTieredWithProrationPrice
> | null;
}

Expand Down Expand Up @@ -8252,6 +8408,158 @@ export namespace SubscriptionSchedulePlanChangeParams {
usage_discount?: number | null;
}
}

export interface OverrideUnitWithProrationPrice {
id: string;

model_type: 'unit_with_proration';

unit_with_proration_config: Record<string, unknown>;

/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;

/**
* The currency of the price. If not provided, the currency of the plan will be
* used.
*/
currency?: string | null;

/**
* The subscription's override discount for the plan.
*/
discount?: OverrideUnitWithProrationPrice.Discount | null;

/**
* The starting quantity of the price, if the price is a fixed price.
*/
fixed_price_quantity?: number | null;

/**
* The subscription's override maximum amount for the plan.
*/
maximum_amount?: string | null;

/**
* The subscription's override minimum amount for the plan.
*/
minimum_amount?: string | null;
}

export namespace OverrideUnitWithProrationPrice {
/**
* The subscription's override discount for the plan.
*/
export interface Discount {
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';

/**
* Only available if discount_type is `amount`.
*/
amount_discount?: string | null;

/**
* 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> | null;

/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount?: number | null;

/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;

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

export interface OverrideTieredWithProrationPrice {
id: string;

model_type: 'tiered_with_proration';

tiered_with_proration_config: Record<string, unknown>;

/**
* The per unit conversion rate of the price currency to the invoicing currency.
*/
conversion_rate?: number | null;

/**
* The currency of the price. If not provided, the currency of the plan will be
* used.
*/
currency?: string | null;

/**
* The subscription's override discount for the plan.
*/
discount?: OverrideTieredWithProrationPrice.Discount | null;

/**
* The starting quantity of the price, if the price is a fixed price.
*/
fixed_price_quantity?: number | null;

/**
* The subscription's override maximum amount for the plan.
*/
maximum_amount?: string | null;

/**
* The subscription's override minimum amount for the plan.
*/
minimum_amount?: string | null;
}

export namespace OverrideTieredWithProrationPrice {
/**
* The subscription's override discount for the plan.
*/
export interface Discount {
discount_type: 'percentage' | 'trial' | 'usage' | 'amount';

/**
* Only available if discount_type is `amount`.
*/
amount_discount?: string | null;

/**
* 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> | null;

/**
* Only available if discount_type is `percentage`. This is a number between 0
* and 1.
*/
percentage_discount?: number | null;

/**
* Only available if discount_type is `trial`
*/
trial_amount_discount?: string | null;

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

export interface SubscriptionTriggerPhaseParams {
Expand Down