Skip to content

Commit

Permalink
API Updates (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed May 5, 2022
1 parent 59e8199 commit ffe44f5
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
62 changes: 62 additions & 0 deletions types/2020-08-27/Products.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ declare module 'stripe' {
*/
deactivate_on?: Array<string>;

/**
* The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product.
*/
default_price?: string | Stripe.Price | null;

deleted?: void;

/**
Expand Down Expand Up @@ -181,6 +186,11 @@ declare module 'stripe' {
*/
deactivate_on?: Array<string>;

/**
* Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product.
*/
default_price_data?: ProductCreateParams.DefaultPriceData;

/**
* The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
*/
Expand Down Expand Up @@ -246,6 +256,53 @@ declare module 'stripe' {
}

namespace ProductCreateParams {
interface DefaultPriceData {
/**
* 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 recurring components of a price such as `interval` and `interval_count`.
*/
recurring?: DefaultPriceData.Recurring;

/**
* 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?: DefaultPriceData.TaxBehavior;

/**
* A positive integer in %s (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
*/
unit_amount?: number;

/**
* Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
*/
unit_amount_decimal?: string;
}

namespace DefaultPriceData {
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 one year interval allowed (1 year, 12 months, or 52 weeks).
*/
interval_count?: number;
}

namespace Recurring {
type Interval = 'day' | 'month' | 'week' | 'year';
}

type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
}

interface PackageDimensions {
/**
* Height, in inches. Maximum precision is 2 decimal places.
Expand Down Expand Up @@ -299,6 +356,11 @@ declare module 'stripe' {
*/
deactivate_on?: Array<string>;

/**
* The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product.
*/
default_price?: string;

/**
* The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
*/
Expand Down
7 changes: 7 additions & 0 deletions types/2020-08-27/Refunds.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ declare module 'stripe' {
*/
failure_reason?: string;

/**
* Email to which refund instructions, if required, are sent to.
*/
instructions_email?: 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.
*/
Expand Down Expand Up @@ -149,6 +154,8 @@ declare module 'stripe' {
*/
expand?: Array<string>;

instructions_email?: 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`.
*/
Expand Down

0 comments on commit ffe44f5

Please sign in to comment.