Skip to content

Update generated code for beta #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
36517b8
Update generated code for v1773
stripe-openapi[bot] May 28, 2025
57276c0
Update generated code for v1774 and 2025-05-28.preview
stripe-openapi[bot] May 30, 2025
e614be5
Allow data to be set in only `POST` rawRequests (#2346)
helenye-stripe Jun 2, 2025
d229b0c
Merge upstream and update generated code for v1776 and 2025-05-28.pre…
stripe-openapi[bot] Jun 2, 2025
1a494b2
Bump version to 18.2.1
helenye-stripe Jun 2, 2025
769628a
Merge upstream and update generated code for v1777 and 2025-05-28.pre…
stripe-openapi[bot] Jun 2, 2025
f36147b
Update generated code for v1779 and 2025-05-28.preview
stripe-openapi[bot] Jun 2, 2025
2c3dab6
Update generated code for v1780 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
43563c8
Update generated code for v1782 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
e51e078
Update generated code for v1783 and 2025-05-28.preview
stripe-openapi[bot] Jun 3, 2025
e6955a6
Update generated code for v1784 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
1f4c858
Update generated code for v1785 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
53d360c
Update generated code for v1787 and 2025-05-28.preview
stripe-openapi[bot] Jun 4, 2025
b266c9a
Update generated code for v1789 and 2025-05-28.preview
stripe-openapi[bot] Jun 6, 2025
21ff72b
Update generated code for v1791 and 2025-05-28.preview
stripe-openapi[bot] Jun 10, 2025
9ee6db3
Update generated code for v1793 and 2025-05-28.preview
stripe-openapi[bot] Jun 10, 2025
1b39df0
Update generated code for v1795 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
175b0a4
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
d86c60d
Update generated code for v1796 and 2025-05-28.preview
stripe-openapi[bot] Jun 12, 2025
348a962
Update generated code for v1797 and 2025-05-28.preview
stripe-openapi[bot] Jun 13, 2025
ccd2a64
Update generated code for v1799 and 2025-05-28.preview
stripe-openapi[bot] Jun 16, 2025
a7b94c4
Update generated code for v1800 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
18d4beb
Update generated code for v1800 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
f335f8c
Update generated code for v1801 and 2025-05-28.preview
stripe-openapi[bot] Jun 17, 2025
db24bbc
Update generated code for v1803 and 2025-05-28.preview
stripe-openapi[bot] Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions API_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-05-28.preview
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ This release changes the pinned API version to 2025-05-28.preview.
* Add support for `confirm_config` on `Terminal.Reader.action.confirm_payment_intent` and `Terminal.ReaderConfirmPaymentIntentParams`
* Add support for error code `forwarding_api_upstream_error` on `QuotePreviewInvoice.last_finalization_error`

## 18.2.1 - 2025-06-02
* [#2346](https://github.com/stripe/stripe-node/pull/2346) Allow data to be set in only `POST` rawRequests
* Fix bug where `rawRequest` incorrectly emits a warning when sending v2 GET requests

## 18.2.0 - 2025-05-29
This release changes the pinned API version to `2025-05-28.basil`.

Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1773
v1803
3 changes: 2 additions & 1 deletion src/RequestSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
this._maxBufferedRequestMetric = maxBufferedRequestMetric;
}

_addHeadersDirectlyToObject(obj: any, headers: RequestHeaders): void {

Check warning on line 55 in src/RequestSender.ts

View workflow job for this annotation

GitHub Actions / Static Checks

Argument 'obj' should be typed with a non-any type
// For convenience, make some headers easily accessible on
// lastResponse.

Expand Down Expand Up @@ -300,8 +300,8 @@
sleepSeconds = Math.max(initialNetworkRetryDelay, sleepSeconds);

// And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask.
if (Number.isInteger(retryAfter) && retryAfter! <= MAX_RETRY_AFTER_WAIT) {

Check warning on line 303 in src/RequestSender.ts

View workflow job for this annotation

GitHub Actions / Static Checks

Forbidden non-null assertion
sleepSeconds = Math.max(sleepSeconds, retryAfter!);

Check warning on line 304 in src/RequestSender.ts

View workflow job for this annotation

GitHub Actions / Static Checks

Forbidden non-null assertion
}

return sleepSeconds * 1000;
Expand Down Expand Up @@ -487,7 +487,8 @@

// Pull request data and options (headers, auth) from args.
const dataFromArgs = getDataFromArgs(args);
const data = Object.assign({}, dataFromArgs);
const data =
requestMethod === 'POST' ? Object.assign({}, dataFromArgs) : null;
const calculatedOptions = getOptionsFromArgs(args);

const headers = calculatedOptions.headers;
Expand Down
3 changes: 2 additions & 1 deletion src/apiVersion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// File generated from our OpenAPI spec

export const ApiVersion = '2025-05-28.preview';
export const ApiVersion = '2025-06-30.preview';
export const ApiMajorVersion = 'preview';
16 changes: 16 additions & 0 deletions test/RequestSender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,22 @@ describe('RequestSender', () => {
done(error);
});
});

