Skip to content

Commit 0301f75

Browse files
authored
Update Stripe specs, examples (openapi-ts#880)
1 parent 1cb3934 commit 0301f75

File tree

10 files changed

+121592
-44634
lines changed

10 files changed

+121592
-44634
lines changed

examples/stripe-openapi2.ts

+1,670-409
Large diffs are not rendered by default.

examples/stripe-openapi3.ts

+14,384-2,110
Large diffs are not rendered by default.

test/v2/expected/stripe.immutable.ts

+25-19
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export interface paths {
333333
readonly get: operations["GetBalanceTransactionsId"];
334334
};
335335
readonly "/v1/billing_portal/sessions": {
336-
/** <p>Creates a session of the Self-service Portal.</p> */
336+
/** <p>Creates a session of the self-serve Portal.</p> */
337337
readonly post: operations["PostBillingPortalSessions"];
338338
};
339339
readonly "/v1/bitcoin/receivers": {
@@ -1054,7 +1054,7 @@ export interface paths {
10541054
readonly "/v1/products": {
10551055
/** <p>Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.</p> */
10561056
readonly get: operations["GetProducts"];
1057-
/** <p>Creates a new product object. To create a product for use with orders, see <a href="#create_product">Products</a>.</p> */
1057+
/** <p>Creates a new product object.</p> */
10581058
readonly post: operations["PostProducts"];
10591059
};
10601060
readonly "/v1/products/{id}": {
@@ -1595,6 +1595,11 @@ export interface definitions {
15951595
* @enum {string}
15961596
*/
15971597
readonly card_payments?: "active" | "inactive" | "pending";
1598+
/**
1599+
* @description The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency.
1600+
* @enum {string}
1601+
*/
1602+
readonly jcb_payments?: "active" | "inactive" | "pending";
15981603
/**
15991604
* @description The status of the legacy payments capability of the account.
16001605
* @enum {string}
@@ -2107,13 +2112,13 @@ export interface definitions {
21072112
};
21082113
/**
21092114
* PortalSession
2110-
* @description A Session describes the instantiation of the Self-serve Portal for
2111-
* a particular customer. By visiting the Self-serve Portal's URL, the customer
2115+
* @description A Session describes the instantiation of the self-serve portal for
2116+
* a particular customer. By visiting the self-serve portal's URL, the customer
21122117
* can manage their subscriptions and view their invoice payment history. For security reasons,
21132118
* Sessions are short-lived and will expire if the customer does not visit the URL.
21142119
* Create Sessions on-demand.
21152120
*
2116-
* Related guide: [Self-serve Portal](https://stripe.com/docs/billing/subscriptions/integrating-self-serve).
2121+
* Related guide: [self-serve Portal](https://stripe.com/docs/billing/subscriptions/integrating-self-serve).
21172122
*/
21182123
readonly "billing_portal.session": {
21192124
/** @description Time at which the object was created. Measured in seconds since the Unix epoch. */
@@ -7957,10 +7962,10 @@ export interface definitions {
79577962
};
79587963
/**
79597964
* Plan
7960-
* @description Plans define the base price, currency, and billing cycle for subscriptions.
7961-
* For example, you might have a $5/month plan
7962-
* that provides limited access to your products, and a
7963-
* $15/month plan that allows full access.
7965+
* @description Plans define the base price, currency, and billing cycle for recurring purchases of products.
7966+
* Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
7967+
*
7968+
* For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
79647969
*
79657970
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).
79667971
*/
@@ -8054,14 +8059,11 @@ export interface definitions {
80548059
};
80558060
/**
80568061
* Product
8057-
* @description Store representations of products you sell in `Product` objects, used in
8058-
* conjunction with [SKUs](https://stripe.com/docs/api#skus). Products may be physical goods, to be shipped, or
8059-
* digital.
8062+
* @description Products describe the specific goods or services you offer to your customers.
8063+
* For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
8064+
* They can be used in conjuction with [SKUs](https://stripe.com/docs/api#skus) and [Plans](https://stripe.com/docs/api#plans) to configure pricing in Checkout and Subscriptions.
80608065
*
8061-
* Documentation on `Product`s for use with `Subscription`s can be found at
8062-
* [Subscription Products](https://stripe.com/docs/api#service_products).
8063-
*
8064-
* Related guide: [Define products and SKUs](https://stripe.com/docs/orders#define-products-skus)
8066+
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) or accept [one-time payments with Checkout](https://stripe.com/docs/payments/checkout/client#create-products) and more about [Products and Plans](https://stripe.com/docs/billing/subscriptions/products-and-plans)
80658067
*/
80668068
readonly product: {
80678069
/** @description Whether the product is currently available for purchase. */
@@ -10317,6 +10319,7 @@ export interface operations {
1031710319
| "au_becs_debit_payments"
1031810320
| "card_issuing"
1031910321
| "card_payments"
10322+
| "jcb_payments"
1032010323
| "legacy_payments"
1032110324
| "tax_reporting_us_1099_k"
1032210325
| "tax_reporting_us_1099_misc"
@@ -11744,6 +11747,7 @@ export interface operations {
1174411747
| "au_becs_debit_payments"
1174511748
| "card_issuing"
1174611749
| "card_payments"
11750+
| "jcb_payments"
1174711751
| "legacy_payments"
1174811752
| "tax_reporting_us_1099_k"
1174911753
| "tax_reporting_us_1099_misc"
@@ -12031,6 +12035,7 @@ export interface operations {
1203112035
| "au_becs_debit_payments"
1203212036
| "card_issuing"
1203312037
| "card_payments"
12038+
| "jcb_payments"
1203412039
| "legacy_payments"
1203512040
| "tax_reporting_us_1099_k"
1203612041
| "tax_reporting_us_1099_misc"
@@ -13760,7 +13765,7 @@ export interface operations {
1376013765
};
1376113766
};
1376213767
};
13763-
/** <p>Creates a session of the Self-service Portal.</p> */
13768+
/** <p>Creates a session of the self-serve Portal.</p> */
1376413769
readonly PostBillingPortalSessions: {
1376513770
readonly parameters: {
1376613771
readonly body: {
@@ -14896,6 +14901,7 @@ export interface operations {
1489614901
*/
1489714902
readonly subscription_data?: {
1489814903
readonly application_fee_percent?: number;
14904+
readonly coupon?: string;
1489914905
readonly default_tax_rates?: readonly string[];
1490014906
readonly items?: readonly {
1490114907
readonly plan: string;
@@ -17945,7 +17951,7 @@ export interface operations {
1794517951
readonly subscription_default_tax_rates?: string;
1794617952
/** List of subscription items, each with an attached plan. */
1794717953
readonly subscription_items?: readonly unknown[];
17948-
/** If previewing an update to a subscription, this decides whether the preview will show the result of applying prorations or not. If set, one of `subscription_items` or `subscription`, and one of `subscription_items` or `subscription_trial_end` are required. */
17954+
/** This field has been renamed to `subscription_proration_behavior`. `subscription_prorate=true` can be replaced with `subscription_proration_behavior=create_prorations` and `subscription_prorate=false` can be replaced with `subscription_proration_behavior=none`. */
1794917955
readonly subscription_prorate?: boolean;
1795017956
/**
1795117957
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#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. Valid values are `create_prorations`, `none`, or `always_invoice`.
@@ -24343,7 +24349,7 @@ export interface operations {
2434324349
};
2434424350
};
2434524351
};
24346-
/** <p>Creates a new product object. To create a product for use with orders, see <a href="#create_product">Products</a>.</p> */
24352+
/** <p>Creates a new product object.</p> */
2434724353
readonly PostProducts: {
2434824354
readonly parameters: {
2434924355
readonly body: {

test/v2/expected/stripe.ts

+25-19
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export interface paths {
333333
get: operations["GetBalanceTransactionsId"];
334334
};
335335
"/v1/billing_portal/sessions": {
336-
/** <p>Creates a session of the Self-service Portal.</p> */
336+
/** <p>Creates a session of the self-serve Portal.</p> */
337337
post: operations["PostBillingPortalSessions"];
338338
};
339339
"/v1/bitcoin/receivers": {
@@ -1054,7 +1054,7 @@ export interface paths {
10541054
"/v1/products": {
10551055
/** <p>Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.</p> */
10561056
get: operations["GetProducts"];
1057-
/** <p>Creates a new product object. To create a product for use with orders, see <a href="#create_product">Products</a>.</p> */
1057+
/** <p>Creates a new product object.</p> */
10581058
post: operations["PostProducts"];
10591059
};
10601060
"/v1/products/{id}": {
@@ -1595,6 +1595,11 @@ export interface definitions {
15951595
* @enum {string}
15961596
*/
15971597
card_payments?: "active" | "inactive" | "pending";
1598+
/**
1599+
* @description The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency.
1600+
* @enum {string}
1601+
*/
1602+
jcb_payments?: "active" | "inactive" | "pending";
15981603
/**
15991604
* @description The status of the legacy payments capability of the account.
16001605
* @enum {string}
@@ -2107,13 +2112,13 @@ export interface definitions {
21072112
};
21082113
/**
21092114
* PortalSession
2110-
* @description A Session describes the instantiation of the Self-serve Portal for
2111-
* a particular customer. By visiting the Self-serve Portal's URL, the customer
2115+
* @description A Session describes the instantiation of the self-serve portal for
2116+
* a particular customer. By visiting the self-serve portal's URL, the customer
21122117
* can manage their subscriptions and view their invoice payment history. For security reasons,
21132118
* Sessions are short-lived and will expire if the customer does not visit the URL.
21142119
* Create Sessions on-demand.
21152120
*
2116-
* Related guide: [Self-serve Portal](https://stripe.com/docs/billing/subscriptions/integrating-self-serve).
2121+
* Related guide: [self-serve Portal](https://stripe.com/docs/billing/subscriptions/integrating-self-serve).
21172122
*/
21182123
"billing_portal.session": {
21192124
/** @description Time at which the object was created. Measured in seconds since the Unix epoch. */
@@ -7945,10 +7950,10 @@ export interface definitions {
79457950
};
79467951
/**
79477952
* Plan
7948-
* @description Plans define the base price, currency, and billing cycle for subscriptions.
7949-
* For example, you might have a $5/month plan
7950-
* that provides limited access to your products, and a
7951-
* $15/month plan that allows full access.
7953+
* @description Plans define the base price, currency, and billing cycle for recurring purchases of products.
7954+
* Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
7955+
*
7956+
* For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
79527957
*
79537958
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).
79547959
*/
@@ -8042,14 +8047,11 @@ export interface definitions {
80428047
};
80438048
/**
80448049
* Product
8045-
* @description Store representations of products you sell in `Product` objects, used in
8046-
* conjunction with [SKUs](https://stripe.com/docs/api#skus). Products may be physical goods, to be shipped, or
8047-
* digital.
8050+
* @description Products describe the specific goods or services you offer to your customers.
8051+
* For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
8052+
* They can be used in conjuction with [SKUs](https://stripe.com/docs/api#skus) and [Plans](https://stripe.com/docs/api#plans) to configure pricing in Checkout and Subscriptions.
80488053
*
8049-
* Documentation on `Product`s for use with `Subscription`s can be found at
8050-
* [Subscription Products](https://stripe.com/docs/api#service_products).
8051-
*
8052-
* Related guide: [Define products and SKUs](https://stripe.com/docs/orders#define-products-skus)
8054+
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) or accept [one-time payments with Checkout](https://stripe.com/docs/payments/checkout/client#create-products) and more about [Products and Plans](https://stripe.com/docs/billing/subscriptions/products-and-plans)
80538055
*/
80548056
product: {
80558057
/** @description Whether the product is currently available for purchase. */
@@ -10305,6 +10307,7 @@ export interface operations {
1030510307
| "au_becs_debit_payments"
1030610308
| "card_issuing"
1030710309
| "card_payments"
10310+
| "jcb_payments"
1030810311
| "legacy_payments"
1030910312
| "tax_reporting_us_1099_k"
1031010313
| "tax_reporting_us_1099_misc"
@@ -11725,6 +11728,7 @@ export interface operations {
1172511728
| "au_becs_debit_payments"
1172611729
| "card_issuing"
1172711730
| "card_payments"
11731+
| "jcb_payments"
1172811732
| "legacy_payments"
1172911733
| "tax_reporting_us_1099_k"
1173011734
| "tax_reporting_us_1099_misc"
@@ -12005,6 +12009,7 @@ export interface operations {
1200512009
| "au_becs_debit_payments"
1200612010
| "card_issuing"
1200712011
| "card_payments"
12012+
| "jcb_payments"
1200812013
| "legacy_payments"
1200912014
| "tax_reporting_us_1099_k"
1201012015
| "tax_reporting_us_1099_misc"
@@ -13727,7 +13732,7 @@ export interface operations {
1372713732
};
1372813733
};
1372913734
};
13730-
/** <p>Creates a session of the Self-service Portal.</p> */
13735+
/** <p>Creates a session of the self-serve Portal.</p> */
1373113736
PostBillingPortalSessions: {
1373213737
parameters: {
1373313738
body: {
@@ -14863,6 +14868,7 @@ export interface operations {
1486314868
*/
1486414869
subscription_data?: {
1486514870
application_fee_percent?: number;
14871+
coupon?: string;
1486614872
default_tax_rates?: string[];
1486714873
items?: {
1486814874
plan: string;
@@ -17912,7 +17918,7 @@ export interface operations {
1791217918
subscription_default_tax_rates?: string;
1791317919
/** List of subscription items, each with an attached plan. */
1791417920
subscription_items?: unknown[];
17915-
/** If previewing an update to a subscription, this decides whether the preview will show the result of applying prorations or not. If set, one of `subscription_items` or `subscription`, and one of `subscription_items` or `subscription_trial_end` are required. */
17921+
/** This field has been renamed to `subscription_proration_behavior`. `subscription_prorate=true` can be replaced with `subscription_proration_behavior=create_prorations` and `subscription_prorate=false` can be replaced with `subscription_proration_behavior=none`. */
1791617922
subscription_prorate?: boolean;
1791717923
/**
1791817924
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#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. Valid values are `create_prorations`, `none`, or `always_invoice`.
@@ -24310,7 +24316,7 @@ export interface operations {
2431024316
};
2431124317
};
2431224318
};
24313-
/** <p>Creates a new product object. To create a product for use with orders, see <a href="#create_product">Products</a>.</p> */
24319+
/** <p>Creates a new product object.</p> */
2431424320
PostProducts: {
2431524321
parameters: {
2431624322
body: {

0 commit comments

Comments
 (0)