From 5f78b16043e1925560fa0bc3f331899c84a8f61e Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 09:49:32 -0700 Subject: [PATCH] Update generated code (#1920) * Update generated code for v584 * Update generated code for v585 * Update generated code for v587 * Update generated code for v588 * Update generated code for v589 * Update generated code for v592 * Update generated code for v595 * Update generated code for v596 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- types/BalanceTransactions.d.ts | 2 +- types/Checkout/Sessions.d.ts | 39 +++++++++++------ types/Checkout/SessionsResource.d.ts | 42 +++++++++++++++---- types/Discounts.d.ts | 28 ++++++------- types/InvoiceItems.d.ts | 40 +++++++++--------- types/Invoices.d.ts | 40 +++++++++--------- types/InvoicesResource.d.ts | 10 +++-- types/Issuing/Authorizations.d.ts | 5 +++ types/PaymentLinks.d.ts | 19 +++------ types/PaymentLinksResource.d.ts | 8 ++-- .../PaymentMethodConfigurationsResource.d.ts | 4 +- types/Persons.d.ts | 40 +++++++++--------- types/Plans.d.ts | 40 +++++++++--------- types/Prices.d.ts | 40 +++++++++--------- types/Products.d.ts | 40 +++++++++--------- types/Radar/ValueListItems.d.ts | 40 +++++++++--------- types/Radar/ValueLists.d.ts | 40 +++++++++--------- types/SetupIntentsResource.d.ts | 13 +++--- types/SubscriptionItems.d.ts | 40 +++++++++--------- types/SubscriptionsResource.d.ts | 22 +++++++++- types/TaxIds.d.ts | 40 +++++++++--------- types/Terminal/Configurations.d.ts | 9 ++++ types/Terminal/ConfigurationsResource.d.ts | 24 +++++++++++ types/Terminal/Locations.d.ts | 40 +++++++++--------- types/Terminal/Readers.d.ts | 40 +++++++++--------- types/TestHelpers/TestClocks.d.ts | 40 +++++++++--------- types/WebhookEndpoints.d.ts | 40 +++++++++--------- 28 files changed, 437 insertions(+), 350 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e8f6775c5f..e6c86cecd6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v581 \ No newline at end of file +v596 \ No newline at end of file diff --git a/types/BalanceTransactions.d.ts b/types/BalanceTransactions.d.ts index edada2d95b..26345b7981 100644 --- a/types/BalanceTransactions.d.ts +++ b/types/BalanceTransactions.d.ts @@ -65,7 +65,7 @@ declare module 'stripe' { net: number; /** - * Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + * Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. */ reporting_category: string; diff --git a/types/Checkout/Sessions.d.ts b/types/Checkout/Sessions.d.ts index 548d659975..f5a1b27116 100644 --- a/types/Checkout/Sessions.d.ts +++ b/types/Checkout/Sessions.d.ts @@ -69,6 +69,11 @@ declare module 'stripe' { */ client_reference_id: string | null; + /** + * Client secret to be used when initializing Stripe.js embedded checkout. + */ + client_secret?: string | null; + /** * Results of `consent_collection` for this session. */ @@ -213,6 +218,16 @@ declare module 'stripe' { */ recovered_from: string | null; + /** + * Applies to Checkout Sessions with `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + */ + redirect_on_completion?: Session.RedirectOnCompletion; + + /** + * Applies to Checkout Sessions with `ui_mode: embedded`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + */ + return_url?: string; + /** * The ID of the SetupIntent for Checkout Sessions in `setup` mode. */ @@ -269,6 +284,11 @@ declare module 'stripe' { */ total_details: Session.TotalDetails | null; + /** + * The UI mode of the Session. Can be `hosted` (default) or `embedded`. + */ + ui_mode?: Session.UiMode | null; + /** * The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.` * This value is only present when the session is active. @@ -510,10 +530,7 @@ declare module 'stripe' { } interface CustomField { - /** - * Configuration for `type=dropdown` fields. - */ - dropdown: CustomField.Dropdown | null; + dropdown?: CustomField.Dropdown; /** * String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. @@ -522,20 +539,14 @@ declare module 'stripe' { label: CustomField.Label; - /** - * Configuration for `type=numeric` fields. - */ - numeric: CustomField.Numeric | null; + numeric?: CustomField.Numeric; /** * Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. */ optional: boolean; - /** - * Configuration for `type=text` fields. - */ - text: CustomField.Text | null; + text?: CustomField.Text; /** * The type of the field. @@ -1338,6 +1349,8 @@ declare module 'stripe' { enabled: boolean; } + type RedirectOnCompletion = 'always' | 'if_required' | 'never'; + interface ShippingAddressCollection { /** * An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -1798,6 +1811,8 @@ declare module 'stripe' { } } } + + type UiMode = 'embedded' | 'hosted'; } } } diff --git a/types/Checkout/SessionsResource.d.ts b/types/Checkout/SessionsResource.d.ts index 0c0971b38b..34f7520649 100644 --- a/types/Checkout/SessionsResource.d.ts +++ b/types/Checkout/SessionsResource.d.ts @@ -4,14 +4,6 @@ declare module 'stripe' { namespace Stripe { namespace Checkout { interface SessionCreateParams { - /** - * The URL to which Stripe should send customers when payment or setup - * is complete. - * If you'd like to use information from the successful Checkout Session on your page, - * read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). - */ - success_url: string; - /** * Configure actions after a Checkout Session has expired. */ @@ -198,6 +190,18 @@ declare module 'stripe' { */ phone_number_collection?: SessionCreateParams.PhoneNumberCollection; + /** + * This parameter applies to `ui_mode: embedded`. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + */ + redirect_on_completion?: SessionCreateParams.RedirectOnCompletion; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the + * payment method's app or site. This parameter is required if ui_mode is `embedded` + * and redirect-based payment methods are enabled on the session. + */ + return_url?: string; + /** * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. */ @@ -226,10 +230,23 @@ declare module 'stripe' { */ subscription_data?: SessionCreateParams.SubscriptionData; + /** + * The URL to which Stripe should send customers when payment or setup + * is complete. + * If you'd like to use information from the successful Checkout Session on your page, + * read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). + */ + success_url?: string; + /** * Controls tax ID collection settings for the session. */ tax_id_collection?: SessionCreateParams.TaxIdCollection; + + /** + * `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + */ + ui_mode?: SessionCreateParams.UiMode; } namespace SessionCreateParams { @@ -1629,6 +1646,8 @@ declare module 'stripe' { enabled: boolean; } + type RedirectOnCompletion = 'always' | 'if_required' | 'never'; + interface SetupIntentData { /** * An arbitrary string attached to the object. Often useful for displaying to users. @@ -2141,6 +2160,8 @@ declare module 'stripe' { */ enabled: boolean; } + + type UiMode = 'embedded' | 'hosted'; } interface SessionRetrieveParams { @@ -2210,7 +2231,10 @@ declare module 'stripe' { * Creates a Session object. */ create( - params: SessionCreateParams, + params?: SessionCreateParams, + options?: RequestOptions + ): Promise>; + create( options?: RequestOptions ): Promise>; diff --git a/types/Discounts.d.ts b/types/Discounts.d.ts index 1790799115..f643ce7757 100644 --- a/types/Discounts.d.ts +++ b/types/Discounts.d.ts @@ -3,12 +3,9 @@ declare module 'stripe' { namespace Stripe { /** - * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). - * It contains information about when the discount began, when it will end, and what it is applied to. - * - * Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + * The DeletedDiscount object. */ - interface Discount { + interface DeletedDiscount { /** * The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array. */ @@ -39,12 +36,7 @@ declare module 'stripe' { /** * Always true for a deleted object */ - deleted?: void; - - /** - * If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. - */ - end: number | null; + deleted: true; /** * The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. @@ -73,9 +65,12 @@ declare module 'stripe' { } /** - * The DeletedDiscount object. + * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + * It contains information about when the discount began, when it will end, and what it is applied to. + * + * Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) */ - interface DeletedDiscount { + interface Discount { /** * The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array. */ @@ -106,7 +101,12 @@ declare module 'stripe' { /** * Always true for a deleted object */ - deleted: true; + deleted?: void; + + /** + * If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. + */ + end: number | null; /** * The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. diff --git a/types/InvoiceItems.d.ts b/types/InvoiceItems.d.ts index 60f475bdc5..a9479a8ff3 100644 --- a/types/InvoiceItems.d.ts +++ b/types/InvoiceItems.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedInvoiceItem object. + */ + interface DeletedInvoiceItem { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'invoiceitem'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an * invoice by creating or updating it with an `invoice` field, at which point it will be included as @@ -147,25 +167,5 @@ declare module 'stripe' { start: number; } } - - /** - * The DeletedInvoiceItem object. - */ - interface DeletedInvoiceItem { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'invoiceitem'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Invoices.d.ts b/types/Invoices.d.ts index 14f71d85f7..763f3a38d2 100644 --- a/types/Invoices.d.ts +++ b/types/Invoices.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedInvoice object. + */ + interface DeletedInvoice { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'invoice'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Invoices are statements of amounts owed by a customer, and are either * generated one-off, or generated periodically from a subscription. @@ -1338,25 +1358,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - /** - * The DeletedInvoice object. - */ - interface DeletedInvoice { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'invoice'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 95ede5dcee..0dbd469059 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -471,8 +471,9 @@ declare module 'stripe' { interface Pdf { /** - * Page size for invoice PDF. Can be set to a4, letter, or auto. - * If set to auto, page size will be switched to a4 or letter based on customer locale. + * Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. + * If set to `auto`, invoice PDF page size defaults to `a4` for customers with + * Japanese locale and `letter` for customers with other locales. */ page_size?: Pdf.PageSize; } @@ -1097,8 +1098,9 @@ declare module 'stripe' { interface Pdf { /** - * Page size for invoice PDF. Can be set to a4, letter, or auto. - * If set to auto, page size will be switched to a4 or letter based on customer locale. + * Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. + * If set to `auto`, invoice PDF page size defaults to `a4` for customers with + * Japanese locale and `letter` for customers with other locales. */ page_size?: Pdf.PageSize; } diff --git a/types/Issuing/Authorizations.d.ts b/types/Issuing/Authorizations.d.ts index 912a060ae8..2749dac615 100644 --- a/types/Issuing/Authorizations.d.ts +++ b/types/Issuing/Authorizations.d.ts @@ -372,6 +372,11 @@ declare module 'stripe' { * Whether the cardholder provided an expiry date and if it matched Stripe's record. */ expiry_check: VerificationData.ExpiryCheck; + + /** + * The postal code submitted as part of the authorization used for postal code verification. + */ + postal_code: string | null; } namespace VerificationData { diff --git a/types/PaymentLinks.d.ts b/types/PaymentLinks.d.ts index 8cafc46961..05ec89bf29 100644 --- a/types/PaymentLinks.d.ts +++ b/types/PaymentLinks.d.ts @@ -215,10 +215,7 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; interface CustomField { - /** - * Configuration for `type=dropdown` fields. - */ - dropdown: CustomField.Dropdown | null; + dropdown?: CustomField.Dropdown; /** * String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. @@ -227,20 +224,14 @@ declare module 'stripe' { label: CustomField.Label; - /** - * Configuration for `type=numeric` fields. - */ - numeric: CustomField.Numeric | null; + numeric?: CustomField.Numeric; /** * Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. */ optional: boolean; - /** - * Configuration for `type=text` fields. - */ - text: CustomField.Text | null; + text?: CustomField.Text; /** * The type of the field. @@ -425,7 +416,7 @@ declare module 'stripe' { capture_method: PaymentIntentData.CaptureMethod | null; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents] (/docs/api/payment_intents) generated from this payment link. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. */ metadata: Stripe.Metadata; @@ -759,7 +750,7 @@ declare module 'stripe' { description: string | null; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions] (/docs/api/subscriptions) generated from this payment link. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. */ metadata: Stripe.Metadata; diff --git a/types/PaymentLinksResource.d.ts b/types/PaymentLinksResource.d.ts index c6b953db34..32532153e3 100644 --- a/types/PaymentLinksResource.d.ts +++ b/types/PaymentLinksResource.d.ts @@ -464,7 +464,7 @@ declare module 'stripe' { capture_method?: PaymentIntentData.CaptureMethod; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents] (/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. */ metadata?: Stripe.MetadataParam; @@ -804,7 +804,7 @@ declare module 'stripe' { description?: string; /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions] (/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. */ metadata?: Stripe.MetadataParam; @@ -1239,7 +1239,7 @@ declare module 'stripe' { interface PaymentIntentData { /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents] (/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. */ metadata?: Stripe.Emptyable; @@ -1537,7 +1537,7 @@ declare module 'stripe' { interface SubscriptionData { /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions] (/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. */ metadata?: Stripe.Emptyable; } diff --git a/types/PaymentMethodConfigurationsResource.d.ts b/types/PaymentMethodConfigurationsResource.d.ts index 6c10645f85..4c0a258057 100644 --- a/types/PaymentMethodConfigurationsResource.d.ts +++ b/types/PaymentMethodConfigurationsResource.d.ts @@ -109,7 +109,7 @@ declare module 'stripe' { ideal?: PaymentMethodConfigurationCreateParams.Ideal; /** - * JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + * JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. */ jcb?: PaymentMethodConfigurationCreateParams.Jcb; @@ -965,7 +965,7 @@ declare module 'stripe' { ideal?: PaymentMethodConfigurationUpdateParams.Ideal; /** - * JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + * JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. */ jcb?: PaymentMethodConfigurationUpdateParams.Jcb; diff --git a/types/Persons.d.ts b/types/Persons.d.ts index d3eee8bdfc..538580c3ed 100644 --- a/types/Persons.d.ts +++ b/types/Persons.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedPerson object. + */ + interface DeletedPerson { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'person'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * This is an object representing a person associated with a Stripe account. * @@ -588,25 +608,5 @@ declare module 'stripe' { } } } - - /** - * The DeletedPerson object. - */ - interface DeletedPerson { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'person'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Plans.d.ts b/types/Plans.d.ts index fd03240f41..fd4040f863 100644 --- a/types/Plans.d.ts +++ b/types/Plans.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedPlan object. + */ + interface DeletedPlan { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'plan'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. * @@ -173,25 +193,5 @@ declare module 'stripe' { type UsageType = 'licensed' | 'metered'; } - - /** - * The DeletedPlan object. - */ - interface DeletedPlan { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'plan'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Prices.d.ts b/types/Prices.d.ts index fd1c964161..646957e344 100644 --- a/types/Prices.d.ts +++ b/types/Prices.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedPrice object. + */ + interface DeletedPrice { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'price'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. * [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. @@ -307,25 +327,5 @@ declare module 'stripe' { type Type = 'one_time' | 'recurring'; } - - /** - * The DeletedPrice object. - */ - interface DeletedPrice { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'price'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Products.d.ts b/types/Products.d.ts index d9e6c49502..d13181d5dd 100644 --- a/types/Products.d.ts +++ b/types/Products.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedProduct object. + */ + interface DeletedProduct { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'product'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Products describe the specific goods or services you offer to your customers. * For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. @@ -146,25 +166,5 @@ declare module 'stripe' { type Type = 'good' | 'service'; } - - /** - * The DeletedProduct object. - */ - interface DeletedProduct { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'product'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Radar/ValueListItems.d.ts b/types/Radar/ValueListItems.d.ts index ee7f92e192..76783c7d40 100644 --- a/types/Radar/ValueListItems.d.ts +++ b/types/Radar/ValueListItems.d.ts @@ -3,6 +3,26 @@ declare module 'stripe' { namespace Stripe { namespace Radar { + /** + * The DeletedValueListItem object. + */ + interface DeletedValueListItem { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'radar.value_list_item'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. * @@ -49,26 +69,6 @@ declare module 'stripe' { */ value_list: string; } - - /** - * The DeletedValueListItem object. - */ - interface DeletedValueListItem { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'radar.value_list_item'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } } diff --git a/types/Radar/ValueLists.d.ts b/types/Radar/ValueLists.d.ts index 99a0321203..1ef78f0a82 100644 --- a/types/Radar/ValueLists.d.ts +++ b/types/Radar/ValueLists.d.ts @@ -3,6 +3,26 @@ declare module 'stripe' { namespace Stripe { namespace Radar { + /** + * The DeletedValueList object. + */ + interface DeletedValueList { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'radar.value_list'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Value lists allow you to group values together which can then be referenced in rules. * @@ -78,26 +98,6 @@ declare module 'stripe' { | 'string' | 'us_bank_account_fingerprint'; } - - /** - * The DeletedValueList object. - */ - interface DeletedValueList { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'radar.value_list'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } } diff --git a/types/SetupIntentsResource.d.ts b/types/SetupIntentsResource.d.ts index d48f247aee..6c85c34b43 100644 --- a/types/SetupIntentsResource.d.ts +++ b/types/SetupIntentsResource.d.ts @@ -1933,14 +1933,14 @@ declare module 'stripe' { expand?: Array; /** - * Only return SetupIntents associated with the specified payment method. + * Only return SetupIntents that associate with the specified payment method. */ payment_method?: string; } interface SetupIntentCancelParams { /** - * Reason for canceling this SetupIntent. Possible values are `abandoned`, `requested_by_customer`, or `duplicate` + * Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` */ cancellation_reason?: SetupIntentCancelParams.CancellationReason; @@ -1963,9 +1963,6 @@ declare module 'stripe' { */ expand?: Array; - /** - * This hash contains details about the Mandate to create - */ mandate_data?: Stripe.Emptyable< | SetupIntentConfirmParams.MandateData1 | SetupIntentConfirmParams.MandateData2 @@ -1983,7 +1980,7 @@ declare module 'stripe' { payment_method_data?: SetupIntentConfirmParams.PaymentMethodData; /** - * Payment-method-specific configuration for this SetupIntent. + * Payment method-specific configuration for this SetupIntent. */ payment_method_options?: SetupIntentConfirmParams.PaymentMethodOptions; @@ -2973,9 +2970,9 @@ declare module 'stripe' { list(options?: RequestOptions): ApiListPromise; /** - * A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. + * You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. * - * Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error. + * After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. */ cancel( id: string, diff --git a/types/SubscriptionItems.d.ts b/types/SubscriptionItems.d.ts index 656a472e2f..fe8c9c2c05 100644 --- a/types/SubscriptionItems.d.ts +++ b/types/SubscriptionItems.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedSubscriptionItem object. + */ + interface DeletedSubscriptionItem { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'subscription_item'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * Subscription items allow you to create customer subscriptions with more than * one plan, making it easy to represent complex billing relationships. @@ -83,25 +103,5 @@ declare module 'stripe' { usage_gte: number | null; } } - - /** - * The DeletedSubscriptionItem object. - */ - interface DeletedSubscriptionItem { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'subscription_item'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/SubscriptionsResource.d.ts b/types/SubscriptionsResource.d.ts index e9e33b62d9..6df1cf678d 100644 --- a/types/SubscriptionsResource.d.ts +++ b/types/SubscriptionsResource.d.ts @@ -1581,7 +1581,27 @@ declare module 'stripe' { ): Promise>; /** - * Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. + * Updates an existing subscription to match the specified parameters. + * When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. + * To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + * + * By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. + * + * Switching prices does not normally change the billing date or generate an immediate charge unless: + * + * + * The billing interval is changed (for example, from monthly to yearly). + * The subscription moves from free to paid, or paid to free. + * A trial starts or ends. + * + * + * In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + * + * If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). + * + * If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. + * + * Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. */ update( id: string, diff --git a/types/TaxIds.d.ts b/types/TaxIds.d.ts index ff65a122b0..5b4643579b 100644 --- a/types/TaxIds.d.ts +++ b/types/TaxIds.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedTaxId object. + */ + interface DeletedTaxId { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'tax_id'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. * Customer and account tax IDs get displayed on related invoices and credit notes. @@ -151,25 +171,5 @@ declare module 'stripe' { type Status = 'pending' | 'unavailable' | 'unverified' | 'verified'; } } - - /** - * The DeletedTaxId object. - */ - interface DeletedTaxId { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'tax_id'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } diff --git a/types/Terminal/Configurations.d.ts b/types/Terminal/Configurations.d.ts index 4484ba5239..f3b6376272 100644 --- a/types/Terminal/Configurations.d.ts +++ b/types/Terminal/Configurations.d.ts @@ -34,6 +34,8 @@ declare module 'stripe' { */ livemode: boolean; + offline?: Configuration.Offline; + tipping?: Configuration.Tipping; verifone_p400?: Configuration.VerifoneP400; @@ -47,6 +49,13 @@ declare module 'stripe' { splashscreen?: string | Stripe.File; } + interface Offline { + /** + * Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + */ + enabled: boolean | null; + } + interface Tipping { aud?: Tipping.Aud; diff --git a/types/Terminal/ConfigurationsResource.d.ts b/types/Terminal/ConfigurationsResource.d.ts index e7f589fcb1..8a6f6e75d1 100644 --- a/types/Terminal/ConfigurationsResource.d.ts +++ b/types/Terminal/ConfigurationsResource.d.ts @@ -14,6 +14,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * Configurations for collecting transactions offline. + */ + offline?: Stripe.Emptyable; + /** * Tipping configurations for readers supporting on-reader tips */ @@ -33,6 +38,13 @@ declare module 'stripe' { splashscreen?: Stripe.Emptyable; } + interface Offline { + /** + * Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + */ + enabled: boolean; + } + interface Tipping { /** * Tipping configuration for AUD @@ -373,6 +385,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * Configurations for collecting transactions offline. + */ + offline?: Stripe.Emptyable; + /** * Tipping configurations for readers supporting on-reader tips */ @@ -394,6 +411,13 @@ declare module 'stripe' { splashscreen?: Stripe.Emptyable; } + interface Offline { + /** + * Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + */ + enabled: boolean; + } + interface Tipping { /** * Tipping configuration for AUD diff --git a/types/Terminal/Locations.d.ts b/types/Terminal/Locations.d.ts index a640c92b90..13e9ec9de2 100644 --- a/types/Terminal/Locations.d.ts +++ b/types/Terminal/Locations.d.ts @@ -3,6 +3,26 @@ declare module 'stripe' { namespace Stripe { namespace Terminal { + /** + * The DeletedLocation object. + */ + interface DeletedLocation { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'terminal.location'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * A Location represents a grouping of readers. * @@ -46,26 +66,6 @@ declare module 'stripe' { */ metadata: Stripe.Metadata; } - - /** - * The DeletedLocation object. - */ - interface DeletedLocation { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'terminal.location'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } } diff --git a/types/Terminal/Readers.d.ts b/types/Terminal/Readers.d.ts index 18a0d6bd24..8c5fc226f7 100644 --- a/types/Terminal/Readers.d.ts +++ b/types/Terminal/Readers.d.ts @@ -3,6 +3,26 @@ declare module 'stripe' { namespace Stripe { namespace Terminal { + /** + * The DeletedReader object. + */ + interface DeletedReader { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'terminal.reader'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * A Reader represents a physical device for accepting payment details. * @@ -293,26 +313,6 @@ declare module 'stripe' { | 'stripe_m2' | 'verifone_P400'; } - - /** - * The DeletedReader object. - */ - interface DeletedReader { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'terminal.reader'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } } diff --git a/types/TestHelpers/TestClocks.d.ts b/types/TestHelpers/TestClocks.d.ts index 8026aa58ce..45fca8b7ab 100644 --- a/types/TestHelpers/TestClocks.d.ts +++ b/types/TestHelpers/TestClocks.d.ts @@ -3,6 +3,26 @@ declare module 'stripe' { namespace Stripe { namespace TestHelpers { + /** + * The DeletedTestClock object. + */ + interface DeletedTestClock { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'test_helpers.test_clock'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * A test clock enables deterministic control over objects in testmode. With a test clock, you can create * objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, @@ -58,26 +78,6 @@ declare module 'stripe' { namespace TestClock { type Status = 'advancing' | 'internal_failure' | 'ready'; } - - /** - * The DeletedTestClock object. - */ - interface DeletedTestClock { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'test_helpers.test_clock'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } } } diff --git a/types/WebhookEndpoints.d.ts b/types/WebhookEndpoints.d.ts index 0d249fc01b..e905982b48 100644 --- a/types/WebhookEndpoints.d.ts +++ b/types/WebhookEndpoints.d.ts @@ -2,6 +2,26 @@ declare module 'stripe' { namespace Stripe { + /** + * The DeletedWebhookEndpoint object. + */ + interface DeletedWebhookEndpoint { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'webhook_endpoint'; + + /** + * Always true for a deleted object + */ + deleted: true; + } + /** * You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be * notified about events that happen in your Stripe account or connected @@ -77,25 +97,5 @@ declare module 'stripe' { */ url: string; } - - /** - * The DeletedWebhookEndpoint object. - */ - interface DeletedWebhookEndpoint { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'webhook_endpoint'; - - /** - * Always true for a deleted object - */ - deleted: true; - } } }