diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b164d836dc..1f7b99f730 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v162 \ No newline at end of file +v163 \ No newline at end of file diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 719357dbdb..a04f41c00a 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -486,6 +486,56 @@ describe('PaymentLink', function() { }); }); +describe('Price', function() { + it('create method', async function() { + const price = await stripe.prices.create({ + unit_amount: 2000, + currency: 'usd', + currency_options: { + uah: {unit_amount: 5000}, + eur: {unit_amount: 1800}, + }, + recurring: {interval: 'month'}, + product: 'prod_xxxxxxxxxxxxx', + }); + expect(price).not.to.be.null; + }); + + it('list method', async function() { + const prices = await stripe.prices.list({limit: 3}); + expect(prices).not.to.be.null; + }); + + it('create method', async function() { + const price = await stripe.prices.create({ + unit_amount: 2000, + currency: 'usd', + recurring: {interval: 'month'}, + product: 'prod_xxxxxxxxxxxxx', + }); + expect(price).not.to.be.null; + }); + + it('retrieve method', async function() { + const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx'); + expect(price).not.to.be.null; + }); + + it('update method', async function() { + const price = await stripe.prices.update('price_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(price).not.to.be.null; + }); + + it('search method', async function() { + const prices = await stripe.prices.search({ + query: "active:'true' AND metadata['order_id']:'6735'", + }); + expect(prices).not.to.be.null; + }); +}); + describe('SetupAttempt', function() { it('list method', async function() { const setupAttempts = await stripe.setupAttempts.list({ @@ -2005,42 +2055,6 @@ describe('Plan', function() { }); }); -describe('Price', function() { - it('list method', async function() { - const prices = await stripe.prices.list({limit: 3}); - expect(prices).not.to.be.null; - }); - - it('create method', async function() { - const price = await stripe.prices.create({ - unit_amount: 2000, - currency: 'usd', - recurring: {interval: 'month'}, - product: 'prod_xxxxxxxxxxxxx', - }); - expect(price).not.to.be.null; - }); - - it('retrieve method', async function() { - const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx'); - expect(price).not.to.be.null; - }); - - it('update method', async function() { - const price = await stripe.prices.update('price_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(price).not.to.be.null; - }); - - it('search method', async function() { - const prices = await stripe.prices.search({ - query: "active:'true' AND metadata['order_id']:'6735'", - }); - expect(prices).not.to.be.null; - }); -}); - describe('Product', function() { it('list method', async function() { const products = await stripe.products.list({limit: 3}); diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2020-08-27/Checkout/Sessions.d.ts index 83005a906e..fedb4b03b7 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2020-08-27/Checkout/Sessions.d.ts @@ -303,33 +303,33 @@ declare module 'stripe' { interface CustomerDetails { /** - * The customer's address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + * The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. */ address: Stripe.Address | null; /** - * The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry. + * The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. * Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. */ email: string | null; /** - * The customer's name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + * The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. */ name: string | null; /** - * The customer's phone number at the time of checkout + * The customer's phone number after a completed Checkout Session. */ phone: string | null; /** - * The customer's tax exempt status at time of checkout. + * The customer's tax exempt status after a completed Checkout Session. */ tax_exempt: CustomerDetails.TaxExempt | null; /** - * The customer's tax IDs at time of checkout. + * The customer's tax IDs after a completed Checkout Session. */ tax_ids: Array | null; } @@ -1283,6 +1283,11 @@ declare module 'stripe' { */ consent_collection?: SessionCreateParams.ConsentCollection; + /** + * 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 an existing Customer, if one exists. In `payment` mode, the customer's most recent card * payment method will be used to prefill the email, name, card details, and billing address @@ -2792,6 +2797,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; diff --git a/types/2020-08-27/Coupons.d.ts b/types/2020-08-27/Coupons.d.ts index 8b9ed35837..0b88c6ad75 100644 --- a/types/2020-08-27/Coupons.d.ts +++ b/types/2020-08-27/Coupons.d.ts @@ -33,6 +33,13 @@ declare module 'stripe' { */ currency: string | null; + /** + * Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Coupon.CurrencyOptions; + }; + deleted?: void; /** @@ -94,6 +101,13 @@ declare module 'stripe' { products: Array; } + interface CurrencyOptions { + /** + * Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + */ + amount_off: number; + } + type Duration = 'forever' | 'once' | 'repeating'; } @@ -133,6 +147,13 @@ declare module 'stripe' { */ currency?: string; + /** + * Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: CouponCreateParams.CurrencyOptions; + }; + /** * Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`. */ @@ -187,6 +208,13 @@ declare module 'stripe' { products?: Array; } + interface CurrencyOptions { + /** + * A positive integer representing the amount to subtract from an invoice total. + */ + amount_off: number; + } + type Duration = 'forever' | 'once' | 'repeating'; } @@ -198,6 +226,13 @@ declare module 'stripe' { } interface CouponUpdateParams { + /** + * Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: CouponUpdateParams.CurrencyOptions; + }; + /** * Specifies which fields in the response should be expanded. */ @@ -214,6 +249,15 @@ declare module 'stripe' { name?: string; } + namespace CouponUpdateParams { + interface CurrencyOptions { + /** + * A positive integer representing the amount to subtract from an invoice total. + */ + amount_off: number; + } + } + interface CouponListParams extends PaginationParams { /** * A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. diff --git a/types/2020-08-27/InvoiceLineItems.d.ts b/types/2020-08-27/InvoiceLineItems.d.ts index bd9b4894e9..a4678a8df6 100644 --- a/types/2020-08-27/InvoiceLineItems.d.ts +++ b/types/2020-08-27/InvoiceLineItems.d.ts @@ -208,6 +208,11 @@ declare module 'stripe' { */ 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. */ diff --git a/types/2020-08-27/Invoices.d.ts b/types/2020-08-27/Invoices.d.ts index 6515825750..72f6815b76 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2020-08-27/Invoices.d.ts @@ -1768,6 +1768,11 @@ declare module 'stripe' { */ 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. */ diff --git a/types/2020-08-27/Orders.d.ts b/types/2020-08-27/Orders.d.ts index 20bd28ee01..0c50c5f898 100644 --- a/types/2020-08-27/Orders.d.ts +++ b/types/2020-08-27/Orders.d.ts @@ -1817,6 +1817,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -2865,6 +2890,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2020-08-27/PaymentLinks.d.ts index 8baa471239..0150b7feda 100644 --- a/types/2020-08-27/PaymentLinks.d.ts +++ b/types/2020-08-27/PaymentLinks.d.ts @@ -548,6 +548,11 @@ declare module 'stripe' { */ consent_collection?: PaymentLinkCreateParams.ConsentCollection; + /** + * 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) and supported by each line item's price. + */ + currency?: string; + /** * Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). */ diff --git a/types/2020-08-27/Prices.d.ts b/types/2020-08-27/Prices.d.ts index 18df63728e..4ee68ec509 100644 --- a/types/2020-08-27/Prices.d.ts +++ b/types/2020-08-27/Prices.d.ts @@ -36,6 +36,13 @@ declare module 'stripe' { */ currency: string; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Price.CurrencyOptions; + }; + /** * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. */ @@ -112,6 +119,81 @@ declare module 'stripe' { namespace Price { type BillingScheme = 'per_unit' | 'tiered'; + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount: CurrencyOptions.CustomUnitAmount | null; + + /** + * 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: CurrencyOptions.TaxBehavior | null; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + */ + unit_amount: number | null; + + /** + * The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + */ + unit_amount_decimal: string | null; + } + + namespace CurrencyOptions { + interface CustomUnitAmount { + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum: number | null; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum: number | null; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset: number | null; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * Price for the entire tier. + */ + flat_amount: number | null; + + /** + * Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + */ + flat_amount_decimal: string | null; + + /** + * Per unit price for units relevant to the tier. + */ + unit_amount: number | null; + + /** + * Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + */ + unit_amount_decimal: string | null; + + /** + * Up to and including to this quantity will be contained in the tier. + */ + up_to: number | null; + } + } + interface CustomUnitAmount { /** * The maximum unit amount the customer can specify for this item. @@ -254,6 +336,13 @@ declare module 'stripe' { */ billing_scheme?: PriceCreateParams.BillingScheme; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: PriceCreateParams.CurrencyOptions; + }; + /** * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. */ @@ -333,6 +422,86 @@ declare module 'stripe' { namespace PriceCreateParams { type BillingScheme = 'per_unit' | 'tiered'; + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface CustomUnitAmount { /** * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. @@ -494,6 +663,13 @@ declare module 'stripe' { */ active?: boolean; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: Stripe.Emptyable<{ + [key: string]: PriceUpdateParams.CurrencyOptions; + }>; + /** * Specifies which fields in the response should be expanded. */ @@ -531,6 +707,86 @@ declare module 'stripe' { } namespace PriceUpdateParams { + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface Recurring { /** * Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). diff --git a/types/2020-08-27/Products.d.ts b/types/2020-08-27/Products.d.ts index d896c0c276..eefbd67b7a 100644 --- a/types/2020-08-27/Products.d.ts +++ b/types/2020-08-27/Products.d.ts @@ -262,6 +262,13 @@ declare module 'stripe' { */ currency: string; + /** + * Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: DefaultPriceData.CurrencyOptions; + }; + /** * The recurring components of a price such as `interval` and `interval_count`. */ @@ -284,6 +291,86 @@ declare module 'stripe' { } namespace DefaultPriceData { + interface CurrencyOptions { + /** + * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + */ + custom_unit_amount?: CurrencyOptions.CustomUnitAmount; + + /** + * 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?: CurrencyOptions.TaxBehavior; + + /** + * Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + */ + tiers?: Array; + + /** + * 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 CurrencyOptions { + interface CustomUnitAmount { + /** + * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + */ + enabled: boolean; + + /** + * The maximum unit amount the customer can specify for this item. + */ + maximum?: number; + + /** + * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + */ + minimum?: number; + + /** + * The starting unit amount which can be updated by the customer. + */ + preset?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + + interface Tier { + /** + * The flat billing amount for an entire tier, regardless of the number of units in the tier. + */ + flat_amount?: number; + + /** + * Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + */ + flat_amount_decimal?: string; + + /** + * The per unit billing amount for each individual unit for which this tier applies. + */ + 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; + + /** + * Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + */ + up_to: 'inf' | number; + } + } + interface Recurring { /** * Specifies billing frequency. Either `day`, `week`, `month` or `year`. diff --git a/types/2020-08-27/PromotionCodes.d.ts b/types/2020-08-27/PromotionCodes.d.ts index 3b22639eff..ba1e241893 100644 --- a/types/2020-08-27/PromotionCodes.d.ts +++ b/types/2020-08-27/PromotionCodes.d.ts @@ -73,6 +73,13 @@ declare module 'stripe' { namespace PromotionCode { interface Restrictions { + /** + * Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + /** * A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices */ @@ -88,6 +95,15 @@ declare module 'stripe' { */ minimum_amount_currency: string | null; } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount: number; + } + } } interface PromotionCodeCreateParams { @@ -139,6 +155,13 @@ declare module 'stripe' { namespace PromotionCodeCreateParams { interface Restrictions { + /** + * Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + /** * A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices */ @@ -154,6 +177,15 @@ declare module 'stripe' { */ minimum_amount_currency?: string; } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount?: number; + } + } } interface PromotionCodeRetrieveParams { @@ -178,6 +210,31 @@ declare module 'stripe' { * 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; + + /** + * Settings that restrict the redemption of the promotion code. + */ + restrictions?: PromotionCodeUpdateParams.Restrictions; + } + + namespace PromotionCodeUpdateParams { + interface Restrictions { + /** + * Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: Restrictions.CurrencyOptions; + }; + } + + namespace Restrictions { + interface CurrencyOptions { + /** + * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + */ + minimum_amount?: number; + } + } } interface PromotionCodeListParams extends PaginationParams { diff --git a/types/2020-08-27/ShippingRates.d.ts b/types/2020-08-27/ShippingRates.d.ts index b9f29c7e45..3ea5966dd0 100644 --- a/types/2020-08-27/ShippingRates.d.ts +++ b/types/2020-08-27/ShippingRates.d.ts @@ -121,6 +121,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -225,6 +250,31 @@ declare module 'stripe' { * 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; + + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } } type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; @@ -248,10 +298,51 @@ declare module 'stripe' { */ expand?: Array; + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateUpdateParams.FixedAmount; + /** * 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; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateUpdateParams.TaxBehavior; + } + + namespace ShippingRateUpdateParams { + interface FixedAmount { + /** + * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + */ + currency_options?: { + [key: string]: FixedAmount.CurrencyOptions; + }; + } + + namespace FixedAmount { + interface CurrencyOptions { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount?: number; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: CurrencyOptions.TaxBehavior; + } + + namespace CurrencyOptions { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; } interface ShippingRateListParams extends PaginationParams { diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2020-08-27/SubscriptionSchedules.d.ts index a5495e5eda..8a965c2932 100644 --- a/types/2020-08-27/SubscriptionSchedules.d.ts +++ b/types/2020-08-27/SubscriptionSchedules.d.ts @@ -229,6 +229,11 @@ declare module 'stripe' { */ coupon: string | Stripe.Coupon | Stripe.DeletedCoupon | null; + /** + * 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. */ @@ -559,6 +564,11 @@ declare module 'stripe' { */ 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. */ @@ -979,6 +989,11 @@ declare module 'stripe' { */ 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. */ diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2020-08-27/Subscriptions.d.ts index 91ac59e962..6b9688c722 100644 --- a/types/2020-08-27/Subscriptions.d.ts +++ b/types/2020-08-27/Subscriptions.d.ts @@ -67,6 +67,11 @@ declare module 'stripe' { */ created: 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). + */ + currency?: string; + /** * End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. */ @@ -579,6 +584,11 @@ declare module 'stripe' { */ 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; + /** * Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. */