Skip to content

Commit

Permalink
Showing 9 changed files with 241 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-a6a1b7ffd49d131bfc4a1e8e508ac1fe23875c64b27c99f97dd4df06ea5e3ff5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-6bef7452aabfcad0e298c7e0bbbd90aa6a1d954ad99a04fe756b827fd12a7ce9.yml
15 changes: 15 additions & 0 deletions src/resources/invoices.ts
Original file line number Diff line number Diff line change
@@ -408,6 +408,11 @@ export namespace Invoice {
*/
next_attempt_at: string | null;

/**
* Number of auto-collection payment attempts.
*/
num_attempts: number | null;

/**
* If Orb has ever attempted payment auto-collection for this invoice, this field
* will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
@@ -1571,6 +1576,11 @@ export namespace InvoiceFetchUpcomingResponse {
*/
next_attempt_at: string | null;

/**
* Number of auto-collection payment attempts.
*/
num_attempts: number | null;

/**
* If Orb has ever attempted payment auto-collection for this invoice, this field
* will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
@@ -2469,6 +2479,11 @@ export interface InvoiceCreateParams {
*/
customer_id?: string | null;

/**
* An optional discount to attach to the invoice.
*/
discount?: Shared.Discount | null;

/**
* The `external_customer_id` of the `Customer` to create this invoice for. One of
* `customer_id` and `external_customer_id` are required.
7 changes: 0 additions & 7 deletions src/resources/items.ts
Original file line number Diff line number Diff line change
@@ -86,13 +86,6 @@ export interface ItemCreateParams {

export interface ItemUpdateParams {
external_connections: Array<ItemUpdateParams.ExternalConnection> | null;

/**
* User-specified key/value pairs for the resource. Individual keys can be removed
* by setting the value to `null`, and the entire metadata mapping can be cleared
* by setting `metadata` to `null`.
*/
metadata?: Record<string, string | null> | null;
}

