From 0383654b1b459644a3e73b0b46559de47362fc36 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:21:37 +0000 Subject: [PATCH 01/22] Update generated code (#2069) * Update generated code for v963 * Update generated code for v964 * Update generated code for v966 * Update generated code for v967 * Update generated code for v968 * Update generated code for v969 * Update generated code for v971 * Update generated code for v972 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- src/resources/Invoices.ts | 4 + types/Billing/MeterEventSummaries.d.ts | 8 +- types/Billing/MeterEvents.d.ts | 2 +- types/Billing/MeterEventsResource.d.ts | 4 +- types/Billing/Meters.d.ts | 8 +- types/Billing/MetersResource.d.ts | 12 +- types/Checkout/Sessions.d.ts | 38 + types/Checkout/SessionsResource.d.ts | 58 + types/CustomersResource.d.ts | 7 + types/InvoicesResource.d.ts | 3538 ++++++++++++++--- types/Issuing/Transactions.d.ts | 2 +- types/PaymentIntentsResource.d.ts | 21 + types/PaymentMethodsResource.d.ts | 14 + types/SetupIntentsResource.d.ts | 21 + .../ConfirmationTokensResource.d.ts | 7 + .../Issuing/AuthorizationsResource.d.ts | 4 +- .../Issuing/TransactionsResource.d.ts | 8 +- 18 files changed, 3181 insertions(+), 577 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ea2fb0ba15..e0b2735086 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v961 \ No newline at end of file +v972 \ No newline at end of file diff --git a/src/resources/Invoices.ts b/src/resources/Invoices.ts index b6ffa98f4f..fc01dc9035 100644 --- a/src/resources/Invoices.ts +++ b/src/resources/Invoices.ts @@ -12,6 +12,10 @@ export const Invoices = StripeResource.extend({ methodType: 'list', }), del: stripeMethod({method: 'DELETE', fullPath: '/v1/invoices/{invoice}'}), + createPreview: stripeMethod({ + method: 'POST', + fullPath: '/v1/invoices/create_preview', + }), finalizeInvoice: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}/finalize', diff --git a/types/Billing/MeterEventSummaries.d.ts b/types/Billing/MeterEventSummaries.d.ts index 409470f52c..8c74518af3 100644 --- a/types/Billing/MeterEventSummaries.d.ts +++ b/types/Billing/MeterEventSummaries.d.ts @@ -19,12 +19,12 @@ declare module 'stripe' { object: 'billing.meter_event_summary'; /** - * Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``. + * Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. */ aggregated_value: number; /** - * End timestamp for this usage summary (inclusive). + * End timestamp for this event summary (inclusive). */ end_time: number; @@ -34,12 +34,12 @@ declare module 'stripe' { livemode: boolean; /** - * The meter associated with this usage summary. + * The meter associated with this event summary. */ meter: string; /** - * Start timestamp for this usage summary (inclusive). + * Start timestamp for this event summary (inclusive). */ start_time: number; } diff --git a/types/Billing/MeterEvents.d.ts b/types/Billing/MeterEvents.d.ts index 40e4471a95..abcb35c586 100644 --- a/types/Billing/MeterEvents.d.ts +++ b/types/Billing/MeterEvents.d.ts @@ -34,7 +34,7 @@ declare module 'stripe' { livemode: boolean; /** - * The payload of the event. + * The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). */ payload: { [key: string]: string; diff --git a/types/Billing/MeterEventsResource.d.ts b/types/Billing/MeterEventsResource.d.ts index 29f53b9ad1..97fb3f86b2 100644 --- a/types/Billing/MeterEventsResource.d.ts +++ b/types/Billing/MeterEventsResource.d.ts @@ -10,7 +10,7 @@ declare module 'stripe' { event_name: string; /** - * The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer. + * The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). */ payload: { [key: string]: string; @@ -27,7 +27,7 @@ declare module 'stripe' { identifier?: string; /** - * The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified. + * The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. */ timestamp?: number; } diff --git a/types/Billing/Meters.d.ts b/types/Billing/Meters.d.ts index 5550f39d44..ca9d47eb0d 100644 --- a/types/Billing/Meters.d.ts +++ b/types/Billing/Meters.d.ts @@ -32,12 +32,12 @@ declare module 'stripe' { display_name: string; /** - * The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + * The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. */ event_name: string; /** - * The time window to pre-aggregate usage events for, if any. + * The time window to pre-aggregate meter events for, if any. */ event_time_window: Meter.EventTimeWindow | null; @@ -64,7 +64,7 @@ declare module 'stripe' { namespace Meter { interface CustomerMapping { /** - * The key in the usage event payload to use for mapping the event to a customer. + * The key in the meter event payload to use for mapping the event to a customer. */ event_payload_key: string; @@ -98,7 +98,7 @@ declare module 'stripe' { interface ValueSettings { /** - * The key in the usage event payload to use as the value for this meter. + * The key in the meter event payload to use as the value for this meter. */ event_payload_key: string; } diff --git a/types/Billing/MetersResource.d.ts b/types/Billing/MetersResource.d.ts index d1f3c7dd51..40ad6e4c6c 100644 --- a/types/Billing/MetersResource.d.ts +++ b/types/Billing/MetersResource.d.ts @@ -15,7 +15,7 @@ declare module 'stripe' { display_name: string; /** - * The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events. + * The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. */ event_name: string; @@ -25,7 +25,7 @@ declare module 'stripe' { customer_mapping?: MeterCreateParams.CustomerMapping; /** - * The time window to pre-aggregate usage events for, if any. + * The time window to pre-aggregate meter events for, if any. */ event_time_window?: MeterCreateParams.EventTimeWindow; @@ -35,7 +35,7 @@ declare module 'stripe' { expand?: Array; /** - * Fields that specify how to calculate a usage event's value. + * Fields that specify how to calculate a meter event's value. */ value_settings?: MeterCreateParams.ValueSettings; } @@ -55,7 +55,7 @@ declare module 'stripe' { interface DefaultAggregation { /** - * Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value. + * Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. */ formula: DefaultAggregation.Formula; } @@ -123,12 +123,12 @@ declare module 'stripe' { customer: string; /** - * The timestamp from when to stop aggregating usage events (exclusive). + * The timestamp from when to stop aggregating meter events (exclusive). */ end_time: number; /** - * The timestamp from when to start aggregating usage events (inclusive). + * The timestamp from when to start aggregating meter events (inclusive). */ start_time: number; diff --git a/types/Checkout/Sessions.d.ts b/types/Checkout/Sessions.d.ts index af4a715bb9..f72b44ca38 100644 --- a/types/Checkout/Sessions.d.ts +++ b/types/Checkout/Sessions.d.ts @@ -228,6 +228,11 @@ declare module 'stripe' { */ return_url?: string; + /** + * Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + */ + saved_payment_method_options: Session.SavedPaymentMethodOptions | null; + /** * The ID of the SetupIntent for Checkout Sessions in `setup` mode. */ @@ -912,6 +917,8 @@ declare module 'stripe' { link?: PaymentMethodOptions.Link; + mobilepay?: PaymentMethodOptions.Mobilepay; + oxxo?: PaymentMethodOptions.Oxxo; p24?: PaymentMethodOptions.P24; @@ -1312,6 +1319,17 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Mobilepay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + interface Oxxo { /** * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -1485,6 +1503,26 @@ declare module 'stripe' { type RedirectOnCompletion = 'always' | 'if_required' | 'never'; + interface SavedPaymentMethodOptions { + /** + * Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + */ + allow_redisplay_filters: Array< + SavedPaymentMethodOptions.AllowRedisplayFilter + > | null; + + /** + * Enable customers to choose if they wish to save their payment method for future use. + */ + payment_method_save: SavedPaymentMethodOptions.PaymentMethodSave | null; + } + + namespace SavedPaymentMethodOptions { + type AllowRedisplayFilter = 'always' | 'limited' | 'unspecified'; + + type PaymentMethodSave = 'disabled' | 'enabled'; + } + interface ShippingAddressCollection { /** * An array of two-letter ISO country codes representing which countries Checkout should provide as options for diff --git a/types/Checkout/SessionsResource.d.ts b/types/Checkout/SessionsResource.d.ts index 86b762801f..f1c749cb46 100644 --- a/types/Checkout/SessionsResource.d.ts +++ b/types/Checkout/SessionsResource.d.ts @@ -162,6 +162,11 @@ declare module 'stripe' { */ payment_method_configuration?: string; + /** + * This parameter allows you to set some attributes on the payment method created during a Checkout session. + */ + payment_method_data?: SessionCreateParams.PaymentMethodData; + /** * Payment-method-specific configuration. */ @@ -202,6 +207,11 @@ declare module 'stripe' { */ return_url?: string; + /** + * Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + */ + saved_payment_method_options?: SessionCreateParams.SavedPaymentMethodOptions; + /** * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. */ @@ -947,6 +957,17 @@ declare module 'stripe' { type PaymentMethodCollection = 'always' | 'if_required'; + interface PaymentMethodData { + /** + * Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + } + + namespace PaymentMethodData { + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + } + interface PaymentMethodOptions { /** * contains details about the ACSS Debit payment method options. @@ -1048,6 +1069,11 @@ declare module 'stripe' { */ link?: PaymentMethodOptions.Link; + /** + * contains details about the Mobilepay payment method options. + */ + mobilepay?: PaymentMethodOptions.Mobilepay; + /** * contains details about the OXXO payment method options. */ @@ -1507,6 +1533,17 @@ declare module 'stripe' { type SetupFutureUsage = 'none' | 'off_session'; } + interface Mobilepay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + interface Oxxo { /** * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. @@ -1762,6 +1799,7 @@ declare module 'stripe' { | 'klarna' | 'konbini' | 'link' + | 'mobilepay' | 'oxxo' | 'p24' | 'paynow' @@ -1785,6 +1823,26 @@ declare module 'stripe' { type RedirectOnCompletion = 'always' | 'if_required' | 'never'; + interface SavedPaymentMethodOptions { + /** + * Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. + */ + allow_redisplay_filters?: Array< + SavedPaymentMethodOptions.AllowRedisplayFilter + >; + + /** + * Enable customers to choose if they wish to save their payment method for future use. + */ + payment_method_save?: SavedPaymentMethodOptions.PaymentMethodSave; + } + + namespace SavedPaymentMethodOptions { + type AllowRedisplayFilter = 'always' | 'limited' | 'unspecified'; + + type PaymentMethodSave = 'disabled' | 'enabled'; + } + interface SetupIntentData { /** * An arbitrary string attached to the object. Often useful for displaying to users. diff --git a/types/CustomersResource.d.ts b/types/CustomersResource.d.ts index 51332cb9ae..31b0507359 100644 --- a/types/CustomersResource.d.ts +++ b/types/CustomersResource.d.ts @@ -767,6 +767,11 @@ declare module 'stripe' { } interface CustomerListPaymentMethodsParams extends PaginationParams { + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: CustomerListPaymentMethodsParams.AllowRedisplay; + /** * Specifies which fields in the response should be expanded. */ @@ -779,6 +784,8 @@ declare module 'stripe' { } namespace CustomerListPaymentMethodsParams { + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + type Type = | 'acss_debit' | 'affirm' diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 9d8fcf1412..e16dcc7ab5 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -1420,30 +1420,11 @@ declare module 'stripe' { interface InvoiceDeleteParams {} - interface InvoiceFinalizeInvoiceParams { - /** - * Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. - */ - auto_advance?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceListUpcomingLinesParams extends PaginationParams { + interface InvoiceCreatePreviewParams { /** * Settings for automatic tax lookup for this invoice preview. */ - automatic_tax?: InvoiceListUpcomingLinesParams.AutomaticTax; + automatic_tax?: InvoiceCreatePreviewParams.AutomaticTax; /** * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. @@ -1463,14 +1444,12 @@ declare module 'stripe' { /** * Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. */ - customer_details?: InvoiceListUpcomingLinesParams.CustomerDetails; + customer_details?: InvoiceCreatePreviewParams.CustomerDetails; /** * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. */ - discounts?: Stripe.Emptyable< - Array - >; + discounts?: Stripe.Emptyable>; /** * Specifies which fields in the response should be expanded. @@ -1480,12 +1459,12 @@ declare module 'stripe' { /** * List of invoice items to add or update in the upcoming invoice preview. */ - invoice_items?: Array; + invoice_items?: Array; /** * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. */ - issuer?: InvoiceListUpcomingLinesParams.Issuer; + issuer?: InvoiceCreatePreviewParams.Issuer; /** * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. @@ -1498,76 +1477,22 @@ declare module 'stripe' { schedule?: string; /** - * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - */ - subscription?: string; - - /** - * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - */ - subscription_billing_cycle_anchor?: - | InvoiceListUpcomingLinesParams.SubscriptionBillingCycleAnchor - | number; - - /** - * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - */ - subscription_cancel_at?: Stripe.Emptyable; - - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - subscription_cancel_at_period_end?: boolean; - - /** - * This simulates the subscription being canceled or expired immediately. - */ - subscription_cancel_now?: boolean; - - /** - * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - */ - subscription_default_tax_rates?: Stripe.Emptyable>; - - /** - * A list of up to 20 subscription items, each with an attached price. - */ - subscription_items?: Array< - InvoiceListUpcomingLinesParams.SubscriptionItem - >; - - /** - * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - */ - subscription_proration_behavior?: InvoiceListUpcomingLinesParams.SubscriptionProrationBehavior; - - /** - * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + * The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. */ - subscription_proration_date?: number; - - /** - * For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - */ - subscription_resume_at?: 'now'; - - /** - * Date a subscription is intended to start (can be future or past). - */ - subscription_start_date?: number; + schedule_details?: InvoiceCreatePreviewParams.ScheduleDetails; /** - * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. */ - subscription_trial_end?: 'now' | number; + subscription?: string; /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + * The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. */ - subscription_trial_from_plan?: boolean; + subscription_details?: InvoiceCreatePreviewParams.SubscriptionDetails; } - namespace InvoiceListUpcomingLinesParams { + namespace InvoiceCreatePreviewParams { interface AutomaticTax { /** * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. @@ -1919,678 +1844,3172 @@ declare module 'stripe' { type Type = 'account' | 'self'; } - type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; - - interface SubscriptionItem { + interface ScheduleDetails { /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionItem.BillingThresholds - >; + end_behavior?: ScheduleDetails.EndBehavior; /** - * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. */ - clear_usage?: boolean; + phases?: Array; /** - * A flag that, if set to `true`, will delete the specified item. + * In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. */ - deleted?: boolean; + proration_behavior?: ScheduleDetails.ProrationBehavior; + } - /** - * The coupons to redeem into discounts for the subscription item. - */ - discounts?: Stripe.Emptyable>; + namespace ScheduleDetails { + type EndBehavior = 'cancel' | 'release'; - /** - * Subscription item to update. - */ - id?: string; + interface Phase { + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + */ + add_invoice_items?: Array; - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.Emptyable; + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; - /** - * Plan ID for this item, as a string. - */ - plan?: string; + /** + * Automatic tax settings for this phase. + */ + automatic_tax?: Phase.AutomaticTax; - /** - * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - */ - price?: string; + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: Phase.BillingCycleAnchor; - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: SubscriptionItem.PriceData; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; - /** - * Quantity for this item. - */ - quantity?: number; + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: Phase.CollectionMethod; - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } + /** + * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + */ + coupon?: string; - namespace SubscriptionItem { - interface BillingThresholds { /** - * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). */ - usage_gte: number; - } + currency?: string; - interface Discount { /** - * ID of the coupon to create a new discount for. + * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. */ - coupon?: string; + default_payment_method?: string; /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. */ - discount?: string; + default_tax_rates?: Stripe.Emptyable>; /** - * ID of the promotion code to create a new discount for. + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. */ - promotion_code?: string; - } + description?: Stripe.Emptyable; - interface PriceData { /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. */ - currency: string; + discounts?: Stripe.Emptyable>; /** - * The ID of the product that this price will belong to. + * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. */ - product: string; + end_date?: number | 'now'; /** - * The recurring components of a price such as `interval` and `interval_count`. + * All invoices will be billed using the specified settings. */ - recurring: PriceData.Recurring; + invoice_settings?: Phase.InvoiceSettings; /** - * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. */ - tax_behavior?: PriceData.TaxBehavior; + items: Array; /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. */ - unit_amount?: number; + iterations?: number; /** - * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. */ - unit_amount_decimal?: string; + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: string; + + /** + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + */ + proration_behavior?: Phase.ProrationBehavior; + + /** + * The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + */ + start_date?: number | 'now'; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Phase.TransferData; + + /** + * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + */ + trial?: boolean; + + /** + * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + */ + trial_end?: number | 'now'; } - namespace PriceData { - interface Recurring { + namespace Phase { + interface AddInvoiceItem { /** - * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + * The coupons to redeem into discounts for the item. */ - interval: Recurring.Interval; + discounts?: Array; /** - * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + * The ID of the price object. */ - interval_count?: number; - } + price?: string; - namespace Recurring { - type Interval = 'day' | 'month' | 'week' | 'year'; - } + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; - type SubscriptionProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } - interface InvoiceMarkUncollectibleParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } + namespace AddInvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; - interface InvoicePayParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; - /** - * In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. - * - * Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. - */ - forgive?: boolean; + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } - /** - * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. - */ - mandate?: Stripe.Emptyable; + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; - /** - * Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). - */ - off_session?: boolean; + /** + * The ID of the product that this price will belong to. + */ + product: string; - /** - * Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. - */ - paid_out_of_band?: boolean; + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; - /** - * A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. - */ - payment_method?: string; + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; - /** - * A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. - */ - source?: string; - } + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } - interface InvoiceRetrieveUpcomingParams { - /** - * Settings for automatic tax lookup for this invoice preview. - */ - automatic_tax?: InvoiceRetrieveUpcomingParams.AutomaticTax; + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } - /** - * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. - */ - coupon?: string; + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; - /** - * The currency to preview this invoice in. Defaults to that of `customer` if not specified. - */ - currency?: string; + /** + * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + */ + liability?: AutomaticTax.Liability; + } - /** - * The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - */ - customer?: string; + namespace AutomaticTax { + interface Liability { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; - /** - * Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. - */ - customer_details?: InvoiceRetrieveUpcomingParams.CustomerDetails; + /** + * Type of the account referenced in the request. + */ + type: Liability.Type; + } - /** - * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. - */ - discounts?: Stripe.Emptyable< - Array - >; + namespace Liability { + type Type = 'account' | 'self'; + } + } - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; + type BillingCycleAnchor = 'automatic' | 'phase_start'; - /** - * List of invoice items to add or update in the upcoming invoice preview. - */ - invoice_items?: Array; + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; - /** - * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. - */ - issuer?: InvoiceRetrieveUpcomingParams.Issuer; + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } - /** - * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - */ - on_behalf_of?: Stripe.Emptyable; + type CollectionMethod = 'charge_automatically' | 'send_invoice'; - /** - * The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. - */ - schedule?: string; + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; - /** - * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - */ - subscription?: string; + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; - /** - * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - */ - subscription_billing_cycle_anchor?: - | InvoiceRetrieveUpcomingParams.SubscriptionBillingCycleAnchor - | number; + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } - /** - * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - */ - subscription_cancel_at?: Stripe.Emptyable; + interface InvoiceSettings { + /** + * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + */ + account_tax_ids?: Stripe.Emptyable>; - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - subscription_cancel_at_period_end?: boolean; + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; - /** - * This simulates the subscription being canceled or expired immediately. - */ - subscription_cancel_now?: boolean; + /** + * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + */ + issuer?: InvoiceSettings.Issuer; + } - /** - * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - */ - subscription_default_tax_rates?: Stripe.Emptyable>; + namespace InvoiceSettings { + interface Issuer { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; - /** - * A list of up to 20 subscription items, each with an attached price. - */ - subscription_items?: Array< - InvoiceRetrieveUpcomingParams.SubscriptionItem - >; + /** + * Type of the account referenced in the request. + */ + type: Issuer.Type; + } - /** - * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. - */ - subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior; + namespace Issuer { + type Type = 'account' | 'self'; + } + } - /** - * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. - */ - subscription_proration_date?: number; + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; - /** - * For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. - */ - subscription_resume_at?: 'now'; + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; - /** - * Date a subscription is intended to start (can be future or past). - */ - subscription_start_date?: number; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + */ + metadata?: Stripe.MetadataParam; - /** - * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. - */ - subscription_trial_end?: 'now' | number; + /** + * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + */ + plan?: string; - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - subscription_trial_from_plan?: boolean; - } + /** + * The ID of the price object. + */ + price?: string; - namespace InvoiceRetrieveUpcomingParams { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - */ - enabled: boolean; + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; - /** - * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. - */ - liability?: AutomaticTax.Liability; - } + /** + * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + */ + quantity?: number; - namespace AutomaticTax { - interface Liability { - /** - * The connected account being referenced when `type` is `account`. - */ - account?: string; + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } - /** - * Type of the account referenced in the request. - */ - type: Liability.Type; - } + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } - namespace Liability { - type Type = 'account' | 'self'; + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; } - interface CustomerDetails { + interface SubscriptionDetails { /** - * The customer's address. + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. */ - address?: Stripe.Emptyable; + billing_cycle_anchor?: SubscriptionDetails.BillingCycleAnchor | number; /** - * The customer's shipping information. Appears on invoices emailed to this customer. + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. */ - shipping?: Stripe.Emptyable; + cancel_at?: Stripe.Emptyable; /** - * Tax details about the customer. + * Boolean indicating whether this subscription should cancel at the end of the current period. */ - tax?: CustomerDetails.Tax; + cancel_at_period_end?: boolean; /** - * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + * This simulates the subscription being canceled or expired immediately. */ - tax_exempt?: Stripe.Emptyable; + cancel_now?: boolean; /** - * The customer's tax IDs. + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. */ - tax_ids?: Array; - } + default_tax_rates?: Stripe.Emptyable>; - namespace CustomerDetails { - interface Shipping { - /** - * Customer shipping address. - */ - address: Stripe.AddressParam; + /** + * A list of up to 20 subscription items, each with an attached price. + */ + items?: Array; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + */ + proration_behavior?: SubscriptionDetails.ProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. + */ + proration_date?: number; + + /** + * For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + */ + resume_at?: 'now'; + + /** + * Date a subscription is intended to start (can be future or past). + */ + start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. + */ + trial_end?: 'now' | number; + } + + namespace SubscriptionDetails { + type BillingCycleAnchor = 'now' | 'unchanged'; + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Subscription item to update. + */ + id?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + } + + interface InvoiceFinalizeInvoiceParams { + /** + * Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + */ + auto_advance?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceListUpcomingLinesParams extends PaginationParams { + /** + * Settings for automatic tax lookup for this invoice preview. + */ + automatic_tax?: InvoiceListUpcomingLinesParams.AutomaticTax; + + /** + * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + */ + coupon?: string; + + /** + * The currency to preview this invoice in. Defaults to that of `customer` if not specified. + */ + currency?: string; + + /** + * The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + */ + customer?: string; + + /** + * Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + */ + customer_details?: InvoiceListUpcomingLinesParams.CustomerDetails; + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + */ + discounts?: Stripe.Emptyable< + Array + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * List of invoice items to add or update in the upcoming invoice preview. + */ + invoice_items?: Array; + + /** + * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + */ + issuer?: InvoiceListUpcomingLinesParams.Issuer; + + /** + * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + */ + schedule?: string; + + /** + * The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + */ + schedule_details?: InvoiceListUpcomingLinesParams.ScheduleDetails; + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + */ + subscription?: string; + + /** + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + */ + subscription_billing_cycle_anchor?: + | InvoiceListUpcomingLinesParams.SubscriptionBillingCycleAnchor + | number; + + /** + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + */ + subscription_cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + */ + subscription_cancel_at_period_end?: boolean; + + /** + * This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + */ + subscription_cancel_now?: boolean; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + */ + subscription_default_tax_rates?: Stripe.Emptyable>; + + /** + * The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + */ + subscription_details?: InvoiceListUpcomingLinesParams.SubscriptionDetails; + + /** + * A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + */ + subscription_items?: Array< + InvoiceListUpcomingLinesParams.SubscriptionItem + >; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + */ + subscription_proration_behavior?: InvoiceListUpcomingLinesParams.SubscriptionProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + */ + subscription_proration_date?: number; + + /** + * For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + */ + subscription_resume_at?: 'now'; + + /** + * Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + */ + subscription_start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + */ + subscription_trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + subscription_trial_from_plan?: boolean; + } + + namespace InvoiceListUpcomingLinesParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + + /** + * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + */ + liability?: AutomaticTax.Liability; + } + + namespace AutomaticTax { + interface Liability { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Liability.Type; + } + + namespace Liability { + type Type = 'account' | 'self'; + } + } + + interface CustomerDetails { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + /** + * Tax details about the customer. + */ + tax?: CustomerDetails.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The customer's tax IDs. + */ + tax_ids?: Array; + } + + namespace CustomerDetails { + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ad_nrt' + | 'ae_trn' + | 'ar_cuit' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'bh_vat' + | 'bo_tin' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'cn_tin' + | 'co_nit' + | 'cr_tin' + | 'do_rcn' + | 'ec_ruc' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'kz_bin' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'ng_tin' + | 'no_vat' + | 'no_voec' + | 'nz_gst' + | 'om_vat' + | 'pe_ruc' + | 'ph_tin' + | 'ro_tin' + | 'rs_pib' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'sv_nit' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'uy_ruc' + | 've_rif' + | 'vn_tin' + | 'za_vat'; + } + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface InvoiceItem { + /** + * The integer amount in cents (or local equivalent) of previewed invoice item. + */ + amount?: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items. + */ + currency?: string; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + */ + discountable?: boolean; + + /** + * The coupons to redeem into discounts for the invoice item in the preview. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + */ + invoiceitem?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + */ + period?: InvoiceItem.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItem.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: InvoiceItem.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace InvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. This value is inclusive. + */ + end: number; + + /** + * The start of the period. This value is inclusive. + */ + start: number; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface Issuer { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Issuer.Type; + } + + namespace Issuer { + type Type = 'account' | 'self'; + } + + interface ScheduleDetails { + /** + * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + */ + end_behavior?: ScheduleDetails.EndBehavior; + + /** + * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + */ + phases?: Array; + + /** + * In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + */ + proration_behavior?: ScheduleDetails.ProrationBehavior; + } + + namespace ScheduleDetails { + type EndBehavior = 'cancel' | 'release'; + + interface Phase { + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + */ + add_invoice_items?: Array; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Automatic tax settings for this phase. + */ + automatic_tax?: Phase.AutomaticTax; + + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: Phase.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: Phase.CollectionMethod; + + /** + * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + */ + coupon?: string; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + + /** + * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + */ + default_payment_method?: string; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + */ + description?: Stripe.Emptyable; + + /** + * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + */ + discounts?: Stripe.Emptyable>; + + /** + * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + */ + end_date?: number | 'now'; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: Phase.InvoiceSettings; + + /** + * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + */ + items: Array; + + /** + * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + */ + iterations?: number; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: string; + + /** + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + */ + proration_behavior?: Phase.ProrationBehavior; + + /** + * The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + */ + start_date?: number | 'now'; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Phase.TransferData; + + /** + * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + */ + trial?: boolean; + + /** + * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + */ + trial_end?: number | 'now'; + } + + namespace Phase { + interface AddInvoiceItem { + /** + * The coupons to redeem into discounts for the item. + */ + discounts?: Array; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + + /** + * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + */ + liability?: AutomaticTax.Liability; + } + + namespace AutomaticTax { + interface Liability { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Liability.Type; + } + + namespace Liability { + type Type = 'account' | 'self'; + } + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface InvoiceSettings { + /** + * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + */ + account_tax_ids?: Stripe.Emptyable>; + + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + + /** + * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + */ + issuer?: InvoiceSettings.Issuer; + } + + namespace InvoiceSettings { + interface Issuer { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Issuer.Type; + } + + namespace Issuer { + type Type = 'account' | 'self'; + } + } + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; + + interface SubscriptionDetails { + /** + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + */ + billing_cycle_anchor?: SubscriptionDetails.BillingCycleAnchor | number; + + /** + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + */ + cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + cancel_at_period_end?: boolean; + + /** + * This simulates the subscription being canceled or expired immediately. + */ + cancel_now?: boolean; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * A list of up to 20 subscription items, each with an attached price. + */ + items?: Array; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. + */ + proration_behavior?: SubscriptionDetails.ProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. + */ + proration_date?: number; + + /** + * For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + */ + resume_at?: 'now'; + + /** + * Date a subscription is intended to start (can be future or past). + */ + start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. + */ + trial_end?: 'now' | number; + } + + namespace SubscriptionDetails { + type BillingCycleAnchor = 'now' | 'unchanged'; + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Subscription item to update. + */ + id?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface SubscriptionItem { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionItem.BillingThresholds + >; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Subscription item to update. + */ + id?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: SubscriptionItem.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace SubscriptionItem { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type SubscriptionProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface InvoiceMarkUncollectibleParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoicePayParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. + * + * Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. + */ + forgive?: boolean; + + /** + * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + */ + mandate?: Stripe.Emptyable; + + /** + * Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + */ + off_session?: boolean; + + /** + * Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + */ + paid_out_of_band?: boolean; + + /** + * A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + */ + payment_method?: string; + + /** + * A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + */ + source?: string; + } + + interface InvoiceRetrieveUpcomingParams { + /** + * Settings for automatic tax lookup for this invoice preview. + */ + automatic_tax?: InvoiceRetrieveUpcomingParams.AutomaticTax; + + /** + * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + */ + coupon?: string; + + /** + * The currency to preview this invoice in. Defaults to that of `customer` if not specified. + */ + currency?: string; + + /** + * The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + */ + customer?: string; + + /** + * Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + */ + customer_details?: InvoiceRetrieveUpcomingParams.CustomerDetails; + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. + */ + discounts?: Stripe.Emptyable< + Array + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * List of invoice items to add or update in the upcoming invoice preview. + */ + invoice_items?: Array; + + /** + * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + */ + issuer?: InvoiceRetrieveUpcomingParams.Issuer; + + /** + * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + */ + schedule?: string; + + /** + * The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. + */ + schedule_details?: InvoiceRetrieveUpcomingParams.ScheduleDetails; + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + */ + subscription?: string; + + /** + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. + */ + subscription_billing_cycle_anchor?: + | InvoiceRetrieveUpcomingParams.SubscriptionBillingCycleAnchor + | number; + + /** + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. + */ + subscription_cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. + */ + subscription_cancel_at_period_end?: boolean; + + /** + * This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. + */ + subscription_cancel_now?: boolean; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. + */ + subscription_default_tax_rates?: Stripe.Emptyable>; + + /** + * The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. + */ + subscription_details?: InvoiceRetrieveUpcomingParams.SubscriptionDetails; + + /** + * A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. + */ + subscription_items?: Array< + InvoiceRetrieveUpcomingParams.SubscriptionItem + >; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. + */ + subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. + */ + subscription_proration_date?: number; + + /** + * For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. + */ + subscription_resume_at?: 'now'; + + /** + * Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. + */ + subscription_start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. + */ + subscription_trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + subscription_trial_from_plan?: boolean; + } + + namespace InvoiceRetrieveUpcomingParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + + /** + * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + */ + liability?: AutomaticTax.Liability; + } + + namespace AutomaticTax { + interface Liability { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Liability.Type; + } + + namespace Liability { + type Type = 'account' | 'self'; + } + } + + interface CustomerDetails { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + /** + * Tax details about the customer. + */ + tax?: CustomerDetails.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The customer's tax IDs. + */ + tax_ids?: Array; + } + + namespace CustomerDetails { + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ad_nrt' + | 'ae_trn' + | 'ar_cuit' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'bh_vat' + | 'bo_tin' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'cn_tin' + | 'co_nit' + | 'cr_tin' + | 'do_rcn' + | 'ec_ruc' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'kz_bin' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'ng_tin' + | 'no_vat' + | 'no_voec' + | 'nz_gst' + | 'om_vat' + | 'pe_ruc' + | 'ph_tin' + | 'ro_tin' + | 'rs_pib' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'sv_nit' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'uy_ruc' + | 've_rif' + | 'vn_tin' + | 'za_vat'; + } + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface InvoiceItem { + /** + * The integer amount in cents (or local equivalent) of previewed invoice item. + */ + amount?: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items. + */ + currency?: string; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + */ + discountable?: boolean; + + /** + * The coupons to redeem into discounts for the invoice item in the preview. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + */ + invoiceitem?: string; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: Stripe.Emptyable; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + */ + period?: InvoiceItem.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItem.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: InvoiceItem.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace InvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. This value is inclusive. + */ + end: number; + + /** + * The start of the period. This value is inclusive. + */ + start: number; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface Issuer { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Issuer.Type; + } + + namespace Issuer { + type Type = 'account' | 'self'; + } + + interface ScheduleDetails { + /** + * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + */ + end_behavior?: ScheduleDetails.EndBehavior; + + /** + * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + */ + phases?: Array; + + /** + * In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. + */ + proration_behavior?: ScheduleDetails.ProrationBehavior; + } + + namespace ScheduleDetails { + type EndBehavior = 'cancel' | 'release'; + interface Phase { /** - * Customer name. + * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. */ - name: string; + add_invoice_items?: Array; /** - * Customer phone (including extension). + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). */ - phone?: string; - } + application_fee_percent?: number; - interface Tax { /** - * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + * Automatic tax settings for this phase. */ - ip_address?: Stripe.Emptyable; - } + automatic_tax?: Phase.AutomaticTax; - type TaxExempt = 'exempt' | 'none' | 'reverse'; + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: Phase.BillingCycleAnchor; - interface TaxId { /** - * Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. */ - type: TaxId.Type; + billing_thresholds?: Stripe.Emptyable; /** - * Value of the tax ID. + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. */ - value: string; + collection_method?: Phase.CollectionMethod; + + /** + * The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + */ + coupon?: string; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string; + + /** + * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + */ + default_payment_method?: string; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + */ + description?: Stripe.Emptyable; + + /** + * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. + */ + discounts?: Stripe.Emptyable>; + + /** + * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + */ + end_date?: number | 'now'; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: Phase.InvoiceSettings; + + /** + * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + */ + items: Array; + + /** + * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + */ + iterations?: number; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: string; + + /** + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + */ + proration_behavior?: Phase.ProrationBehavior; + + /** + * The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + */ + start_date?: number | 'now'; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Phase.TransferData; + + /** + * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + */ + trial?: boolean; + + /** + * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + */ + trial_end?: number | 'now'; } - namespace TaxId { - type Type = - | 'ad_nrt' - | 'ae_trn' - | 'ar_cuit' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'bh_vat' - | 'bo_tin' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'cn_tin' - | 'co_nit' - | 'cr_tin' - | 'do_rcn' - | 'ec_ruc' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'kz_bin' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'ng_tin' - | 'no_vat' - | 'no_voec' - | 'nz_gst' - | 'om_vat' - | 'pe_ruc' - | 'ph_tin' - | 'ro_tin' - | 'rs_pib' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'sv_nit' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'uy_ruc' - | 've_rif' - | 'vn_tin' - | 'za_vat'; - } - } + namespace Phase { + interface AddInvoiceItem { + /** + * The coupons to redeem into discounts for the item. + */ + discounts?: Array; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + + /** + * The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + */ + liability?: AutomaticTax.Liability; + } + + namespace AutomaticTax { + interface Liability { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Liability.Type; + } + + namespace Liability { + type Type = 'account' | 'self'; + } + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface InvoiceSettings { + /** + * The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + */ + account_tax_ids?: Stripe.Emptyable>; + + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + + /** + * The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + */ + issuer?: InvoiceSettings.Issuer; + } + + namespace InvoiceSettings { + interface Issuer { + /** + * The connected account being referenced when `type` is `account`. + */ + account?: string; + + /** + * Type of the account referenced in the request. + */ + type: Issuer.Type; + } + + namespace Issuer { + type Type = 'account' | 'self'; + } + } + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * The coupons to redeem into discounts for the subscription item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } - /** - * ID of the promotion code to create a new discount for. - */ - promotion_code?: string; - } + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } - interface InvoiceItem { - /** - * The integer amount in cents (or local equivalent) of previewed invoice item. - */ - amount?: number; + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items. - */ - currency?: string; + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - */ - description?: string; + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } - /** - * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - */ - discountable?: boolean; + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } - /** - * The coupons to redeem into discounts for the invoice item in the preview. - */ - discounts?: Stripe.Emptyable>; + type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; + interface SubscriptionDetails { /** - * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. */ - invoiceitem?: string; + billing_cycle_anchor?: SubscriptionDetails.BillingCycleAnchor | number; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. */ - metadata?: Stripe.Emptyable; + cancel_at?: Stripe.Emptyable; /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + * Boolean indicating whether this subscription should cancel at the end of the current period. */ - period?: InvoiceItem.Period; + cancel_at_period_end?: boolean; /** - * The ID of the price object. + * This simulates the subscription being canceled or expired immediately. */ - price?: string; + cancel_now?: boolean; /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. */ - price_data?: InvoiceItem.PriceData; + default_tax_rates?: Stripe.Emptyable>; /** - * Non-negative integer. The quantity of units for the invoice item. + * A list of up to 20 subscription items, each with an attached price. */ - quantity?: number; + items?: Array; /** - * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + * Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. */ - tax_behavior?: InvoiceItem.TaxBehavior; + proration_behavior?: SubscriptionDetails.ProrationBehavior; /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + * If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. */ - tax_code?: Stripe.Emptyable; + proration_date?: number; /** - * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + * For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. */ - tax_rates?: Stripe.Emptyable>; + resume_at?: 'now'; /** - * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + * Date a subscription is intended to start (can be future or past). */ - unit_amount?: number; + start_date?: number; /** - * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. */ - unit_amount_decimal?: string; + trial_end?: 'now' | number; } - namespace InvoiceItem { - interface Discount { + namespace SubscriptionDetails { + type BillingCycleAnchor = 'now' | 'unchanged'; + + interface Item { /** - * ID of the coupon to create a new discount for. + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. */ - coupon?: string; + billing_thresholds?: Stripe.Emptyable; /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. */ - discount?: string; + clear_usage?: boolean; /** - * ID of the promotion code to create a new discount for. + * A flag that, if set to `true`, will delete the specified item. */ - promotion_code?: string; - } + deleted?: boolean; - interface Period { /** - * The end of the period, which must be greater than or equal to the start. This value is inclusive. + * The coupons to redeem into discounts for the subscription item. */ - end: number; + discounts?: Stripe.Emptyable>; /** - * The start of the period. This value is inclusive. + * Subscription item to update. */ - start: number; - } + id?: string; - interface PriceData { /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ - currency: string; + metadata?: Stripe.Emptyable; /** - * The ID of the product that this price will belong to. + * Plan ID for this item, as a string. */ - product: string; + plan?: string; /** - * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. */ - tax_behavior?: PriceData.TaxBehavior; + price?: string; /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. */ - unit_amount?: number; + price_data?: Item.PriceData; /** - * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + * Quantity for this item. */ - unit_amount_decimal?: string; - } + quantity?: number; - namespace PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; } - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } + namespace Item { + interface BillingThresholds { + /** + * Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) + */ + usage_gte: number; + } - interface Issuer { - /** - * The connected account being referenced when `type` is `account`. - */ - account?: string; + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; - /** - * Type of the account referenced in the request. - */ - type: Issuer.Type; - } + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; - namespace Issuer { - type Type = 'account' | 'self'; - } + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } - type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; + interface PriceData { + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.Recurring; + + /** + * Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + */ + tax_behavior?: PriceData.TaxBehavior; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + */ + unit_amount?: number; + + /** + * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + */ + unit_amount_decimal?: string; + } + + namespace PriceData { + interface Recurring { + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: Recurring.Interval; + + /** + * The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + */ + interval_count?: number; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } interface SubscriptionItem { /** @@ -3069,6 +5488,21 @@ declare module 'stripe' { options?: RequestOptions ): Promise>; + /** + * At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + * + * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + * + * You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. + */ + createPreview( + params?: InvoiceCreatePreviewParams, + options?: RequestOptions + ): Promise>; + createPreview( + options?: RequestOptions + ): Promise>; + /** * Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. */ diff --git a/types/Issuing/Transactions.d.ts b/types/Issuing/Transactions.d.ts index cd8c88230b..7ff79517dd 100644 --- a/types/Issuing/Transactions.d.ts +++ b/types/Issuing/Transactions.d.ts @@ -297,7 +297,7 @@ declare module 'stripe' { type: string; /** - * The units for `volume_decimal`. One of `us_gallon` or `liter`. + * The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. */ unit: string; diff --git a/types/PaymentIntentsResource.d.ts b/types/PaymentIntentsResource.d.ts index bff040a7fa..eeb84b74ed 100644 --- a/types/PaymentIntentsResource.d.ts +++ b/types/PaymentIntentsResource.d.ts @@ -274,6 +274,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -474,6 +479,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { @@ -2509,6 +2516,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -2709,6 +2721,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { @@ -4889,6 +4903,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -5089,6 +5108,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { diff --git a/types/PaymentMethodsResource.d.ts b/types/PaymentMethodsResource.d.ts index 1b8ebb1ee2..e2c8ea2735 100644 --- a/types/PaymentMethodsResource.d.ts +++ b/types/PaymentMethodsResource.d.ts @@ -23,6 +23,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodCreateParams.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodCreateParams.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -243,6 +248,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { @@ -656,6 +663,11 @@ declare module 'stripe' { } interface PaymentMethodUpdateParams { + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodUpdateParams.AllowRedisplay; + /** * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. */ @@ -688,6 +700,8 @@ declare module 'stripe' { } namespace PaymentMethodUpdateParams { + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface BillingDetails { /** * Billing address. diff --git a/types/SetupIntentsResource.d.ts b/types/SetupIntentsResource.d.ts index f4f329a0dd..92d24bf9a8 100644 --- a/types/SetupIntentsResource.d.ts +++ b/types/SetupIntentsResource.d.ts @@ -204,6 +204,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -404,6 +409,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { @@ -1274,6 +1281,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -1474,6 +1486,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { @@ -2431,6 +2445,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -2631,6 +2650,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { diff --git a/types/TestHelpers/ConfirmationTokensResource.d.ts b/types/TestHelpers/ConfirmationTokensResource.d.ts index 1022b7771e..69004fb9c4 100644 --- a/types/TestHelpers/ConfirmationTokensResource.d.ts +++ b/types/TestHelpers/ConfirmationTokensResource.d.ts @@ -59,6 +59,11 @@ declare module 'stripe' { */ alipay?: PaymentMethodData.Alipay; + /** + * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. + */ + allow_redisplay?: PaymentMethodData.AllowRedisplay; + /** * If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. */ @@ -259,6 +264,8 @@ declare module 'stripe' { interface Alipay {} + type AllowRedisplay = 'always' | 'limited' | 'unspecified'; + interface AmazonPay {} interface AuBecsDebit { diff --git a/types/TestHelpers/Issuing/AuthorizationsResource.d.ts b/types/TestHelpers/Issuing/AuthorizationsResource.d.ts index 273b6eb725..51304b5106 100644 --- a/types/TestHelpers/Issuing/AuthorizationsResource.d.ts +++ b/types/TestHelpers/Issuing/AuthorizationsResource.d.ts @@ -635,7 +635,7 @@ declare module 'stripe' { type?: Fuel.Type; /** - * The units for `volume_decimal`. One of `us_gallon` or `liter`. + * The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. */ unit?: Fuel.Unit; @@ -658,7 +658,7 @@ declare module 'stripe' { | 'unleaded_regular' | 'unleaded_super'; - type Unit = 'liter' | 'us_gallon'; + type Unit = 'liter' | 'other' | 'us_gallon'; } interface Lodging { diff --git a/types/TestHelpers/Issuing/TransactionsResource.d.ts b/types/TestHelpers/Issuing/TransactionsResource.d.ts index 2c7d7ccd43..e2770ae27e 100644 --- a/types/TestHelpers/Issuing/TransactionsResource.d.ts +++ b/types/TestHelpers/Issuing/TransactionsResource.d.ts @@ -478,7 +478,7 @@ declare module 'stripe' { type?: Fuel.Type; /** - * The units for `volume_decimal`. One of `us_gallon` or `liter`. + * The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. */ unit?: Fuel.Unit; @@ -501,7 +501,7 @@ declare module 'stripe' { | 'unleaded_regular' | 'unleaded_super'; - type Unit = 'liter' | 'us_gallon'; + type Unit = 'liter' | 'other' | 'us_gallon'; } interface Lodging { @@ -1004,7 +1004,7 @@ declare module 'stripe' { type?: Fuel.Type; /** - * The units for `volume_decimal`. One of `us_gallon` or `liter`. + * The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`. */ unit?: Fuel.Unit; @@ -1027,7 +1027,7 @@ declare module 'stripe' { | 'unleaded_regular' | 'unleaded_super'; - type Unit = 'liter' | 'us_gallon'; + type Unit = 'liter' | 'other' | 'us_gallon'; } interface Lodging { From d66abe744c936c362fc1b7925d663915960ac501 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Thu, 18 Apr 2024 14:24:03 -0700 Subject: [PATCH 02/22] Bump version to 15.3.0 --- CHANGELOG.md | 31 +++++++++++++++++++++---------- VERSION | 2 +- package.json | 2 +- src/stripe.core.ts | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea89173c8..0820edf87c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,28 @@ # Changelog +## 15.3.0 - 2024-04-18 +* [#2069](https://github.com/stripe/stripe-node/pull/2069) Update generated code + * Add support for `create_preview` method on resource `Invoice` + * Add support for `payment_method_data` on `Checkout.SessionCreateParams` + * Add support for `saved_payment_method_options` on `Checkout.SessionCreateParams` and `Checkout.Session` + * Add support for `mobilepay` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options` + * Add support for new value `mobilepay` on enum `Checkout.SessionCreateParams.payment_method_types[]` + * Add support for `allow_redisplay` on `ConfirmationTokenCreateParams.testHelpers.payment_method_data`, `CustomerListPaymentMethodsParams`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data` + * Add support for `schedule_details` and `subscription_details` on `InvoiceUpcomingLinesParams` and `InvoiceUpcomingParams` + * Add support for new value `other` on enums `Issuing.AuthorizationCaptureParams.testHelpers.purchase_details.fuel.unit`, `Issuing.TransactionCreateForceCaptureParams.testHelpers.purchase_details.fuel.unit`, and `Issuing.TransactionCreateUnlinkedRefundParams.testHelpers.purchase_details.fuel.unit` + ## 15.2.0 - 2024-04-16 * [#2064](https://github.com/stripe/stripe-node/pull/2064) Update generated code - * Add support for new resource `Entitlements.ActiveEntitlementSummary` - * Add support for `balances` and `payouts_list` on `AccountSession.components` and `AccountSessionCreateParams.components` - * Change `AccountSession.components.payment_details.features.destination_on_behalf_of_charge_management` and `AccountSession.components.payments.features.destination_on_behalf_of_charge_management` to be required - * Change `Billing.MeterEventCreateParams.timestamp` and `Dispute.payment_method_details.card` to be optional - * Change type of `Dispute.payment_method_details.card` from `DisputePaymentMethodDetailsCard | null` to `DisputePaymentMethodDetailsCard` - * Add support for new value `entitlements.active_entitlement_summary.updated` on enum `Event.type` - * Remove support for `config` on `Forwarding.RequestCreateParams` and `Forwarding.Request`. This field is no longer used by the Forwarding Request API. - * Add support for `capture_method` on `PaymentIntent.payment_method_options.revolut_pay`, `PaymentIntentConfirmParams.payment_method_options.revolut_pay`, `PaymentIntentCreateParams.payment_method_options.revolut_pay`, and `PaymentIntentUpdateParams.payment_method_options.revolut_pay` - * Add support for `swish` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration` - * Add support for new value `entitlements.active_entitlement_summary.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` + * Add support for new resource `Entitlements.ActiveEntitlementSummary` + * Add support for `balances` and `payouts_list` on `AccountSession.components` and `AccountSessionCreateParams.components` + * Change `AccountSession.components.payment_details.features.destination_on_behalf_of_charge_management` and `AccountSession.components.payments.features.destination_on_behalf_of_charge_management` to be required + * Change `Billing.MeterEventCreateParams.timestamp` and `Dispute.payment_method_details.card` to be optional + * Change type of `Dispute.payment_method_details.card` from `DisputePaymentMethodDetailsCard | null` to `DisputePaymentMethodDetailsCard` + * Add support for new value `entitlements.active_entitlement_summary.updated` on enum `Event.type` + * Remove support for `config` on `Forwarding.RequestCreateParams` and `Forwarding.Request`. This field is no longer used by the Forwarding Request API. + * Add support for `capture_method` on `PaymentIntent.payment_method_options.revolut_pay`, `PaymentIntentConfirmParams.payment_method_options.revolut_pay`, `PaymentIntentCreateParams.payment_method_options.revolut_pay`, and `PaymentIntentUpdateParams.payment_method_options.revolut_pay` + * Add support for `swish` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration` + * Add support for new value `entitlements.active_entitlement_summary.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` ## 15.1.0 - 2024-04-11 * [#2062](https://github.com/stripe/stripe-node/pull/2062) Update generated code diff --git a/VERSION b/VERSION index 6c43fc8aef..5ff58dbcd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.2.0 +15.3.0 diff --git a/package.json b/package.json index e050a5e8f1..53fb393824 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "15.2.0", + "version": "15.3.0", "description": "Stripe API wrapper", "keywords": [ "stripe", diff --git a/src/stripe.core.ts b/src/stripe.core.ts index 846e059490..99b192b8fa 100644 --- a/src/stripe.core.ts +++ b/src/stripe.core.ts @@ -49,7 +49,7 @@ export function createStripe( platformFunctions: PlatformFunctions, requestSender: RequestSenderFactory = defaultRequestSenderFactory ): typeof Stripe { - Stripe.PACKAGE_VERSION = '15.2.0'; + Stripe.PACKAGE_VERSION = '15.3.0'; Stripe.USER_AGENT = { bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', From 472b4214debcfdaf9f8a2ad66edf80834a709d55 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 23:17:08 +0000 Subject: [PATCH 03/22] Update generated code for v974 --- OPENAPI_VERSION | 2 +- types/InvoiceLineItems.d.ts | 2 +- types/InvoicesResource.d.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e0b2735086..afb443dc4e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v972 \ No newline at end of file +v974 \ No newline at end of file diff --git a/types/InvoiceLineItems.d.ts b/types/InvoiceLineItems.d.ts index 31b7ca58e8..edb64c6cb0 100644 --- a/types/InvoiceLineItems.d.ts +++ b/types/InvoiceLineItems.d.ts @@ -77,7 +77,7 @@ declare module 'stripe' { margins?: Array | null; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. */ metadata: Stripe.Metadata; diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 4811184fec..38a38438f1 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -8933,7 +8933,7 @@ declare module 'stripe' { expand?: Array; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. */ invoice_metadata?: Stripe.Emptyable<{ [key: string]: string; @@ -8973,7 +8973,7 @@ declare module 'stripe' { margins?: Stripe.Emptyable>; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. */ metadata?: Stripe.Emptyable; @@ -9258,7 +9258,7 @@ declare module 'stripe' { margins?: Stripe.Emptyable>; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. */ metadata?: Stripe.Emptyable; From 5db36e677a855a8b179dc6e048271faf130a67da Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 23:46:18 +0000 Subject: [PATCH 04/22] Update generated code for v975 --- OPENAPI_VERSION | 2 +- types/PaymentMethodConfigurationsResource.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index afb443dc4e..32eb2fbfa1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v974 \ No newline at end of file +v975 \ No newline at end of file diff --git a/types/PaymentMethodConfigurationsResource.d.ts b/types/PaymentMethodConfigurationsResource.d.ts index f03627b98e..cb124306d5 100644 --- a/types/PaymentMethodConfigurationsResource.d.ts +++ b/types/PaymentMethodConfigurationsResource.d.ts @@ -1997,7 +1997,7 @@ declare module 'stripe' { } } - interface PaymentMethodConfigurationListParams { + interface PaymentMethodConfigurationListParams extends PaginationParams { /** * The Connect application to filter by. */ From 2c834c6cab3d2fbcf67e8fc702c43192adca9d85 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:07:32 +0000 Subject: [PATCH 05/22] Update generated code for v976 --- OPENAPI_VERSION | 2 +- types/Identity/VerificationSessions.d.ts | 6 +-- .../VerificationSessionsResource.d.ts | 52 +------------------ 3 files changed, 6 insertions(+), 54 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 32eb2fbfa1..9eaeb566b9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v975 \ No newline at end of file +v976 \ No newline at end of file diff --git a/types/Identity/VerificationSessions.d.ts b/types/Identity/VerificationSessions.d.ts index db07e12bdd..28a75b6c8c 100644 --- a/types/Identity/VerificationSessions.d.ts +++ b/types/Identity/VerificationSessions.d.ts @@ -73,7 +73,7 @@ declare module 'stripe' { /** * Details provided about the user being verified. These details may be shown to the user. */ - provided_details?: VerificationSession.ProvidedDetails | null; + provided_details: VerificationSession.ProvidedDetails | null; /** * Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. @@ -237,7 +237,7 @@ declare module 'stripe' { /** * The user's verified email address */ - email?: string | null; + email: string | null; /** * The user's verified first name. @@ -262,7 +262,7 @@ declare module 'stripe' { /** * The user's verified phone number */ - phone?: string | null; + phone: string | null; } namespace VerifiedOutputs { diff --git a/types/Identity/VerificationSessionsResource.d.ts b/types/Identity/VerificationSessionsResource.d.ts index bdfb730b01..5f8319a41e 100644 --- a/types/Identity/VerificationSessionsResource.d.ts +++ b/types/Identity/VerificationSessionsResource.d.ts @@ -35,12 +35,12 @@ declare module 'stripe' { return_url?: string; /** - * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. */ type?: VerificationSessionCreateParams.Type; /** - * The ID of a Verification Flow from the Dashboard. + * The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. */ verification_flow?: string; } @@ -51,16 +51,6 @@ declare module 'stripe' { * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). */ document?: Stripe.Emptyable; - - /** - * Options that apply to the email check. - */ - email?: Stripe.Emptyable; - - /** - * Options that apply to the phone check. - */ - phone?: Stripe.Emptyable; } namespace Options { @@ -89,20 +79,6 @@ declare module 'stripe' { namespace Document { type AllowedType = 'driving_license' | 'id_card' | 'passport'; } - - interface Email { - /** - * Request one time password verification of `provided_details.email`. - */ - require_verification?: boolean; - } - - interface Phone { - /** - * Request one time password verification of `provided_details.phone`. - */ - require_verification?: boolean; - } } interface ProvidedDetails { @@ -160,16 +136,6 @@ declare module 'stripe' { * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). */ document?: Stripe.Emptyable; - - /** - * Options that apply to the email check. - */ - email?: Stripe.Emptyable; - - /** - * Options that apply to the phone check. - */ - phone?: Stripe.Emptyable; } namespace Options { @@ -198,20 +164,6 @@ declare module 'stripe' { namespace Document { type AllowedType = 'driving_license' | 'id_card' | 'passport'; } - - interface Email { - /** - * Request one time password verification of `provided_details.email`. - */ - require_verification?: boolean; - } - - interface Phone { - /** - * Request one time password verification of `provided_details.phone`. - */ - require_verification?: boolean; - } } interface ProvidedDetails { From 3898eb63ca71c3f0ea7d66c4764609d626a8ed21 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:31:02 +0000 Subject: [PATCH 06/22] Update generated code for v977 --- OPENAPI_VERSION | 2 +- types/ConfirmationTokens.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9eaeb566b9..e0fe925571 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v976 \ No newline at end of file +v977 \ No newline at end of file diff --git a/types/ConfirmationTokens.d.ts b/types/ConfirmationTokens.d.ts index 97d5662855..d01dd30d5f 100644 --- a/types/ConfirmationTokens.d.ts +++ b/types/ConfirmationTokens.d.ts @@ -28,7 +28,7 @@ declare module 'stripe' { created: number; /** - * Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. + * Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. */ expires_at: number | null; From e8ed1a4acfcaa206a4758e1278dd74d9914bbe94 Mon Sep 17 00:00:00 2001 From: bitofbreeze <9855031+bitofbreeze@users.noreply.github.com> Date: Tue, 23 Apr 2024 03:09:12 +0900 Subject: [PATCH 07/22] Make cloudflare package export (#2061) Cloudflare's runtime uses the "workerd" condition export key as described [here](https://developers.cloudflare.com/workers/wrangler/bundling/#conditional-exports) and [here](https://runtime-keys.proposal.wintercg.org/#workerd). Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 53fb393824..6d9fa97dd7 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,10 @@ "import": "./esm/stripe.esm.worker.js", "require": "./cjs/stripe.cjs.worker.js" }, + "workerd": { + "import": "./esm/stripe.esm.worker.js", + "require": "./cjs/stripe.cjs.worker.js" + }, "default": { "import": "./esm/stripe.esm.node.js", "require": "./cjs/stripe.cjs.node.js" From d57ef671b4473e72070295ab08423f85a4e26af7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 21:38:39 +0000 Subject: [PATCH 08/22] Update generated code for v978 --- OPENAPI_VERSION | 2 +- types/AccountSessionsResource.d.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e0fe925571..3814033492 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v977 \ No newline at end of file +v978 \ No newline at end of file diff --git a/types/AccountSessionsResource.d.ts b/types/AccountSessionsResource.d.ts index 3e1c6d015c..dabedf99dd 100644 --- a/types/AccountSessionsResource.d.ts +++ b/types/AccountSessionsResource.d.ts @@ -78,6 +78,11 @@ declare module 'stripe' { */ payment_details?: Components.PaymentDetails; + /** + * Configuration for the payment method settings embedded component. + */ + payment_method_settings?: Components.PaymentMethodSettings; + /** * Configuration for the payments embedded component. */ @@ -366,6 +371,22 @@ declare module 'stripe' { } } + interface PaymentMethodSettings { + /** + * Whether the embedded component is enabled. + */ + enabled: boolean; + + /** + * The list of features enabled in the embedded component. + */ + features?: PaymentMethodSettings.Features; + } + + namespace PaymentMethodSettings { + interface Features {} + } + interface Payments { /** * Whether the embedded component is enabled. From b95a0ac3ef914edbe199d2f37e5608e4c59b6e80 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 22:18:24 +0000 Subject: [PATCH 09/22] Update generated code for v979 --- OPENAPI_VERSION | 2 +- types/Accounts.d.ts | 24 ++++++----- types/AccountsResource.d.ts | 81 ++++++++++++++++++++++++------------- types/Balance.d.ts | 2 +- types/BankAccounts.d.ts | 7 ++-- types/Cards.d.ts | 6 +-- types/LoginLinks.d.ts | 2 +- types/Persons.d.ts | 5 +-- types/Tokens.d.ts | 9 +++-- types/TokensResource.d.ts | 2 +- 10 files changed, 85 insertions(+), 55 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3814033492..ee18395703 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v978 \ No newline at end of file +v979 \ No newline at end of file diff --git a/types/Accounts.d.ts b/types/Accounts.d.ts index 4c6d87d399..859dc26a74 100644 --- a/types/Accounts.d.ts +++ b/types/Accounts.d.ts @@ -7,9 +7,14 @@ declare module 'stripe' { * properties on the account like its current requirements or if the account is * enabled to make live charges or receive payouts. * - * For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that - * account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), - * some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). + * For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is `application`, which includes Custom accounts, the properties below are always + * returned. + * + * For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is `stripe`, which includes Standard and Express accounts, some properties are only returned + * until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions) + * to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts). */ interface Account { /** @@ -28,7 +33,7 @@ declare module 'stripe' { business_profile?: Account.BusinessProfile | null; /** - * The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. + * The business type. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ business_type?: Account.BusinessType | null; @@ -64,7 +69,7 @@ declare module 'stripe' { deleted?: void; /** - * Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. */ details_submitted: boolean; @@ -83,10 +88,9 @@ declare module 'stripe' { /** * This is an object representing a person associated with a Stripe account. * - * A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - * See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. + * A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. * - * Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) + * See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). */ individual?: Stripe.Person; @@ -112,7 +116,7 @@ declare module 'stripe' { tos_acceptance?: Account.TosAcceptance; /** - * The Stripe account type. Can be `standard`, `express`, or `custom`. + * The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. */ type: Account.Type; } @@ -1357,7 +1361,7 @@ declare module 'stripe' { interface Payouts { /** - * A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. Default value is `false` for Custom accounts, otherwise `true`. + * A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](https://stripe.com/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. */ debit_negative_balances: boolean; diff --git a/types/AccountsResource.d.ts b/types/AccountsResource.d.ts index ae0ed034c1..b452451be6 100644 --- a/types/AccountsResource.d.ts +++ b/types/AccountsResource.d.ts @@ -14,17 +14,24 @@ declare module 'stripe' { business_profile?: AccountCreateParams.BusinessProfile; /** - * The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ business_type?: AccountCreateParams.BusinessType; /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + * Each key of the dictionary represents a capability, and each capability + * maps to its settings (for example, whether it has been requested or not). Each + * capability is inactive until you have provided its specific + * requirements and Stripe has verified them. An account might have some + * of its requested capabilities be active and some be inactive. + * + * Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) + * is `none`, which includes Custom accounts. */ capabilities?: AccountCreateParams.Capabilities; /** - * Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ company?: AccountCreateParams.Company; @@ -49,7 +56,7 @@ declare module 'stripe' { documents?: AccountCreateParams.Documents; /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + * The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. */ email?: string; @@ -59,14 +66,14 @@ declare module 'stripe' { expand?: Array; /** - * A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ external_account?: string | AccountCreateParams.ExternalAccount; /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ individual?: AccountCreateParams.Individual; @@ -86,7 +93,7 @@ declare module 'stripe' { settings?: AccountCreateParams.Settings; /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ tos_acceptance?: AccountCreateParams.TosAcceptance; @@ -1611,17 +1618,24 @@ declare module 'stripe' { business_profile?: AccountUpdateParams.BusinessProfile; /** - * The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ business_type?: AccountUpdateParams.BusinessType; /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + * Each key of the dictionary represents a capability, and each capability + * maps to its settings (for example, whether it has been requested or not). Each + * capability is inactive until you have provided its specific + * requirements and Stripe has verified them. An account might have some + * of its requested capabilities be active and some be inactive. + * + * Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) + * is `none`, which includes Custom accounts. */ capabilities?: AccountUpdateParams.Capabilities; /** - * Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ company?: AccountUpdateParams.Company; @@ -1636,7 +1650,7 @@ declare module 'stripe' { documents?: AccountUpdateParams.Documents; /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + * The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. */ email?: string; @@ -1646,9 +1660,9 @@ declare module 'stripe' { expand?: Array; /** - * A card or bank account to attach to the account for receiving [payouts](https://docs.stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://docs.stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://docs.stripe.com/api#account_create_bank_account) creation. + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://docs.stripe.com/api#account_create_bank_account) or [card creation](https://docs.stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ external_account?: Stripe.Emptyable< | string @@ -1658,7 +1672,7 @@ declare module 'stripe' { >; /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for Custom accounts. + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ individual?: AccountUpdateParams.Individual; @@ -1678,7 +1692,7 @@ declare module 'stripe' { settings?: AccountUpdateParams.Settings; /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://docs.stripe.com/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ tos_acceptance?: AccountUpdateParams.TosAcceptance; } @@ -4138,12 +4152,16 @@ declare module 'stripe' { ): Promise>; /** - * Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are + * Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are * left unchanged. * - * For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that - * account has started to go through Connect Onboarding. Once you create an [Account Link or Account Session](https://stripe.com/docs/api/account_links), - * some properties can only be changed or updated for Custom accounts. + * For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is application, which includes Custom accounts, you can update any information on the account. + * + * For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is stripe, which includes Standard and Express accounts, you can update all information until you create + * an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, + * after which some properties can no longer be updated. * * To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our * [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. @@ -4164,9 +4182,11 @@ declare module 'stripe' { list(options?: RequestOptions): ApiListPromise; /** - * With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + * With [Connect](https://stripe.com/connect), you can delete accounts you manage. * - * Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + * Test-mode accounts can be deleted at any time. + * + * Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. * * If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. */ @@ -4190,9 +4210,9 @@ declare module 'stripe' { ): Promise>; /** - * Creates a single-use login link for an Express account to access their Stripe dashboard. + * Creates a single-use login link for a connected account to access the Express Dashboard. * - * You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + * You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. */ createLoginLink( id: string, @@ -4287,9 +4307,9 @@ declare module 'stripe' { ): ApiListPromise; /** - * With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + * With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. * - * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + * Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. */ reject( id: string, @@ -4369,9 +4389,14 @@ declare module 'stripe' { ): Promise>; /** - * Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + * Updates the metadata, account holder name, account holder type of a bank account belonging to + * a connected account and optionally sets it as the default for its currency. Other bank account + * details are not editable by design. + * + * You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). * - * You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + * You can re-enable a disabled bank account by performing an update call without providing any + * arguments or changes. */ updateExternalAccount( accountId: string, diff --git a/types/Balance.d.ts b/types/Balance.d.ts index cc554f24f2..8487acc816 100644 --- a/types/Balance.d.ts +++ b/types/Balance.d.ts @@ -27,7 +27,7 @@ declare module 'stripe' { available: Array; /** - * Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. + * Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. */ connect_reserved?: Array; diff --git a/types/BankAccounts.d.ts b/types/BankAccounts.d.ts index fb30452383..a567875c65 100644 --- a/types/BankAccounts.d.ts +++ b/types/BankAccounts.d.ts @@ -5,11 +5,12 @@ declare module 'stripe' { /** * These bank accounts are payment methods on `Customer` objects. * - * On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer - * destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + * On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer + * destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). * They can be bank accounts or debit cards as well, and are documented in the links above. * - * Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers) + * Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) */ interface BankAccount { /** diff --git a/types/Cards.d.ts b/types/Cards.d.ts index 344bbcd888..3d61af3f9c 100644 --- a/types/Cards.d.ts +++ b/types/Cards.d.ts @@ -21,7 +21,7 @@ declare module 'stripe' { object: 'card'; /** - * The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. + * The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ account?: string | Stripe.Account | null; @@ -81,7 +81,7 @@ declare module 'stripe' { country: string | null; /** - * Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. + * Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ currency?: string | null; @@ -96,7 +96,7 @@ declare module 'stripe' { cvc_check: string | null; /** - * Whether this card is the default external account for its currency. + * Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. */ default_for_currency?: boolean | null; diff --git a/types/LoginLinks.d.ts b/types/LoginLinks.d.ts index 2b5d31a04f..18df17840a 100644 --- a/types/LoginLinks.d.ts +++ b/types/LoginLinks.d.ts @@ -3,7 +3,7 @@ declare module 'stripe' { namespace Stripe { /** - * Login Links are single-use login link for an Express account to access their Stripe dashboard. + * Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/object#account_object-controller-stripe_dashboard-type) must be `express` to have access to the Express Dashboard. */ interface LoginLink { /** diff --git a/types/Persons.d.ts b/types/Persons.d.ts index 7d3708913d..013c2cd716 100644 --- a/types/Persons.d.ts +++ b/types/Persons.d.ts @@ -25,10 +25,9 @@ declare module 'stripe' { /** * This is an object representing a person associated with a Stripe account. * - * A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - * See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. + * A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. * - * Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) + * See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). */ interface Person { /** diff --git a/types/Tokens.d.ts b/types/Tokens.d.ts index c3fdddeaac..9b2f66eacb 100644 --- a/types/Tokens.d.ts +++ b/types/Tokens.d.ts @@ -20,7 +20,7 @@ declare module 'stripe' { * * You can't store or use tokens more than once. To store card or bank account * information for later use, create [Customer](https://stripe.com/docs/api#customers) - * objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). + * objects or [External accounts](https://stripe.com/api#external_accounts). * [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, * performs best with integrations that use client-side tokenization. */ @@ -38,11 +38,12 @@ declare module 'stripe' { /** * These bank accounts are payment methods on `Customer` objects. * - * On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer - * destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + * On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer + * destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + * is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts). * They can be bank accounts or debit cards as well, and are documented in the links above. * - * Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers) + * Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) */ bank_account?: Stripe.BankAccount; diff --git a/types/TokensResource.d.ts b/types/TokensResource.d.ts index b55d1d3020..a291144bc4 100644 --- a/types/TokensResource.d.ts +++ b/types/TokensResource.d.ts @@ -890,7 +890,7 @@ declare module 'stripe' { class TokensResource { /** * Creates a single-use token that represents a bank account's details. - * You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + * You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. */ create( params?: TokenCreateParams, From 50fd6e07541e2b72bb9c9c8d8bb22ba2196f2c0f Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 23:23:35 +0000 Subject: [PATCH 10/22] Update generated code for v980 --- OPENAPI_VERSION | 2 +- types/QuoteLines.d.ts | 22 ++++++++++++++++++++ types/QuotesResource.d.ts | 44 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ee18395703..212870537e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v979 \ No newline at end of file +v980 \ No newline at end of file diff --git a/types/QuoteLines.d.ts b/types/QuoteLines.d.ts index 2dc71382f2..350df5e9cd 100644 --- a/types/QuoteLines.d.ts +++ b/types/QuoteLines.d.ts @@ -31,6 +31,11 @@ declare module 'stripe' { */ billing_cycle_anchor: QuoteLine.BillingCycleAnchor | null; + /** + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + */ + cancel_subscription_schedule?: QuoteLine.CancelSubscriptionSchedule | null; + /** * Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. */ @@ -444,6 +449,23 @@ declare module 'stripe' { type BillingCycleAnchor = 'automatic' | 'line_starts_at'; + interface CancelSubscriptionSchedule { + /** + * Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + */ + cancel_at: 'line_starts_at'; + + /** + * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + */ + invoice_now: boolean | null; + + /** + * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + */ + prorate: boolean | null; + } + interface EndsAt { /** * The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `ends_at` field. For example, if `ends_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `ends_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `ends_at` is respecified. This field is guaranteed to be populated after quote acceptance. diff --git a/types/QuotesResource.d.ts b/types/QuotesResource.d.ts index e483c59ff8..2ee8099abf 100644 --- a/types/QuotesResource.d.ts +++ b/types/QuotesResource.d.ts @@ -278,6 +278,11 @@ declare module 'stripe' { */ billing_cycle_anchor?: Line.BillingCycleAnchor; + /** + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + */ + cancel_subscription_schedule?: Line.CancelSubscriptionSchedule; + /** * Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. */ @@ -703,6 +708,23 @@ declare module 'stripe' { type BillingCycleAnchor = 'automatic' | 'line_starts_at'; + interface CancelSubscriptionSchedule { + /** + * Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + */ + cancel_at: 'line_starts_at'; + + /** + * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + */ + invoice_now?: boolean; + + /** + * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + */ + prorate?: boolean; + } + interface EndsAt { /** * Use the `end` time of a given discount. @@ -1946,6 +1968,11 @@ declare module 'stripe' { */ billing_cycle_anchor?: Line.BillingCycleAnchor; + /** + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + */ + cancel_subscription_schedule?: Line.CancelSubscriptionSchedule; + /** * Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. */ @@ -2376,6 +2403,23 @@ declare module 'stripe' { type BillingCycleAnchor = 'automatic' | 'line_starts_at'; + interface CancelSubscriptionSchedule { + /** + * Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + */ + cancel_at: 'line_starts_at'; + + /** + * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + */ + invoice_now?: boolean; + + /** + * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + */ + prorate?: boolean; + } + interface EndsAt { /** * Use the `end` time of a given discount. From 7647f41ad52ba52e442000906578e0a22e124342 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:02:18 +0000 Subject: [PATCH 11/22] Update generated code for v981 --- OPENAPI_VERSION | 2 +- types/EventTypes.d.ts | 2 +- types/Events.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 212870537e..4db457fa8d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v980 \ No newline at end of file +v981 \ No newline at end of file diff --git a/types/EventTypes.d.ts b/types/EventTypes.d.ts index 2c678ef44f..50d0e05fd0 100644 --- a/types/EventTypes.d.ts +++ b/types/EventTypes.d.ts @@ -1349,7 +1349,7 @@ declare module 'stripe' { } /** - * An ad-hoc custom event that is sent based on user configured [Automation](/docs/billing/revenue-recovery/automations#send-custom-webhook-event-action). + * An ad-hoc custom event that is sent based on user configured [Automation](/docs/billing/automations#send-custom-webhook-event-action). */ interface CustomerSubscriptionCustomEventEvent extends EventBase { type: 'customer.subscription.custom_event'; diff --git a/types/Events.d.ts b/types/Events.d.ts index 7555cb1d02..58c8826b63 100644 --- a/types/Events.d.ts +++ b/types/Events.d.ts @@ -38,7 +38,7 @@ declare module 'stripe' { /** * The trigger name of the automation that triggered this action. - * Please visit [Revenue and retention automations](https://stripe.com/docs/billing/revenue-recovery/automations#choose-a-trigger) for all possible trigger names. + * Please visit [Revenue and retention automations](https://stripe.com/docs/billing/automations#choose-a-trigger) for all possible trigger names. */ trigger: string; @@ -416,7 +416,7 @@ declare module 'stripe' { pending_webhooks: number; /** - * Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://stripe.com/docs/billing/revenue-recovery/automations) action. + * Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://stripe.com/docs/billing/automations) action. */ reason?: Event.Reason | null; From a979b2cd88142a1d90c636a17d0df4624ea38322 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:43:20 +0000 Subject: [PATCH 12/22] Update generated code for v982 --- OPENAPI_VERSION | 2 +- types/Entitlements/ActiveEntitlements.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4db457fa8d..735a5bbc23 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v981 \ No newline at end of file +v982 \ No newline at end of file diff --git a/types/Entitlements/ActiveEntitlements.d.ts b/types/Entitlements/ActiveEntitlements.d.ts index 2a2e651e04..11ddc2019c 100644 --- a/types/Entitlements/ActiveEntitlements.d.ts +++ b/types/Entitlements/ActiveEntitlements.d.ts @@ -18,9 +18,9 @@ declare module 'stripe' { object: 'entitlements.active_entitlement'; /** - * The feature that the customer is entitled to. + * The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. */ - feature: string; + feature: string | Stripe.Entitlements.Feature; /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. From 7faab4487319077b5a5532e45691b2b0a56fc096 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:49:03 +0000 Subject: [PATCH 13/22] Update generated code for v983 --- OPENAPI_VERSION | 2 +- types/ProductsResource.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 735a5bbc23..56fee85a72 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v982 \ No newline at end of file +v983 \ No newline at end of file diff --git a/types/ProductsResource.d.ts b/types/ProductsResource.d.ts index b72662f104..9281719855 100644 --- a/types/ProductsResource.d.ts +++ b/types/ProductsResource.d.ts @@ -452,7 +452,7 @@ declare module 'stripe' { interface ProductCreateFeatureParams { /** - * The ID of the [Feature](docs/api/entitlements/feature) object attached to this product. + * The ID of the [Feature](https://stripe.com/docs/api/entitlements/feature) object attached to this product. */ entitlement_feature: string; From 3398ce9202183994164ba5eb28c087bf8864b9d3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:14:29 +0000 Subject: [PATCH 14/22] Update generated code for v984 --- OPENAPI_VERSION | 2 +- types/QuoteLines.d.ts | 2 +- types/QuotesResource.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 56fee85a72..a040219e6e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v983 \ No newline at end of file +v984 \ No newline at end of file diff --git a/types/QuoteLines.d.ts b/types/QuoteLines.d.ts index 350df5e9cd..332a0b5e17 100644 --- a/types/QuoteLines.d.ts +++ b/types/QuoteLines.d.ts @@ -32,7 +32,7 @@ declare module 'stripe' { billing_cycle_anchor: QuoteLine.BillingCycleAnchor | null; /** - * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. */ cancel_subscription_schedule?: QuoteLine.CancelSubscriptionSchedule | null; diff --git a/types/QuotesResource.d.ts b/types/QuotesResource.d.ts index 2ee8099abf..820d4af837 100644 --- a/types/QuotesResource.d.ts +++ b/types/QuotesResource.d.ts @@ -279,7 +279,7 @@ declare module 'stripe' { billing_cycle_anchor?: Line.BillingCycleAnchor; /** - * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. */ cancel_subscription_schedule?: Line.CancelSubscriptionSchedule; @@ -1969,7 +1969,7 @@ declare module 'stripe' { billing_cycle_anchor?: Line.BillingCycleAnchor; /** - * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for metadata modifications. + * A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. */ cancel_subscription_schedule?: Line.CancelSubscriptionSchedule; From 85c7bda515afa6783abc4992dfac1608bd0ad3cc Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:03:59 +0000 Subject: [PATCH 15/22] Update generated code for v985 --- OPENAPI_VERSION | 2 +- types/EventTypes.d.ts | 22 +++++++++++----------- types/Events.d.ts | 8 ++++---- types/EventsResource.d.ts | 2 +- types/WebhookEndpoints.d.ts | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a040219e6e..8a5a8933c4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v984 \ No newline at end of file +v985 \ No newline at end of file diff --git a/types/EventTypes.d.ts b/types/EventTypes.d.ts index 50d0e05fd0..10285b8bb1 100644 --- a/types/EventTypes.d.ts +++ b/types/EventTypes.d.ts @@ -725,7 +725,7 @@ declare module 'stripe' { } /** - * Occurs when funds are reinstated to your account after a dispute is closed. This includes [partially refunded payments](/docs/disputes#disputes-on-partially-refunded-payments). + * Occurs when funds are reinstated to your account after a dispute is closed. This includes [partially refunded payments](https://docs.stripe.com/disputes#disputes-on-partially-refunded-payments). */ interface ChargeDisputeFundsReinstatedEvent extends EventBase { type: 'charge.dispute.funds_reinstated'; @@ -1301,7 +1301,7 @@ declare module 'stripe' { } /** - * Occurs whenever collection is paused on a customer's subscription. Only applies when [payment collection](/docs/billing/subscriptions/pause) is paused, not when subscriptions enter `status=paused`. + * Occurs whenever collection is paused on a customer's subscription. Only applies when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is paused, not when subscriptions enter `status=paused`. */ interface CustomerSubscriptionCollectionPausedEvent extends EventBase { type: 'customer.subscription.collection_paused'; @@ -1317,7 +1317,7 @@ declare module 'stripe' { } /** - * Occurs whenever collection is resumed on a customer's subscription that is currently paused. Only applies when [payment collection](/docs/billing/subscriptions/pause) is resumed, not when subscriptions exit `status=paused`. + * Occurs whenever collection is resumed on a customer's subscription that is currently paused. Only applies when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is resumed, not when subscriptions exit `status=paused`. */ interface CustomerSubscriptionCollectionResumedEvent extends EventBase { type: 'customer.subscription.collection_resumed'; @@ -1349,7 +1349,7 @@ declare module 'stripe' { } /** - * An ad-hoc custom event that is sent based on user configured [Automation](/docs/billing/automations#send-custom-webhook-event-action). + * An ad-hoc custom event that is sent based on user configured [Automation](https://docs.stripe.com/billing/automations#send-custom-webhook-event-action). */ interface CustomerSubscriptionCustomEventEvent extends EventBase { type: 'customer.subscription.custom_event'; @@ -1381,7 +1381,7 @@ declare module 'stripe' { } /** - * Occurs whenever a customer's subscription is paused. Only applies when subscriptions enter `status=paused`, not when [payment collection](/docs/billing/subscriptions/pause) is paused. + * Occurs whenever a customer's subscription is paused. Only applies when subscriptions enter `status=paused`, not when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is paused. */ interface CustomerSubscriptionPausedEvent extends EventBase { type: 'customer.subscription.paused'; @@ -1429,7 +1429,7 @@ declare module 'stripe' { } /** - * Occurs whenever a customer's subscription is no longer paused. Only applies when a `status=paused` subscription is [resumed](/docs/api/subscriptions/resume), not when [payment collection](/docs/billing/subscriptions/pause) is resumed. + * Occurs whenever a customer's subscription is no longer paused. Only applies when a `status=paused` subscription is [resumed](https://docs.stripe.com/api/subscriptions/resume), not when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is resumed. */ interface CustomerSubscriptionResumedEvent extends EventBase { type: 'customer.subscription.resumed'; @@ -1836,7 +1836,7 @@ declare module 'stripe' { } /** - * Occurs whenever a new invoice is created. To learn how webhooks can be used with this event, and how they can affect it, see [Using Webhooks with Subscriptions](/docs/subscriptions/webhooks). + * Occurs whenever a new invoice is created. To learn how webhooks can be used with this event, and how they can affect it, see [Using Webhooks with Subscriptions](https://docs.stripe.com/subscriptions/webhooks). */ interface InvoiceCreatedEvent extends EventBase { type: 'invoice.created'; @@ -1868,7 +1868,7 @@ declare module 'stripe' { } /** - * Occurs whenever a draft invoice cannot be finalized. See the invoice’s [last finalization error](/docs/api/invoices/object#invoice_object-last_finalization_error) for details. + * Occurs whenever a draft invoice cannot be finalized. See the invoice’s [last finalization error](https://docs.stripe.com/api/invoices/object#invoice_object-last_finalization_error) for details. */ interface InvoiceFinalizationFailedEvent extends EventBase { type: 'invoice.finalization_failed'; @@ -2108,7 +2108,7 @@ declare module 'stripe' { } /** - * Represents a synchronous request for authorization, see [Using your integration to handle authorization requests](/docs/issuing/purchases/authorizations#authorization-handling). + * Represents a synchronous request for authorization, see [Using your integration to handle authorization requests](https://docs.stripe.com/issuing/purchases/authorizations#authorization-handling). */ interface IssuingAuthorizationRequestEvent extends EventBase { type: 'issuing_authorization.request'; @@ -2428,7 +2428,7 @@ declare module 'stripe' { } /** - * Occurs when a PaymentIntent has funds to be captured. Check the `amount_capturable` property on the PaymentIntent to determine the amount that can be captured. You may capture the PaymentIntent with an `amount_to_capture` value up to the specified amount. [Learn more about capturing PaymentIntents.](https://stripe.com/docs/api/payment_intents/capture) + * Occurs when a PaymentIntent has funds to be captured. Check the `amount_capturable` property on the PaymentIntent to determine the amount that can be captured. You may capture the PaymentIntent with an `amount_to_capture` value up to the specified amount. [Learn more about capturing PaymentIntents.](https://docs.stripe.com/api/payment_intents/capture) */ interface PaymentIntentAmountCapturableUpdatedEvent extends EventBase { type: 'payment_intent.amount_capturable_updated'; @@ -2636,7 +2636,7 @@ declare module 'stripe' { } /** - * Occurs whenever a payment method is updated via the [PaymentMethod update API](https://stripe.com/docs/api/payment_methods/update). + * Occurs whenever a payment method is updated via the [PaymentMethod update API](https://docs.stripe.com/api/payment_methods/update). */ interface PaymentMethodUpdatedEvent extends EventBase { type: 'payment_method.updated'; diff --git a/types/Events.d.ts b/types/Events.d.ts index 58c8826b63..57ebbdb82a 100644 --- a/types/Events.d.ts +++ b/types/Events.d.ts @@ -38,7 +38,7 @@ declare module 'stripe' { /** * The trigger name of the automation that triggered this action. - * Please visit [Revenue and retention automations](https://stripe.com/docs/billing/automations#choose-a-trigger) for all possible trigger names. + * Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names. */ trigger: string; @@ -367,10 +367,10 @@ declare module 'stripe' { * `Event` objects directly to an endpoint on your server. You can manage * webhooks in your * [account settings](https://dashboard.stripe.com/account/webhooks). Learn how - * to [listen for events](https://stripe.com/docs/webhooks) + * to [listen for events](https://docs.stripe.com/webhooks) * so that your integration can automatically trigger reactions. * - * When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications + * When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications * that occur in connected accounts. For these events, there's an * additional `account` attribute in the received `Event` object. * @@ -416,7 +416,7 @@ declare module 'stripe' { pending_webhooks: number; /** - * Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://stripe.com/docs/billing/automations) action. + * Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action. */ reason?: Event.Reason | null; diff --git a/types/EventsResource.d.ts b/types/EventsResource.d.ts index 91c67d7090..f82714f666 100644 --- a/types/EventsResource.d.ts +++ b/types/EventsResource.d.ts @@ -51,7 +51,7 @@ declare module 'stripe' { ): Promise>; /** - * List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + * List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). */ list( params?: EventListParams, diff --git a/types/WebhookEndpoints.d.ts b/types/WebhookEndpoints.d.ts index e905982b48..1e817a0cda 100644 --- a/types/WebhookEndpoints.d.ts +++ b/types/WebhookEndpoints.d.ts @@ -23,13 +23,13 @@ declare module 'stripe' { } /** - * You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be + * You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be * notified about events that happen in your Stripe account or connected * accounts. * * Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. * - * Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure) + * Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure) */ interface WebhookEndpoint { /** @@ -83,7 +83,7 @@ declare module 'stripe' { metadata: Stripe.Metadata; /** - * The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). Only returned at creation. + * The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. */ secret?: string; From 50c21ce6906b1732dc5dc83d71279544128670a7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:39:17 +0000 Subject: [PATCH 16/22] Update generated code for v987 --- OPENAPI_VERSION | 2 +- types/Checkout/Sessions.d.ts | 30 ++++++++++++++++++++++++++++-- types/Invoices.d.ts | 2 ++ types/InvoicesResource.d.ts | 4 ++++ types/Mandates.d.ts | 8 ++++++++ types/PaymentIntents.d.ts | 26 ++++++++++++++++++++++++++ types/QuotePreviewInvoices.d.ts | 2 ++ types/SetupAttempts.d.ts | 8 ++++++++ types/Subscriptions.d.ts | 2 ++ types/SubscriptionsResource.d.ts | 4 ++++ 10 files changed, 85 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8a5a8933c4..f7ad102c1a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v985 \ No newline at end of file +v987 \ No newline at end of file diff --git a/types/Checkout/Sessions.d.ts b/types/Checkout/Sessions.d.ts index af1ed13fdc..34534f8c11 100644 --- a/types/Checkout/Sessions.d.ts +++ b/types/Checkout/Sessions.d.ts @@ -1040,7 +1040,20 @@ declare module 'stripe' { setup_future_usage?: 'none'; } - interface AmazonPay {} + interface AmazonPay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AmazonPay.SetupFutureUsage; + } + + namespace AmazonPay { + type SetupFutureUsage = 'none' | 'off_session'; + } interface AuBecsDebit { /** @@ -1410,7 +1423,20 @@ declare module 'stripe' { expires_after_seconds: number | null; } - interface RevolutPay {} + interface RevolutPay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: RevolutPay.SetupFutureUsage; + } + + namespace RevolutPay { + type SetupFutureUsage = 'none' | 'off_session'; + } interface SepaDebit { /** diff --git a/types/Invoices.d.ts b/types/Invoices.d.ts index ce8ecd33bb..c793c519dc 100644 --- a/types/Invoices.d.ts +++ b/types/Invoices.d.ts @@ -1219,6 +1219,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -1237,6 +1238,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 38a38438f1..19e3c3eff0 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -562,6 +562,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -580,6 +581,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' @@ -1316,6 +1318,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -1334,6 +1337,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' diff --git a/types/Mandates.d.ts b/types/Mandates.d.ts index 549f03021d..767ac1edf3 100644 --- a/types/Mandates.d.ts +++ b/types/Mandates.d.ts @@ -90,6 +90,8 @@ declare module 'stripe' { interface PaymentMethodDetails { acss_debit?: PaymentMethodDetails.AcssDebit; + amazon_pay?: PaymentMethodDetails.AmazonPay; + au_becs_debit?: PaymentMethodDetails.AuBecsDebit; bacs_debit?: PaymentMethodDetails.BacsDebit; @@ -104,6 +106,8 @@ declare module 'stripe' { payto?: PaymentMethodDetails.Payto; + revolut_pay?: PaymentMethodDetails.RevolutPay; + sepa_debit?: PaymentMethodDetails.SepaDebit; /** @@ -145,6 +149,8 @@ declare module 'stripe' { type TransactionType = 'business' | 'personal'; } + interface AmazonPay {} + interface AuBecsDebit { /** * The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. @@ -278,6 +284,8 @@ declare module 'stripe' { | 'utility'; } + interface RevolutPay {} + interface SepaDebit { /** * The unique reference of the mandate. diff --git a/types/PaymentIntents.d.ts b/types/PaymentIntents.d.ts index 35dc89bceb..ded69ec175 100644 --- a/types/PaymentIntents.d.ts +++ b/types/PaymentIntents.d.ts @@ -1763,6 +1763,19 @@ declare module 'stripe' { * Controls when the funds will be captured from the customer's account. */ capture_method?: 'manual'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AmazonPay.SetupFutureUsage; + } + + namespace AmazonPay { + type SetupFutureUsage = 'none' | 'off_session'; } interface AuBecsDebit { @@ -2561,6 +2574,19 @@ declare module 'stripe' { * Controls when the funds will be captured from the customer's account. */ capture_method?: 'manual'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: RevolutPay.SetupFutureUsage; + } + + namespace RevolutPay { + type SetupFutureUsage = 'none' | 'off_session'; } interface SepaDebit { diff --git a/types/QuotePreviewInvoices.d.ts b/types/QuotePreviewInvoices.d.ts index ca6ebd24be..320285def9 100644 --- a/types/QuotePreviewInvoices.d.ts +++ b/types/QuotePreviewInvoices.d.ts @@ -1196,6 +1196,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -1214,6 +1215,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' diff --git a/types/SetupAttempts.d.ts b/types/SetupAttempts.d.ts index 7dab4136e9..96439e73b4 100644 --- a/types/SetupAttempts.d.ts +++ b/types/SetupAttempts.d.ts @@ -92,6 +92,8 @@ declare module 'stripe' { interface PaymentMethodDetails { acss_debit?: PaymentMethodDetails.AcssDebit; + amazon_pay?: PaymentMethodDetails.AmazonPay; + au_becs_debit?: PaymentMethodDetails.AuBecsDebit; bacs_debit?: PaymentMethodDetails.BacsDebit; @@ -116,6 +118,8 @@ declare module 'stripe' { payto?: PaymentMethodDetails.Payto; + revolut_pay?: PaymentMethodDetails.RevolutPay; + sepa_debit?: PaymentMethodDetails.SepaDebit; sofort?: PaymentMethodDetails.Sofort; @@ -131,6 +135,8 @@ declare module 'stripe' { namespace PaymentMethodDetails { interface AcssDebit {} + interface AmazonPay {} + interface AuBecsDebit {} interface BacsDebit {} @@ -461,6 +467,8 @@ declare module 'stripe' { interface Payto {} + interface RevolutPay {} + interface SepaDebit {} interface Sofort { diff --git a/types/Subscriptions.d.ts b/types/Subscriptions.d.ts index 303d1e2a7f..67e10837ff 100644 --- a/types/Subscriptions.d.ts +++ b/types/Subscriptions.d.ts @@ -596,6 +596,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -614,6 +615,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' diff --git a/types/SubscriptionsResource.d.ts b/types/SubscriptionsResource.d.ts index 07af343645..3f41d4ba81 100644 --- a/types/SubscriptionsResource.d.ts +++ b/types/SubscriptionsResource.d.ts @@ -914,6 +914,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -932,6 +933,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' @@ -1924,6 +1926,7 @@ declare module 'stripe' { | 'ach_credit_transfer' | 'ach_debit' | 'acss_debit' + | 'amazon_pay' | 'au_becs_debit' | 'bacs_debit' | 'bancontact' @@ -1942,6 +1945,7 @@ declare module 'stripe' { | 'paynow' | 'paypal' | 'promptpay' + | 'revolut_pay' | 'sepa_credit_transfer' | 'sepa_debit' | 'sofort' From fec336dce2a5c045e4c6fffa9e6bd03bf0459f41 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:26:00 +0000 Subject: [PATCH 17/22] Update generated code for v988 --- OPENAPI_VERSION | 2 +- types/Capabilities.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f7ad102c1a..e13775c59c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v987 \ No newline at end of file +v988 \ No newline at end of file diff --git a/types/Capabilities.d.ts b/types/Capabilities.d.ts index a4d189d558..faeaabe795 100644 --- a/types/Capabilities.d.ts +++ b/types/Capabilities.d.ts @@ -226,13 +226,13 @@ declare module 'stripe' { currently_due: Array; /** - * If the capability is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. + * If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`. * - * `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service: + * `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). * - * - [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses) + * `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. * - * If you believe that the rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. + * If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. */ disabled_reason: string | null; From 2daf407fcd4c46b8dbcc863bb8c38d1236a12abc Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:00:45 +0000 Subject: [PATCH 18/22] Update generated code for v989 --- OPENAPI_VERSION | 2 +- types/InvoicesResource.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e13775c59c..811766d231 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v988 \ No newline at end of file +v989 \ No newline at end of file diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 19e3c3eff0..2cc5367c35 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -9730,7 +9730,7 @@ declare module 'stripe' { * * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. * - * You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request. + * You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. */ retrieveUpcoming( params?: InvoiceRetrieveUpcomingParams, From 3aec72947763da30943df1b55b1c5f4b955d473a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 00:09:42 +0000 Subject: [PATCH 19/22] Update generated code for v990 --- OPENAPI_VERSION | 2 +- types/Accounts.d.ts | 2 +- types/AccountsResource.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 811766d231..16c0892c20 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v989 \ No newline at end of file +v990 \ No newline at end of file diff --git a/types/Accounts.d.ts b/types/Accounts.d.ts index 859dc26a74..64b46a66af 100644 --- a/types/Accounts.d.ts +++ b/types/Accounts.d.ts @@ -811,7 +811,7 @@ declare module 'stripe' { interface Fees { /** - * A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. + * A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). */ payer: Fees.Payer; } diff --git a/types/AccountsResource.d.ts b/types/AccountsResource.d.ts index b452451be6..ff99d541a8 100644 --- a/types/AccountsResource.d.ts +++ b/types/AccountsResource.d.ts @@ -943,7 +943,7 @@ declare module 'stripe' { interface Fees { /** - * A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. + * A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). */ payer?: Fees.Payer; } From b8c668d69a65bf45261d4db436341c06c3e8bf90 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 01:13:58 +0000 Subject: [PATCH 20/22] Update generated code for v991 --- OPENAPI_VERSION | 2 +- types/PricesResource.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 16c0892c20..00ab578704 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v990 \ No newline at end of file +v991 \ No newline at end of file diff --git a/types/PricesResource.d.ts b/types/PricesResource.d.ts index 038af1f7b1..59838bbf10 100644 --- a/types/PricesResource.d.ts +++ b/types/PricesResource.d.ts @@ -91,7 +91,7 @@ declare module 'stripe' { transform_quantity?: PriceCreateParams.TransformQuantity; /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. */ unit_amount?: number; From be333103d19136305ec84da2a26cf2a33978d7b8 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:23:36 +0000 Subject: [PATCH 21/22] Update generated code for v992 --- OPENAPI_VERSION | 2 +- types/PaymentMethodConfigurations.d.ts | 36 +++++++++++++ .../PaymentMethodConfigurationsResource.d.ts | 50 +++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 00ab578704..6eb80deb21 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v991 \ No newline at end of file +v992 \ No newline at end of file diff --git a/types/PaymentMethodConfigurations.d.ts b/types/PaymentMethodConfigurations.d.ts index d9238f1194..a769651153 100644 --- a/types/PaymentMethodConfigurations.d.ts +++ b/types/PaymentMethodConfigurations.d.ts @@ -99,6 +99,8 @@ declare module 'stripe' { */ livemode: boolean; + mobilepay?: PaymentMethodConfiguration.Mobilepay; + multibanco?: PaymentMethodConfiguration.Multibanco; /** @@ -987,6 +989,40 @@ declare module 'stripe' { } } + interface Mobilepay { + /** + * Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + */ + available: boolean; + + display_preference: Mobilepay.DisplayPreference; + } + + namespace Mobilepay { + interface DisplayPreference { + /** + * For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + */ + overridable: boolean | null; + + /** + * The account's display preference. + */ + preference: DisplayPreference.Preference; + + /** + * The effective display preference value. + */ + value: DisplayPreference.Value; + } + + namespace DisplayPreference { + type Preference = 'none' | 'off' | 'on'; + + type Value = 'off' | 'on'; + } + } + interface Multibanco { /** * Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. diff --git a/types/PaymentMethodConfigurationsResource.d.ts b/types/PaymentMethodConfigurationsResource.d.ts index cb124306d5..4806c32856 100644 --- a/types/PaymentMethodConfigurationsResource.d.ts +++ b/types/PaymentMethodConfigurationsResource.d.ts @@ -138,6 +138,11 @@ declare module 'stripe' { */ link?: PaymentMethodConfigurationCreateParams.Link; + /** + * MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + */ + mobilepay?: PaymentMethodConfigurationCreateParams.Mobilepay; + /** * Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. */ @@ -735,6 +740,26 @@ declare module 'stripe' { } } + interface Mobilepay { + /** + * Whether or not the payment method should be displayed. + */ + display_preference?: Mobilepay.DisplayPreference; + } + + namespace Mobilepay { + interface DisplayPreference { + /** + * The account's preference for whether or not to display this payment method. + */ + preference?: DisplayPreference.Preference; + } + + namespace DisplayPreference { + type Preference = 'none' | 'off' | 'on'; + } + } + interface Multibanco { /** * Whether or not the payment method should be displayed. @@ -1144,6 +1169,11 @@ declare module 'stripe' { */ link?: PaymentMethodConfigurationUpdateParams.Link; + /** + * MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. + */ + mobilepay?: PaymentMethodConfigurationUpdateParams.Mobilepay; + /** * Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. */ @@ -1736,6 +1766,26 @@ declare module 'stripe' { } } + interface Mobilepay { + /** + * Whether or not the payment method should be displayed. + */ + display_preference?: Mobilepay.DisplayPreference; + } + + namespace Mobilepay { + interface DisplayPreference { + /** + * The account's preference for whether or not to display this payment method. + */ + preference?: DisplayPreference.Preference; + } + + namespace DisplayPreference { + type Preference = 'none' | 'off' | 'on'; + } + } + interface Multibanco { /** * Whether or not the payment method should be displayed. From 850dbb9d2bb8635cf648b68857f1ce68a99b8ad5 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 18:55:48 +0000 Subject: [PATCH 22/22] Update generated code for v993 --- OPENAPI_VERSION | 2 +- types/EventTypes.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6eb80deb21..52d771c1e6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v992 \ No newline at end of file +v993 \ No newline at end of file diff --git a/types/EventTypes.d.ts b/types/EventTypes.d.ts index 10285b8bb1..cc239a1f57 100644 --- a/types/EventTypes.d.ts +++ b/types/EventTypes.d.ts @@ -1852,7 +1852,7 @@ declare module 'stripe' { } /** - * Occurs whenever a draft invoice is deleted. + * Occurs whenever a draft invoice is deleted. Note: This event is not sent for [invoice previews](https://docs.stripe.com/api/invoices/create_preview). */ interface InvoiceDeletedEvent extends EventBase { type: 'invoice.deleted';