it('sends empty v2 GET request bodies', (done) => {
const scope = nock(`https://api.stripe.com`)
.get(`/v2/core/event_destinations`)
.reply(200, {data: [], next_page_url: null, previous_page_url: null});

realStripe
.rawRequest('GET', '/v2/core/event_destinations')
.then((result) => {
done();
scope.done();
})
.catch((error) => {
done(error);
});
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/resources/generated_examples_test.spec.js

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions types/AccountSessions.d.ts

Large diffs are not rendered by default.

124 changes: 62 additions & 62 deletions types/AccountSessionsResource.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion types/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ declare module 'stripe' {
/**
* Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page.
*/
hosted_payment_method_save?: Invoices.HostedPaymentMethodSave | null;
hosted_payment_method_save: Invoices.HostedPaymentMethodSave | null;
}

namespace Invoices {
Expand Down
27 changes: 27 additions & 0 deletions types/AccountsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,9 @@ declare module 'stripe' {
*/
phone?: string;

/**
* When the business was incorporated or registered.
*/
registration_date?: Stripe.Emptyable<Company.RegistrationDate>;

/**
Expand Down Expand Up @@ -1427,6 +1430,11 @@ declare module 'stripe' {
*/
company_tax_id_verification?: Documents.CompanyTaxIdVerification;

/**
* One or more documents that demonstrate proof of address.
*/
proof_of_address?: Documents.ProofOfAddress;

/**
* One or more documents showing the company's proof of registration with the national business registry.
*/
Expand Down Expand Up @@ -1481,6 +1489,13 @@ declare module 'stripe' {
files?: Array<string>;
}

interface ProofOfAddress {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
*/
files?: Array<string>;
}

interface ProofOfRegistration {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
Expand Down Expand Up @@ -3497,6 +3512,11 @@ declare module 'stripe' {
*/
company_tax_id_verification?: Documents.CompanyTaxIdVerification;

/**
* One or more documents that demonstrate proof of address.
*/
proof_of_address?: Documents.ProofOfAddress;

/**
* One or more documents showing the company's proof of registration with the national business registry.
*/
Expand Down Expand Up @@ -3551,6 +3571,13 @@ declare module 'stripe' {
files?: Array<string>;
}

interface ProofOfAddress {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
*/
files?: Array<string>;
}

interface ProofOfRegistration {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
Expand Down
2 changes: 1 addition & 1 deletion types/BillingPortal/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ declare module 'stripe' {

interface SubscriptionUpdateConfirm {
/**
* The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified.
* The coupon or promotion code to apply to this subscription update.
*/
discounts: Array<SubscriptionUpdateConfirm.Discount> | null;

Expand Down
2 changes: 1 addition & 1 deletion types/BillingPortal/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ declare module 'stripe' {

interface SubscriptionUpdateConfirm {
/**
* The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified.
* The coupon or promotion code to apply to this subscription update.
*/
discounts?: Array<SubscriptionUpdateConfirm.Discount>;

Expand Down
14 changes: 10 additions & 4 deletions types/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ declare module 'stripe' {
incremental_authorization?: Card.IncrementalAuthorization;

/**
* Installment details for this payment (Mexico only).
* Installment details for this payment.
*
* For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
*/
Expand Down Expand Up @@ -1033,9 +1033,13 @@ declare module 'stripe' {
interval: 'month' | null;

/**
* Type of installment plan, one of `fixed_count`.
* Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
*/
type: 'fixed_count';
type: Plan.Type;
}

namespace Plan {
type Type = 'bonus' | 'fixed_count' | 'revolving';
}
}

Expand Down Expand Up @@ -1636,7 +1640,7 @@ declare module 'stripe' {

interface Ideal {
/**
* The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
* The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
*/
bank: Ideal.Bank | null;

Expand Down Expand Up @@ -1672,6 +1676,7 @@ declare module 'stripe' {
| 'abn_amro'
| 'asn_bank'
| 'bunq'
| 'buut'
| 'handelsbanken'
| 'ing'
| 'knab'
Expand All @@ -1691,6 +1696,7 @@ declare module 'stripe' {
| 'ASNBNL21'
| 'BITSNL2A'
| 'BUNQNL2A'
| 'BUUTNL2A'
| 'FVLBNL22'
| 'HANDNL2A'
| 'INGBNL2A'
Expand Down
17 changes: 10 additions & 7 deletions types/Checkout/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ declare module 'stripe' {
invoice_creation?: SessionCreateParams.InvoiceCreation;

/**
* A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices).
* A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). The parameter is required for `payment` and `subscription` mode.
*
* For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.
*
Expand Down Expand Up @@ -2886,15 +2886,12 @@ declare module 'stripe' {
transfer_data?: SubscriptionData.TransferData;

/**
* Unix timestamp representing the end of the trial period the customer
* will get before being charged for the first time. Has to be at least
* 48 hours in the future.
* Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future.
*/
trial_end?: number;

/**
* Integer representing the number of trial period days before the
* customer is charged for the first time. Has to be at least 1.
* Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.
*/
trial_period_days?: number;

Expand All @@ -2905,7 +2902,13 @@ declare module 'stripe' {
}

namespace SubscriptionData {
type BillingMode = 'classic' | 'flexible';
interface BillingMode {
type: BillingMode.Type;
}

namespace BillingMode {
type Type = 'classic' | 'flexible';
}

interface InvoiceSettings {
/**
Expand Down
12 changes: 9 additions & 3 deletions types/ConfirmationTokens.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,13 @@ declare module 'stripe' {
interval: 'month' | null;

/**
* Type of installment plan, one of `fixed_count`.
* Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
*/
type: 'fixed_count';
type: Plan.Type;
}

namespace Plan {
type Type = 'bonus' | 'fixed_count' | 'revolving';
}
}
}
Expand Down Expand Up @@ -1134,7 +1138,7 @@ declare module 'stripe' {

interface Ideal {
/**
* The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
* The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
*/
bank: Ideal.Bank | null;

Expand All @@ -1149,6 +1153,7 @@ declare module 'stripe' {
| 'abn_amro'
| 'asn_bank'
| 'bunq'
| 'buut'
| 'handelsbanken'
| 'ing'
| 'knab'
Expand All @@ -1168,6 +1173,7 @@ declare module 'stripe' {
| 'ASNBNL21'
| 'BITSNL2A'
| 'BUNQNL2A'
| 'BUUTNL2A'
| 'FVLBNL22'
| 'HANDNL2A'
| 'INGBNL2A'
Expand Down
18 changes: 9 additions & 9 deletions types/CreditNotesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module 'stripe' {
invoice: string;

/**
* The integer amount in cents (or local equivalent) representing the total amount of the credit note.
* The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
amount?: number;

Expand All @@ -34,7 +34,7 @@ declare module 'stripe' {
expand?: Array<string>;

/**
* Line items that make up the credit note.
* Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
lines?: Array<CreditNoteCreateParams.Line>;

Expand Down Expand Up @@ -69,7 +69,7 @@ declare module 'stripe' {
refunds?: Array<CreditNoteCreateParams.Refund>;

/**
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
shipping_cost?: CreditNoteCreateParams.ShippingCost;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ declare module 'stripe' {
invoice: string;

/**
* The integer amount in cents (or local equivalent) representing the total amount of the credit note.
* The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
amount?: number;

Expand All @@ -261,7 +261,7 @@ declare module 'stripe' {
expand?: Array<string>;

/**
* Line items that make up the credit note.
* Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
lines?: Array<CreditNoteListPreviewLineItemsParams.Line>;

Expand Down Expand Up @@ -296,7 +296,7 @@ declare module 'stripe' {
refunds?: Array<CreditNoteListPreviewLineItemsParams.Refund>;

/**
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
shipping_cost?: CreditNoteListPreviewLineItemsParams.ShippingCost;
}
Expand Down Expand Up @@ -405,7 +405,7 @@ declare module 'stripe' {
invoice: string;

/**
* The integer amount in cents (or local equivalent) representing the total amount of the credit note.
* The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
amount?: number;

Expand All @@ -430,7 +430,7 @@ declare module 'stripe' {
expand?: Array<string>;

/**
* Line items that make up the credit note.
* Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
lines?: Array<CreditNotePreviewParams.Line>;

Expand Down Expand Up @@ -465,7 +465,7 @@ declare module 'stripe' {
refunds?: Array<CreditNotePreviewParams.Refund>;

/**
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
* When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
*/
shipping_cost?: CreditNotePreviewParams.ShippingCost;
}
Expand Down
2 changes: 1 addition & 1 deletion types/CustomerSessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ declare module 'stripe' {
payment_method_redisplay: Features.PaymentMethodRedisplay;

/**
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`.
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`.
*/
payment_method_redisplay_limit: number | null;

Expand Down
2 changes: 1 addition & 1 deletion types/CustomerSessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ declare module 'stripe' {
payment_method_redisplay?: Features.PaymentMethodRedisplay;

/**
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`.
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`.
*/
payment_method_redisplay_limit?: number;

Expand Down
Loading
Loading