export namespace ItemUpdateParams {
32 changes: 16 additions & 16 deletions src/resources/plans/plans.ts
Original file line number Diff line number Diff line change
@@ -228,7 +228,7 @@ export namespace Plan {
*/
duration: number | null;

duration_unit: 'daily' | 'monthly' | 'quarterly' | 'annual' | null;
duration_unit: 'daily' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | null;

maximum: PlanPhase.Maximum | null;

@@ -347,7 +347,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -416,7 +416,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -491,7 +491,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -586,7 +586,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -674,7 +674,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -770,7 +770,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -844,7 +844,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -933,7 +933,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1014,7 +1014,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1074,7 +1074,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1134,7 +1134,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1194,7 +1194,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1254,7 +1254,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1314,7 +1314,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
@@ -1374,7 +1374,7 @@ export namespace PlanCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* The id of the item the plan will be associated with.
72 changes: 36 additions & 36 deletions src/resources/prices/prices.ts
Original file line number Diff line number Diff line change
@@ -360,7 +360,7 @@ export namespace Price {

billable_metric: UnitPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -453,7 +453,7 @@ export namespace Price {

billable_metric: PackagePrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -552,7 +552,7 @@ export namespace Price {

billable_metric: MatrixPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -671,7 +671,7 @@ export namespace Price {

billable_metric: TieredPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -783,7 +783,7 @@ export namespace Price {

billable_metric: TieredBpsPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -903,7 +903,7 @@ export namespace Price {

bps_config: BpsPrice.BpsConfig;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1001,7 +1001,7 @@ export namespace Price {

bulk_bps_config: BulkBpsPrice.BulkBpsConfig;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1114,7 +1114,7 @@ export namespace Price {

bulk_config: BulkPrice.BulkConfig;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1219,7 +1219,7 @@ export namespace Price {

billable_metric: ThresholdTotalAmountPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1305,7 +1305,7 @@ export namespace Price {

billable_metric: TieredPackagePrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1391,7 +1391,7 @@ export namespace Price {

billable_metric: GroupedTieredPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1477,7 +1477,7 @@ export namespace Price {

billable_metric: TieredWithMinimumPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1563,7 +1563,7 @@ export namespace Price {

billable_metric: TieredPackageWithMinimumPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1649,7 +1649,7 @@ export namespace Price {

billable_metric: PackageWithAllocationPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1735,7 +1735,7 @@ export namespace Price {

billable_metric: UnitWithPercentPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1821,7 +1821,7 @@ export namespace Price {

billable_metric: MatrixWithAllocationPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -1945,7 +1945,7 @@ export namespace Price {

billable_metric: TieredWithProrationPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -2031,7 +2031,7 @@ export namespace Price {

billable_metric: UnitWithProrationPrice.BillableMetric | null;

cadence: 'one_time' | 'monthly' | 'quarterly' | 'annual';
cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual';

conversion_rate: number | null;

@@ -2142,7 +2142,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2210,7 +2210,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2284,7 +2284,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2378,7 +2378,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2477,7 +2477,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2564,7 +2564,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2659,7 +2659,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2732,7 +2732,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2820,7 +2820,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2900,7 +2900,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -2959,7 +2959,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3018,7 +3018,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3077,7 +3077,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3136,7 +3136,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3195,7 +3195,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3254,7 +3254,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3313,7 +3313,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3372,7 +3372,7 @@ export namespace PriceCreateParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
139 changes: 121 additions & 18 deletions src/resources/subscriptions.ts
Original file line number Diff line number Diff line change
@@ -3575,10 +3575,20 @@ export interface SubscriptionPriceIntervalsParams {
*/
add?: Array<SubscriptionPriceIntervalsParams.Add>;

/**
* A list of adjustments to add to the subscription.
*/
add_adjustments?: Array<SubscriptionPriceIntervalsParams.AddAdjustment>;

/**
* A list of price intervals to edit on the subscription.
*/
edit?: Array<SubscriptionPriceIntervalsParams.Edit>;

/**
* A list of adjustments to edit on the subscription.
*/
edit_adjustments?: Array<SubscriptionPriceIntervalsParams.EditAdjustment>;
}

export namespace SubscriptionPriceIntervalsParams {
@@ -3702,7 +3712,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3770,7 +3780,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3844,7 +3854,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -3938,7 +3948,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4037,7 +4047,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4124,7 +4134,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4219,7 +4229,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4292,7 +4302,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4380,7 +4390,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4460,7 +4470,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4519,7 +4529,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4578,7 +4588,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4637,7 +4647,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4696,7 +4706,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4755,7 +4765,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4814,7 +4824,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4873,7 +4883,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4932,7 +4942,7 @@ export namespace SubscriptionPriceIntervalsParams {
/**
* The cadence to bill for this price on.
*/
cadence: 'annual' | 'monthly' | 'quarterly' | 'one_time';
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time';

/**
* An ISO 4217 currency string for which this price is billed in.
@@ -4988,6 +4998,80 @@ export namespace SubscriptionPriceIntervalsParams {
}
}

export interface AddAdjustment {
/**
* The definition of a new adjustment to create and add to the subscription.
*/
adjustment:
| AddAdjustment.NewPercentageDiscount
| AddAdjustment.NewAmountDiscount
| AddAdjustment.NewMinimum
| AddAdjustment.NewMaximum;

/**
* The start date of the adjustment interval. This is the date that the adjustment
* will start affecting prices on the subscription.
*/
start_date: (string & {}) | Shared.BillingCycleRelativeDate;

/**
* The end date of the adjustment interval. This is the date that the adjustment
* will stop affecting prices on the subscription.
*/
end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;
}

export namespace AddAdjustment {
export interface NewPercentageDiscount {
adjustment_type: 'percentage_discount';

/**
* The set of price IDs to which this adjustment applies.
*/
applies_to_price_ids: Array<string>;

percentage_discount: number;
}

export interface NewAmountDiscount {
adjustment_type: 'amount_discount';

amount_discount: string;

/**
* The set of price IDs to which this adjustment applies.
*/
applies_to_price_ids: Array<string>;
}

export interface NewMinimum {
adjustment_type: 'minimum';

/**
* The set of price IDs to which this adjustment applies.
*/
applies_to_price_ids: Array<string>;

/**
* The item ID that revenue from this minimum will be attributed to.
*/
item_id: string;

minimum_amount: string;
}

export interface NewMaximum {
adjustment_type: 'maximum';

/**
* The set of price IDs to which this adjustment applies.
*/
applies_to_price_ids: Array<string>;

maximum_amount: string;
}
}

export interface Edit {
/**
* The id of the price interval to edit.
@@ -5034,6 +5118,25 @@ export namespace SubscriptionPriceIntervalsParams {
quantity: number;
}
}

export interface EditAdjustment {
/**
* The id of the adjustment interval to edit.
*/
adjustment_interval_id: string;

/**
* The updated end date of this adjustment interval. If not specified, the start
* date will not be updated.
*/
end_date?: (string & {}) | Shared.BillingCycleRelativeDate | null;

/**
* The updated start date of this adjustment interval. If not specified, the start
* date will not be updated.
*/
start_date?: (string & {}) | Shared.BillingCycleRelativeDate;
}
}

export interface SubscriptionSchedulePlanChangeParams {
6 changes: 6 additions & 0 deletions tests/api-resources/invoices.test.ts
Original file line number Diff line number Diff line change
@@ -88,6 +88,12 @@ describe('resource invoices', () => {
],
net_terms: 0,
customer_id: '4khy3nwzktxv7',
discount: {
discount_type: 'percentage',
applies_to_price_ids: ['h74gfhdjvn7ujokd', '7hfgtgjnbvc3ujkl'],
reason: 'string',
percentage_discount: 0.15,
},
external_customer_id: 'external-customer-id',
memo: 'An optional memo for my invoice.',
metadata: { foo: 'string' },
1 change: 0 additions & 1 deletion tests/api-resources/items.test.ts
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@ describe('resource items', () => {
{ external_connection_name: 'stripe', external_entity_id: 'string' },
{ external_connection_name: 'stripe', external_entity_id: 'string' },
],
metadata: { foo: 'string' },
});
});

46 changes: 46 additions & 0 deletions tests/api-resources/subscriptions.test.ts
Original file line number Diff line number Diff line change
@@ -461,6 +461,35 @@ describe('resource subscriptions', () => {
maximum_amount: 0,
},
],
add_adjustments: [
{
adjustment: {
applies_to_price_ids: ['price_1', 'price_2'],
adjustment_type: 'percentage_discount',
percentage_discount: 0,
},
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
{
adjustment: {
applies_to_price_ids: ['price_1', 'price_2'],
adjustment_type: 'percentage_discount',
percentage_discount: 0,
},
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
{
adjustment: {
applies_to_price_ids: ['price_1', 'price_2'],
adjustment_type: 'percentage_discount',
percentage_discount: 0,
},
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
],
edit: [
{
price_interval_id: 'sdfs6wdjvn7ujokd',
@@ -496,6 +525,23 @@ describe('resource subscriptions', () => {
billing_cycle_day: 0,
},
],
edit_adjustments: [
{
adjustment_interval_id: 'sdfs6wdjvn7ujokd',
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
{
adjustment_interval_id: 'sdfs6wdjvn7ujokd',
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
{
adjustment_interval_id: 'sdfs6wdjvn7ujokd',
start_date: '2019-12-27T18:11:19.117Z',
end_date: '2019-12-27T18:11:19.117Z',
},
],
},
{ path: '/_stainless_unknown_path' },
),

0 comments on commit c1134f1

Please sign in to comment.