Skip to content

Commit c6adfcd

Browse files
feat(api): api update
1 parent 5312391 commit c6adfcd

File tree

9 files changed

+44
-13
lines changed

9 files changed

+44
-13
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5b9152241ebdd0d2f3fd536784f33721d24a5c4a59e75cab366a3dcb36552d3d.yml
3-
openapi_spec_hash: b40061d10bbe1ebab8998bddd1827cf8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-f2b97a2c3e41f618dc8955ed325092320ff2170a7d7a9a26a31dc235c969b657.yml
3+
openapi_spec_hash: 64548564dc8ce80ef3ad38fc8cb56b30
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

src/resources/shared.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14182,6 +14182,13 @@ export interface PriceInterval {
1418214182
*/
1418314183
billing_cycle_day: number;
1418414184

14185+
/**
14186+
* For in-arrears prices. If true, and the price interval ends mid-cycle, the final
14187+
* line item will be deferred to the next scheduled invoice instead of being billed
14188+
* mid-cycle.
14189+
*/
14190+
can_defer_billing: boolean;
14191+
1418514192
/**
1418614193
* The end of the current billing period. This is an exclusive timestamp, such that
1418714194
* the instant returned is exactly the end of the billing period. Set to null if
@@ -14341,6 +14348,11 @@ export interface TieredConfig {
1434114348
* Tiers for rating based on total usage quantities into the specified tier
1434214349
*/
1434314350
tiers: Array<Tier>;
14351+
14352+
/**
14353+
* If true, subtotals from this price are prorated based on the service period
14354+
*/
14355+
prorated?: boolean;
1434414356
}
1434514357

