diff --git a/.stats.yml b/.stats.yml index 2105f66..b6290eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-d9cc087ece8a2eba847035f3cd8ae44d3401046e01761ab6ad7fd6165d93f0c8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-d08c3c586f46f155358104a907afa8300ce44a25814c1574c0f4344935c1b838.yml diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 8e370a7..f5350d3 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -3599,6 +3599,11 @@ export namespace SubscriptionPriceIntervalsParams { */ start_date: (string & {}) | Shared.BillingCycleRelativeDate; + /** + * The definition of a new allocation price to create and add to the subscription. + */ + allocation_price?: Add.AllocationPrice | null; + /** * A list of discounts to initialize on the price interval. */ @@ -3667,6 +3672,33 @@ export namespace SubscriptionPriceIntervalsParams { } export namespace Add { + /** + * The definition of a new allocation price to create and add to the subscription. + */ + export interface AllocationPrice { + /** + * An amount of the currency to allocate to the customer at the specified cadence. + */ + amount: number; + + /** + * The cadence at which to allocate the amount to the customer. + */ + cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual'; + + /** + * An ISO 4217 currency string or a custom pricing unit identifier in which to bill + * this price. + */ + currency: string; + + /** + * Whether the allocated amount should expire at the end of the cadence or roll + * over to the next period. + */ + expires_at_end_of_cadence: boolean; + } + export interface AmountDiscountCreationParams { /** * Only available if discount_type is `amount`. diff --git a/tests/api-resources/subscriptions.test.ts b/tests/api-resources/subscriptions.test.ts index 3ab500f..8c1bd8f 100644 --- a/tests/api-resources/subscriptions.test.ts +++ b/tests/api-resources/subscriptions.test.ts @@ -381,6 +381,12 @@ describe('resource subscriptions', () => { unit_config: { unit_amount: 'string' }, currency: 'string', }, + allocation_price: { + currency: 'USD', + amount: 0, + cadence: 'monthly', + expires_at_end_of_cadence: true, + }, start_date: '2019-12-27T18:11:19.117Z', end_date: '2019-12-27T18:11:19.117Z', fixed_fee_quantity_transitions: [ @@ -413,6 +419,12 @@ describe('resource subscriptions', () => { unit_config: { unit_amount: 'string' }, currency: 'string', }, + allocation_price: { + currency: 'USD', + amount: 0, + cadence: 'monthly', + expires_at_end_of_cadence: true, + }, start_date: '2019-12-27T18:11:19.117Z', end_date: '2019-12-27T18:11:19.117Z', fixed_fee_quantity_transitions: [ @@ -445,6 +457,12 @@ describe('resource subscriptions', () => { unit_config: { unit_amount: 'string' }, currency: 'string', }, + allocation_price: { + currency: 'USD', + amount: 0, + cadence: 'monthly', + expires_at_end_of_cadence: true, + }, start_date: '2019-12-27T18:11:19.117Z', end_date: '2019-12-27T18:11:19.117Z', fixed_fee_quantity_transitions: [