1434614358
export interface TieredConversionRateConfig {
@@ -14403,6 +14415,11 @@ export interface UnitConfig {
1440314415
* Rate per unit of usage
1440414416
*/
1440514417
unit_amount: string;
14418+
14419+
/**
14420+
* If true, subtotals from this price are prorated based on the service period
14421+
*/
14422+
prorated?: boolean;
1440614423
}
1440714424

1440814425
export interface UnitConversionRateConfig {

src/resources/subscriptions.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6480,6 +6480,13 @@ export interface SubscriptionPriceIntervalsParams {
64806480
*/
64816481
allow_invoice_credit_or_void?: boolean | null;
64826482

6483+
/**
6484+
* If true, ending an in-arrears price interval mid-cycle will defer billing the
6485+
* final line itemuntil the next scheduled invoice. If false, it will be billed on
6486+
* its end date. If not provided, behaviorwill follow account default.
6487+
*/
6488+
can_defer_billing?: boolean | null;
6489+
64836490
/**
64846491
* A list of price intervals to edit on the subscription.
64856492
*/
@@ -7182,6 +7189,13 @@ export namespace SubscriptionPriceIntervalsParams {
71827189
*/
71837190
billing_cycle_day?: number | null;
71847191

7192+
/**
7193+
* If true, ending an in-arrears price interval mid-cycle will defer billing the
7194+
* final line itemuntil the next scheduled invoice. If false, it will be billed on
7195+
* its end date. If not provided, behaviorwill follow account default.
7196+
*/
7197+
can_defer_billing?: boolean | null;
7198+
71857199
/**
71867200
* The updated end date of this price interval. If not specified, the end date will
71877201
* not be updated.

tests/api-resources/beta/beta.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('resource beta', () => {
5555
item_id: 'item_id',
5656
model_type: 'unit',
5757
name: 'Annual fee',
58-
unit_config: { unit_amount: 'unit_amount' },
58+
unit_config: { unit_amount: 'unit_amount', prorated: true },
5959
billable_metric_id: 'billable_metric_id',
6060
billed_in_advance: true,
6161
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -115,7 +115,7 @@ describe('resource beta', () => {
115115
item_id: 'item_id',
116116
model_type: 'unit',
117117
name: 'Annual fee',
118-
unit_config: { unit_amount: 'unit_amount' },
118+
unit_config: { unit_amount: 'unit_amount', prorated: true },
119119
billable_metric_id: 'billable_metric_id',
120120
billed_in_advance: true,
121121
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },

tests/api-resources/beta/external-plan-id.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('resource externalPlanId', () => {
5555
item_id: 'item_id',
5656
model_type: 'unit',
5757
name: 'Annual fee',
58-
unit_config: { unit_amount: 'unit_amount' },
58+
unit_config: { unit_amount: 'unit_amount', prorated: true },
5959
billable_metric_id: 'billable_metric_id',
6060
billed_in_advance: true,
6161
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -115,7 +115,7 @@ describe('resource externalPlanId', () => {
115115
item_id: 'item_id',
116116
model_type: 'unit',
117117
name: 'Annual fee',
118-
unit_config: { unit_amount: 'unit_amount' },
118+
unit_config: { unit_amount: 'unit_amount', prorated: true },
119119
billable_metric_id: 'billable_metric_id',
120120
billed_in_advance: true,
121121
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },

tests/api-resources/invoices.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('resource invoices', () => {
4646
name: 'Line Item Name',
4747
quantity: 1,
4848
start_date: '2023-09-22',
49-
unit_config: { unit_amount: 'unit_amount' },
49+
unit_config: { unit_amount: 'unit_amount', prorated: true },
5050
},
5151
],
5252
customer_id: '4khy3nwzktxv7',

tests/api-resources/plans/plans.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('resource plans', () => {
4040
item_id: 'item_id',
4141
model_type: 'unit',
4242
name: 'Annual fee',
43-
unit_config: { unit_amount: 'unit_amount' },
43+
unit_config: { unit_amount: 'unit_amount', prorated: true },
4444
billable_metric_id: 'billable_metric_id',
4545
billed_in_advance: true,
4646
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },

tests/api-resources/prices/prices.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('resource prices', () => {
3434
item_id: 'item_id',
3535
model_type: 'unit',
3636
name: 'Annual fee',
37-
unit_config: { unit_amount: 'unit_amount' },
37+
unit_config: { unit_amount: 'unit_amount', prorated: true },
3838
billable_metric_id: 'billable_metric_id',
3939
billed_in_advance: true,
4040
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -143,7 +143,7 @@ describe('resource prices', () => {
143143
item_id: 'item_id',
144144
model_type: 'unit',
145145
name: 'Annual fee',
146-
unit_config: { unit_amount: 'unit_amount' },
146+
unit_config: { unit_amount: 'unit_amount', prorated: true },
147147
billable_metric_id: 'billable_metric_id',
148148
billed_in_advance: true,
149149
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -209,7 +209,7 @@ describe('resource prices', () => {
209209
item_id: 'item_id',
210210
model_type: 'unit',
211211
name: 'Annual fee',
212-
unit_config: { unit_amount: 'unit_amount' },
212+
unit_config: { unit_amount: 'unit_amount', prorated: true },
213213
billable_metric_id: 'billable_metric_id',
214214
billed_in_advance: true,
215215
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },

tests/api-resources/subscriptions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ describe('resource subscriptions', () => {
320320
item_id: 'item_id',
321321
model_type: 'unit',
322322
name: 'Annual fee',
323-
unit_config: { unit_amount: 'unit_amount' },
323+
unit_config: { unit_amount: 'unit_amount', prorated: true },
324324
billable_metric_id: 'billable_metric_id',
325325
billed_in_advance: true,
326326
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },
@@ -409,7 +409,7 @@ describe('resource subscriptions', () => {
409409
item_id: 'item_id',
410410
model_type: 'unit',
411411
name: 'Annual fee',
412-
unit_config: { unit_amount: 'unit_amount' },
412+
unit_config: { unit_amount: 'unit_amount', prorated: true },
413413
billable_metric_id: 'billable_metric_id',
414414
billed_in_advance: true,
415415
billing_cycle_configuration: { duration: 0, duration_unit: 'day' },

0 commit comments

Comments
 (0)