From 539e72ca9367b2ed329e7fc1b70078b840c4062e Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Fri, 11 Nov 2022 08:56:09 -0800 Subject: [PATCH 01/23] Add type information here and there (#1612) --- .eslintrc.js | 4 +- lib/Error.js | 2 + lib/StripeResource.js | 12 ++- lib/Webhooks.js | 4 + lib/autoPagination.js | 1 + lib/multipart.js | 8 +- lib/net/FetchHttpClient.js | 2 + lib/net/NodeHttpClient.js | 1 + lib/stripe.js | 20 ++-- lib/utils.js | 2 + src/Error.ts | 40 +------- src/ResourceNamespace.ts | 17 +++- src/StripeMethod.ts | 4 +- src/StripeResource.ts | 174 +++++++++++++++++++------------ src/Types.d.ts | 203 +++++++++++++++++++++++++++++++++++++ src/Webhooks.ts | 146 +++++++++++++++++++------- src/autoPagination.ts | 106 ++++++++++++++----- src/makeRequest.ts | 31 ++++-- src/multipart.ts | 50 ++++++--- src/net/FetchHttpClient.ts | 54 +++++----- src/net/HttpClient.ts | 36 +++---- src/net/NodeHttpClient.ts | 112 ++++++++++---------- src/stripe.ts | 97 ++++++++++-------- src/utils.ts | 94 +++++++++-------- tsconfig.json | 3 + 25 files changed, 837 insertions(+), 386 deletions(-) create mode 100644 src/Types.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 4eb5fcc6be..05679266e1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -265,11 +265,11 @@ module.exports = { '@typescript-eslint/no-empty-interface': 0, '@typescript-eslint/no-unused-vars': 0, '@typescript-eslint/triple-slash-reference': 0, - '@typescript-eslint/ban-ts-ignore': 0, + '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-empty-function': 0, '@typescript-eslint/camelcase': 0, '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/no-var-requires': 0, 'prefer-rest-params': 'off', }, diff --git a/lib/Error.js b/lib/Error.js index a50ccab948..0b5c8ad8db 100644 --- a/lib/Error.js +++ b/lib/Error.js @@ -1,4 +1,5 @@ 'use strict'; +/* eslint-disable camelcase */ /** * StripeError is the base error from which all other more specific Stripe errors derive. * Specifically for errors returned from Stripe's REST API. @@ -16,6 +17,7 @@ class StripeError extends Error { this.headers = raw.headers; this.requestId = raw.requestId; this.statusCode = raw.statusCode; + // @ts-ignore this.message = raw.message; this.charge = raw.charge; this.decline_code = raw.decline_code; diff --git a/lib/StripeResource.js b/lib/StripeResource.js index bfced38996..9a11b7d1c3 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -28,20 +28,25 @@ function StripeResource(stripe, deprecatedUrlData) { ); } this.basePath = utils.makeURLInterpolator( + // @ts-ignore changing type of basePath this.basePath || stripe.getApiField('basePath') ); + // @ts-ignore changing type of path this.resourcePath = this.path; + // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); // DEPRECATED: This was kept for backwards compatibility in case users were // using this, but basic methods are now explicitly defined on a resource. if (this.includeBasic) { this.includeBasic.forEach(function(methodName) { + // @ts-ignore this[methodName] = StripeResource.BASIC_METHODS[methodName]; }, this); } this.initialize(...arguments); } StripeResource.prototype = { + _stripe: null, path: '', // Methods that don't use the API's default '/v1' path can override it with this setting. basePath: null, @@ -90,6 +95,8 @@ StripeResource.prototype = { }, // DEPRECATED: Here for backcompat in case users relied on this. wrapTimeout: utils.callbackifyPromiseWithTimeout, + // eslint-disable-next-line no-warning-comments + // TODO: Unused? _timeoutHandler(timeout, req, callback) { return () => { const timeoutErr = new TypeError('ETIMEDOUT'); @@ -234,7 +241,7 @@ StripeResource.prototype = { requestRetries > 0 ? ` Request was retried ${requestRetries} times.` : '' }`; }, - _errorHandler(req, requestRetries, callback) { + _errorHandler(res, requestRetries, callback) { return (message, detail) => { callback.call( this, @@ -451,6 +458,7 @@ StripeResource.prototype = { timeout ); const requestStartTime = Date.now(); + // @ts-ignore const requestEvent = utils.removeNullish({ api_version: apiVersion, account: headers['Stripe-Account'], @@ -470,6 +478,7 @@ StripeResource.prototype = { apiVersion, headers, requestRetries, + // @ts-ignore res.getHeaders()['retry-after'] ); } else if (options.streaming && res.getStatusCode() < 400) { @@ -496,6 +505,7 @@ StripeResource.prototype = { message: isTimeoutError ? `Request aborted due to timeout being reached (${timeout}ms)` : this._generateConnectionErrorMessage(requestRetries), + // @ts-ignore detail: error, }) ); diff --git a/lib/Webhooks.js b/lib/Webhooks.js index f7570b3946..ce6322201e 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -4,6 +4,7 @@ const _Error = require('./Error'); const {StripeError, StripeSignatureVerificationError} = _Error; const Webhook = { DEFAULT_TOLERANCE: 300, + // @ts-ignore signature: null, constructEvent(payload, header, secret, tolerance, cryptoProvider) { this.signature.verifyHeader( @@ -13,6 +14,7 @@ const Webhook = { tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider ); + // @ts-ignore const jsonPayload = JSON.parse(payload); return jsonPayload; }, @@ -30,6 +32,7 @@ const Webhook = { tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider ); + // @ts-ignore const jsonPayload = JSON.parse(payload); return jsonPayload; }, @@ -175,6 +178,7 @@ function validateComputedSignature( tolerance ) { const signatureFound = !!details.signatures.filter( + // @ts-ignore utils.secureCompare.bind(utils, expectedSignature) ).length; if (!signatureFound) { diff --git a/lib/autoPagination.js b/lib/autoPagination.js index 141afdeb49..3626ffeae3 100644 --- a/lib/autoPagination.js +++ b/lib/autoPagination.js @@ -182,6 +182,7 @@ function makeAutoPagingEach(asyncIteratorNext) { } const autoPagePromise = wrapAsyncIteratorWithCallback( asyncIteratorNext, + // @ts-ignore we might need a null check onItem ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); diff --git a/lib/multipart.js b/lib/multipart.js index d88d468b1f..29e53c8363 100644 --- a/lib/multipart.js +++ b/lib/multipart.js @@ -28,14 +28,15 @@ const multipartDataGenerator = (method, data, headers) => { const v = flattenedData[k]; push(`--${segno}`); if (Object.prototype.hasOwnProperty.call(v, 'data')) { + const typedEntry = v; push( `Content-Disposition: form-data; name=${q(k)}; filename=${q( - v.name || 'blob' + typedEntry.name || 'blob' )}` ); - push(`Content-Type: ${v.type || 'application/octet-stream'}`); + push(`Content-Type: ${typedEntry.type || 'application/octet-stream'}`); push(''); - push(v.data); + push(typedEntry.data); } else { push(`Content-Disposition: form-data; name=${q(k)}`); push(''); @@ -52,6 +53,7 @@ const streamProcessor = (method, data, headers, callback) => { bufferArray.push(line); }) .once('end', () => { + // @ts-ignore const bufferData = Object.assign({}, data); bufferData.file.data = Buffer.concat(bufferArray); const buffer = multipartDataGenerator(method, bufferData, headers); diff --git a/lib/net/FetchHttpClient.js b/lib/net/FetchHttpClient.js index 195b1bb0c6..355824001a 100644 --- a/lib/net/FetchHttpClient.js +++ b/lib/net/FetchHttpClient.js @@ -44,7 +44,9 @@ class FetchHttpClient extends HttpClient { const fetchFn = this._fetchFn || fetch; const fetchPromise = fetchFn(url.toString(), { method, + // @ts-ignore headers, + // @ts-ignore body, }); // The Fetch API does not support passing in a timeout natively, so a diff --git a/lib/net/NodeHttpClient.js b/lib/net/NodeHttpClient.js index c5712dfe2f..cf580fd63d 100644 --- a/lib/net/NodeHttpClient.js +++ b/lib/net/NodeHttpClient.js @@ -74,6 +74,7 @@ class NodeHttpClient extends HttpClient { } class NodeHttpClientResponse extends HttpClientResponse { constructor(res) { + // @ts-ignore super(res.statusCode, res.headers || {}); this._res = res; } diff --git a/lib/stripe.js b/lib/stripe.js index 60b82e7312..97a78644cb 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -108,6 +108,7 @@ function Stripe(key, config = {}) { this._prevRequestMetrics = []; this._enableTelemetry = props.telemetry !== false; // Expose StripeResource on the instance too + // @ts-ignore this.StripeResource = Stripe.StripeResource; } Stripe.errors = _Error; @@ -286,14 +287,17 @@ Stripe.prototype = { throw new Error('AppInfo.name is required'); } info = info || {}; - const appInfo = APP_INFO_PROPERTIES.reduce((accum, prop) => { - if (typeof info[prop] == 'string') { - accum = accum || {}; - accum[prop] = info[prop]; - } - return accum; - }, undefined); - this._appInfo = appInfo; + this._appInfo = APP_INFO_PROPERTIES.reduce( + (accum, prop) => { + if (typeof info[prop] == 'string') { + accum = accum || {}; + accum[prop] = info[prop]; + } + return accum; + }, + // @ts-ignore + undefined + ); }, /** * @deprecated will be removed in a future major version. Use the config object instead: diff --git a/lib/utils.js b/lib/utils.js index 2ed6fb43cf..5031266832 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -9,6 +9,7 @@ let exec = null; try { exec = require('child_process').exec; } catch (e) { + // @ts-ignore if (e.code !== 'MODULE_NOT_FOUND') { throw e; } @@ -77,6 +78,7 @@ const utils = { const cleanString = str.replace(/["\n\r\u2028\u2029]/g, ($0) => rc[$0]); return (outputs) => { return cleanString.replace(/\{([\s\S]+?)\}/g, ($0, $1) => + // @ts-ignore encodeURIComponent(outputs[$1] || '') ); }; diff --git a/src/Error.ts b/src/Error.ts index fbf88cc5d6..b5489fe001 100644 --- a/src/Error.ts +++ b/src/Error.ts @@ -1,35 +1,4 @@ /* eslint-disable camelcase */ -type RawErrorType = - | 'card_error' - | 'invalid_request_error' - | 'api_error' - | 'idempotency_error' - | 'rate_limit_error' - | 'authentication_error' - | 'invalid_grant'; - -type StripeRawError = { - message?: string; - type?: RawErrorType; - - headers?: {[header: string]: string}; - statusCode?: number; - requestId?: string; - code?: string; - doc_url?: string; - decline_code?: string; - param?: string; - detail?: string; - charge?: string; - payment_method_type?: string; - - payment_intent?: any; - payment_method?: any; - setup_intent?: any; - source?: any; - exception?: any; -}; - /** * StripeError is the base error from which all other more specific Stripe errors derive. * Specifically for errors returned from Stripe's REST API. @@ -38,9 +7,9 @@ class StripeError extends Error { readonly message: string; readonly type: string; readonly raw: unknown; - readonly rawType: RawErrorType; - readonly headers: {[header: string]: string}; - readonly requestId: string; + readonly rawType?: RawErrorType; + readonly headers?: {[header: string]: string}; + readonly requestId?: string; readonly code?: string; readonly doc_url?: string; @@ -69,6 +38,7 @@ class StripeError extends Error { this.headers = raw.headers; this.requestId = raw.requestId; this.statusCode = raw.statusCode; + // @ts-ignore this.message = raw.message; this.charge = raw.charge; @@ -83,7 +53,7 @@ class StripeError extends Error { /** * Helper factory which takes raw stripe errors and outputs wrapping instances */ - static generate(rawStripeError) { + static generate(rawStripeError: StripeRawError): StripeError { switch (rawStripeError.type) { case 'card_error': return new StripeCardError(rawStripeError); diff --git a/src/ResourceNamespace.ts b/src/ResourceNamespace.ts index c4b6c5566d..b4d5238c7a 100644 --- a/src/ResourceNamespace.ts +++ b/src/ResourceNamespace.ts @@ -1,19 +1,26 @@ // ResourceNamespace allows you to create nested resources, i.e. `stripe.issuing.cards`. // It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`. -function ResourceNamespace(stripe, resources) { +function ResourceNamespace( + this: StripeResourceNamespaceObject, + stripe: StripeObject, + resources: Array +): void { for (const name in resources) { const camelCaseName = name[0].toLowerCase() + name.substring(1); - const resource = new resources[name](stripe); + const resource = new (resources[name] as any)(stripe); this[camelCaseName] = resource; } } -module.exports = function(namespace, resources) { - return function(stripe) { - return new ResourceNamespace(stripe, resources); +module.exports = function( + namespace: string, + resources: Array +): (stripe: StripeObject) => StripeResourceNamespaceObject { + return function(stripe: StripeObject): StripeResourceNamespaceObject { + return new (ResourceNamespace as any)(stripe, resources); }; }; diff --git a/src/StripeMethod.ts b/src/StripeMethod.ts index f2c0595988..3a99651f4e 100644 --- a/src/StripeMethod.ts +++ b/src/StripeMethod.ts @@ -19,13 +19,13 @@ const makeAutoPaginationMethods = autoPagination.makeAutoPaginationMethods; * Usefully for applying transforms to data on a per-method basis. * @param [spec.host] Hostname for the request. */ -function stripeMethod(spec) { +function stripeMethod(spec: MethodSpec): (...args: any[]) => Promise { if (spec.path !== undefined && spec.fullPath !== undefined) { throw new Error( `Method spec specified both a 'path' (${spec.path}) and a 'fullPath' (${spec.fullPath}).` ); } - return function(...args) { + return function(this: StripeResourceObject, ...args: any[]): Promise { const callback = typeof args[args.length - 1] == 'function' && args.pop(); spec.urlParams = utils.extractUrlParams( diff --git a/src/StripeResource.ts b/src/StripeResource.ts index e8f85599fe..b4392c0d57 100644 --- a/src/StripeResource.ts +++ b/src/StripeResource.ts @@ -12,16 +12,6 @@ const { const {HttpClient} = require('./net/HttpClient'); -type Settings = { - timeout?: number; -}; - -type Options = { - settings?: Settings; - streaming?: boolean; - headers?: Record; -}; - // Provide extension mechanism for Stripe Resource Sub-Classes StripeResource.extend = utils.protoExtend; @@ -35,7 +25,11 @@ const MAX_RETRY_AFTER_WAIT = 60; /** * Encapsulates request logic for a Stripe Resource */ -function StripeResource(stripe, deprecatedUrlData) { +function StripeResource( + this: StripeResourceObject, + stripe: StripeObject, + deprecatedUrlData?: never +): void { this._stripe = stripe; if (deprecatedUrlData) { throw new Error( @@ -44,29 +38,32 @@ function StripeResource(stripe, deprecatedUrlData) { } this.basePath = utils.makeURLInterpolator( + // @ts-ignore changing type of basePath this.basePath || stripe.getApiField('basePath') ); + // @ts-ignore changing type of path this.resourcePath = this.path; + // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); - // DEPRECATED: This was kept for backwards compatibility in case users were // using this, but basic methods are now explicitly defined on a resource. if (this.includeBasic) { this.includeBasic.forEach(function(methodName) { + // @ts-ignore this[methodName] = StripeResource.BASIC_METHODS[methodName]; }, this); } - this.initialize(...arguments); } StripeResource.prototype = { + _stripe: null as StripeObject | null, path: '', // Methods that don't use the API's default '/v1' path can override it with this setting. basePath: null, - initialize() {}, + initialize(): void {}, // Function to override the default data processor. This allows full control // over how a StripeResource's request data will get converted into an HTTP @@ -78,7 +75,10 @@ StripeResource.prototype = { // be thrown, and they will be passed to the callback/promise. validateRequest: null, - createFullPath(commandPath, urlData) { + createFullPath( + commandPath: string | ((urlData: Record) => string), + urlData: Record + ): string { const urlParts = [this.basePath(urlData), this.path(urlData)]; if (typeof commandPath === 'function') { @@ -99,7 +99,7 @@ StripeResource.prototype = { // Creates a relative resource path with symbols left in (unlike // createFullPath which takes some data to replace them with). For example it // might produce: /invoices/{id} - createResourcePathWithSymbols(pathWithSymbols) { + createResourcePathWithSymbols(pathWithSymbols: string | null): string { // If there is no path beyond the resource path, we want to produce just // / rather than //. if (pathWithSymbols) { @@ -109,7 +109,7 @@ StripeResource.prototype = { } }, - _joinUrlParts(parts) { + _joinUrlParts(parts: Array): string { // Replace any accidentally doubled up slashes. This previously used // path.join, which would do this as well. Unfortunately we need to do this // as the functions for creating paths are technically part of the public @@ -120,8 +120,14 @@ StripeResource.prototype = { // DEPRECATED: Here for backcompat in case users relied on this. wrapTimeout: utils.callbackifyPromiseWithTimeout, - _timeoutHandler(timeout, req, callback) { - return () => { + // eslint-disable-next-line no-warning-comments + // TODO: Unused? + _timeoutHandler( + timeout: number, + req: any, + callback: RequestCallback + ): () => void { + return (): void => { const timeoutErr = new TypeError('ETIMEDOUT'); (timeoutErr as any).code = 'ETIMEDOUT'; @@ -129,7 +135,10 @@ StripeResource.prototype = { }; }, - _addHeadersDirectlyToObject(obj, headers) { + _addHeadersDirectlyToObject( + obj: Record, + headers: RequestHeaders + ): void { // For convenience, make some headers easily accessible on // lastResponse. @@ -140,7 +149,11 @@ StripeResource.prototype = { obj.idempotencyKey = obj.idempotencyKey || headers['idempotency-key']; }, - _makeResponseEvent(requestEvent, statusCode, headers) { + _makeResponseEvent( + requestEvent: RequestEvent, + statusCode: number, + headers: RequestHeaders + ): ResponseEvent { const requestEndTime = Date.now(); const requestDurationMs = requestEndTime - requestEvent.request_start_time; @@ -158,7 +171,7 @@ StripeResource.prototype = { }); }, - _getRequestId(headers) { + _getRequestId(headers: RequestHeaders): HttpHeaderValue { return headers['request-id']; }, @@ -172,11 +185,14 @@ StripeResource.prototype = { * still be buffered/parsed and handled by _jsonResponseHandler -- see * makeRequest) */ - _streamingResponseHandler(requestEvent, callback) { - return (res) => { + _streamingResponseHandler( + requestEvent: RequestEvent, + callback: RequestCallback + ): (res: HttpClientResponseInterface) => RequestCallbackReturn { + return (res: HttpClientResponseInterface): RequestCallbackReturn => { const headers = res.getHeaders(); - const streamCompleteCallback = () => { + const streamCompleteCallback = (): void => { const responseEvent = this._makeResponseEvent( requestEvent, res.getStatusCode(), @@ -205,8 +221,8 @@ StripeResource.prototype = { * parses the JSON and returns it (i.e. passes it to the callback) if there * is no "error" field. Otherwise constructs/passes an appropriate Error. */ - _jsonResponseHandler(requestEvent, callback) { - return (res) => { + _jsonResponseHandler(requestEvent: RequestEvent, callback: RequestCallback) { + return (res: HttpClientResponseInterface): void => { const headers = res.getHeaders(); const requestId = this._getRequestId(headers); const statusCode = res.getStatusCode(); @@ -253,11 +269,11 @@ StripeResource.prototype = { return jsonResponse; }, - (e) => { + (e: Error) => { throw new StripeAPIError({ message: 'Invalid JSON received from the Stripe API', exception: e, - requestId: headers['request-id'], + requestId: headers['request-id'] as string, }); } ) @@ -281,14 +297,18 @@ StripeResource.prototype = { }; }, - _generateConnectionErrorMessage(requestRetries) { + _generateConnectionErrorMessage(requestRetries: number): string { return `An error occurred with our connection to Stripe.${ requestRetries > 0 ? ` Request was retried ${requestRetries} times.` : '' }`; }, - _errorHandler(req, requestRetries, callback) { - return (message, detail) => { + _errorHandler( + res: never, + requestRetries: number, + callback: RequestCallback + ): (message: string, detail: string) => void { + return (message: string, detail: string): void => { callback.call( this, new StripeConnectionError({ @@ -301,7 +321,12 @@ StripeResource.prototype = { }, // For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency - _shouldRetry(res, numRetries, maxRetries, error) { + _shouldRetry( + res: HttpClientResponseInterface, + numRetries: number, + maxRetries: number, + error?: {code: number} + ): boolean { if ( error && numRetries === 0 && @@ -346,7 +371,10 @@ StripeResource.prototype = { return false; }, - _getSleepTimeInMS(numRetries, retryAfter = null) { + _getSleepTimeInMS( + numRetries: number, + retryAfter: number | null = null + ): number { const initialNetworkRetryDelay = this._stripe.getInitialNetworkRetryDelay(); const maxNetworkRetryDelay = this._stripe.getMaxNetworkRetryDelay(); @@ -366,22 +394,25 @@ StripeResource.prototype = { 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) { - sleepSeconds = Math.max(sleepSeconds, retryAfter); + if (Number.isInteger(retryAfter) && retryAfter! <= MAX_RETRY_AFTER_WAIT) { + sleepSeconds = Math.max(sleepSeconds, retryAfter!); } return sleepSeconds * 1000; }, // Max retries can be set on a per request basis. Favor those over the global setting - _getMaxNetworkRetries(settings: {maxNetworkRetries?: number} = {}) { + _getMaxNetworkRetries(settings: RequestSettings = {}): number { return settings.maxNetworkRetries && Number.isInteger(settings.maxNetworkRetries) ? settings.maxNetworkRetries : this._stripe.getMaxNetworkRetries(); }, - _defaultIdempotencyKey(method, settings) { + _defaultIdempotencyKey( + method: string, + settings: RequestSettings + ): string | null { // If this is a POST and we allow multiple retries, ensure an idempotency key. const maxRetries = this._getMaxNetworkRetries(settings); @@ -392,14 +423,14 @@ StripeResource.prototype = { }, _makeHeaders( - auth, - contentLength, - apiVersion, - clientUserAgent, - method, - userSuppliedHeaders, - userSuppliedSettings - ) { + auth: string, + contentLength: number, + apiVersion: string, + clientUserAgent: string, + method: string, + userSuppliedHeaders: RequestHeaders, + userSuppliedSettings: RequestSettings + ): Record { const defaultHeaders = { // Use specified auth token or use default from this stripe instance: Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'), @@ -414,7 +445,7 @@ StripeResource.prototype = { method, userSuppliedSettings ), - }; + } as RequestHeaders; // As per https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2: // A user agent SHOULD send a Content-Length in a request message when @@ -451,7 +482,7 @@ StripeResource.prototype = { ); }, - _getUserAgentString() { + _getUserAgentString(): string { const packageVersion = this._stripe.getConstant('PACKAGE_VERSION'); const appInfo = this._stripe._appInfo ? this._stripe.getAppInfoAsString() @@ -460,7 +491,7 @@ StripeResource.prototype = { return `Stripe/v1 NodeBindings/${packageVersion} ${appInfo}`.trim(); }, - _getTelemetryHeader() { + _getTelemetryHeader(): string | undefined { if ( this._stripe.getTelemetryEnabled() && this._stripe._prevRequestMetrics.length > 0 @@ -472,7 +503,7 @@ StripeResource.prototype = { } }, - _recordRequestMetrics(requestId, requestDurationMs) { + _recordRequestMetrics(requestId: string, requestDurationMs: number): void { if (this._stripe.getTelemetryEnabled() && requestId) { if ( this._stripe._prevRequestMetrics.length > @@ -490,16 +521,24 @@ StripeResource.prototype = { } }, - _request(method, host, path, data, auth, options: Options = {}, callback) { - let requestData; + _request( + method: string, + host: string, + path: string, + data: string, + auth: string, + options: RequestOptions = {}, + callback: RequestCallback + ): void { + let requestData: string; const retryRequest = ( - requestFn, - apiVersion, - headers, - requestRetries, - retryAfter - ) => { + requestFn: typeof makeRequest, + apiVersion: string, + headers: RequestHeaders, + requestRetries: number, + retryAfter: number | null + ): NodeJS.Timeout => { return setTimeout( requestFn, this._getSleepTimeInMS(requestRetries, retryAfter), @@ -509,7 +548,11 @@ StripeResource.prototype = { ); }; - const makeRequest = (apiVersion, headers, numRetries) => { + const makeRequest = ( + apiVersion: string, + headers: RequestHeaders, + numRetries: number + ): void => { // timeout can be set on a per-request basis. Favor that over the global setting const timeout = options.settings && @@ -534,7 +577,8 @@ StripeResource.prototype = { const requestStartTime = Date.now(); - const requestEvent = utils.removeNullish({ + // @ts-ignore + const requestEvent: RequestEvent = utils.removeNullish({ api_version: apiVersion, account: headers['Stripe-Account'], idempotency_key: headers['Idempotency-Key'], @@ -550,13 +594,14 @@ StripeResource.prototype = { this._stripe._emitter.emit('request', requestEvent); req - .then((res) => { + .then((res: HttpClientResponseInterface) => { if (this._shouldRetry(res, requestRetries, maxRetries)) { return retryRequest( makeRequest, apiVersion, headers, requestRetries, + // @ts-ignore res.getHeaders()['retry-after'] ); } else if (options.streaming && res.getStatusCode() < 400) { @@ -565,7 +610,7 @@ StripeResource.prototype = { return this._jsonResponseHandler(requestEvent, callback)(res); } }) - .catch((error) => { + .catch((error: HttpClientResponseError) => { if (this._shouldRetry(null, requestRetries, maxRetries, error)) { return retryRequest( makeRequest, @@ -584,6 +629,7 @@ StripeResource.prototype = { message: isTimeoutError ? `Request aborted due to timeout being reached (${timeout}ms)` : this._generateConnectionErrorMessage(requestRetries), + // @ts-ignore detail: error, }) ); @@ -591,14 +637,14 @@ StripeResource.prototype = { }); }; - const prepareAndMakeRequest = (error, data) => { + const prepareAndMakeRequest = (error: Error | null, data: string): void => { if (error) { return callback(error); } requestData = data; - this._stripe.getClientUserAgent((clientUserAgent) => { + this._stripe.getClientUserAgent((clientUserAgent: string) => { const apiVersion = this._stripe.getApiField('version'); const headers = this._makeHeaders( auth, diff --git a/src/Types.d.ts b/src/Types.d.ts new file mode 100644 index 0000000000..c785e6f3d0 --- /dev/null +++ b/src/Types.d.ts @@ -0,0 +1,203 @@ +/* eslint-disable camelcase */ +type AppInfo = {name?: string} & Record; +type BufferedFile = {name: string; type: string; file: {data: Buffer}}; +type HttpClientResponseError = {code: number}; +type HttpHeaderValue = string | number | string[]; +type MethodSpec = { + method: string; + methodType: string; + urlParams: Array; + path?: string; + fullPath?: string; + encode: (data: RequestData) => RequestData; + validator: (data: RequestData, headers: RequestHeaders) => void; + headers: Record; + streaming?: boolean; + host?: string; + transformResponseData?: (response: HttpClientResponseInterface) => any; +}; +type MultipartRequestData = RequestData | StreamingFile | BufferedFile; +type RawErrorType = + | 'card_error' + | 'invalid_request_error' + | 'api_error' + | 'idempotency_error' + | 'rate_limit_error' + | 'authentication_error' + | 'invalid_grant'; +type RequestArgs = Array; +type RequestCallback = ( + this: StripeResourceObject | void, + error: Error | null, + response?: any +) => RequestCallbackReturn; +type RequestCallbackReturn = any; +type RequestData = Record; +type RequestEvent = { + api_version?: string; + account?: string; + idempotency_key?: string; + method?: string; + path?: string; + request_start_time: number; +}; +type RequestHeaders = Record; +type RequestOptions = { + settings?: RequestSettings; + streaming?: boolean; + headers?: RequestHeaders; +}; +type RequestOpts = { + requestMethod: string; + requestPath: string; + bodyData: RequestData; + queryData: RequestData; + auth: string; + headers: RequestHeaders; + host: string; + streaming: boolean; + settings: RequestSettings; +}; +type RequestSettings = {timeout?: number; maxNetworkRetries?: number}; +type ResponseEvent = { + api_version?: string; + account?: string; + idempotency_key?: string; + method?: string; + path?: string; + status?: number; + request_id?: string; + elapsed?: number; + request_start_time?: number; + request_end_time?: number; +}; +type ResponseHeaderValue = string | string[]; +type ResponseHeaders = Record; +interface HttpClientResponseInterface { + getStatusCode: () => number; + getHeaders: () => ResponseHeaders; + getRawResponse: () => unknown; + toStream: (streamCompleteCallback: () => void) => unknown; + toJSON: () => Promise; +} +type StreamingFile = { + name: string; + type: string; + file: {data: import('events').EventEmitter}; +}; +type StripeConstructor = { + new (key: string, config: Record): StripeObject; +}; +declare const Stripe: StripeConstructor; +type StripeCryptoProvider = { + computeHMACSignature: (data: string, secret: string) => string; + computeHMACSignatureAsync: (data: string, secret: string) => Promise; +}; +interface HttpClientInterface { + getClientName: () => string; + makeRequest: ( + host: string, + port: string, + path: string, + method: string, + headers: RequestHeaders, + requestData: RequestData, + protocol: string, + timeout: number + ) => Promise; +} +type StripeObject = { + on: any; + off: any; + once: any; + VERSION: string; + StripeResource: typeof StripeResource; + errors: any; + webhooks: any; + getApiField: (name: string) => T; + _prepResources: () => void; + _setAppInfo: (appInfo: AppInfo) => void; + _setApiKey: (apiKey: string) => void; + _prevRequestMetrics: number[]; + _api: { + auth: string | null; + host: string; + port: string | number; + protocol: string; + basePath: string; + version: string; + timeout: string; + maxNetworkRetries: number; + agent: string; + httpClient: any; + dev: boolean; + stripeAccount: string | null; + }; + _emitter: import('events').EventEmitter; + _enableTelemetry: boolean; + _getPropsFromConfig: (config: Record) => UserProvidedConfig; +}; +type StripeRawError = { + message?: string; + type?: RawErrorType; + headers?: {[header: string]: string}; + statusCode?: number; + requestId?: string; + code?: string; + doc_url?: string; + decline_code?: string; + param?: string; + detail?: string; + charge?: string; + payment_method_type?: string; + payment_intent?: any; + payment_method?: any; + setup_intent?: any; + source?: any; + exception?: any; +}; +type StripeResourceConstructor = { + new (stripe: StripeObject, deprecatedUrlData?: never): StripeResourceObject; +}; +declare const StripeResource: StripeResourceConstructor; +type StripeResourceNamespaceObject = Record< + string, + StripeResourceObject | unknown +>; +type StripeResourceObject = { + _stripe: StripeObject; + basePath: UrlInterpolator; + path: UrlInterpolator; + resourcePath: string; + includeBasic: Array; + createResourcePathWithSymbols: (path: string | null | undefined) => string; + createFullPath: ( + interpolator: UrlInterpolator, + urlData: RequestData + ) => string; + _request: ( + method: string, + host: string, + path: string, + data: RequestData, + auth: string, + options: RequestOptions, + callback: RequestCallback + ) => void; + initialize: (...args: Array) => void; +}; +type UrlInterpolator = (params: Record) => string; +type UserProvidedConfig = { + apiVersion?: string; + protocol?: string; + host?: string; + httpAgent?: any; + timeout?: number; + port?: number; + maxNetworkRetries?: number; + httpClient?: HttpClientInterface; + stripeAccount?: string; + typescript?: boolean; + telemetry?: boolean; + appInfo?: AppInfo; +}; diff --git a/src/Webhooks.ts b/src/Webhooks.ts index 14d5a4ed8f..955da33bb6 100644 --- a/src/Webhooks.ts +++ b/src/Webhooks.ts @@ -2,11 +2,74 @@ import utils = require('./utils'); import _Error = require('./Error'); const {StripeError, StripeSignatureVerificationError} = _Error; -const Webhook = { +type WebhookHeader = string | Buffer; +type WebhookParsedHeader = { + signatures: Array; + timestamp: number; +}; +type WebhookParsedEvent = { + details: WebhookParsedHeader; + decodedPayload: string; + decodedHeader: string; +}; +type WebhookTestHeaderOptions = { + timestamp: number; + payload: string; + secret: string; + scheme: string; + signature: string; + cryptoProvider: StripeCryptoProvider; +}; + +type WebhookEvent = Record; +type WebhookPayload = string | Buffer; +type WebhookSignatureObject = { + verifyHeader: ( + encodedPayload: WebhookPayload, + encodedHeader: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ) => boolean; + verifyHeaderAsync: ( + encodedPayload: WebhookPayload, + encodedHeader: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ) => Promise; +}; +type WebhookObject = { + DEFAULT_TOLERANCE: number; + signature: WebhookSignatureObject; + constructEvent: ( + payload: WebhookPayload, + header: WebhookHeader, + secret: string, + tolerance: null, + cryptoProvider: StripeCryptoProvider + ) => WebhookEvent; + constructEventAsync: ( + payload: WebhookPayload, + header: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ) => Promise; + generateTestHeaderString: (opts: WebhookTestHeaderOptions) => string; +}; + +const Webhook: WebhookObject = { DEFAULT_TOLERANCE: 300, // 5 minutes + // @ts-ignore signature: null, - - constructEvent(payload, header, secret, tolerance, cryptoProvider) { + constructEvent( + payload: WebhookPayload, + header: WebhookHeader, + secret: string, + tolerance: null, + cryptoProvider: StripeCryptoProvider + ): WebhookEvent { this.signature.verifyHeader( payload, header, @@ -15,17 +78,18 @@ const Webhook = { cryptoProvider ); + // @ts-ignore const jsonPayload = JSON.parse(payload); return jsonPayload; }, async constructEventAsync( - payload, - header, - secret, - tolerance, - cryptoProvider - ) { + payload: WebhookPayload, + header: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ): Promise { await this.signature.verifyHeaderAsync( payload, header, @@ -34,6 +98,7 @@ const Webhook = { cryptoProvider ); + // @ts-ignore const jsonPayload = JSON.parse(payload); return jsonPayload; }, @@ -49,7 +114,7 @@ const Webhook = { * @property {string} signature - Computed webhook signature * @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider. */ - generateTestHeaderString: function(opts) { + generateTestHeaderString: function(opts: WebhookTestHeaderOptions): string { if (!opts) { throw new StripeError({ message: 'Options are required', @@ -82,12 +147,12 @@ const signature = { EXPECTED_SCHEME: 'v1', verifyHeader( - encodedPayload, - encodedHeader, - secret, - tolerance, - cryptoProvider - ) { + encodedPayload: WebhookPayload, + encodedHeader: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ): boolean { const { decodedHeader: header, decodedPayload: payload, @@ -112,12 +177,12 @@ const signature = { }, async verifyHeaderAsync( - encodedPayload, - encodedHeader, - secret, - tolerance, - cryptoProvider - ) { + encodedPayload: WebhookPayload, + encodedHeader: WebhookHeader, + secret: string, + tolerance: number, + cryptoProvider: StripeCryptoProvider + ): Promise { const { decodedHeader: header, decodedPayload: payload, @@ -141,11 +206,18 @@ const signature = { }, }; -function makeHMACContent(payload, details) { +function makeHMACContent( + payload: WebhookPayload, + details: WebhookParsedHeader +): string { return `${details.timestamp}.${payload}`; } -function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) { +function parseEventDetails( + encodedPayload: WebhookPayload, + encodedHeader: WebhookHeader, + expectedScheme: string +): WebhookParsedEvent { const decodedPayload = Buffer.isBuffer(encodedPayload) ? encodedPayload.toString('utf8') : encodedPayload; @@ -196,13 +268,14 @@ function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) { } function validateComputedSignature( - payload, - header, - details, - expectedSignature, - tolerance -) { + payload: WebhookPayload, + header: string, + details: WebhookParsedHeader, + expectedSignature: string, + tolerance: number +): boolean { const signatureFound = !!details.signatures.filter( + // @ts-ignore utils.secureCompare.bind(utils, expectedSignature) ).length; @@ -236,12 +309,15 @@ function validateComputedSignature( return true; } -function parseHeader(header, scheme) { +function parseHeader( + header: string, + scheme: string +): WebhookParsedHeader | null { if (typeof header !== 'string') { return null; } - return header.split(',').reduce( + return header.split(',').reduce( (accum, item) => { const kv = item.split('='); @@ -262,18 +338,18 @@ function parseHeader(header, scheme) { ); } -let webhooksNodeCryptoProviderInstance = null; +let webhooksNodeCryptoProviderInstance: StripeCryptoProvider | null = null; /** * Lazily instantiate a NodeCryptoProvider instance. This is a stateless object * so a singleton can be used here. */ -function getNodeCryptoProvider() { +function getNodeCryptoProvider(): StripeCryptoProvider { if (!webhooksNodeCryptoProviderInstance) { const NodeCryptoProvider = require('./crypto/NodeCryptoProvider'); webhooksNodeCryptoProviderInstance = new NodeCryptoProvider(); } - return webhooksNodeCryptoProviderInstance; + return webhooksNodeCryptoProviderInstance!; } Webhook.signature = signature; diff --git a/src/autoPagination.ts b/src/autoPagination.ts index b98f44d122..81ca6369b1 100644 --- a/src/autoPagination.ts +++ b/src/autoPagination.ts @@ -1,8 +1,50 @@ import makeRequest = require('./makeRequest'); const utils = require('./utils'); -function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { - const promiseCache = {currentPromise: null}; +type PromiseCache = { + currentPromise: Promise | undefined | null; +}; +type IterationResult = { + done: boolean; + value?: any; +}; +type IterationDoneCallback = () => void; +type IterationItemCallback = ( + item: any, + next: any +) => void | boolean | Promise; +type ListResult = { + data: Array; + // eslint-disable-next-line camelcase + has_more: boolean; +}; +type AutoPagingEach = ( + onItem: IterationItemCallback, + onDone?: IterationDoneCallback +) => Promise; + +type AutoPagingToArrayOptions = { + limit?: number; +}; +type AutoPagingToArray = ( + opts: AutoPagingToArrayOptions, + onDone: IterationDoneCallback +) => Promise>; + +type AutoPaginationMethods = { + autoPagingEach: AutoPagingEach; + autoPagingToArray: AutoPagingToArray; + next: () => Promise; + return: () => void; +}; + +function makeAutoPaginationMethods( + self: StripeResourceObject, + requestArgs: RequestArgs, + spec: MethodSpec, + firstPagePromise: Promise +): AutoPaginationMethods { + const promiseCache: PromiseCache = {currentPromise: null}; const reverseIteration = isReverseIteration(requestArgs); let pagePromise = firstPagePromise; let i = 0; @@ -14,9 +56,9 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { // // Please note: spec.methodType === 'search' is beta functionality and is // subject to change/removal at any time. - let getNextPagePromise; + let getNextPagePromise: (pageResult: any) => Promise; if (spec.methodType === 'search') { - getNextPagePromise = (pageResult) => { + getNextPagePromise = (pageResult): Promise => { if (!pageResult.next_page) { throw Error( 'Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.' @@ -27,7 +69,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { }); }; } else { - getNextPagePromise = (pageResult) => { + getNextPagePromise = (pageResult): Promise => { const lastId = getLastId(pageResult, reverseIteration); return makeRequest(self, requestArgs, spec, { [reverseIteration ? 'ending_before' : 'starting_after']: lastId, @@ -35,7 +77,9 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { }; } - function iterate(pageResult) { + function iterate( + pageResult: ListResult + ): IterationResult | Promise { if ( !( pageResult && @@ -63,7 +107,7 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { return {value: undefined, done: true}; } - function asyncIteratorNext() { + function asyncIteratorNext(): Promise { return memoizedPromise(promiseCache, (resolve, reject) => { return pagePromise .then(iterate) @@ -75,13 +119,13 @@ function makeAutoPaginationMethods(self, requestArgs, spec, firstPagePromise) { const autoPagingEach = makeAutoPagingEach(asyncIteratorNext); const autoPagingToArray = makeAutoPagingToArray(autoPagingEach); - const autoPaginationMethods = { + const autoPaginationMethods: AutoPaginationMethods = { autoPagingEach, autoPagingToArray, // Async iterator functions: next: asyncIteratorNext, - return: () => { + return: (): any => { // This is required for `break`. return {}; }, @@ -102,7 +146,7 @@ export = { * ---------------- */ -function getAsyncIteratorSymbol() { +function getAsyncIteratorSymbol(): symbol | string { if (typeof Symbol !== 'undefined' && Symbol.asyncIterator) { return Symbol.asyncIterator; } @@ -110,7 +154,7 @@ function getAsyncIteratorSymbol() { return '@@asyncIterator'; } -function getDoneCallback(args) { +function getDoneCallback(args: Array): IterationDoneCallback | undefined { if (args.length < 2) { return undefined; } @@ -134,7 +178,7 @@ function getDoneCallback(args) { * In addition to standard validation, this helper * coalesces the former forms into the latter form. */ -function getItemCallback(args) { +function getItemCallback(args: Array): IterationItemCallback | undefined { if (args.length === 0) { return undefined; } @@ -160,13 +204,13 @@ function getItemCallback(args) { // 1. `.autoPagingEach((item) => { doSomething(item); return false; });` // 2. `.autoPagingEach(async (item) => { await doSomething(item); return false; });` // 3. `.autoPagingEach((item) => doSomething(item).then(() => false));` - return function _onItem(item, next) { + return function _onItem(item, next): void { const shouldContinue = onItem(item); next(shouldContinue); }; } -function getLastId(listResult, reverseIteration) { +function getLastId(listResult: ListResult, reverseIteration: boolean): string { const lastIdx = reverseIteration ? 0 : listResult.data.length - 1; const lastItem = listResult.data[lastIdx]; const lastId = lastItem && lastItem.id; @@ -183,7 +227,10 @@ function getLastId(listResult, reverseIteration) { * return the same result until something has resolved * to prevent page-turning race conditions. */ -function memoizedPromise(promiseCache, cb) { +function memoizedPromise( + promiseCache: PromiseCache, + cb: (resolve: (value: T) => void, reject: (reason?: any) => void) => void +): Promise { if (promiseCache.currentPromise) { return promiseCache.currentPromise; } @@ -194,8 +241,10 @@ function memoizedPromise(promiseCache, cb) { return promiseCache.currentPromise; } -function makeAutoPagingEach(asyncIteratorNext) { - return function autoPagingEach(/* onItem?, onDone? */) { +function makeAutoPagingEach( + asyncIteratorNext: () => Promise +): AutoPagingEach { + return function autoPagingEach(/* onItem?, onDone? */): Promise { const args = [].slice.call(arguments); const onItem = getItemCallback(args); const onDone = getDoneCallback(args); @@ -205,14 +254,20 @@ function makeAutoPagingEach(asyncIteratorNext) { const autoPagePromise = wrapAsyncIteratorWithCallback( asyncIteratorNext, + // @ts-ignore we might need a null check onItem ); return utils.callbackifyPromiseWithTimeout(autoPagePromise, onDone); - }; + } as AutoPagingEach; } -function makeAutoPagingToArray(autoPagingEach) { - return function autoPagingToArray(opts, onDone) { +function makeAutoPagingToArray( + autoPagingEach: AutoPagingEach +): AutoPagingToArray { + return function autoPagingToArray( + opts, + onDone: IterationDoneCallback + ): Promise> { const limit = opts && opts.limit; if (!limit) { throw Error( @@ -225,7 +280,7 @@ function makeAutoPagingToArray(autoPagingEach) { ); } const promise = new Promise((resolve, reject) => { - const items = []; + const items: Array = []; autoPagingEach((item) => { items.push(item); if (items.length >= limit) { @@ -241,9 +296,12 @@ function makeAutoPagingToArray(autoPagingEach) { }; } -function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { +function wrapAsyncIteratorWithCallback( + asyncIteratorNext: () => Promise, + onItem: IterationItemCallback +): Promise { return new Promise((resolve, reject) => { - function handleIteration(iterResult) { + function handleIteration(iterResult: IterationResult): Promise | void { if (iterResult.done) { resolve(); return; @@ -270,7 +328,7 @@ function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) { }); } -function isReverseIteration(requestArgs) { +function isReverseIteration(requestArgs: RequestArgs): boolean { const args = [].slice.call(requestArgs); const dataFromArgs = utils.getDataFromArgs(args); diff --git a/src/makeRequest.ts b/src/makeRequest.ts index 57737cfd25..42dc109bfb 100644 --- a/src/makeRequest.ts +++ b/src/makeRequest.ts @@ -1,13 +1,18 @@ const utils = require('./utils'); -function getRequestOpts(self, requestArgs, spec, overrideData) { +function getRequestOpts( + self: StripeResourceObject, + requestArgs: RequestArgs, + spec: MethodSpec, + overrideData: RequestData +): RequestOpts { // Extract spec values with defaults. const requestMethod = (spec.method || 'GET').toUpperCase(); const urlParams = spec.urlParams || []; - const encode = spec.encode || ((data) => data); + const encode = spec.encode || ((data): RequestData => data); const isUsingFullPath = !!spec.fullPath; - const commandPath = utils.makeURLInterpolator( + const commandPath: UrlInterpolator = utils.makeURLInterpolator( isUsingFullPath ? spec.fullPath : spec.path || '' ); // When using fullPath, we ignore the resource path as it should already be @@ -17,10 +22,10 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { : self.createResourcePathWithSymbols(spec.path); // Don't mutate args externally. - const args = [].slice.call(requestArgs); + const args: RequestArgs = [].slice.call(requestArgs); // Generate and validate url params. - const urlData = urlParams.reduce((urlData, param) => { + const urlData = urlParams.reduce((urlData, param) => { const arg = args.shift(); if (typeof arg !== 'string') { throw new Error( @@ -74,9 +79,14 @@ function getRequestOpts(self, requestArgs, spec, overrideData) { }; } -function makeRequest(self, requestArgs, spec, overrideData) { - return new Promise((resolve, reject) => { - let opts; +function makeRequest( + self: StripeResourceObject, + requestArgs: RequestArgs, + spec: MethodSpec, + overrideData: RequestData +): Promise { + return new Promise((resolve, reject) => { + let opts: RequestOpts; try { opts = getRequestOpts(self, requestArgs, spec, overrideData); } catch (err) { @@ -84,7 +94,10 @@ function makeRequest(self, requestArgs, spec, overrideData) { return; } - function requestCallback(err, response) { + function requestCallback( + err: any, + response: HttpClientResponseInterface + ): void { if (err) { reject(err); } else { diff --git a/src/multipart.ts b/src/multipart.ts index dbb59a8bcf..01e91b1a37 100644 --- a/src/multipart.ts +++ b/src/multipart.ts @@ -3,18 +3,26 @@ import _Error = require('./Error'); const {StripeError} = _Error; class StreamProcessingError extends StripeError {} - +type MultipartCallbackReturn = any; +type MultipartCallback = ( + error: Error | null, + data: Buffer | string | null +) => MultipartCallbackReturn; // Method for formatting HTTP body for the multipart/form-data specification // Mostly taken from Fermata.js // https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343 -const multipartDataGenerator = (method, data, headers) => { +const multipartDataGenerator = ( + method: string, + data: MultipartRequestData, + headers: RequestHeaders +): Buffer => { const segno = ( Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16) ).toString(); headers['Content-Type'] = `multipart/form-data; boundary=${segno}`; let buffer = Buffer.alloc(0); - function push(l) { + function push(l: any): void { const prevBuffer = buffer; const newBuffer = l instanceof Buffer ? l : Buffer.from(l); buffer = Buffer.alloc(prevBuffer.length + newBuffer.length + 2); @@ -23,7 +31,7 @@ const multipartDataGenerator = (method, data, headers) => { buffer.write('\r\n', buffer.length - 2); } - function q(s) { + function q(s: string): string { return `"${s.replace(/"|"/g, '%22').replace(/\r\n|\r|\n/g, ' ')}"`; } @@ -33,14 +41,19 @@ const multipartDataGenerator = (method, data, headers) => { const v = flattenedData[k]; push(`--${segno}`); if (Object.prototype.hasOwnProperty.call(v, 'data')) { + const typedEntry: { + name: string; + data: BufferedFile; + type: string; + } = v as any; push( `Content-Disposition: form-data; name=${q(k)}; filename=${q( - v.name || 'blob' + typedEntry.name || 'blob' )}` ); - push(`Content-Type: ${v.type || 'application/octet-stream'}`); + push(`Content-Type: ${typedEntry.type || 'application/octet-stream'}`); push(''); - push(v.data); + push(typedEntry.data); } else { push(`Content-Disposition: form-data; name=${q(k)}`); push(''); @@ -52,14 +65,20 @@ const multipartDataGenerator = (method, data, headers) => { return buffer; }; -const streamProcessor = (method, data, headers, callback) => { - const bufferArray = []; +const streamProcessor = ( + method: string, + data: StreamingFile, + headers: RequestHeaders, + callback: MultipartCallback +): void => { + const bufferArray: Array = []; data.file.data - .on('data', (line) => { + .on('data', (line: Buffer) => { bufferArray.push(line); }) .once('end', () => { - const bufferData = Object.assign({}, data); + // @ts-ignore + const bufferData: BufferedFile = Object.assign({}, data); bufferData.file.data = Buffer.concat(bufferArray); const buffer = multipartDataGenerator(method, bufferData, headers); callback(null, buffer); @@ -76,7 +95,12 @@ const streamProcessor = (method, data, headers, callback) => { }); }; -const multipartRequestDataProcessor = (method, data, headers, callback) => { +const multipartRequestDataProcessor = ( + method: string, + data: MultipartRequestData, + headers: RequestHeaders, + callback: MultipartCallback +): MultipartCallbackReturn => { data = data || {}; if (method !== 'POST') { @@ -85,7 +109,7 @@ const multipartRequestDataProcessor = (method, data, headers, callback) => { const isStream = utils.checkForStream(data); if (isStream) { - return streamProcessor(method, data, headers, callback); + return streamProcessor(method, data as StreamingFile, headers, callback); } const buffer = multipartDataGenerator(method, data, headers); diff --git a/src/net/FetchHttpClient.ts b/src/net/FetchHttpClient.ts index 630bddc42d..6e4facecee 100644 --- a/src/net/FetchHttpClient.ts +++ b/src/net/FetchHttpClient.ts @@ -9,33 +9,29 @@ const {HttpClient, HttpClientResponse} = _HttpClient; * Fetch API. As an example, this could be the function provided by the * node-fetch package (https://github.com/node-fetch/node-fetch). */ -class FetchHttpClient extends HttpClient { - _fetchFn: ( - input: RequestInfo | URL, - init?: RequestInit | undefined - ) => Promise; - _res: Response; +class FetchHttpClient extends HttpClient implements HttpClientInterface { + _fetchFn: typeof fetch; - constructor(fetchFn) { + constructor(fetchFn: typeof fetch) { super(); this._fetchFn = fetchFn; } /** @override. */ - getClientName() { + getClientName(): string { return 'fetch'; } makeRequest( - host, - port, - path, - method, - headers, - requestData, - protocol, - timeout - ) { + host: string, + port: string, + path: string, + method: string, + headers: RequestHeaders, + requestData: RequestData, + protocol: string, + timeout: number + ): Promise { const isInsecureConnection = protocol === 'http'; const url = new URL( @@ -55,7 +51,9 @@ class FetchHttpClient extends HttpClient { const fetchFn = this._fetchFn || fetch; const fetchPromise = fetchFn(url.toString(), { method, + // @ts-ignore headers, + // @ts-ignore body, }); @@ -72,7 +70,7 @@ class FetchHttpClient extends HttpClient { // to be established followed by 20s for the body, Fetch would timeout but // Node would not. The more fine-grained timeout cannot be implemented with // fetch. - let pendingTimeoutId; + let pendingTimeoutId: NodeJS.Timeout | null; const timeoutPromise = new Promise((_, reject) => { pendingTimeoutId = setTimeout(() => { pendingTimeoutId = null; @@ -82,7 +80,7 @@ class FetchHttpClient extends HttpClient { return Promise.race([fetchPromise, timeoutPromise]) .then((res) => { - return new FetchHttpClientResponse(res); + return new FetchHttpClientResponse(res as Response); }) .finally(() => { if (pendingTimeoutId) { @@ -92,10 +90,11 @@ class FetchHttpClient extends HttpClient { } } -class FetchHttpClientResponse extends HttpClientResponse { +class FetchHttpClientResponse extends HttpClientResponse + implements HttpClientResponseInterface { _res: Response; - constructor(res) { + constructor(res: Response) { super( res.status, FetchHttpClientResponse._transformHeadersToObject(res.headers) @@ -103,11 +102,13 @@ class FetchHttpClientResponse extends HttpClientResponse { this._res = res; } - getRawResponse() { + getRawResponse(): Response { return this._res; } - toStream(streamCompleteCallback) { + toStream( + streamCompleteCallback: () => void + ): ReadableStream | null { // Unfortunately `fetch` does not have event handlers for when the stream is // completely read. We therefore invoke the streamCompleteCallback right // away. This callback emits a response event with metadata and completes @@ -119,15 +120,14 @@ class FetchHttpClientResponse extends HttpClientResponse { return this._res.body; } - toJSON() { + toJSON(): Promise { return this._res.json(); } - static _transformHeadersToObject(headers) { + static _transformHeadersToObject(headers: Headers): ResponseHeaders { // Fetch uses a Headers instance so this must be converted to a barebones // JS object to meet the HttpClient interface. - const headersObj = {}; - + const headersObj: ResponseHeaders = {}; for (const entry of headers) { if (!Array.isArray(entry) || entry.length != 2) { throw new Error( diff --git a/src/net/HttpClient.ts b/src/net/HttpClient.ts index 2c035d7cd7..56c67090d4 100644 --- a/src/net/HttpClient.ts +++ b/src/net/HttpClient.ts @@ -9,30 +9,30 @@ type TimeoutError = TypeError & {code?: string}; * 2. A client class which extends HttpClient and implements all methods, * returning their own response class when making requests. */ -class HttpClient { +class HttpClient implements HttpClientInterface { static CONNECTION_CLOSED_ERROR_CODES: string[]; static TIMEOUT_ERROR_CODE: string; /** The client name used for diagnostics. */ - getClientName() { + getClientName(): string { throw new Error('getClientName not implemented.'); } makeRequest( - host, - port, - path, - method, - headers, - requestData, - protocol, - timeout - ) { + host: string, + port: string, + path: string, + method: string, + headers: RequestHeaders, + requestData: RequestData, + protocol: string, + timeout: number + ): Promise { throw new Error('makeRequest not implemented.'); } /** Helper to make a consistent timeout error across implementations. */ - static makeTimeoutError() { + static makeTimeoutError(): TimeoutError { const timeoutErr: TimeoutError = new TypeError( HttpClient.TIMEOUT_ERROR_CODE ); @@ -44,11 +44,11 @@ class HttpClient { HttpClient.CONNECTION_CLOSED_ERROR_CODES = ['ECONNRESET', 'EPIPE']; HttpClient.TIMEOUT_ERROR_CODE = 'ETIMEDOUT'; -class HttpClientResponse { +class HttpClientResponse implements HttpClientResponseInterface { _statusCode: number; - _headers: Record; + _headers: ResponseHeaders; - constructor(statusCode, headers) { + constructor(statusCode: number, headers: ResponseHeaders) { this._statusCode = statusCode; this._headers = headers; } @@ -57,15 +57,15 @@ class HttpClientResponse { return this._statusCode; } - getHeaders(): Record { + getHeaders(): ResponseHeaders { return this._headers; } - getRawResponse() { + getRawResponse(): unknown { throw new Error('getRawResponse not implemented.'); } - toStream(streamCompleteCallback) { + toStream(streamCompleteCallback: () => void): unknown { throw new Error('toStream not implemented.'); } diff --git a/src/net/NodeHttpClient.ts b/src/net/NodeHttpClient.ts index 1d556a0906..93b37a26b5 100644 --- a/src/net/NodeHttpClient.ts +++ b/src/net/NodeHttpClient.ts @@ -14,26 +14,26 @@ const defaultHttpsAgent = new https.Agent({keepAlive: true}); class NodeHttpClient extends HttpClient { _agent: http.Agent | https.Agent; - constructor(agent) { + constructor(agent: http.Agent | https.Agent) { super(); this._agent = agent; } /** @override. */ - getClientName() { + getClientName(): string { return 'node'; } makeRequest( - host, - port, - path, - method, - headers, - requestData, - protocol, - timeout - ) { + host: string, + port: string, + path: string, + method: string, + headers: RequestHeaders, + requestData: RequestData, + protocol: string, + timeout: number + ): Promise { const isInsecureConnection = protocol === 'http'; let agent = this._agent; @@ -41,64 +41,68 @@ class NodeHttpClient extends HttpClient { agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent; } - const requestPromise = new Promise((resolve, reject) => { - const req = (isInsecureConnection ? http : https).request({ - host: host, - port: port, - path, - method, - agent, - headers, - ciphers: 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5', - }); - - req.setTimeout(timeout, () => { - req.destroy(HttpClient.makeTimeoutError()); - }); - - req.on('response', (res) => { - resolve(new NodeHttpClientResponse(res)); - }); - - req.on('error', (error) => { - reject(error); - }); - - req.once('socket', (socket) => { - if (socket.connecting) { - socket.once( - isInsecureConnection ? 'connect' : 'secureConnect', - () => { - // Send payload; we're safe: - req.write(requestData); - req.end(); - } - ); - } else { - // we're already connected - req.write(requestData); - req.end(); - } - }); - }); + const requestPromise = new Promise( + (resolve, reject) => { + const req = (isInsecureConnection ? http : https).request({ + host: host, + port: port, + path, + method, + agent, + headers, + ciphers: 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5', + }); + + req.setTimeout(timeout, () => { + req.destroy(HttpClient.makeTimeoutError()); + }); + + req.on('response', (res) => { + resolve(new NodeHttpClientResponse(res)); + }); + + req.on('error', (error) => { + reject(error); + }); + + req.once('socket', (socket) => { + if (socket.connecting) { + socket.once( + isInsecureConnection ? 'connect' : 'secureConnect', + () => { + // Send payload; we're safe: + req.write(requestData); + req.end(); + } + ); + } else { + // we're already connected + req.write(requestData); + req.end(); + } + }); + } + ); return requestPromise; } } -class NodeHttpClientResponse extends HttpClientResponse { +class NodeHttpClientResponse extends HttpClientResponse + implements HttpClientResponseInterface { _res: http.IncomingMessage; constructor(res: http.IncomingMessage) { + // @ts-ignore super(res.statusCode, res.headers || {}); this._res = res; } - getRawResponse() { + getRawResponse(): http.IncomingMessage { return this._res; } - toStream(streamCompleteCallback) { + toStream(streamCompleteCallback: () => void): http.IncomingMessage { // The raw response is itself the stream, so we just return that. To be // backwards compatible, we should invoke the streamCompleteCallback only // once the stream has been fully consumed. diff --git a/src/stripe.ts b/src/stripe.ts index 5d6cb7e377..6e684e19c7 100644 --- a/src/stripe.ts +++ b/src/stripe.ts @@ -5,7 +5,7 @@ const resources = require('./resources'); const DEFAULT_HOST = 'api.stripe.com'; const DEFAULT_PORT = '443'; const DEFAULT_BASE_PATH = '/v1/'; -const DEFAULT_API_VERSION = null; +const DEFAULT_API_VERSION = (null as unknown) as string; const DEFAULT_TIMEOUT = 80000; @@ -24,7 +24,7 @@ Stripe.USER_AGENT = { }; /** @private */ -Stripe._UNAME_CACHE = null; +Stripe._UNAME_CACHE = null as Promise | null; const MAX_NETWORK_RETRY_DELAY_SEC = 2; const INITIAL_NETWORK_RETRY_DELAY_SEC = 0.5; @@ -46,8 +46,8 @@ const ALLOWED_CONFIG_PROPERTIES = [ ]; const EventEmitter = require('events').EventEmitter; - import StripeResource = require('./StripeResource'); +import * as http from 'http'; Stripe.StripeResource = StripeResource; Stripe.resources = resources; @@ -58,7 +58,11 @@ Stripe.HttpClientResponse = HttpClientResponse; const CryptoProvider = require('./crypto/CryptoProvider'); Stripe.CryptoProvider = CryptoProvider; -function Stripe(key, config = {}) { +function Stripe( + this: StripeObject, + key: string, + config: Record = {} +): void { if (!(this instanceof Stripe)) { return new (Stripe as any)(key, config); } @@ -132,13 +136,14 @@ function Stripe(key, config = {}) { this._enableTelemetry = props.telemetry !== false; // Expose StripeResource on the instance too + // @ts-ignore this.StripeResource = Stripe.StripeResource; } Stripe.errors = _Error; Stripe.webhooks = require('./Webhooks'); -Stripe.createNodeHttpClient = (agent) => { +Stripe.createNodeHttpClient = (agent: http.Agent): typeof HttpClient => { const {NodeHttpClient} = require('./net/NodeHttpClient'); return new NodeHttpClient(agent); }; @@ -150,7 +155,7 @@ Stripe.createNodeHttpClient = (agent) => { * A fetch function can optionally be passed in as a parameter. If none is * passed, will default to the default `fetch` function in the global scope. */ -Stripe.createFetchHttpClient = (fetchFn) => { +Stripe.createFetchHttpClient = (fetchFn: typeof fetch): typeof HttpClient => { const {FetchHttpClient} = require('./net/FetchHttpClient'); return new FetchHttpClient(fetchFn); }; @@ -159,7 +164,7 @@ Stripe.createFetchHttpClient = (fetchFn) => { * Create a CryptoProvider which uses the built-in Node crypto libraries for * its crypto operations. */ -Stripe.createNodeCryptoProvider = () => { +Stripe.createNodeCryptoProvider = (): StripeCryptoProvider => { const NodeCryptoProvider = require('./crypto/NodeCryptoProvider'); return new NodeCryptoProvider(); }; @@ -172,7 +177,9 @@ Stripe.createNodeCryptoProvider = () => { * is passed, will default to the default `crypto.subtle` object in the global * scope. */ -Stripe.createSubtleCryptoProvider = (subtleCrypto) => { +Stripe.createSubtleCryptoProvider = ( + subtleCrypto: typeof crypto.subtle +): StripeCryptoProvider => { const SubtleCryptoProvider = require('./crypto/SubtleCryptoProvider'); return new SubtleCryptoProvider(subtleCrypto); }; @@ -188,7 +195,7 @@ Stripe.prototype = { * }); * */ - setHost(host, port, protocol) { + setHost(host: string, port: number, protocol: string): void { emitWarning( '`setHost` is deprecated. Use the `host` config option instead.' ); @@ -209,7 +216,7 @@ Stripe.prototype = { * }); * */ - setProtocol(protocol) { + setProtocol(protocol: string): void { emitWarning( '`setProtocol` is deprecated. Use the `protocol` config option instead.' ); @@ -224,7 +231,7 @@ Stripe.prototype = { * }); * */ - setPort(port) { + setPort(port: number): void { emitWarning( '`setPort` is deprecated. Use the `port` config option instead.' ); @@ -239,7 +246,7 @@ Stripe.prototype = { * }); * */ - setApiVersion(version) { + setApiVersion(version: string): void { emitWarning( '`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.' ); @@ -263,7 +270,7 @@ Stripe.prototype = { * * stripe.customers.create(params, {apiKey: 'sk_test_...'}); */ - setApiKey(key) { + setApiKey(key: string): void { emitWarning( '`setApiKey` is deprecated. Use the `apiKey` request option instead.' ); @@ -273,7 +280,7 @@ Stripe.prototype = { /** * @private */ - _setApiKey(key) { + _setApiKey(key: string): void { if (key) { this._setApiField('auth', `Bearer ${key}`); } @@ -286,7 +293,7 @@ Stripe.prototype = { * timeout: TIMEOUT_MS, * }); */ - setTimeout(timeout) { + setTimeout(timeout: number): void { emitWarning( '`setTimeout` is deprecated. Use the `timeout` config or request option instead.' ); @@ -305,7 +312,7 @@ Stripe.prototype = { * }, * }); */ - setAppInfo(info) { + setAppInfo(info: AppInfo): void { emitWarning( '`setAppInfo` is deprecated. Use the `appInfo` config option instead.' ); @@ -316,7 +323,7 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _setAppInfo(info) { + _setAppInfo(info: AppInfo): void { if (info && typeof info !== 'object') { throw new Error('AppInfo must be an object.'); } @@ -327,7 +334,7 @@ Stripe.prototype = { info = info || {}; - const appInfo = APP_INFO_PROPERTIES.reduce( + this._appInfo = APP_INFO_PROPERTIES.reduce>( (accum: Record, prop) => { if (typeof info[prop] == 'string') { accum = accum || {}; @@ -337,10 +344,9 @@ Stripe.prototype = { return accum; }, + // @ts-ignore undefined ); - - this._appInfo = appInfo; }, /** @@ -352,7 +358,7 @@ Stripe.prototype = { * }); * */ - setHttpAgent(agent) { + setHttpAgent(agent: string): void { emitWarning( '`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.' ); @@ -363,7 +369,7 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _setApiField(key, value) { + _setApiField(key: string, value: unknown): void { this._api[key] = value; }, @@ -374,15 +380,15 @@ Stripe.prototype = { * * It may be deprecated and removed in the future. */ - getApiField(key) { + getApiField(key: string): T { return this._api[key]; }, - setClientId(clientId) { + setClientId(clientId: string): void { this._clientId = clientId; }, - getClientId() { + getClientId(): string { return this._clientId; }, @@ -393,7 +399,7 @@ Stripe.prototype = { * * It may be deprecated and removed in the future. */ - getConstant: (c) => { + getConstant: (c: string): unknown => { switch (c) { case 'DEFAULT_HOST': return DEFAULT_HOST; @@ -410,10 +416,10 @@ Stripe.prototype = { case 'INITIAL_NETWORK_RETRY_DELAY_SEC': return INITIAL_NETWORK_RETRY_DELAY_SEC; } - return Stripe[c]; + return ((Stripe as unknown) as Record)[c]; }, - getMaxNetworkRetries() { + getMaxNetworkRetries(): number { return this.getApiField('maxNetworkRetries'); }, @@ -425,7 +431,7 @@ Stripe.prototype = { * }); * */ - setMaxNetworkRetries(maxNetworkRetries) { + setMaxNetworkRetries(maxNetworkRetries: number): void { this._setApiNumberField('maxNetworkRetries', maxNetworkRetries); }, @@ -433,32 +439,32 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _setApiNumberField(prop, n, defaultVal) { + _setApiNumberField(prop: string, n: number, defaultVal?: number): void { const val = utils.validateInteger(prop, n, defaultVal); this._setApiField(prop, val); }, - getMaxNetworkRetryDelay() { + getMaxNetworkRetryDelay(): number { return MAX_NETWORK_RETRY_DELAY_SEC; }, - getInitialNetworkRetryDelay() { + getInitialNetworkRetryDelay(): number { return INITIAL_NETWORK_RETRY_DELAY_SEC; }, /** * @private */ - getUname(cb) { + getUname(cb: (uname: string) => void): void { if (!Stripe._UNAME_CACHE) { - Stripe._UNAME_CACHE = new Promise((resolve) => { - utils.safeExec('uname -a', (err, uname) => { + Stripe._UNAME_CACHE = new Promise((resolve) => { + utils.safeExec('uname -a', (err: Error, uname: string) => { resolve(uname); }); }); } - Stripe._UNAME_CACHE.then((uname) => cb(uname)); + Stripe._UNAME_CACHE.then((uname: string) => cb(uname)); }, /** @@ -471,7 +477,7 @@ Stripe.prototype = { * Gets a JSON version of a User-Agent and uses a cached version for a slight * speed advantage. */ - getClientUserAgent(cb) { + getClientUserAgent(cb: (userAgent: string) => void): void { return this.getClientUserAgentSeeded(Stripe.USER_AGENT, cb); }, @@ -485,8 +491,11 @@ Stripe.prototype = { * Gets a JSON version of a User-Agent by encoding a seeded object and * fetching a uname from the system. */ - getClientUserAgentSeeded(seed, cb) { - this.getUname((uname) => { + getClientUserAgentSeeded( + seed: Record, + cb: (userAgent: string) => void + ): void { + this.getUname((uname: string) => { const userAgent: Record = {}; for (const field in seed) { userAgent[field] = encodeURIComponent(seed[field]); @@ -515,7 +524,7 @@ Stripe.prototype = { * * It may be deprecated and removed in the future. */ - getAppInfoAsString() { + getAppInfoAsString(): string { if (!this._appInfo) { return ''; } @@ -541,14 +550,14 @@ Stripe.prototype = { * }); * */ - setTelemetryEnabled(enableTelemetry) { + setTelemetryEnabled(enableTelemetry: boolean): void { emitWarning( '`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.' ); this._enableTelemetry = enableTelemetry; }, - getTelemetryEnabled() { + getTelemetryEnabled(): boolean { return this._enableTelemetry; }, @@ -556,7 +565,7 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _prepResources() { + _prepResources(): void { for (const name in resources) { this[utils.pascalToCamelCase(name)] = new resources[name](this); } @@ -566,7 +575,7 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _getPropsFromConfig(config) { + _getPropsFromConfig(config: Record): UserProvidedConfig { // If config is null or undefined, just bail early with no props if (!config) { return {}; diff --git a/src/utils.ts b/src/utils.ts index 40b12656bd..9eb3971cc9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -9,6 +9,7 @@ let exec = null; try { exec = require('child_process').exec; } catch (e) { + // @ts-ignore if (e.code !== 'MODULE_NOT_FOUND') { throw e; } @@ -30,7 +31,7 @@ const DEPRECATED_OPTIONS = { stripe_account: 'stripeAccount', stripe_version: 'apiVersion', stripeVersion: 'apiVersion', -}; +} as Record; const DEPRECATED_OPTIONS_KEYS = Object.keys(DEPRECATED_OPTIONS); type Settings = { @@ -39,15 +40,15 @@ type Settings = { }; type Options = { - auth?: string; + auth?: string | null; host?: string; - settings?: Settings; + settings: Settings; streaming?: boolean; - headers?: Record; + headers: Record; }; const utils = { - isOptionsHash(o) { + isOptionsHash(o: unknown): boolean | unknown { return ( o && typeof o === 'object' && @@ -64,11 +65,11 @@ const utils = { * Stringifies an Object, accommodating nested objects * (forming the conventional key 'parent[child]=value') */ - stringifyRequestData: (data) => { + stringifyRequestData: (data: RequestData | string): string => { return ( qs .stringify(data, { - serializeDate: (d) => Math.floor(d.getTime() / 1000), + serializeDate: (d: Date) => Math.floor(d.getTime() / 1000), }) // Don't use strict form encoding by changing the square bracket control // characters back to their literals. This is fine by the server, and @@ -84,24 +85,25 @@ const utils = { * const fn = makeURLInterpolator('some/url/{param1}/{param2}'); * fn({ param1: 123, param2: 456 }); // => 'some/url/123/456' */ - makeURLInterpolator: (() => { + makeURLInterpolator: ((): ((s: string) => UrlInterpolator) => { const rc = { '\n': '\\n', '"': '\\"', '\u2028': '\\u2028', '\u2029': '\\u2029', - }; - return (str) => { + } as Record; + return (str: string): UrlInterpolator => { const cleanString = str.replace(/["\n\r\u2028\u2029]/g, ($0) => rc[$0]); - return (outputs) => { + return (outputs: Record): string => { return cleanString.replace(/\{([\s\S]+?)\}/g, ($0, $1) => + // @ts-ignore encodeURIComponent(outputs[$1] || '') ); }; }; })(), - extractUrlParams: (path) => { + extractUrlParams: (path: string): Array => { const params = path.match(/\{\w+\}/g); if (!params) { return []; @@ -116,7 +118,7 @@ const utils = { * @param {object[]} args * @returns {object} */ - getDataFromArgs(args) { + getDataFromArgs(args: RequestArgs): RequestData { if (!Array.isArray(args) || !args[0] || typeof args[0] !== 'object') { return {}; } @@ -152,7 +154,7 @@ const utils = { /** * Return the options hash from a list of arguments */ - getOptionsFromArgs: (args) => { + getOptionsFromArgs: (args: RequestArgs): Options => { const opts: Options = { auth: null, headers: {}, @@ -161,9 +163,9 @@ const utils = { if (args.length > 0) { const arg = args[args.length - 1]; if (typeof arg === 'string') { - opts.auth = args.pop(); + opts.auth = args.pop() as string; } else if (utils.isOptionsHash(arg)) { - const params = {...args.pop()}; + const params = {...(args.pop() as Record)}; const extraKeys = Object.keys(params).filter( (key) => !OPTIONS_KEYS.includes(key) @@ -194,7 +196,7 @@ const utils = { } if (params.apiKey) { - opts.auth = params.apiKey; + opts.auth = params.apiKey as string; } if (params.idempotencyKey) { opts.headers['Idempotency-Key'] = params.idempotencyKey; @@ -206,13 +208,13 @@ const utils = { opts.headers['Stripe-Version'] = params.apiVersion; } if (Number.isInteger(params.maxNetworkRetries)) { - opts.settings.maxNetworkRetries = params.maxNetworkRetries; + opts.settings.maxNetworkRetries = params.maxNetworkRetries as number; } if (Number.isInteger(params.timeout)) { - opts.settings.timeout = params.timeout; + opts.settings.timeout = params.timeout as number; } if (params.host) { - opts.host = params.host; + opts.host = params.host as string; } } } @@ -222,12 +224,12 @@ const utils = { /** * Provide simple "Class" extension mechanism */ - protoExtend(sub) { + protoExtend(this: any, sub: any): (...args: any[]) => void { // eslint-disable-next-line @typescript-eslint/no-this-alias const Super = this; const Constructor = Object.prototype.hasOwnProperty.call(sub, 'constructor') ? sub.constructor - : function(...args) { + : function(this: StripeResourceObject, ...args: any[]): void { Super.apply(this, args); }; @@ -246,7 +248,7 @@ const utils = { /** * Secure compare, from https://github.com/freewil/scmp */ - secureCompare: (a, b) => { + secureCompare: (a: Uint8Array, b: Uint8Array): boolean => { a = Buffer.from(a); b = Buffer.from(b); @@ -274,12 +276,12 @@ const utils = { /** * Remove empty values from an object */ - removeNullish: (obj) => { + removeNullish: (obj: Record): Record => { if (typeof obj !== 'object') { throw new Error('Argument must be an object'); } - return Object.keys(obj).reduce((result, key) => { + return Object.keys(obj).reduce>((result, key) => { if (obj[key] != null) { result[key] = obj[key]; } @@ -293,12 +295,12 @@ const utils = { * becomes * {'Foo-Bar': 'hi'} */ - normalizeHeaders: (obj) => { + normalizeHeaders: (obj: RequestHeaders): RequestHeaders => { if (!(obj && typeof obj === 'object')) { return obj; } - return Object.keys(obj).reduce((result, header) => { + return Object.keys(obj).reduce((result, header) => { result[utils.normalizeHeader(header)] = obj[header]; return result; }, {}); @@ -308,7 +310,7 @@ const utils = { * Stolen from https://github.com/marten-de-vries/header-case-normalizer/blob/master/index.js#L36-L41 * without the exceptions which are irrelevant to us. */ - normalizeHeader: (header) => { + normalizeHeader: (header: string): string => { return header .split('-') .map( @@ -321,14 +323,17 @@ const utils = { * Determine if file data is a derivative of EventEmitter class. * https://nodejs.org/api/events.html#events_events */ - checkForStream: (obj) => { + checkForStream: (obj: {file?: {data: unknown}}): boolean => { if (obj.file && obj.file.data) { return obj.file.data instanceof EventEmitter; } return false; }, - callbackifyPromiseWithTimeout: (promise, callback) => { + callbackifyPromiseWithTimeout: ( + promise: Promise, + callback: (error: unknown, result: T | null) => void + ): Promise => { if (callback) { // Ensure callback is called outside of promise stack. return promise.then( @@ -351,7 +356,7 @@ const utils = { /** * Allow for special capitalization cases (such as OAuth) */ - pascalToCamelCase: (name) => { + pascalToCamelCase: (name: string): string => { if (name === 'OAuth') { return 'oauth'; } else { @@ -368,7 +373,10 @@ const utils = { * * This unifies that interface. */ - safeExec: (cmd, cb) => { + safeExec: ( + cmd: string, + cb: (error: unknown, stdout: string | null) => void + ): void => { // Occurs if we couldn't load the `child_process` module, which might // happen in certain sandboxed environments like a CloudFlare Worker. if (utils._exec === null) { @@ -386,16 +394,18 @@ const utils = { // For mocking in tests. _exec: exec, - isObject: (obj) => { + isObject: (obj: unknown): boolean => { const type = typeof obj; return (type === 'function' || type === 'object') && !!obj; }, // For use in multipart requests - flattenAndStringify: (data) => { - const result = {}; + flattenAndStringify: ( + data: MultipartRequestData + ): Record => { + const result: RequestData = {}; - const step = (obj, prevKey) => { + const step = (obj: RequestData, prevKey: string | null): void => { Object.keys(obj).forEach((key) => { const value = obj[key]; @@ -407,7 +417,7 @@ const utils = { !Object.prototype.hasOwnProperty.call(value, 'data') ) { // Non-buffer non-file Objects are recursively flattened - return step(value, newKey); + return step(value as RequestData, newKey); } else { // Buffers and file objects are stored without modification result[newKey] = value; @@ -427,7 +437,7 @@ const utils = { /** * https://stackoverflow.com/a/2117523 */ - uuid4: () => { + uuid4: (): string => { // available in: v14.17.x+ if (crypto.randomUUID) { return crypto.randomUUID(); @@ -441,7 +451,7 @@ const utils = { }); }, - validateInteger: (name, n, defaultVal) => { + validateInteger: (name: string, n: unknown, defaultVal?: number): number => { if (!Number.isInteger(n)) { if (defaultVal !== undefined) { return defaultVal; @@ -450,10 +460,10 @@ const utils = { } } - return n; + return n as number; }, - determineProcessUserAgentProperties: () => { + determineProcessUserAgentProperties: (): Record => { return typeof process === 'undefined' ? {} : { @@ -463,7 +473,7 @@ const utils = { }, }; -function emitWarning(warning) { +function emitWarning(warning: string): void { if (typeof process.emitWarning !== 'function') { return console.warn( `Stripe: ${warning}` diff --git a/tsconfig.json b/tsconfig.json index 199458365d..b0e175f4d9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,9 @@ "module": "commonjs", "checkJs": false, "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strict": true, }, "include": ["./src/**/*"] } From 7c110565c51e285e015ff6f18b32e26cbb554040 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:11:48 -0800 Subject: [PATCH 02/23] Annotate prototypes with types (#1619) --- lib/StripeResource.js | 25 ++---------- lib/stripe.js | 14 +++++++ src/StripeResource.ts | 53 +++++-------------------- src/Types.d.ts | 92 ++++++++++++++++++++++++++++++++++++++++--- src/stripe.ts | 34 +++++++++++++--- tsconfig.json | 1 + 6 files changed, 143 insertions(+), 76 deletions(-) diff --git a/lib/StripeResource.js b/lib/StripeResource.js index 9a11b7d1c3..4ca71e7517 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -47,7 +47,9 @@ function StripeResource(stripe, deprecatedUrlData) { } StripeResource.prototype = { _stripe: null, + // @ts-ignore the type of path changes in ctor path: '', + resourcePath: '', // Methods that don't use the API's default '/v1' path can override it with this setting. basePath: null, initialize() {}, @@ -95,15 +97,6 @@ StripeResource.prototype = { }, // DEPRECATED: Here for backcompat in case users relied on this. wrapTimeout: utils.callbackifyPromiseWithTimeout, - // eslint-disable-next-line no-warning-comments - // TODO: Unused? - _timeoutHandler(timeout, req, callback) { - return () => { - const timeoutErr = new TypeError('ETIMEDOUT'); - timeoutErr.code = 'ETIMEDOUT'; - req.destroy(timeoutErr); - }; - }, _addHeadersDirectlyToObject(obj, headers) { // For convenience, make some headers easily accessible on // lastResponse. @@ -241,18 +234,6 @@ StripeResource.prototype = { requestRetries > 0 ? ` Request was retried ${requestRetries} times.` : '' }`; }, - _errorHandler(res, requestRetries, callback) { - return (message, detail) => { - callback.call( - this, - new StripeConnectionError({ - message: this._generateConnectionErrorMessage(requestRetries), - detail, - }), - null - ); - }; - }, // For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency _shouldRetry(res, numRetries, maxRetries, error) { if ( @@ -468,7 +449,7 @@ StripeResource.prototype = { request_start_time: requestStartTime, }); const requestRetries = numRetries || 0; - const maxRetries = this._getMaxNetworkRetries(options.settings); + const maxRetries = this._getMaxNetworkRetries(options.settings || {}); this._stripe._emitter.emit('request', requestEvent); req .then((res) => { diff --git a/lib/stripe.js b/lib/stripe.js index 97a78644cb..c4341c1b82 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -149,6 +149,19 @@ Stripe.createSubtleCryptoProvider = (subtleCrypto) => { return new SubtleCryptoProvider(subtleCrypto); }; Stripe.prototype = { + // Properties are set in the constructor above + _appInfo: null, + on: null, + off: null, + once: null, + VERSION: null, + StripeResource: null, + webhooks: null, + errors: null, + _api: null, + _prevRequestMetrics: null, + _emitter: null, + _enableTelemetry: null, /** * @deprecated will be removed in a future major version. Use the config object instead: * @@ -488,6 +501,7 @@ Stripe.prototype = { */ _prepResources() { for (const name in resources) { + // @ts-ignore this[utils.pascalToCamelCase(name)] = new resources[name](this); } }, diff --git a/src/StripeResource.ts b/src/StripeResource.ts index b4392c0d57..b273a9ae77 100644 --- a/src/StripeResource.ts +++ b/src/StripeResource.ts @@ -58,10 +58,12 @@ function StripeResource( StripeResource.prototype = { _stripe: null as StripeObject | null, - path: '', + // @ts-ignore the type of path changes in ctor + path: '' as UrlInterpolator, + resourcePath: '', // Methods that don't use the API's default '/v1' path can override it with this setting. - basePath: null, + basePath: null!, initialize(): void {}, @@ -120,25 +122,7 @@ StripeResource.prototype = { // DEPRECATED: Here for backcompat in case users relied on this. wrapTimeout: utils.callbackifyPromiseWithTimeout, - // eslint-disable-next-line no-warning-comments - // TODO: Unused? - _timeoutHandler( - timeout: number, - req: any, - callback: RequestCallback - ): () => void { - return (): void => { - const timeoutErr = new TypeError('ETIMEDOUT'); - (timeoutErr as any).code = 'ETIMEDOUT'; - - req.destroy(timeoutErr); - }; - }, - - _addHeadersDirectlyToObject( - obj: Record, - headers: RequestHeaders - ): void { + _addHeadersDirectlyToObject(obj: any, headers: RequestHeaders): void { // For convenience, make some headers easily accessible on // lastResponse. @@ -303,29 +287,12 @@ StripeResource.prototype = { }`; }, - _errorHandler( - res: never, - requestRetries: number, - callback: RequestCallback - ): (message: string, detail: string) => void { - return (message: string, detail: string): void => { - callback.call( - this, - new StripeConnectionError({ - message: this._generateConnectionErrorMessage(requestRetries), - detail, - }), - null - ); - }; - }, - // For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency _shouldRetry( - res: HttpClientResponseInterface, + res: null | HttpClientResponseInterface, numRetries: number, maxRetries: number, - error?: {code: number} + error?: HttpClientResponseError ): boolean { if ( error && @@ -525,7 +492,7 @@ StripeResource.prototype = { method: string, host: string, path: string, - data: string, + data: RequestData, auth: string, options: RequestOptions = {}, callback: RequestCallback @@ -589,7 +556,7 @@ StripeResource.prototype = { const requestRetries = numRetries || 0; - const maxRetries = this._getMaxNetworkRetries(options.settings); + const maxRetries = this._getMaxNetworkRetries(options.settings || {}); this._stripe._emitter.emit('request', requestEvent); @@ -671,6 +638,6 @@ StripeResource.prototype = { prepareAndMakeRequest(null, utils.stringifyRequestData(data || {})); } }, -}; +} as StripeResourceObject; export = StripeResource; diff --git a/src/Types.d.ts b/src/Types.d.ts index c785e6f3d0..b1cc7e9e59 100644 --- a/src/Types.d.ts +++ b/src/Types.d.ts @@ -107,6 +107,29 @@ interface HttpClientInterface { ) => Promise; } type StripeObject = { + getClientUserAgentSeeded: ( + seed: Record, + callback: (userAgent: string) => void + ) => void; + getUname: (callback: (uname: string) => void) => void; + setProtocol: (protocol: string) => void; + setPort: (port: number) => void; + getClientUserAgent: (callback: (clientUserAgent: string) => void) => void; + getTelemetryEnabled: () => boolean; + getAppInfoAsString: () => string; + getInitialNetworkRetryDelay: () => number; + getMaxNetworkRetryDelay: () => number; + getMaxNetworkRetries: () => number; + getConstant: (name: string) => T; + _setApiField: ( + name: K, + value: StripeObject['_api'][K] + ) => void; + getApiField: ( + key: K + ) => StripeObject['_api'][K]; + _setApiNumberField: (name: string, value: number) => unknown; + _appInfo: any; on: any; off: any; once: any; @@ -114,11 +137,13 @@ type StripeObject = { StripeResource: typeof StripeResource; errors: any; webhooks: any; - getApiField: (name: string) => T; _prepResources: () => void; _setAppInfo: (appInfo: AppInfo) => void; _setApiKey: (apiKey: string) => void; - _prevRequestMetrics: number[]; + _prevRequestMetrics: Array<{ + request_id: string; + request_duration_ms: number; + }>; _api: { auth: string | null; host: string; @@ -126,7 +151,7 @@ type StripeObject = { protocol: string; basePath: string; version: string; - timeout: string; + timeout: number; maxNetworkRetries: number; agent: string; httpClient: any; @@ -136,6 +161,7 @@ type StripeObject = { _emitter: import('events').EventEmitter; _enableTelemetry: boolean; _getPropsFromConfig: (config: Record) => UserProvidedConfig; + _clientId?: string; }; type StripeRawError = { message?: string; @@ -169,13 +195,13 @@ type StripeResourceObject = { basePath: UrlInterpolator; path: UrlInterpolator; resourcePath: string; - includeBasic: Array; + includeBasic?: Array; createResourcePathWithSymbols: (path: string | null | undefined) => string; createFullPath: ( interpolator: UrlInterpolator, urlData: RequestData ) => string; - _request: ( + _request( method: string, host: string, path: string, @@ -183,8 +209,62 @@ type StripeResourceObject = { auth: string, options: RequestOptions, callback: RequestCallback - ) => void; + ): void; initialize: (...args: Array) => void; + _joinUrlParts: (urlParts: string[]) => string; + _getRequestId: (headers: RequestHeaders) => string; + _makeResponseEvent: ( + requestEvent: RequestEvent, + statusCode: number, + headers: ResponseHeaders + ) => ResponseEvent; + _getUserAgentString: () => string; + _getTelemetryHeader: () => string; + requestDataProcessor: + | null + | (( + method: string, + data: RequestData, + headers: RequestHeaders | undefined, + prepareAndMakeRequest: (error: Error | null, data: string) => void + ) => void); + _recordRequestMetrics: (requestId: string, elapsed?: number) => void; + _addHeadersDirectlyToObject: (obj: any, headers: ResponseHeaders) => void; + _getMaxNetworkRetries: (settings: RequestSettings) => number; + _defaultIdempotencyKey: ( + method: string, + userSuppliedSettings: RequestSettings + ) => string | number | string[]; + _getSleepTimeInMS: ( + requestRetries: number, + retryAfter: number | null + ) => number | undefined; + _shouldRetry: ( + res: HttpClientResponseInterface | null, + requestRetries: number, + maxRetries: number, + error?: HttpClientResponseError + ) => boolean | undefined; + _jsonResponseHandler: ( + requestEvent: RequestEvent, + callback: RequestCallback + ) => (res: HttpClientResponseInterface) => void; + _streamingResponseHandler: ( + requestEvent: RequestEvent, + callback: RequestCallback + ) => (res: HttpClientResponseInterface) => RequestCallbackReturn; + _generateConnectionErrorMessage: ( + requestRetries: number + ) => string | undefined; + _makeHeaders: ( + auth: string, + length: number, + apiVersion: string, + clientUserAgent: string, + method: string, + headers: RequestHeaders | undefined, + settings: RequestSettings | undefined + ) => RequestHeaders; }; type UrlInterpolator = (params: Record) => string; type UserProvidedConfig = { diff --git a/src/stripe.ts b/src/stripe.ts index 6e684e19c7..b53719fa77 100644 --- a/src/stripe.ts +++ b/src/stripe.ts @@ -185,6 +185,20 @@ Stripe.createSubtleCryptoProvider = ( }; Stripe.prototype = { + // Properties are set in the constructor above + _appInfo: null!, + on: null!, + off: null!, + once: null!, + VERSION: null!, + StripeResource: null!, + webhooks: null!, + errors: null!, + _api: null!, + _prevRequestMetrics: null!, + _emitter: null!, + _enableTelemetry: null!, + /** * @deprecated will be removed in a future major version. Use the config object instead: * @@ -369,7 +383,10 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _setApiField(key: string, value: unknown): void { + _setApiField( + key: K, + value: StripeObject['_api'][K] + ): void { this._api[key] = value; }, @@ -380,7 +397,9 @@ Stripe.prototype = { * * It may be deprecated and removed in the future. */ - getApiField(key: string): T { + getApiField( + key: K + ): StripeObject['_api'][K] { return this._api[key]; }, @@ -388,7 +407,7 @@ Stripe.prototype = { this._clientId = clientId; }, - getClientId(): string { + getClientId(): string | undefined { return this._clientId; }, @@ -439,7 +458,11 @@ Stripe.prototype = { * @private * This may be removed in the future. */ - _setApiNumberField(prop: string, n: number, defaultVal?: number): void { + _setApiNumberField( + prop: keyof StripeObject['_api'], + n: number, + defaultVal?: number + ): void { const val = utils.validateInteger(prop, n, defaultVal); this._setApiField(prop, val); @@ -567,6 +590,7 @@ Stripe.prototype = { */ _prepResources(): void { for (const name in resources) { + // @ts-ignore this[utils.pascalToCamelCase(name)] = new resources[name](this); } }, @@ -611,7 +635,7 @@ Stripe.prototype = { return config; }, -}; +} as StripeObject; module.exports = Stripe; diff --git a/tsconfig.json b/tsconfig.json index b0e175f4d9..441cce9364 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strict": true, + "strictFunctionTypes": true, }, "include": ["./src/**/*"] } From 3e80143129af5046c42cbec338c9049aa525face Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Wed, 16 Nov 2022 11:36:51 -0800 Subject: [PATCH 03/23] Next major release changes (#1608) * Update StripeSignatureVerificationError to accept header and payload strings * Build * Update supported runtime versions * Remove Orders and subscription_data[items] * Remove SKU resource * Remove SKUs.spec.js * Remove deprecated configuration setter methods (#1597) * Remove deprecated config properties * Update test and remove config properties from types/ * Remove setProtocol from types, refactor old tests * Replace more require('../lib/stripe') with Stripe * Remove global stripe from EphemeralKeys test * Rename local stripe to newStripe in stripe.spec.js * Refactor EphemeralKeys.spec.js * Remove more deprecated items (#1600) Remove remaining deprecated items * Generate files for next major (#1603) * Generate next major * Deprecate StripeResource.path and related interfaces (#1604) * Deprecate path * More fully deprecate * Fix linting errors * Revert "Fix linting errors" This reverts commit 68ac772749e6e403650ad22fdeb448c6af09293e. * Revert "Deprecate StripeResource.path and related interfaces (#1604)" This reverts commit 9c9de9e9852369e575a701b33e8e47e277862a14. * fix tests to work without Invoices defining fullPAth Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Co-authored-by: Richard Marmorstein * Update LatestApiVersion and types reference * Update all references to latest API version * Regenerate * Latest API version * fix tests * Update API_VERSION and references * Format Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Co-authored-by: Richard Marmorstein Co-authored-by: Pavel Krymets Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- .github/workflows/main.yml | 1 - API_VERSION | 2 +- README.md | 4 +- .../typescript-node-express/express-ts.ts | 2 +- lib/Error.js | 8 +- lib/StripeMethod.basic.js | 26 - lib/StripeResource.js | 13 +- lib/Webhooks.js | 30 +- lib/apiVersion.js | 2 +- lib/resources.js | 2 - lib/resources/AccountLinks.js | 3 +- lib/resources/Accounts.js | 43 +- lib/resources/ApplePayDomains.js | 9 +- lib/resources/ApplicationFees.js | 13 +- lib/resources/Apps/Secrets.js | 9 +- lib/resources/Balance.js | 3 +- lib/resources/BalanceTransactions.js | 5 +- lib/resources/BillingPortal/Configurations.js | 9 +- lib/resources/BillingPortal/Sessions.js | 3 +- lib/resources/Charges.js | 13 +- lib/resources/Checkout/Sessions.js | 11 +- lib/resources/CountrySpecs.js | 5 +- lib/resources/Coupons.js | 11 +- lib/resources/CreditNotes.js | 17 +- lib/resources/Customers.js | 58 +- lib/resources/Disputes.js | 9 +- lib/resources/EphemeralKeys.js | 5 +- lib/resources/Events.js | 5 +- lib/resources/ExchangeRates.js | 5 +- lib/resources/FileLinks.js | 9 +- lib/resources/Files.js | 6 +- .../FinancialConnections/Accounts.js | 11 +- .../FinancialConnections/Sessions.js | 5 +- lib/resources/Identity/VerificationReports.js | 5 +- .../Identity/VerificationSessions.js | 13 +- lib/resources/InvoiceItems.js | 11 +- lib/resources/Invoices.js | 29 +- lib/resources/Issuing/Authorizations.js | 11 +- lib/resources/Issuing/Cardholders.js | 9 +- lib/resources/Issuing/Cards.js | 9 +- lib/resources/Issuing/Disputes.js | 11 +- lib/resources/Issuing/Transactions.js | 7 +- lib/resources/Mandates.js | 3 +- lib/resources/Orders.js | 41 - lib/resources/PaymentIntents.js | 23 +- lib/resources/PaymentLinks.js | 11 +- lib/resources/PaymentMethods.js | 13 +- lib/resources/Payouts.js | 13 +- lib/resources/Plans.js | 11 +- lib/resources/Prices.js | 11 +- lib/resources/Products.js | 13 +- lib/resources/PromotionCodes.js | 9 +- lib/resources/Quotes.js | 21 +- lib/resources/Radar/EarlyFraudWarnings.js | 5 +- lib/resources/Radar/ValueListItems.js | 9 +- lib/resources/Radar/ValueLists.js | 11 +- lib/resources/Refunds.js | 11 +- lib/resources/Reporting/ReportRuns.js | 7 +- lib/resources/Reporting/ReportTypes.js | 5 +- lib/resources/Reviews.js | 7 +- lib/resources/SKUs.js | 28 - lib/resources/SetupAttempts.js | 3 +- lib/resources/SetupIntents.js | 15 +- lib/resources/ShippingRates.js | 9 +- lib/resources/Sigma/ScheduledQueryRuns.js | 5 +- lib/resources/Sources.js | 11 +- lib/resources/SubscriptionItems.js | 16 +- lib/resources/SubscriptionSchedules.js | 13 +- lib/resources/Subscriptions.js | 17 +- lib/resources/TaxCodes.js | 5 +- lib/resources/TaxRates.js | 9 +- lib/resources/Terminal/Configurations.js | 11 +- lib/resources/Terminal/ConnectionTokens.js | 3 +- lib/resources/Terminal/Locations.js | 11 +- lib/resources/Terminal/Readers.js | 19 +- lib/resources/TestHelpers/Customers.js | 3 +- lib/resources/TestHelpers/Issuing/Cards.js | 9 +- lib/resources/TestHelpers/Refunds.js | 3 +- lib/resources/TestHelpers/Terminal/Readers.js | 4 +- lib/resources/TestHelpers/TestClocks.js | 11 +- .../TestHelpers/Treasury/InboundTransfers.js | 7 +- .../TestHelpers/Treasury/OutboundPayments.js | 7 +- .../TestHelpers/Treasury/OutboundTransfers.js | 10 +- .../TestHelpers/Treasury/ReceivedCredits.js | 3 +- .../TestHelpers/Treasury/ReceivedDebits.js | 3 +- lib/resources/Tokens.js | 5 +- lib/resources/Topups.js | 11 +- lib/resources/Transfers.js | 17 +- lib/resources/Treasury/CreditReversals.js | 7 +- lib/resources/Treasury/DebitReversals.js | 7 +- lib/resources/Treasury/FinancialAccounts.js | 13 +- lib/resources/Treasury/InboundTransfers.js | 9 +- lib/resources/Treasury/OutboundPayments.js | 9 +- lib/resources/Treasury/OutboundTransfers.js | 9 +- lib/resources/Treasury/ReceivedCredits.js | 5 +- lib/resources/Treasury/ReceivedDebits.js | 5 +- lib/resources/Treasury/TransactionEntries.js | 5 +- lib/resources/Treasury/Transactions.js | 5 +- lib/resources/WebhookEndpoints.js | 11 +- lib/stripe.js | 160 +- lib/utils.js | 39 +- package.json | 4 +- src/Error.ts | 11 +- src/StripeMethod.basic.js | 32 - src/StripeResource.ts | 15 +- src/Types.d.ts | 2 - src/Webhooks.ts | 30 +- src/apiVersion.js | 2 +- src/resources.js | 2 - src/resources/AccountLinks.js | 4 +- src/resources/Accounts.js | 44 +- src/resources/ApplePayDomains.js | 10 +- src/resources/ApplicationFees.js | 14 +- src/resources/Apps/Secrets.js | 10 +- src/resources/Balance.js | 4 +- src/resources/BalanceTransactions.js | 6 +- src/resources/BillingPortal/Configurations.js | 10 +- src/resources/BillingPortal/Sessions.js | 4 +- src/resources/Charges.js | 14 +- src/resources/Checkout/Sessions.js | 12 +- src/resources/CountrySpecs.js | 6 +- src/resources/Coupons.js | 12 +- src/resources/CreditNotes.js | 18 +- src/resources/Customers.js | 59 +- src/resources/Disputes.js | 10 +- src/resources/EphemeralKeys.js | 6 +- src/resources/Events.js | 6 +- src/resources/ExchangeRates.js | 6 +- src/resources/FileLinks.js | 10 +- src/resources/Files.js | 7 +- .../FinancialConnections/Accounts.js | 12 +- .../FinancialConnections/Sessions.js | 6 +- src/resources/Identity/VerificationReports.js | 6 +- .../Identity/VerificationSessions.js | 14 +- src/resources/InvoiceItems.js | 12 +- src/resources/Invoices.js | 30 +- src/resources/Issuing/Authorizations.js | 12 +- src/resources/Issuing/Cardholders.js | 10 +- src/resources/Issuing/Cards.js | 10 +- src/resources/Issuing/Disputes.js | 12 +- src/resources/Issuing/Transactions.js | 8 +- src/resources/Mandates.js | 4 +- src/resources/Orders.js | 52 - src/resources/PaymentIntents.js | 24 +- src/resources/PaymentLinks.js | 12 +- src/resources/PaymentMethods.js | 14 +- src/resources/Payouts.js | 14 +- src/resources/Plans.js | 12 +- src/resources/Prices.js | 12 +- src/resources/Products.js | 14 +- src/resources/PromotionCodes.js | 10 +- src/resources/Quotes.js | 22 +- src/resources/Radar/EarlyFraudWarnings.js | 6 +- src/resources/Radar/ValueListItems.js | 10 +- src/resources/Radar/ValueLists.js | 12 +- src/resources/Refunds.js | 12 +- src/resources/Reporting/ReportRuns.js | 8 +- src/resources/Reporting/ReportTypes.js | 6 +- src/resources/Reviews.js | 8 +- src/resources/SKUs.js | 36 - src/resources/SetupAttempts.js | 4 +- src/resources/SetupIntents.js | 16 +- src/resources/ShippingRates.js | 10 +- src/resources/Sigma/ScheduledQueryRuns.js | 6 +- src/resources/Sources.js | 12 +- src/resources/SubscriptionItems.js | 17 +- src/resources/SubscriptionSchedules.js | 14 +- src/resources/Subscriptions.js | 18 +- src/resources/TaxCodes.js | 6 +- src/resources/TaxRates.js | 10 +- src/resources/Terminal/Configurations.js | 12 +- src/resources/Terminal/ConnectionTokens.js | 4 +- src/resources/Terminal/Locations.js | 12 +- src/resources/Terminal/Readers.js | 20 +- src/resources/TestHelpers/Customers.js | 4 +- src/resources/TestHelpers/Issuing/Cards.js | 10 +- src/resources/TestHelpers/Refunds.js | 4 +- src/resources/TestHelpers/Terminal/Readers.js | 5 +- src/resources/TestHelpers/TestClocks.js | 12 +- .../TestHelpers/Treasury/InboundTransfers.js | 8 +- .../TestHelpers/Treasury/OutboundPayments.js | 8 +- .../TestHelpers/Treasury/OutboundTransfers.js | 11 +- .../TestHelpers/Treasury/ReceivedCredits.js | 4 +- .../TestHelpers/Treasury/ReceivedDebits.js | 4 +- src/resources/Tokens.js | 6 +- src/resources/Topups.js | 12 +- src/resources/Transfers.js | 18 +- src/resources/Treasury/CreditReversals.js | 8 +- src/resources/Treasury/DebitReversals.js | 8 +- src/resources/Treasury/FinancialAccounts.js | 14 +- src/resources/Treasury/InboundTransfers.js | 10 +- src/resources/Treasury/OutboundPayments.js | 10 +- src/resources/Treasury/OutboundTransfers.js | 10 +- src/resources/Treasury/ReceivedCredits.js | 6 +- src/resources/Treasury/ReceivedDebits.js | 6 +- src/resources/Treasury/TransactionEntries.js | 6 +- src/resources/Treasury/Transactions.js | 6 +- src/resources/WebhookEndpoints.js | 12 +- src/stripe.ts | 170 +- src/utils.ts | 40 +- test/StripeResource.spec.js | 30 +- test/resources/EphemeralKeys.spec.js | 36 +- test/resources/SKUs.spec.js | 98 - .../resources/generated_examples_test.spec.js | 35 - test/stripe.spec.js | 112 +- test/telemetry.spec.js | 30 +- test/utils.spec.js | 85 - testUtils/index.js | 4 +- types/2022-08-01/Orders.d.ts | 3356 ----------------- types/2022-08-01/SKUs.d.ts | 453 --- .../AccountLinks.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Accounts.d.ts | 0 .../ApplePayDomains.d.ts | 0 .../ApplicationFees.d.ts | 0 .../Applications.d.ts | 0 .../Apps/Secrets.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Balance.d.ts | 0 .../BalanceTransactions.d.ts | 0 .../BankAccounts.d.ts | 0 .../BillingPortal/Configurations.d.ts | 0 .../BillingPortal/Sessions.d.ts | 0 .../Capabilities.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Cards.d.ts | 0 .../CashBalances.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Charges.d.ts | 2 +- .../Checkout/Sessions.d.ts | 28 - .../ConnectCollectionTransfers.d.ts | 0 .../CountrySpecs.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Coupons.d.ts | 0 .../CreditNoteLineItems.d.ts | 0 .../CreditNotes.d.ts | 0 .../CustomerBalanceTransactions.d.ts | 0 .../CustomerCashBalanceTransactions.d.ts | 0 .../CustomerSources.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Customers.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Discounts.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Disputes.d.ts | 0 .../EphemeralKeys.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Events.d.ts | 0 .../ExchangeRates.d.ts | 0 .../ExternalAccounts.d.ts | 0 .../FeeRefunds.d.ts | 0 .../{2022-08-01 => 2022-11-15}/FileLinks.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Files.d.ts | 0 .../FinancialConnections/AccountOwners.d.ts | 0 .../AccountOwnerships.d.ts | 0 .../FinancialConnections/Accounts.d.ts | 0 .../FinancialConnections/Sessions.d.ts | 0 .../FundingInstructions.d.ts | 0 .../Identity/VerificationReports.d.ts | 0 .../Identity/VerificationSessions.d.ts | 0 .../InvoiceItems.d.ts | 0 .../InvoiceLineItems.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Invoices.d.ts | 0 .../Issuing/Authorizations.d.ts | 0 .../Issuing/Cardholders.d.ts | 0 .../Issuing/Cards.d.ts | 0 .../Issuing/Disputes.d.ts | 0 .../Issuing/Transactions.d.ts | 0 .../{2022-08-01 => 2022-11-15}/LineItems.d.ts | 7 - .../LoginLinks.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Mandates.d.ts | 0 .../PaymentIntents.d.ts | 10 +- .../PaymentLinks.d.ts | 0 .../PaymentMethods.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Payouts.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Persons.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Plans.d.ts | 0 .../PlatformTaxFees.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Prices.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Products.d.ts | 0 .../PromotionCodes.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Quotes.d.ts | 0 .../Radar/EarlyFraudWarnings.d.ts | 0 .../Radar/ValueListItems.d.ts | 0 .../Radar/ValueLists.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Refunds.d.ts | 4 - .../Reporting/ReportRuns.d.ts | 0 .../Reporting/ReportTypes.d.ts | 0 .../ReserveTransactions.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Reviews.d.ts | 0 .../SetupAttempts.d.ts | 0 .../SetupIntents.d.ts | 0 .../ShippingRates.d.ts | 0 .../Sigma/ScheduledQueryRuns.d.ts | 0 .../SourceMandateNotifications.d.ts | 0 .../SourceTransactions.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Sources.d.ts | 0 .../SubscriptionItems.d.ts | 0 .../SubscriptionSchedules.d.ts | 0 .../Subscriptions.d.ts | 0 .../{2022-08-01 => 2022-11-15}/TaxCodes.d.ts | 0 .../TaxDeductedAtSources.d.ts | 0 types/{2022-08-01 => 2022-11-15}/TaxIds.d.ts | 0 .../{2022-08-01 => 2022-11-15}/TaxRates.d.ts | 0 .../Terminal/Configurations.d.ts | 0 .../Terminal/ConnectionTokens.d.ts | 0 .../Terminal/Locations.d.ts | 0 .../Terminal/Readers.d.ts | 0 .../TestHelpers/Customers.d.ts | 0 .../TestHelpers/Issuing/Cards.d.ts | 0 .../TestHelpers/Refunds.d.ts | 0 .../TestHelpers/Terminal/Readers.d.ts | 0 .../TestHelpers/TestClocks.d.ts | 0 .../Treasury/InboundTransfers.d.ts | 0 .../Treasury/OutboundPayments.d.ts | 0 .../Treasury/OutboundTransfers.d.ts | 0 .../TestHelpers/Treasury/ReceivedCredits.d.ts | 0 .../TestHelpers/Treasury/ReceivedDebits.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Tokens.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Topups.d.ts | 0 .../TransferReversals.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Transfers.d.ts | 0 .../Treasury/CreditReversals.d.ts | 0 .../Treasury/DebitReversals.d.ts | 0 .../Treasury/FinancialAccountFeatures.d.ts | 0 .../Treasury/FinancialAccounts.d.ts | 0 .../Treasury/InboundTransfers.d.ts | 0 .../Treasury/OutboundPayments.d.ts | 0 .../Treasury/OutboundTransfers.d.ts | 0 .../Treasury/ReceivedCredits.d.ts | 0 .../Treasury/ReceivedDebits.d.ts | 0 .../Treasury/TransactionEntries.d.ts | 0 .../Treasury/Transactions.d.ts | 0 .../UsageRecordSummaries.d.ts | 0 .../UsageRecords.d.ts | 0 .../WebhookEndpoints.d.ts | 3 +- types/{2022-08-01 => 2022-11-15}/index.d.ts | 27 - types/lib.d.ts | 2 +- types/test/typescriptTest.ts | 18 +- 330 files changed, 990 insertions(+), 5951 deletions(-) delete mode 100644 lib/StripeMethod.basic.js delete mode 100644 lib/resources/Orders.js delete mode 100644 lib/resources/SKUs.js delete mode 100644 src/StripeMethod.basic.js delete mode 100644 src/resources/Orders.js delete mode 100644 src/resources/SKUs.js delete mode 100644 test/resources/SKUs.spec.js delete mode 100644 types/2022-08-01/Orders.d.ts delete mode 100644 types/2022-08-01/SKUs.d.ts rename types/{2022-08-01 => 2022-11-15}/AccountLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Accounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ApplePayDomains.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ApplicationFees.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Applications.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Apps/Secrets.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Balance.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BankAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BillingPortal/Configurations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BillingPortal/Sessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Capabilities.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CashBalances.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Charges.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/Checkout/Sessions.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/ConnectCollectionTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CountrySpecs.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Coupons.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CreditNoteLineItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CreditNotes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerBalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerCashBalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerSources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Customers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Discounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Disputes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/EphemeralKeys.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Events.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ExchangeRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ExternalAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FeeRefunds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FileLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Files.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/AccountOwners.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/AccountOwnerships.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/Accounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/Sessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FundingInstructions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Identity/VerificationReports.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Identity/VerificationSessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/InvoiceItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/InvoiceLineItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Invoices.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Authorizations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Cardholders.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Disputes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Transactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/LineItems.d.ts (93%) rename types/{2022-08-01 => 2022-11-15}/LoginLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Mandates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PaymentIntents.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/PaymentLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PaymentMethods.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Payouts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Persons.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Plans.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PlatformTaxFees.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Prices.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Products.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PromotionCodes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Quotes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/EarlyFraudWarnings.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/ValueListItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/ValueLists.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Refunds.d.ts (97%) rename types/{2022-08-01 => 2022-11-15}/Reporting/ReportRuns.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Reporting/ReportTypes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ReserveTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Reviews.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SetupAttempts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SetupIntents.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ShippingRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Sigma/ScheduledQueryRuns.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SourceMandateNotifications.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SourceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Sources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SubscriptionItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SubscriptionSchedules.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Subscriptions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxCodes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxDeductedAtSources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxIds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Configurations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/ConnectionTokens.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Locations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Readers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Customers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Issuing/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Refunds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Terminal/Readers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/TestClocks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/InboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/OutboundPayments.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/OutboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/ReceivedCredits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/ReceivedDebits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Tokens.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Topups.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TransferReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Transfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/CreditReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/DebitReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/FinancialAccountFeatures.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/FinancialAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/InboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/OutboundPayments.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/OutboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/ReceivedCredits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/ReceivedDebits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/TransactionEntries.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/Transactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/UsageRecordSummaries.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/UsageRecords.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/WebhookEndpoints.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/index.d.ts (91%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33f05239e1..15c420c8c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,6 @@ jobs: - "16" - "14" - "12" - - "10" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/API_VERSION b/API_VERSION index 0366ceb901..63dfe03884 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2022-08-01 +2022-11-15 diff --git a/README.md b/README.md index 12801a9ef0..13b2974a8d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See [video demonstrations][youtube-playlist] covering how to use the library. ## Requirements -Node 8, 10 or higher. +Node 12 or higher. ## Installation @@ -73,7 +73,7 @@ and instantiate it as `new Stripe()` with the latest API version. ```ts import Stripe from 'stripe'; const stripe = new Stripe('sk_test_...', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); const createCustomer = async () => { diff --git a/examples/webhook-signing/typescript-node-express/express-ts.ts b/examples/webhook-signing/typescript-node-express/express-ts.ts index c0a4c1d4b7..88b6da04b2 100644 --- a/examples/webhook-signing/typescript-node-express/express-ts.ts +++ b/examples/webhook-signing/typescript-node-express/express-ts.ts @@ -5,7 +5,7 @@ import env from 'dotenv'; env.config(); const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET; diff --git a/lib/Error.js b/lib/Error.js index 0b5c8ad8db..dfdfb447fd 100644 --- a/lib/Error.js +++ b/lib/Error.js @@ -95,7 +95,13 @@ class StripeConnectionError extends StripeError {} * SignatureVerificationError is raised when the signature verification for a * webhook fails */ -class StripeSignatureVerificationError extends StripeError {} +class StripeSignatureVerificationError extends StripeError { + constructor(header, payload, raw = {}) { + super(raw); + this.header = header; + this.payload = payload; + } +} /** * IdempotencyError is raised in cases where an idempotency key was used * improperly. diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js deleted file mode 100644 index 1949b543c9..0000000000 --- a/lib/StripeMethod.basic.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -const stripeMethod = require('./StripeMethod'); -// DEPRECATED: These were kept for backwards compatibility in case users were -// using this, but basic methods are now explicitly defined on a resource. -module.exports = { - create: stripeMethod({ - method: 'POST', - }), - list: stripeMethod({ - method: 'GET', - methodType: 'list', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '{id}', - }), - // Avoid 'delete' keyword in JS - del: stripeMethod({ - method: 'DELETE', - path: '{id}', - }), -}; diff --git a/lib/StripeResource.js b/lib/StripeResource.js index 4ca71e7517..6ca731d883 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -12,9 +12,8 @@ const { const {HttpClient} = require('./net/HttpClient'); // Provide extension mechanism for Stripe Resource Sub-Classes StripeResource.extend = utils.protoExtend; -// Expose method-creator & prepared (basic) methods +// Expose method-creator StripeResource.method = require('./StripeMethod'); -StripeResource.BASIC_METHODS = require('./StripeMethod.basic'); StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100; const MAX_RETRY_AFTER_WAIT = 60; /** @@ -35,14 +34,6 @@ function StripeResource(stripe, deprecatedUrlData) { this.resourcePath = this.path; // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); - // DEPRECATED: This was kept for backwards compatibility in case users were - // using this, but basic methods are now explicitly defined on a resource. - if (this.includeBasic) { - this.includeBasic.forEach(function(methodName) { - // @ts-ignore - this[methodName] = StripeResource.BASIC_METHODS[methodName]; - }, this); - } this.initialize(...arguments); } StripeResource.prototype = { @@ -95,8 +86,6 @@ StripeResource.prototype = { // interface and so we need to preserve backwards compatibility. return parts.join('/').replace(/\/{2,}/g, '/'); }, - // DEPRECATED: Here for backcompat in case users relied on this. - wrapTimeout: utils.callbackifyPromiseWithTimeout, _addHeadersDirectlyToObject(obj, headers) { // For convenience, make some headers easily accessible on // lastResponse. diff --git a/lib/Webhooks.js b/lib/Webhooks.js index ce6322201e..23690d44a3 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -145,23 +145,13 @@ function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) { : encodedHeader; const details = parseHeader(decodedHeader, expectedScheme); if (!details || details.timestamp === -1) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'Unable to extract timestamp and signatures from header', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } if (!details.signatures.length) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'No signatures found with expected scheme', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } return { @@ -182,27 +172,19 @@ function validateComputedSignature( utils.secureCompare.bind(utils, expectedSignature) ).length; if (!signatureFound) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } const timestampAge = Math.floor(Date.now() / 1000) - details.timestamp; if (tolerance > 0 && timestampAge > tolerance) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'Timestamp outside the tolerance zone', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } return true; diff --git a/lib/apiVersion.js b/lib/apiVersion.js index 518f4476ab..d28b6bac34 100644 --- a/lib/apiVersion.js +++ b/lib/apiVersion.js @@ -1,3 +1,3 @@ 'use strict'; // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2022-08-01'}; +module.exports = {ApiVersion: '2022-11-15'}; diff --git a/lib/resources.js b/lib/resources.js index 60e5444aad..eb497e3587 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -25,7 +25,6 @@ module.exports = { InvoiceItems: require('./resources/InvoiceItems'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), - Orders: require('./resources/Orders'), PaymentIntents: require('./resources/PaymentIntents'), PaymentLinks: require('./resources/PaymentLinks'), PaymentMethods: require('./resources/PaymentMethods'), @@ -40,7 +39,6 @@ module.exports = { SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), diff --git a/lib/resources/AccountLinks.js b/lib/resources/AccountLinks.js index 2e8453e200..45a2185524 100644 --- a/lib/resources/AccountLinks.js +++ b/lib/resources/AccountLinks.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_links', }), }); diff --git a/lib/resources/Accounts.js b/lib/resources/Accounts.js index 44d78baf59..63aa6e6bb5 100644 --- a/lib/resources/Accounts.js +++ b/lib/resources/Accounts.js @@ -4,10 +4,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; // Since path can either be `account` or `accounts`, support both through stripeMethod path; module.exports = StripeResource.extend({ - path: '', create: stripeMethod({ method: 'POST', - path: 'accounts', + fullPath: '/v1/accounts', }), retrieve(id) { // No longer allow an api key to be passed as the first string to this function due to ambiguity between @@ -15,7 +14,7 @@ module.exports = StripeResource.extend({ if (typeof id === 'string') { return stripeMethod({ method: 'GET', - path: 'accounts/{id}', + fullPath: '/v1/accounts/{id}', }).apply(this, arguments); } else { if (id === null || id === undefined) { @@ -24,84 +23,84 @@ module.exports = StripeResource.extend({ } return stripeMethod({ method: 'GET', - path: 'account', + fullPath: '/v1/account', }).apply(this, arguments); } }, update: stripeMethod({ method: 'POST', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: 'accounts', + fullPath: '/v1/accounts', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), reject: stripeMethod({ method: 'POST', - path: 'accounts/{account}/reject', + fullPath: '/v1/accounts/{account}/reject', }), retrieveCapability: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), updateCapability: stripeMethod({ method: 'POST', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), listCapabilities: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities', + fullPath: '/v1/accounts/{account}/capabilities', methodType: 'list', }), createExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', }), retrieveExternalAccount: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), updateExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), listExternalAccounts: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', methodType: 'list', }), deleteExternalAccount: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), createLoginLink: stripeMethod({ method: 'POST', - path: 'accounts/{account}/login_links', + fullPath: '/v1/accounts/{account}/login_links', }), createPerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', }), retrievePerson: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), updatePerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), listPersons: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', methodType: 'list', }), deletePerson: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), }); diff --git a/lib/resources/ApplePayDomains.js b/lib/resources/ApplePayDomains.js index e9a24f3638..4ca4546ec3 100644 --- a/lib/resources/ApplePayDomains.js +++ b/lib/resources/ApplePayDomains.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apple_pay/domains', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apple_pay/domains', }), retrieve: stripeMethod({ method: 'GET', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apple_pay/domains', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), }); diff --git a/lib/resources/ApplicationFees.js b/lib/resources/ApplicationFees.js index c2e524df7a..7f0fa49662 100644 --- a/lib/resources/ApplicationFees.js +++ b/lib/resources/ApplicationFees.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/application_fees/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/application_fees', methodType: 'list', }), createRefund: stripeMethod({ method: 'POST', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', }), retrieveRefund: stripeMethod({ method: 'GET', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), updateRefund: stripeMethod({ method: 'POST', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), listRefunds: stripeMethod({ method: 'GET', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', methodType: 'list', }), }); diff --git a/lib/resources/Apps/Secrets.js b/lib/resources/Apps/Secrets.js index d5a0831a6f..112e3539e5 100644 --- a/lib/resources/Apps/Secrets.js +++ b/lib/resources/Apps/Secrets.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apps/secrets', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apps/secrets', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apps/secrets', methodType: 'list', }), deleteWhere: stripeMethod({ method: 'POST', - path: '/delete', + fullPath: '/v1/apps/secrets/delete', }), find: stripeMethod({ method: 'GET', - path: '/find', + fullPath: '/v1/apps/secrets/find', }), }); diff --git a/lib/resources/Balance.js b/lib/resources/Balance.js index 9b6f692d86..84378bb100 100644 --- a/lib/resources/Balance.js +++ b/lib/resources/Balance.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance', }), }); diff --git a/lib/resources/BalanceTransactions.js b/lib/resources/BalanceTransactions.js index 00438d0dc0..3e205b9dc5 100644 --- a/lib/resources/BalanceTransactions.js +++ b/lib/resources/BalanceTransactions.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance_transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/balance_transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance_transactions', methodType: 'list', }), }); diff --git a/lib/resources/BillingPortal/Configurations.js b/lib/resources/BillingPortal/Configurations.js index 624852cb04..df450890e9 100644 --- a/lib/resources/BillingPortal/Configurations.js +++ b/lib/resources/BillingPortal/Configurations.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/configurations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/billing_portal/configurations', methodType: 'list', }), }); diff --git a/lib/resources/BillingPortal/Sessions.js b/lib/resources/BillingPortal/Sessions.js index 909b3e077e..db2e2e5d2a 100644 --- a/lib/resources/BillingPortal/Sessions.js +++ b/lib/resources/BillingPortal/Sessions.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/sessions', }), }); diff --git a/lib/resources/Charges.js b/lib/resources/Charges.js index ebe6b16a76..6e3302700c 100644 --- a/lib/resources/Charges.js +++ b/lib/resources/Charges.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/charges', }), retrieve: stripeMethod({ method: 'GET', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), update: stripeMethod({ method: 'POST', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/charges', methodType: 'list', }), capture: stripeMethod({ method: 'POST', - path: '/{charge}/capture', + fullPath: '/v1/charges/{charge}/capture', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/charges/search', methodType: 'search', }), }); diff --git a/lib/resources/Checkout/Sessions.js b/lib/resources/Checkout/Sessions.js index 9e3e61f000..ecaafb11d2 100644 --- a/lib/resources/Checkout/Sessions.js +++ b/lib/resources/Checkout/Sessions.js @@ -3,27 +3,26 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'checkout/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/checkout/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/checkout/sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/checkout/sessions', methodType: 'list', }), expire: stripeMethod({ method: 'POST', - path: '/{session}/expire', + fullPath: '/v1/checkout/sessions/{session}/expire', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{session}/line_items', + fullPath: '/v1/checkout/sessions/{session}/line_items', methodType: 'list', }), }); diff --git a/lib/resources/CountrySpecs.js b/lib/resources/CountrySpecs.js index 5f76abfdcd..6a9d410b4d 100644 --- a/lib/resources/CountrySpecs.js +++ b/lib/resources/CountrySpecs.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'country_specs', retrieve: stripeMethod({ method: 'GET', - path: '/{country}', + fullPath: '/v1/country_specs/{country}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/country_specs', methodType: 'list', }), }); diff --git a/lib/resources/Coupons.js b/lib/resources/Coupons.js index 0e3d7c8acb..043eeead74 100644 --- a/lib/resources/Coupons.js +++ b/lib/resources/Coupons.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'coupons', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/coupons', }), retrieve: stripeMethod({ method: 'GET', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), update: stripeMethod({ method: 'POST', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/coupons', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), }); diff --git a/lib/resources/CreditNotes.js b/lib/resources/CreditNotes.js index 94865f45e6..6574070881 100644 --- a/lib/resources/CreditNotes.js +++ b/lib/resources/CreditNotes.js @@ -3,40 +3,39 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/credit_notes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/credit_notes', methodType: 'list', }), listPreviewLineItems: stripeMethod({ method: 'GET', - path: '/preview/lines', + fullPath: '/v1/credit_notes/preview/lines', methodType: 'list', }), preview: stripeMethod({ method: 'GET', - path: '/preview', + fullPath: '/v1/credit_notes/preview', }), voidCreditNote: stripeMethod({ method: 'POST', - path: '/{id}/void', + fullPath: '/v1/credit_notes/{id}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{creditNote}/lines', + fullPath: '/v1/credit_notes/{credit_note}/lines', methodType: 'list', }), }); diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index d0236d5444..0c98e91590 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -3,124 +3,124 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/customers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), update: stripeMethod({ method: 'POST', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/customers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), createFundingInstructions: stripeMethod({ method: 'POST', - path: '/{customer}/funding_instructions', + fullPath: '/v1/customers/{customer}/funding_instructions', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{customer}/discount', + fullPath: '/v1/customers/{customer}/discount', }), listPaymentMethods: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods', + fullPath: '/v1/customers/{customer}/payment_methods', methodType: 'list', }), retrievePaymentMethod: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods/{paymentMethod}', + fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/customers/search', methodType: 'search', }), retrieveCashBalance: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), updateCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), createBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', }), retrieveBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), updateBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), listBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', methodType: 'list', }), retrieveCashBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions/{transaction}', + fullPath: + '/v1/customers/{customer}/cash_balance_transactions/{transaction}', }), listCashBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions', + fullPath: '/v1/customers/{customer}/cash_balance_transactions', methodType: 'list', }), createSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', }), retrieveSource: stripeMethod({ method: 'GET', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), updateSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), listSources: stripeMethod({ method: 'GET', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', methodType: 'list', }), deleteSource: stripeMethod({ method: 'DELETE', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), verifySource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}/verify', + fullPath: '/v1/customers/{customer}/sources/{id}/verify', }), createTaxId: stripeMethod({ method: 'POST', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', }), retrieveTaxId: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), listTaxIds: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', methodType: 'list', }), deleteTaxId: stripeMethod({ method: 'DELETE', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), }); diff --git a/lib/resources/Disputes.js b/lib/resources/Disputes.js index 6ca079cd87..3679668634 100644 --- a/lib/resources/Disputes.js +++ b/lib/resources/Disputes.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/disputes', methodType: 'list', }), close: stripeMethod({ method: 'POST', - path: '/{dispute}/close', + fullPath: '/v1/disputes/{dispute}/close', }), }); diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 962d341761..186a3b091e 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -3,10 +3,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'ephemeral_keys', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/ephemeral_keys', validator: (data, options) => { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( @@ -17,6 +16,6 @@ module.exports = StripeResource.extend({ }), del: stripeMethod({ method: 'DELETE', - path: '/{key}', + fullPath: '/v1/ephemeral_keys/{key}', }), }); diff --git a/lib/resources/Events.js b/lib/resources/Events.js index 5c2c8ceb86..e148e305ae 100644 --- a/lib/resources/Events.js +++ b/lib/resources/Events.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'events', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/events/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/events', methodType: 'list', }), }); diff --git a/lib/resources/ExchangeRates.js b/lib/resources/ExchangeRates.js index 3c1464a3ae..f92da86aab 100644 --- a/lib/resources/ExchangeRates.js +++ b/lib/resources/ExchangeRates.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'exchange_rates', retrieve: stripeMethod({ method: 'GET', - path: '/{rateId}', + fullPath: '/v1/exchange_rates/{rate_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/exchange_rates', methodType: 'list', }), }); diff --git a/lib/resources/FileLinks.js b/lib/resources/FileLinks.js index 805e37ee5d..b474227b31 100644 --- a/lib/resources/FileLinks.js +++ b/lib/resources/FileLinks.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'file_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/file_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), update: stripeMethod({ method: 'POST', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/file_links', methodType: 'list', }), }); diff --git a/lib/resources/Files.js b/lib/resources/Files.js index b436f465d9..11856b1323 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -4,9 +4,9 @@ const {multipartRequestDataProcessor} = require('../multipart'); const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'files', create: stripeMethod({ method: 'POST', + fullPath: '/v1/files', headers: { 'Content-Type': 'multipart/form-data', }, @@ -14,11 +14,11 @@ module.exports = StripeResource.extend({ }), retrieve: stripeMethod({ method: 'GET', - path: '/{file}', + fullPath: '/v1/files/{file}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/files', methodType: 'list', }), requestDataProcessor: multipartRequestDataProcessor, diff --git a/lib/resources/FinancialConnections/Accounts.js b/lib/resources/FinancialConnections/Accounts.js index 2a85a3b0d8..8ce36e37b2 100644 --- a/lib/resources/FinancialConnections/Accounts.js +++ b/lib/resources/FinancialConnections/Accounts.js @@ -3,27 +3,26 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/accounts', retrieve: stripeMethod({ method: 'GET', - path: '/{account}', + fullPath: '/v1/financial_connections/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/financial_connections/accounts', methodType: 'list', }), disconnect: stripeMethod({ method: 'POST', - path: '/{account}/disconnect', + fullPath: '/v1/financial_connections/accounts/{account}/disconnect', }), listOwners: stripeMethod({ method: 'GET', - path: '/{account}/owners', + fullPath: '/v1/financial_connections/accounts/{account}/owners', methodType: 'list', }), refresh: stripeMethod({ method: 'POST', - path: '/{account}/refresh', + fullPath: '/v1/financial_connections/accounts/{account}/refresh', }), }); diff --git a/lib/resources/FinancialConnections/Sessions.js b/lib/resources/FinancialConnections/Sessions.js index 0508a13fc3..b5bbb4c641 100644 --- a/lib/resources/FinancialConnections/Sessions.js +++ b/lib/resources/FinancialConnections/Sessions.js @@ -3,13 +3,12 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/financial_connections/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/financial_connections/sessions/{session}', }), }); diff --git a/lib/resources/Identity/VerificationReports.js b/lib/resources/Identity/VerificationReports.js index 058451119b..3bd584a265 100644 --- a/lib/resources/Identity/VerificationReports.js +++ b/lib/resources/Identity/VerificationReports.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_reports', retrieve: stripeMethod({ method: 'GET', - path: '/{report}', + fullPath: '/v1/identity/verification_reports/{report}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_reports', methodType: 'list', }), }); diff --git a/lib/resources/Identity/VerificationSessions.js b/lib/resources/Identity/VerificationSessions.js index 4f9ae5d151..e9d3b72e87 100644 --- a/lib/resources/Identity/VerificationSessions.js +++ b/lib/resources/Identity/VerificationSessions.js @@ -3,30 +3,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/identity/verification_sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), update: stripeMethod({ method: 'POST', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_sessions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{session}/cancel', + fullPath: '/v1/identity/verification_sessions/{session}/cancel', }), redact: stripeMethod({ method: 'POST', - path: '/{session}/redact', + fullPath: '/v1/identity/verification_sessions/{session}/redact', }), }); diff --git a/lib/resources/InvoiceItems.js b/lib/resources/InvoiceItems.js index 58ed3d88fd..1a961fddb8 100644 --- a/lib/resources/InvoiceItems.js +++ b/lib/resources/InvoiceItems.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoiceitems', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoiceitems', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), update: stripeMethod({ method: 'POST', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoiceitems', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), }); diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index 67237d020d..e1ac39f34f 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -3,65 +3,64 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoices', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), update: stripeMethod({ method: 'POST', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoices', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), finalizeInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/finalize', + fullPath: '/v1/invoices/{invoice}/finalize', }), listUpcomingLines: stripeMethod({ method: 'GET', - path: '/upcoming/lines', + fullPath: '/v1/invoices/upcoming/lines', methodType: 'list', }), markUncollectible: stripeMethod({ method: 'POST', - path: '/{invoice}/mark_uncollectible', + fullPath: '/v1/invoices/{invoice}/mark_uncollectible', }), pay: stripeMethod({ method: 'POST', - path: '/{invoice}/pay', + fullPath: '/v1/invoices/{invoice}/pay', }), retrieveUpcoming: stripeMethod({ method: 'GET', - path: '/upcoming', + fullPath: '/v1/invoices/upcoming', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/invoices/search', methodType: 'search', }), sendInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/send', + fullPath: '/v1/invoices/{invoice}/send', }), voidInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/void', + fullPath: '/v1/invoices/{invoice}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{invoice}/lines', + fullPath: '/v1/invoices/{invoice}/lines', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Authorizations.js b/lib/resources/Issuing/Authorizations.js index 649d2b0595..7d9e894b97 100644 --- a/lib/resources/Issuing/Authorizations.js +++ b/lib/resources/Issuing/Authorizations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/authorizations', retrieve: stripeMethod({ method: 'GET', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), update: stripeMethod({ method: 'POST', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/authorizations', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{authorization}/approve', + fullPath: '/v1/issuing/authorizations/{authorization}/approve', }), decline: stripeMethod({ method: 'POST', - path: '/{authorization}/decline', + fullPath: '/v1/issuing/authorizations/{authorization}/decline', }), }); diff --git a/lib/resources/Issuing/Cardholders.js b/lib/resources/Issuing/Cardholders.js index 20f17017b3..a76764eba3 100644 --- a/lib/resources/Issuing/Cardholders.js +++ b/lib/resources/Issuing/Cardholders.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cardholders', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cardholders', }), retrieve: stripeMethod({ method: 'GET', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), update: stripeMethod({ method: 'POST', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cardholders', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Cards.js b/lib/resources/Issuing/Cards.js index 35d66cd465..98cc817f1e 100644 --- a/lib/resources/Issuing/Cards.js +++ b/lib/resources/Issuing/Cards.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cards', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), update: stripeMethod({ method: 'POST', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cards', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Disputes.js b/lib/resources/Issuing/Disputes.js index 4d14d03db2..803d4b6149 100644 --- a/lib/resources/Issuing/Disputes.js +++ b/lib/resources/Issuing/Disputes.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/disputes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/disputes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/disputes', methodType: 'list', }), submit: stripeMethod({ method: 'POST', - path: '/{dispute}/submit', + fullPath: '/v1/issuing/disputes/{dispute}/submit', }), }); diff --git a/lib/resources/Issuing/Transactions.js b/lib/resources/Issuing/Transactions.js index 23a8e4f41e..789dd7e3df 100644 --- a/lib/resources/Issuing/Transactions.js +++ b/lib/resources/Issuing/Transactions.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), update: stripeMethod({ method: 'POST', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/transactions', methodType: 'list', }), }); diff --git a/lib/resources/Mandates.js b/lib/resources/Mandates.js index 37bc7fae45..06240ae2d2 100644 --- a/lib/resources/Mandates.js +++ b/lib/resources/Mandates.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'mandates', retrieve: stripeMethod({ method: 'GET', - path: '/{mandate}', + fullPath: '/v1/mandates/{mandate}', }), }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js deleted file mode 100644 index 61697d6a14..0000000000 --- a/lib/resources/Orders.js +++ /dev/null @@ -1,41 +0,0 @@ -// File generated from our OpenAPI spec -'use strict'; -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; -module.exports = StripeResource.extend({ - path: 'orders', - create: stripeMethod({ - method: 'POST', - path: '', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - cancel: stripeMethod({ - method: 'POST', - path: '/{id}/cancel', - }), - listLineItems: stripeMethod({ - method: 'GET', - path: '/{id}/line_items', - methodType: 'list', - }), - reopen: stripeMethod({ - method: 'POST', - path: '/{id}/reopen', - }), - submit: stripeMethod({ - method: 'POST', - path: '/{id}/submit', - }), -}); diff --git a/lib/resources/PaymentIntents.js b/lib/resources/PaymentIntents.js index b79f5aa6f5..963f1688e6 100644 --- a/lib/resources/PaymentIntents.js +++ b/lib/resources/PaymentIntents.js @@ -3,51 +3,50 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_intents', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_intents', methodType: 'list', }), applyCustomerBalance: stripeMethod({ method: 'POST', - path: '/{intent}/apply_customer_balance', + fullPath: '/v1/payment_intents/{intent}/apply_customer_balance', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/payment_intents/{intent}/cancel', }), capture: stripeMethod({ method: 'POST', - path: '/{intent}/capture', + fullPath: '/v1/payment_intents/{intent}/capture', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/payment_intents/{intent}/confirm', }), incrementAuthorization: stripeMethod({ method: 'POST', - path: '/{intent}/increment_authorization', + fullPath: '/v1/payment_intents/{intent}/increment_authorization', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/payment_intents/search', methodType: 'search', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/payment_intents/{intent}/verify_microdeposits', }), }); diff --git a/lib/resources/PaymentLinks.js b/lib/resources/PaymentLinks.js index b2e76d285f..86acf3cb8c 100644 --- a/lib/resources/PaymentLinks.js +++ b/lib/resources/PaymentLinks.js @@ -3,27 +3,26 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_links', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{paymentLink}/line_items', + fullPath: '/v1/payment_links/{payment_link}/line_items', methodType: 'list', }), }); diff --git a/lib/resources/PaymentMethods.js b/lib/resources/PaymentMethods.js index dff07ab37e..85fc630698 100644 --- a/lib/resources/PaymentMethods.js +++ b/lib/resources/PaymentMethods.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_methods', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_methods', methodType: 'list', }), attach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/attach', + fullPath: '/v1/payment_methods/{payment_method}/attach', }), detach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/detach', + fullPath: '/v1/payment_methods/{payment_method}/detach', }), }); diff --git a/lib/resources/Payouts.js b/lib/resources/Payouts.js index 3ba5176ffc..fd8ddde975 100644 --- a/lib/resources/Payouts.js +++ b/lib/resources/Payouts.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payouts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), update: stripeMethod({ method: 'POST', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payouts', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{payout}/cancel', + fullPath: '/v1/payouts/{payout}/cancel', }), reverse: stripeMethod({ method: 'POST', - path: '/{payout}/reverse', + fullPath: '/v1/payouts/{payout}/reverse', }), }); diff --git a/lib/resources/Plans.js b/lib/resources/Plans.js index ade0a6cab4..a39523bd8c 100644 --- a/lib/resources/Plans.js +++ b/lib/resources/Plans.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'plans', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/plans', }), retrieve: stripeMethod({ method: 'GET', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), update: stripeMethod({ method: 'POST', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/plans', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), }); diff --git a/lib/resources/Prices.js b/lib/resources/Prices.js index f48b5b9981..7406e1362f 100644 --- a/lib/resources/Prices.js +++ b/lib/resources/Prices.js @@ -3,27 +3,26 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'prices', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/prices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), update: stripeMethod({ method: 'POST', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/prices', methodType: 'list', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/prices/search', methodType: 'search', }), }); diff --git a/lib/resources/Products.js b/lib/resources/Products.js index fdb03d6a30..eba8e78d30 100644 --- a/lib/resources/Products.js +++ b/lib/resources/Products.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'products', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/products', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/products/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/products/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/products', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{id}', + fullPath: '/v1/products/{id}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/products/search', methodType: 'search', }), }); diff --git a/lib/resources/PromotionCodes.js b/lib/resources/PromotionCodes.js index 77d3ac71bd..e112795f02 100644 --- a/lib/resources/PromotionCodes.js +++ b/lib/resources/PromotionCodes.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'promotion_codes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/promotion_codes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), update: stripeMethod({ method: 'POST', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/promotion_codes', methodType: 'list', }), }); diff --git a/lib/resources/Quotes.js b/lib/resources/Quotes.js index ca6073104d..f5c97a375b 100644 --- a/lib/resources/Quotes.js +++ b/lib/resources/Quotes.js @@ -3,50 +3,49 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quotes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/quotes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), update: stripeMethod({ method: 'POST', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quotes', methodType: 'list', }), accept: stripeMethod({ method: 'POST', - path: '/{quote}/accept', + fullPath: '/v1/quotes/{quote}/accept', }), cancel: stripeMethod({ method: 'POST', - path: '/{quote}/cancel', + fullPath: '/v1/quotes/{quote}/cancel', }), finalizeQuote: stripeMethod({ method: 'POST', - path: '/{quote}/finalize', + fullPath: '/v1/quotes/{quote}/finalize', }), listComputedUpfrontLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/computed_upfront_line_items', + fullPath: '/v1/quotes/{quote}/computed_upfront_line_items', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/line_items', + fullPath: '/v1/quotes/{quote}/line_items', methodType: 'list', }), pdf: stripeMethod({ host: 'files.stripe.com', method: 'GET', - path: '/{quote}/pdf', + fullPath: '/v1/quotes/{quote}/pdf', streaming: true, }), }); diff --git a/lib/resources/Radar/EarlyFraudWarnings.js b/lib/resources/Radar/EarlyFraudWarnings.js index 3b32b7aee5..5eaf23768a 100644 --- a/lib/resources/Radar/EarlyFraudWarnings.js +++ b/lib/resources/Radar/EarlyFraudWarnings.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/early_fraud_warnings', retrieve: stripeMethod({ method: 'GET', - path: '/{earlyFraudWarning}', + fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/early_fraud_warnings', methodType: 'list', }), }); diff --git a/lib/resources/Radar/ValueListItems.js b/lib/resources/Radar/ValueListItems.js index 2555807345..4fd46fd0ac 100644 --- a/lib/resources/Radar/ValueListItems.js +++ b/lib/resources/Radar/ValueListItems.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_list_items', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_list_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_list_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), }); diff --git a/lib/resources/Radar/ValueLists.js b/lib/resources/Radar/ValueLists.js index 8f3b6f9648..e89b5500c8 100644 --- a/lib/resources/Radar/ValueLists.js +++ b/lib/resources/Radar/ValueLists.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_lists', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_lists', }), retrieve: stripeMethod({ method: 'GET', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), update: stripeMethod({ method: 'POST', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_lists', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), }); diff --git a/lib/resources/Refunds.js b/lib/resources/Refunds.js index 698646e681..87d3f6e1dc 100644 --- a/lib/resources/Refunds.js +++ b/lib/resources/Refunds.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'refunds', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/refunds', }), retrieve: stripeMethod({ method: 'GET', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), update: stripeMethod({ method: 'POST', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/refunds', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{refund}/cancel', + fullPath: '/v1/refunds/{refund}/cancel', }), }); diff --git a/lib/resources/Reporting/ReportRuns.js b/lib/resources/Reporting/ReportRuns.js index 0d0055f6da..d6e853aff0 100644 --- a/lib/resources/Reporting/ReportRuns.js +++ b/lib/resources/Reporting/ReportRuns.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_runs', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/reporting/report_runs', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reportRun}', + fullPath: '/v1/reporting/report_runs/{report_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_runs', methodType: 'list', }), }); diff --git a/lib/resources/Reporting/ReportTypes.js b/lib/resources/Reporting/ReportTypes.js index 7a1f1bb67c..58e8075460 100644 --- a/lib/resources/Reporting/ReportTypes.js +++ b/lib/resources/Reporting/ReportTypes.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_types', retrieve: stripeMethod({ method: 'GET', - path: '/{reportType}', + fullPath: '/v1/reporting/report_types/{report_type}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_types', methodType: 'list', }), }); diff --git a/lib/resources/Reviews.js b/lib/resources/Reviews.js index f4426b2703..201fbc1d64 100644 --- a/lib/resources/Reviews.js +++ b/lib/resources/Reviews.js @@ -3,18 +3,17 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', retrieve: stripeMethod({ method: 'GET', - path: '/{review}', + fullPath: '/v1/reviews/{review}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reviews', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{review}/approve', + fullPath: '/v1/reviews/{review}/approve', }), }); diff --git a/lib/resources/SKUs.js b/lib/resources/SKUs.js deleted file mode 100644 index 9347fb54e0..0000000000 --- a/lib/resources/SKUs.js +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec -'use strict'; -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; -module.exports = StripeResource.extend({ - path: 'skus', - create: stripeMethod({ - method: 'POST', - path: '', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - del: stripeMethod({ - method: 'DELETE', - path: '/{id}', - }), -}); diff --git a/lib/resources/SetupAttempts.js b/lib/resources/SetupAttempts.js index c8144bf284..36f232f4b9 100644 --- a/lib/resources/SetupAttempts.js +++ b/lib/resources/SetupAttempts.js @@ -3,10 +3,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_attempts', list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_attempts', methodType: 'list', }), }); diff --git a/lib/resources/SetupIntents.js b/lib/resources/SetupIntents.js index adbf79a340..9ce7ca7231 100644 --- a/lib/resources/SetupIntents.js +++ b/lib/resources/SetupIntents.js @@ -3,34 +3,33 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_intents', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/setup_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_intents', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/setup_intents/{intent}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/setup_intents/{intent}/confirm', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/setup_intents/{intent}/verify_microdeposits', }), }); diff --git a/lib/resources/ShippingRates.js b/lib/resources/ShippingRates.js index 859f07772d..abda3a77c0 100644 --- a/lib/resources/ShippingRates.js +++ b/lib/resources/ShippingRates.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'shipping_rates', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/shipping_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), update: stripeMethod({ method: 'POST', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/shipping_rates', methodType: 'list', }), }); diff --git a/lib/resources/Sigma/ScheduledQueryRuns.js b/lib/resources/Sigma/ScheduledQueryRuns.js index e518c11a46..4e6c7211a1 100644 --- a/lib/resources/Sigma/ScheduledQueryRuns.js +++ b/lib/resources/Sigma/ScheduledQueryRuns.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sigma/scheduled_query_runs', retrieve: stripeMethod({ method: 'GET', - path: '/{scheduledQueryRun}', + fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/sigma/scheduled_query_runs', methodType: 'list', }), }); diff --git a/lib/resources/Sources.js b/lib/resources/Sources.js index 8dc06c4df6..e26f8ad3b9 100644 --- a/lib/resources/Sources.js +++ b/lib/resources/Sources.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/sources', }), retrieve: stripeMethod({ method: 'GET', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), update: stripeMethod({ method: 'POST', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), listSourceTransactions: stripeMethod({ method: 'GET', - path: '/{source}/source_transactions', + fullPath: '/v1/sources/{source}/source_transactions', methodType: 'list', }), verify: stripeMethod({ method: 'POST', - path: '/{source}/verify', + fullPath: '/v1/sources/{source}/verify', }), }); diff --git a/lib/resources/SubscriptionItems.js b/lib/resources/SubscriptionItems.js index 8d05380657..7681fb88ac 100644 --- a/lib/resources/SubscriptionItems.js +++ b/lib/resources/SubscriptionItems.js @@ -3,35 +3,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_items', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), update: stripeMethod({ method: 'POST', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), createUsageRecord: stripeMethod({ method: 'POST', - path: '/{subscriptionItem}/usage_records', + fullPath: '/v1/subscription_items/{subscription_item}/usage_records', }), listUsageRecordSummaries: stripeMethod({ method: 'GET', - path: '/{subscriptionItem}/usage_record_summaries', + fullPath: + '/v1/subscription_items/{subscription_item}/usage_record_summaries', methodType: 'list', }), }); diff --git a/lib/resources/SubscriptionSchedules.js b/lib/resources/SubscriptionSchedules.js index 4bb9916c21..c2d3e634f3 100644 --- a/lib/resources/SubscriptionSchedules.js +++ b/lib/resources/SubscriptionSchedules.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_schedules', }), retrieve: stripeMethod({ method: 'GET', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), update: stripeMethod({ method: 'POST', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_schedules', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{schedule}/cancel', + fullPath: '/v1/subscription_schedules/{schedule}/cancel', }), release: stripeMethod({ method: 'POST', - path: '/{schedule}/release', + fullPath: '/v1/subscription_schedules/{schedule}/release', }), }); diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index 14494398b8..4790d2d0ca 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -3,39 +3,38 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscriptions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), update: stripeMethod({ method: 'POST', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscriptions', methodType: 'list', }), cancel: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), del: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}/discount', + fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/subscriptions/search', methodType: 'search', }), }); diff --git a/lib/resources/TaxCodes.js b/lib/resources/TaxCodes.js index 37c76cfb2d..d590878674 100644 --- a/lib/resources/TaxCodes.js +++ b/lib/resources/TaxCodes.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_codes', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/tax_codes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_codes', methodType: 'list', }), }); diff --git a/lib/resources/TaxRates.js b/lib/resources/TaxRates.js index 2d2242c80d..e4975933ad 100644 --- a/lib/resources/TaxRates.js +++ b/lib/resources/TaxRates.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_rates', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tax_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), update: stripeMethod({ method: 'POST', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_rates', methodType: 'list', }), }); diff --git a/lib/resources/Terminal/Configurations.js b/lib/resources/Terminal/Configurations.js index c040bbc9f7..02c8297c27 100644 --- a/lib/resources/Terminal/Configurations.js +++ b/lib/resources/Terminal/Configurations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/configurations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/configurations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), }); diff --git a/lib/resources/Terminal/ConnectionTokens.js b/lib/resources/Terminal/ConnectionTokens.js index fc16a45e17..640a6b8712 100644 --- a/lib/resources/Terminal/ConnectionTokens.js +++ b/lib/resources/Terminal/ConnectionTokens.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/connection_tokens', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/connection_tokens', }), }); diff --git a/lib/resources/Terminal/Locations.js b/lib/resources/Terminal/Locations.js index e89ac4c4d7..6b893361a6 100644 --- a/lib/resources/Terminal/Locations.js +++ b/lib/resources/Terminal/Locations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/locations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/locations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), update: stripeMethod({ method: 'POST', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/locations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), }); diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index ec5cbae9a0..879835e91c 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -3,42 +3,41 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/readers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/readers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), update: stripeMethod({ method: 'POST', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/readers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), cancelAction: stripeMethod({ method: 'POST', - path: '/{reader}/cancel_action', + fullPath: '/v1/terminal/readers/{reader}/cancel_action', }), processPaymentIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_payment_intent', + fullPath: '/v1/terminal/readers/{reader}/process_payment_intent', }), processSetupIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_setup_intent', + fullPath: '/v1/terminal/readers/{reader}/process_setup_intent', }), setReaderDisplay: stripeMethod({ method: 'POST', - path: '/{reader}/set_reader_display', + fullPath: '/v1/terminal/readers/{reader}/set_reader_display', }), }); diff --git a/lib/resources/TestHelpers/Customers.js b/lib/resources/TestHelpers/Customers.js index 418ac2b91b..98bb0b651f 100644 --- a/lib/resources/TestHelpers/Customers.js +++ b/lib/resources/TestHelpers/Customers.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/customers', fundCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/fund_cash_balance', + fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance', }), }); diff --git a/lib/resources/TestHelpers/Issuing/Cards.js b/lib/resources/TestHelpers/Issuing/Cards.js index 67d2ae6841..4e13f2245e 100644 --- a/lib/resources/TestHelpers/Issuing/Cards.js +++ b/lib/resources/TestHelpers/Issuing/Cards.js @@ -3,21 +3,20 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/issuing/cards', deliverCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/deliver', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver', }), failCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/fail', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail', }), returnCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/return', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return', }), shipCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/ship', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship', }), }); diff --git a/lib/resources/TestHelpers/Refunds.js b/lib/resources/TestHelpers/Refunds.js index 23c6e4a536..79f2f221bc 100644 --- a/lib/resources/TestHelpers/Refunds.js +++ b/lib/resources/TestHelpers/Refunds.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/refunds', expire: stripeMethod({ method: 'POST', - path: '/{refund}/expire', + fullPath: '/v1/test_helpers/refunds/{refund}/expire', }), }); diff --git a/lib/resources/TestHelpers/Terminal/Readers.js b/lib/resources/TestHelpers/Terminal/Readers.js index 9e1b961009..a828c20ccf 100644 --- a/lib/resources/TestHelpers/Terminal/Readers.js +++ b/lib/resources/TestHelpers/Terminal/Readers.js @@ -3,9 +3,9 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/terminal/readers', presentPaymentMethod: stripeMethod({ method: 'POST', - path: '/{reader}/present_payment_method', + fullPath: + '/v1/test_helpers/terminal/readers/{reader}/present_payment_method', }), }); diff --git a/lib/resources/TestHelpers/TestClocks.js b/lib/resources/TestHelpers/TestClocks.js index 23e443c940..d3686c123e 100644 --- a/lib/resources/TestHelpers/TestClocks.js +++ b/lib/resources/TestHelpers/TestClocks.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/test_clocks', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/test_clocks', }), retrieve: stripeMethod({ method: 'GET', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/test_helpers/test_clocks', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), advance: stripeMethod({ method: 'POST', - path: '/{testClock}/advance', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance', }), }); diff --git a/lib/resources/TestHelpers/Treasury/InboundTransfers.js b/lib/resources/TestHelpers/Treasury/InboundTransfers.js index a565bdb064..0143e4b71a 100644 --- a/lib/resources/TestHelpers/Treasury/InboundTransfers.js +++ b/lib/resources/TestHelpers/Treasury/InboundTransfers.js @@ -3,17 +3,16 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/inbound_transfers', fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail', }), returnInboundTransfer: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return', }), succeed: stripeMethod({ method: 'POST', - path: '/{id}/succeed', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed', }), }); diff --git a/lib/resources/TestHelpers/Treasury/OutboundPayments.js b/lib/resources/TestHelpers/Treasury/OutboundPayments.js index 3b0e9c0b28..7bed50182d 100644 --- a/lib/resources/TestHelpers/Treasury/OutboundPayments.js +++ b/lib/resources/TestHelpers/Treasury/OutboundPayments.js @@ -3,17 +3,16 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_payments', fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{id}/post', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post', }), returnOutboundPayment: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return', }), }); diff --git a/lib/resources/TestHelpers/Treasury/OutboundTransfers.js b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js index 70c4282770..f38f2a6743 100644 --- a/lib/resources/TestHelpers/Treasury/OutboundTransfers.js +++ b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js @@ -3,17 +3,19 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_transfers', fail: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/fail', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/post', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post', }), returnOutboundTransfer: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/return', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return', }), }); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedCredits.js b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js index c13b41e601..3461023f91 100644 --- a/lib/resources/TestHelpers/Treasury/ReceivedCredits.js +++ b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js @@ -3,9 +3,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_credits', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_credits', }), }); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedDebits.js b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js index 245ff75520..9d27e31246 100644 --- a/lib/resources/TestHelpers/Treasury/ReceivedDebits.js +++ b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js @@ -3,9 +3,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_debits', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_debits', }), }); diff --git a/lib/resources/Tokens.js b/lib/resources/Tokens.js index d840debbf9..aba36dc673 100644 --- a/lib/resources/Tokens.js +++ b/lib/resources/Tokens.js @@ -3,13 +3,12 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tokens', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tokens', }), retrieve: stripeMethod({ method: 'GET', - path: '/{token}', + fullPath: '/v1/tokens/{token}', }), }); diff --git a/lib/resources/Topups.js b/lib/resources/Topups.js index e894b6f6b6..98a373ce13 100644 --- a/lib/resources/Topups.js +++ b/lib/resources/Topups.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'topups', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/topups', }), retrieve: stripeMethod({ method: 'GET', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), update: stripeMethod({ method: 'POST', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/topups', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{topup}/cancel', + fullPath: '/v1/topups/{topup}/cancel', }), }); diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index c45b376bd4..f046445237 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -3,39 +3,38 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), update: stripeMethod({ method: 'POST', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/transfers', methodType: 'list', }), createReversal: stripeMethod({ method: 'POST', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', }), retrieveReversal: stripeMethod({ method: 'GET', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), updateReversal: stripeMethod({ method: 'POST', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), listReversals: stripeMethod({ method: 'GET', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/CreditReversals.js b/lib/resources/Treasury/CreditReversals.js index 58139a528d..39f5765ddc 100644 --- a/lib/resources/Treasury/CreditReversals.js +++ b/lib/resources/Treasury/CreditReversals.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/credit_reversals', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/credit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{creditReversal}', + fullPath: '/v1/treasury/credit_reversals/{credit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/credit_reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/DebitReversals.js b/lib/resources/Treasury/DebitReversals.js index 4e1e252504..e0c91bc57e 100644 --- a/lib/resources/Treasury/DebitReversals.js +++ b/lib/resources/Treasury/DebitReversals.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/debit_reversals', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/debit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{debitReversal}', + fullPath: '/v1/treasury/debit_reversals/{debit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/debit_reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/FinancialAccounts.js b/lib/resources/Treasury/FinancialAccounts.js index d52bbea9f1..370fab541e 100644 --- a/lib/resources/Treasury/FinancialAccounts.js +++ b/lib/resources/Treasury/FinancialAccounts.js @@ -3,30 +3,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/financial_accounts', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/financial_accounts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), update: stripeMethod({ method: 'POST', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/financial_accounts', methodType: 'list', }), retrieveFeatures: stripeMethod({ method: 'GET', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), updateFeatures: stripeMethod({ method: 'POST', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), }); diff --git a/lib/resources/Treasury/InboundTransfers.js b/lib/resources/Treasury/InboundTransfers.js index ecb36ecf31..ef54bf4dca 100644 --- a/lib/resources/Treasury/InboundTransfers.js +++ b/lib/resources/Treasury/InboundTransfers.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/inbound_transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/inbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/inbound_transfers/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/inbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{inboundTransfer}/cancel', + fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel', }), }); diff --git a/lib/resources/Treasury/OutboundPayments.js b/lib/resources/Treasury/OutboundPayments.js index 9e707e38ec..2bab72b957 100644 --- a/lib/resources/Treasury/OutboundPayments.js +++ b/lib/resources/Treasury/OutboundPayments.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_payments', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_payments', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/outbound_payments/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_payments', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/treasury/outbound_payments/{id}/cancel', }), }); diff --git a/lib/resources/Treasury/OutboundTransfers.js b/lib/resources/Treasury/OutboundTransfers.js index b7f024445c..749b57f884 100644 --- a/lib/resources/Treasury/OutboundTransfers.js +++ b/lib/resources/Treasury/OutboundTransfers.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{outboundTransfer}', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/cancel', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel', }), }); diff --git a/lib/resources/Treasury/ReceivedCredits.js b/lib/resources/Treasury/ReceivedCredits.js index 23abb51d70..0c32c22d7d 100644 --- a/lib/resources/Treasury/ReceivedCredits.js +++ b/lib/resources/Treasury/ReceivedCredits.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_credits', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_credits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_credits', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/ReceivedDebits.js b/lib/resources/Treasury/ReceivedDebits.js index 38e197bee3..e4448c1173 100644 --- a/lib/resources/Treasury/ReceivedDebits.js +++ b/lib/resources/Treasury/ReceivedDebits.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_debits', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_debits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_debits', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/TransactionEntries.js b/lib/resources/Treasury/TransactionEntries.js index 8b64e41a80..9500b9f8fc 100644 --- a/lib/resources/Treasury/TransactionEntries.js +++ b/lib/resources/Treasury/TransactionEntries.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transaction_entries', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transaction_entries/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transaction_entries', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/Transactions.js b/lib/resources/Treasury/Transactions.js index bcf4143114..9896e74250 100644 --- a/lib/resources/Treasury/Transactions.js +++ b/lib/resources/Treasury/Transactions.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transactions', methodType: 'list', }), }); diff --git a/lib/resources/WebhookEndpoints.js b/lib/resources/WebhookEndpoints.js index 3027842505..272a9ac078 100644 --- a/lib/resources/WebhookEndpoints.js +++ b/lib/resources/WebhookEndpoints.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'webhook_endpoints', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/webhook_endpoints', }), retrieve: stripeMethod({ method: 'GET', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), update: stripeMethod({ method: 'POST', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/webhook_endpoints', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), }); diff --git a/lib/stripe.js b/lib/stripe.js index c4341c1b82..7288061bad 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -150,7 +150,7 @@ Stripe.createSubtleCryptoProvider = (subtleCrypto) => { }; Stripe.prototype = { // Properties are set in the constructor above - _appInfo: null, + _appInfo: undefined, on: null, off: null, once: null, @@ -162,93 +162,6 @@ Stripe.prototype = { _prevRequestMetrics: null, _emitter: null, _enableTelemetry: null, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * host: 'example.com', - * port: '8080', - * protocol: 'http', - * }); - * - */ - setHost(host, port, protocol) { - emitWarning( - '`setHost` is deprecated. Use the `host` config option instead.' - ); - this._setApiField('host', host); - if (port) { - this.setPort(port); - } - if (protocol) { - this.setProtocol(protocol); - } - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * protocol: 'http', - * }); - * - */ - setProtocol(protocol) { - emitWarning( - '`setProtocol` is deprecated. Use the `protocol` config option instead.' - ); - this._setApiField('protocol', protocol.toLowerCase()); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * port: 3000, - * }); - * - */ - setPort(port) { - emitWarning( - '`setPort` is deprecated. Use the `port` config option instead.' - ); - this._setApiField('port', port); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * apiVersion: API_VERSION, - * }); - * - */ - setApiVersion(version) { - emitWarning( - '`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.' - ); - if (version) { - this._setApiField('version', version); - } - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY); - * - * Or, for Stripe Connect, use `stripeAccount` instead: - * - * const stripe = new Stripe(API_KEY, { - * stripeAccount: 'acct_...', - * }); - * - * Or, to use a different apiKey on a given request: - * - * stripe.customers.create(params, {apiKey: 'sk_test_...'}); - */ - setApiKey(key) { - emitWarning( - '`setApiKey` is deprecated. Use the `apiKey` request option instead.' - ); - this._setApiKey(key); - }, /** * @private */ @@ -257,37 +170,6 @@ Stripe.prototype = { this._setApiField('auth', `Bearer ${key}`); } }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * timeout: TIMEOUT_MS, - * }); - */ - setTimeout(timeout) { - emitWarning( - '`setTimeout` is deprecated. Use the `timeout` config or request option instead.' - ); - this._setApiField('timeout', timeout == null ? DEFAULT_TIMEOUT : timeout); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * appInfo: { - * name: 'MyPlugin', - * version: '1.4.2', - * url: 'https://myplugin.com', - * partner_id: '1234', - * }, - * }); - */ - setAppInfo(info) { - emitWarning( - '`setAppInfo` is deprecated. Use the `appInfo` config option instead.' - ); - this._setAppInfo(info); - }, /** * @private * This may be removed in the future. @@ -312,21 +194,6 @@ Stripe.prototype = { undefined ); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const ProxyAgent = require('https-proxy-agent'); - * const stripe = new Stripe(API_KEY, { - * httpAgent: new ProxyAgent(process.env.http_proxy), - * }); - * - */ - setHttpAgent(agent) { - emitWarning( - '`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.' - ); - this._setApiField('agent', agent); - }, /** * @private * This may be removed in the future. @@ -379,17 +246,6 @@ Stripe.prototype = { getMaxNetworkRetries() { return this.getApiField('maxNetworkRetries'); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * maxNetworkRetries: 2, - * }); - * - */ - setMaxNetworkRetries(maxNetworkRetries) { - this._setApiNumberField('maxNetworkRetries', maxNetworkRetries); - }, /** * @private * This may be removed in the future. @@ -478,20 +334,6 @@ Stripe.prototype = { } return formatted; }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * telemetry: false, - * }); - * - */ - setTelemetryEnabled(enableTelemetry) { - emitWarning( - '`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.' - ); - this._enableTelemetry = enableTelemetry; - }, getTelemetryEnabled() { return this._enableTelemetry; }, diff --git a/lib/utils.js b/lib/utils.js index 5031266832..d803d84932 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -23,25 +23,12 @@ const OPTIONS_KEYS = [ 'timeout', 'host', ]; -const DEPRECATED_OPTIONS = { - api_key: 'apiKey', - idempotency_key: 'idempotencyKey', - stripe_account: 'stripeAccount', - stripe_version: 'apiVersion', - stripeVersion: 'apiVersion', -}; -const DEPRECATED_OPTIONS_KEYS = Object.keys(DEPRECATED_OPTIONS); const utils = { isOptionsHash(o) { return ( o && typeof o === 'object' && - (OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - ) || - DEPRECATED_OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - )) + OPTIONS_KEYS.some((prop) => Object.prototype.hasOwnProperty.call(o, prop)) ); }, /** @@ -143,27 +130,9 @@ const utils = { (key) => !OPTIONS_KEYS.includes(key) ); if (extraKeys.length) { - const nonDeprecated = extraKeys.filter((key) => { - if (!DEPRECATED_OPTIONS[key]) { - return true; - } - const newParam = DEPRECATED_OPTIONS[key]; - if (params[newParam]) { - throw Error( - `Both '${newParam}' and '${key}' were provided; please remove '${key}', which is deprecated.` - ); - } - /** - * TODO turn this into a hard error in a future major version (once we have fixed our docs). - */ - emitWarning(`'${key}' is deprecated; use '${newParam}' instead.`); - params[newParam] = params[key]; - }); - if (nonDeprecated.length) { - emitWarning( - `Invalid options found (${extraKeys.join(', ')}); ignoring.` - ); - } + emitWarning( + `Invalid options found (${extraKeys.join(', ')}); ignoring.` + ); } if (params.apiKey) { opts.auth = params.apiKey; diff --git a/package.json b/package.json index ec9d30a6a0..e7c6cb83c5 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,10 @@ }, "bugs": "https://github.com/stripe/stripe-node/issues", "engines": { - "node": "^8.1 || >=10.*" + "node": ">=12.*" }, "main": "lib/stripe.js", - "types": "types/2022-08-01/index.d.ts", + "types": "types/2022-11-15/index.d.ts", "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", diff --git a/src/Error.ts b/src/Error.ts index b5489fe001..98c27ec02e 100644 --- a/src/Error.ts +++ b/src/Error.ts @@ -127,7 +127,16 @@ class StripeConnectionError extends StripeError {} * SignatureVerificationError is raised when the signature verification for a * webhook fails */ -class StripeSignatureVerificationError extends StripeError {} +class StripeSignatureVerificationError extends StripeError { + header: string; + payload: string; + + constructor(header: string, payload: string, raw: StripeRawError = {}) { + super(raw); + this.header = header; + this.payload = payload; + } +} /** * IdempotencyError is raised in cases where an idempotency key was used diff --git a/src/StripeMethod.basic.js b/src/StripeMethod.basic.js deleted file mode 100644 index b9be5302e4..0000000000 --- a/src/StripeMethod.basic.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const stripeMethod = require('./StripeMethod'); - -// DEPRECATED: These were kept for backwards compatibility in case users were -// using this, but basic methods are now explicitly defined on a resource. -module.exports = { - create: stripeMethod({ - method: 'POST', - }), - - list: stripeMethod({ - method: 'GET', - methodType: 'list', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '{id}', - }), - - // Avoid 'delete' keyword in JS - del: stripeMethod({ - method: 'DELETE', - path: '{id}', - }), -}; diff --git a/src/StripeResource.ts b/src/StripeResource.ts index b273a9ae77..b99cbfd0a8 100644 --- a/src/StripeResource.ts +++ b/src/StripeResource.ts @@ -15,9 +15,8 @@ const {HttpClient} = require('./net/HttpClient'); // Provide extension mechanism for Stripe Resource Sub-Classes StripeResource.extend = utils.protoExtend; -// Expose method-creator & prepared (basic) methods +// Expose method-creator StripeResource.method = require('./StripeMethod'); -StripeResource.BASIC_METHODS = require('./StripeMethod.basic'); StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100; const MAX_RETRY_AFTER_WAIT = 60; @@ -45,14 +44,7 @@ function StripeResource( this.resourcePath = this.path; // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); - // DEPRECATED: This was kept for backwards compatibility in case users were - // using this, but basic methods are now explicitly defined on a resource. - if (this.includeBasic) { - this.includeBasic.forEach(function(methodName) { - // @ts-ignore - this[methodName] = StripeResource.BASIC_METHODS[methodName]; - }, this); - } + this.initialize(...arguments); } @@ -119,9 +111,6 @@ StripeResource.prototype = { return parts.join('/').replace(/\/{2,}/g, '/'); }, - // DEPRECATED: Here for backcompat in case users relied on this. - wrapTimeout: utils.callbackifyPromiseWithTimeout, - _addHeadersDirectlyToObject(obj: any, headers: RequestHeaders): void { // For convenience, make some headers easily accessible on // lastResponse. diff --git a/src/Types.d.ts b/src/Types.d.ts index b1cc7e9e59..037ad8d207 100644 --- a/src/Types.d.ts +++ b/src/Types.d.ts @@ -112,8 +112,6 @@ type StripeObject = { callback: (userAgent: string) => void ) => void; getUname: (callback: (uname: string) => void) => void; - setProtocol: (protocol: string) => void; - setPort: (port: number) => void; getClientUserAgent: (callback: (clientUserAgent: string) => void) => void; getTelemetryEnabled: () => boolean; getAppInfoAsString: () => string; diff --git a/src/Webhooks.ts b/src/Webhooks.ts index 955da33bb6..bbbccbe656 100644 --- a/src/Webhooks.ts +++ b/src/Webhooks.ts @@ -239,24 +239,14 @@ function parseEventDetails( const details = parseHeader(decodedHeader, expectedScheme); if (!details || details.timestamp === -1) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'Unable to extract timestamp and signatures from header', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } if (!details.signatures.length) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'No signatures found with expected scheme', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } @@ -280,29 +270,21 @@ function validateComputedSignature( ).length; if (!signatureFound) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } const timestampAge = Math.floor(Date.now() / 1000) - details.timestamp; if (tolerance > 0 && timestampAge > tolerance) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'Timestamp outside the tolerance zone', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } diff --git a/src/apiVersion.js b/src/apiVersion.js index 704a3619eb..f164407310 100644 --- a/src/apiVersion.js +++ b/src/apiVersion.js @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2022-08-01'}; +module.exports = {ApiVersion: '2022-11-15'}; diff --git a/src/resources.js b/src/resources.js index 825c8f1d9d..5e36ae42d3 100644 --- a/src/resources.js +++ b/src/resources.js @@ -28,7 +28,6 @@ module.exports = { InvoiceItems: require('./resources/InvoiceItems'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), - Orders: require('./resources/Orders'), PaymentIntents: require('./resources/PaymentIntents'), PaymentLinks: require('./resources/PaymentLinks'), PaymentMethods: require('./resources/PaymentMethods'), @@ -43,7 +42,6 @@ module.exports = { SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), diff --git a/src/resources/AccountLinks.js b/src/resources/AccountLinks.js index 41e02b1ec5..713304f703 100644 --- a/src/resources/AccountLinks.js +++ b/src/resources/AccountLinks.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_links', }), }); diff --git a/src/resources/Accounts.js b/src/resources/Accounts.js index 351c055f23..9956629e30 100644 --- a/src/resources/Accounts.js +++ b/src/resources/Accounts.js @@ -7,11 +7,9 @@ const stripeMethod = StripeResource.method; // Since path can either be `account` or `accounts`, support both through stripeMethod path; module.exports = StripeResource.extend({ - path: '', - create: stripeMethod({ method: 'POST', - path: 'accounts', + fullPath: '/v1/accounts', }), retrieve(id) { @@ -20,7 +18,7 @@ module.exports = StripeResource.extend({ if (typeof id === 'string') { return stripeMethod({ method: 'GET', - path: 'accounts/{id}', + fullPath: '/v1/accounts/{id}', }).apply(this, arguments); } else { if (id === null || id === undefined) { @@ -29,102 +27,102 @@ module.exports = StripeResource.extend({ } return stripeMethod({ method: 'GET', - path: 'account', + fullPath: '/v1/account', }).apply(this, arguments); } }, update: stripeMethod({ method: 'POST', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: 'accounts', + fullPath: '/v1/accounts', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), reject: stripeMethod({ method: 'POST', - path: 'accounts/{account}/reject', + fullPath: '/v1/accounts/{account}/reject', }), retrieveCapability: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), updateCapability: stripeMethod({ method: 'POST', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), listCapabilities: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities', + fullPath: '/v1/accounts/{account}/capabilities', methodType: 'list', }), createExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', }), retrieveExternalAccount: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), updateExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), listExternalAccounts: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', methodType: 'list', }), deleteExternalAccount: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), createLoginLink: stripeMethod({ method: 'POST', - path: 'accounts/{account}/login_links', + fullPath: '/v1/accounts/{account}/login_links', }), createPerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', }), retrievePerson: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), updatePerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), listPersons: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', methodType: 'list', }), deletePerson: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), }); diff --git a/src/resources/ApplePayDomains.js b/src/resources/ApplePayDomains.js index 76a8c59585..363e375f2e 100644 --- a/src/resources/ApplePayDomains.js +++ b/src/resources/ApplePayDomains.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apple_pay/domains', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apple_pay/domains', }), retrieve: stripeMethod({ method: 'GET', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apple_pay/domains', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), }); diff --git a/src/resources/ApplicationFees.js b/src/resources/ApplicationFees.js index ebd6372aca..21affd640b 100644 --- a/src/resources/ApplicationFees.js +++ b/src/resources/ApplicationFees.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/application_fees/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/application_fees', methodType: 'list', }), createRefund: stripeMethod({ method: 'POST', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', }), retrieveRefund: stripeMethod({ method: 'GET', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), updateRefund: stripeMethod({ method: 'POST', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), listRefunds: stripeMethod({ method: 'GET', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', methodType: 'list', }), }); diff --git a/src/resources/Apps/Secrets.js b/src/resources/Apps/Secrets.js index 238037508f..7003cb2a43 100644 --- a/src/resources/Apps/Secrets.js +++ b/src/resources/Apps/Secrets.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apps/secrets', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apps/secrets', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apps/secrets', methodType: 'list', }), deleteWhere: stripeMethod({ method: 'POST', - path: '/delete', + fullPath: '/v1/apps/secrets/delete', }), find: stripeMethod({ method: 'GET', - path: '/find', + fullPath: '/v1/apps/secrets/find', }), }); diff --git a/src/resources/Balance.js b/src/resources/Balance.js index ac7a9ae459..8cb2c44bd7 100644 --- a/src/resources/Balance.js +++ b/src/resources/Balance.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', - retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance', }), }); diff --git a/src/resources/BalanceTransactions.js b/src/resources/BalanceTransactions.js index adbe3d41f9..4e0c9d0e88 100644 --- a/src/resources/BalanceTransactions.js +++ b/src/resources/BalanceTransactions.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance_transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/balance_transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance_transactions', methodType: 'list', }), }); diff --git a/src/resources/BillingPortal/Configurations.js b/src/resources/BillingPortal/Configurations.js index ff3200160a..cda7d157ff 100644 --- a/src/resources/BillingPortal/Configurations.js +++ b/src/resources/BillingPortal/Configurations.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/configurations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/billing_portal/configurations', methodType: 'list', }), }); diff --git a/src/resources/BillingPortal/Sessions.js b/src/resources/BillingPortal/Sessions.js index 04f0ef6805..b2dbd1c963 100644 --- a/src/resources/BillingPortal/Sessions.js +++ b/src/resources/BillingPortal/Sessions.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/sessions', }), }); diff --git a/src/resources/Charges.js b/src/resources/Charges.js index f4546063f7..87b18dc1ac 100644 --- a/src/resources/Charges.js +++ b/src/resources/Charges.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/charges', }), retrieve: stripeMethod({ method: 'GET', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), update: stripeMethod({ method: 'POST', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/charges', methodType: 'list', }), capture: stripeMethod({ method: 'POST', - path: '/{charge}/capture', + fullPath: '/v1/charges/{charge}/capture', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/charges/search', methodType: 'search', }), }); diff --git a/src/resources/Checkout/Sessions.js b/src/resources/Checkout/Sessions.js index 1cef4d65d7..cf9bfb2489 100644 --- a/src/resources/Checkout/Sessions.js +++ b/src/resources/Checkout/Sessions.js @@ -6,32 +6,30 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'checkout/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/checkout/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/checkout/sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/checkout/sessions', methodType: 'list', }), expire: stripeMethod({ method: 'POST', - path: '/{session}/expire', + fullPath: '/v1/checkout/sessions/{session}/expire', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{session}/line_items', + fullPath: '/v1/checkout/sessions/{session}/line_items', methodType: 'list', }), }); diff --git a/src/resources/CountrySpecs.js b/src/resources/CountrySpecs.js index 789f99054a..f21b9ab490 100644 --- a/src/resources/CountrySpecs.js +++ b/src/resources/CountrySpecs.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'country_specs', - retrieve: stripeMethod({ method: 'GET', - path: '/{country}', + fullPath: '/v1/country_specs/{country}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/country_specs', methodType: 'list', }), }); diff --git a/src/resources/Coupons.js b/src/resources/Coupons.js index 11bed027fe..3b62c60ece 100644 --- a/src/resources/Coupons.js +++ b/src/resources/Coupons.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'coupons', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/coupons', }), retrieve: stripeMethod({ method: 'GET', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), update: stripeMethod({ method: 'POST', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/coupons', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), }); diff --git a/src/resources/CreditNotes.js b/src/resources/CreditNotes.js index e435282d00..eda7d9e29d 100644 --- a/src/resources/CreditNotes.js +++ b/src/resources/CreditNotes.js @@ -6,48 +6,46 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/credit_notes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/credit_notes', methodType: 'list', }), listPreviewLineItems: stripeMethod({ method: 'GET', - path: '/preview/lines', + fullPath: '/v1/credit_notes/preview/lines', methodType: 'list', }), preview: stripeMethod({ method: 'GET', - path: '/preview', + fullPath: '/v1/credit_notes/preview', }), voidCreditNote: stripeMethod({ method: 'POST', - path: '/{id}/void', + fullPath: '/v1/credit_notes/{id}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{creditNote}/lines', + fullPath: '/v1/credit_notes/{credit_note}/lines', methodType: 'list', }), }); diff --git a/src/resources/Customers.js b/src/resources/Customers.js index e3b8e8fab8..234e5573ba 100644 --- a/src/resources/Customers.js +++ b/src/resources/Customers.js @@ -6,152 +6,151 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/customers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), update: stripeMethod({ method: 'POST', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/customers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), createFundingInstructions: stripeMethod({ method: 'POST', - path: '/{customer}/funding_instructions', + fullPath: '/v1/customers/{customer}/funding_instructions', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{customer}/discount', + fullPath: '/v1/customers/{customer}/discount', }), listPaymentMethods: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods', + fullPath: '/v1/customers/{customer}/payment_methods', methodType: 'list', }), retrievePaymentMethod: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods/{paymentMethod}', + fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/customers/search', methodType: 'search', }), retrieveCashBalance: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), updateCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), createBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', }), retrieveBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), updateBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), listBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', methodType: 'list', }), retrieveCashBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions/{transaction}', + fullPath: + '/v1/customers/{customer}/cash_balance_transactions/{transaction}', }), listCashBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions', + fullPath: '/v1/customers/{customer}/cash_balance_transactions', methodType: 'list', }), createSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', }), retrieveSource: stripeMethod({ method: 'GET', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), updateSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), listSources: stripeMethod({ method: 'GET', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', methodType: 'list', }), deleteSource: stripeMethod({ method: 'DELETE', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), verifySource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}/verify', + fullPath: '/v1/customers/{customer}/sources/{id}/verify', }), createTaxId: stripeMethod({ method: 'POST', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', }), retrieveTaxId: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), listTaxIds: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', methodType: 'list', }), deleteTaxId: stripeMethod({ method: 'DELETE', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), }); diff --git a/src/resources/Disputes.js b/src/resources/Disputes.js index 1318758949..d40c7a8fd8 100644 --- a/src/resources/Disputes.js +++ b/src/resources/Disputes.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', - retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/disputes', methodType: 'list', }), close: stripeMethod({ method: 'POST', - path: '/{dispute}/close', + fullPath: '/v1/disputes/{dispute}/close', }), }); diff --git a/src/resources/EphemeralKeys.js b/src/resources/EphemeralKeys.js index 2f9b02694c..45c632b744 100644 --- a/src/resources/EphemeralKeys.js +++ b/src/resources/EphemeralKeys.js @@ -6,11 +6,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'ephemeral_keys', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/ephemeral_keys', validator: (data, options) => { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( @@ -22,6 +20,6 @@ module.exports = StripeResource.extend({ del: stripeMethod({ method: 'DELETE', - path: '/{key}', + fullPath: '/v1/ephemeral_keys/{key}', }), }); diff --git a/src/resources/Events.js b/src/resources/Events.js index 79ee31d45a..cb0b5ee931 100644 --- a/src/resources/Events.js +++ b/src/resources/Events.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'events', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/events/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/events', methodType: 'list', }), }); diff --git a/src/resources/ExchangeRates.js b/src/resources/ExchangeRates.js index 021e972336..bd6aec6ba9 100644 --- a/src/resources/ExchangeRates.js +++ b/src/resources/ExchangeRates.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'exchange_rates', - retrieve: stripeMethod({ method: 'GET', - path: '/{rateId}', + fullPath: '/v1/exchange_rates/{rate_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/exchange_rates', methodType: 'list', }), }); diff --git a/src/resources/FileLinks.js b/src/resources/FileLinks.js index 7c7a6e117d..0cc3afe7c7 100644 --- a/src/resources/FileLinks.js +++ b/src/resources/FileLinks.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'file_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/file_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), update: stripeMethod({ method: 'POST', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/file_links', methodType: 'list', }), }); diff --git a/src/resources/Files.js b/src/resources/Files.js index 5dee82d1d2..fbe9ce87b5 100644 --- a/src/resources/Files.js +++ b/src/resources/Files.js @@ -7,10 +7,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'files', - create: stripeMethod({ method: 'POST', + fullPath: '/v1/files', headers: { 'Content-Type': 'multipart/form-data', }, @@ -19,12 +18,12 @@ module.exports = StripeResource.extend({ retrieve: stripeMethod({ method: 'GET', - path: '/{file}', + fullPath: '/v1/files/{file}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/files', methodType: 'list', }), diff --git a/src/resources/FinancialConnections/Accounts.js b/src/resources/FinancialConnections/Accounts.js index 674f42ec48..e795b2283a 100644 --- a/src/resources/FinancialConnections/Accounts.js +++ b/src/resources/FinancialConnections/Accounts.js @@ -6,32 +6,30 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/accounts', - retrieve: stripeMethod({ method: 'GET', - path: '/{account}', + fullPath: '/v1/financial_connections/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/financial_connections/accounts', methodType: 'list', }), disconnect: stripeMethod({ method: 'POST', - path: '/{account}/disconnect', + fullPath: '/v1/financial_connections/accounts/{account}/disconnect', }), listOwners: stripeMethod({ method: 'GET', - path: '/{account}/owners', + fullPath: '/v1/financial_connections/accounts/{account}/owners', methodType: 'list', }), refresh: stripeMethod({ method: 'POST', - path: '/{account}/refresh', + fullPath: '/v1/financial_connections/accounts/{account}/refresh', }), }); diff --git a/src/resources/FinancialConnections/Sessions.js b/src/resources/FinancialConnections/Sessions.js index 0e968a437b..077390c48d 100644 --- a/src/resources/FinancialConnections/Sessions.js +++ b/src/resources/FinancialConnections/Sessions.js @@ -6,15 +6,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/financial_connections/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/financial_connections/sessions/{session}', }), }); diff --git a/src/resources/Identity/VerificationReports.js b/src/resources/Identity/VerificationReports.js index 6d78faa7a0..6c8734c889 100644 --- a/src/resources/Identity/VerificationReports.js +++ b/src/resources/Identity/VerificationReports.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_reports', - retrieve: stripeMethod({ method: 'GET', - path: '/{report}', + fullPath: '/v1/identity/verification_reports/{report}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_reports', methodType: 'list', }), }); diff --git a/src/resources/Identity/VerificationSessions.js b/src/resources/Identity/VerificationSessions.js index 02345e1210..47f442ba02 100644 --- a/src/resources/Identity/VerificationSessions.js +++ b/src/resources/Identity/VerificationSessions.js @@ -6,36 +6,34 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/identity/verification_sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), update: stripeMethod({ method: 'POST', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_sessions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{session}/cancel', + fullPath: '/v1/identity/verification_sessions/{session}/cancel', }), redact: stripeMethod({ method: 'POST', - path: '/{session}/redact', + fullPath: '/v1/identity/verification_sessions/{session}/redact', }), }); diff --git a/src/resources/InvoiceItems.js b/src/resources/InvoiceItems.js index c7cb5586be..715c07e8a3 100644 --- a/src/resources/InvoiceItems.js +++ b/src/resources/InvoiceItems.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoiceitems', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoiceitems', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), update: stripeMethod({ method: 'POST', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoiceitems', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), }); diff --git a/src/resources/Invoices.js b/src/resources/Invoices.js index 21543c1f3a..4e1866f0ac 100644 --- a/src/resources/Invoices.js +++ b/src/resources/Invoices.js @@ -6,79 +6,77 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoices', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), update: stripeMethod({ method: 'POST', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoices', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), finalizeInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/finalize', + fullPath: '/v1/invoices/{invoice}/finalize', }), listUpcomingLines: stripeMethod({ method: 'GET', - path: '/upcoming/lines', + fullPath: '/v1/invoices/upcoming/lines', methodType: 'list', }), markUncollectible: stripeMethod({ method: 'POST', - path: '/{invoice}/mark_uncollectible', + fullPath: '/v1/invoices/{invoice}/mark_uncollectible', }), pay: stripeMethod({ method: 'POST', - path: '/{invoice}/pay', + fullPath: '/v1/invoices/{invoice}/pay', }), retrieveUpcoming: stripeMethod({ method: 'GET', - path: '/upcoming', + fullPath: '/v1/invoices/upcoming', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/invoices/search', methodType: 'search', }), sendInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/send', + fullPath: '/v1/invoices/{invoice}/send', }), voidInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/void', + fullPath: '/v1/invoices/{invoice}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{invoice}/lines', + fullPath: '/v1/invoices/{invoice}/lines', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Authorizations.js b/src/resources/Issuing/Authorizations.js index 5310d0ea8b..78afe9a49d 100644 --- a/src/resources/Issuing/Authorizations.js +++ b/src/resources/Issuing/Authorizations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/authorizations', - retrieve: stripeMethod({ method: 'GET', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), update: stripeMethod({ method: 'POST', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/authorizations', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{authorization}/approve', + fullPath: '/v1/issuing/authorizations/{authorization}/approve', }), decline: stripeMethod({ method: 'POST', - path: '/{authorization}/decline', + fullPath: '/v1/issuing/authorizations/{authorization}/decline', }), }); diff --git a/src/resources/Issuing/Cardholders.js b/src/resources/Issuing/Cardholders.js index 7b340e6912..bb00cde297 100644 --- a/src/resources/Issuing/Cardholders.js +++ b/src/resources/Issuing/Cardholders.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cardholders', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cardholders', }), retrieve: stripeMethod({ method: 'GET', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), update: stripeMethod({ method: 'POST', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cardholders', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Cards.js b/src/resources/Issuing/Cards.js index efc2cbc10f..f197403f1b 100644 --- a/src/resources/Issuing/Cards.js +++ b/src/resources/Issuing/Cards.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cards', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), update: stripeMethod({ method: 'POST', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cards', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Disputes.js b/src/resources/Issuing/Disputes.js index f62a2be96d..67eab915d3 100644 --- a/src/resources/Issuing/Disputes.js +++ b/src/resources/Issuing/Disputes.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/disputes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/disputes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/disputes', methodType: 'list', }), submit: stripeMethod({ method: 'POST', - path: '/{dispute}/submit', + fullPath: '/v1/issuing/disputes/{dispute}/submit', }), }); diff --git a/src/resources/Issuing/Transactions.js b/src/resources/Issuing/Transactions.js index 22b438429d..eee0eb821a 100644 --- a/src/resources/Issuing/Transactions.js +++ b/src/resources/Issuing/Transactions.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), update: stripeMethod({ method: 'POST', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/transactions', methodType: 'list', }), }); diff --git a/src/resources/Mandates.js b/src/resources/Mandates.js index 6d9ced9f82..678e732d31 100644 --- a/src/resources/Mandates.js +++ b/src/resources/Mandates.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'mandates', - retrieve: stripeMethod({ method: 'GET', - path: '/{mandate}', + fullPath: '/v1/mandates/{mandate}', }), }); diff --git a/src/resources/Orders.js b/src/resources/Orders.js deleted file mode 100644 index a216b32fc7..0000000000 --- a/src/resources/Orders.js +++ /dev/null @@ -1,52 +0,0 @@ -// File generated from our OpenAPI spec - -'use strict'; - -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; - -module.exports = StripeResource.extend({ - path: 'orders', - - create: stripeMethod({ - method: 'POST', - path: '', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - - cancel: stripeMethod({ - method: 'POST', - path: '/{id}/cancel', - }), - - listLineItems: stripeMethod({ - method: 'GET', - path: '/{id}/line_items', - methodType: 'list', - }), - - reopen: stripeMethod({ - method: 'POST', - path: '/{id}/reopen', - }), - - submit: stripeMethod({ - method: 'POST', - path: '/{id}/submit', - }), -}); diff --git a/src/resources/PaymentIntents.js b/src/resources/PaymentIntents.js index d6addba0d3..a90d20f2ec 100644 --- a/src/resources/PaymentIntents.js +++ b/src/resources/PaymentIntents.js @@ -6,62 +6,60 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_intents', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_intents', methodType: 'list', }), applyCustomerBalance: stripeMethod({ method: 'POST', - path: '/{intent}/apply_customer_balance', + fullPath: '/v1/payment_intents/{intent}/apply_customer_balance', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/payment_intents/{intent}/cancel', }), capture: stripeMethod({ method: 'POST', - path: '/{intent}/capture', + fullPath: '/v1/payment_intents/{intent}/capture', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/payment_intents/{intent}/confirm', }), incrementAuthorization: stripeMethod({ method: 'POST', - path: '/{intent}/increment_authorization', + fullPath: '/v1/payment_intents/{intent}/increment_authorization', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/payment_intents/search', methodType: 'search', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/payment_intents/{intent}/verify_microdeposits', }), }); diff --git a/src/resources/PaymentLinks.js b/src/resources/PaymentLinks.js index a357cedd89..2eb101ca69 100644 --- a/src/resources/PaymentLinks.js +++ b/src/resources/PaymentLinks.js @@ -6,32 +6,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_links', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{paymentLink}/line_items', + fullPath: '/v1/payment_links/{payment_link}/line_items', methodType: 'list', }), }); diff --git a/src/resources/PaymentMethods.js b/src/resources/PaymentMethods.js index bd74b2ee5f..682d1bae3b 100644 --- a/src/resources/PaymentMethods.js +++ b/src/resources/PaymentMethods.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_methods', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_methods', methodType: 'list', }), attach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/attach', + fullPath: '/v1/payment_methods/{payment_method}/attach', }), detach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/detach', + fullPath: '/v1/payment_methods/{payment_method}/detach', }), }); diff --git a/src/resources/Payouts.js b/src/resources/Payouts.js index a3b8e0cd66..0fa971792f 100644 --- a/src/resources/Payouts.js +++ b/src/resources/Payouts.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payouts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), update: stripeMethod({ method: 'POST', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payouts', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{payout}/cancel', + fullPath: '/v1/payouts/{payout}/cancel', }), reverse: stripeMethod({ method: 'POST', - path: '/{payout}/reverse', + fullPath: '/v1/payouts/{payout}/reverse', }), }); diff --git a/src/resources/Plans.js b/src/resources/Plans.js index bd55a157da..c9032c1ab1 100644 --- a/src/resources/Plans.js +++ b/src/resources/Plans.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'plans', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/plans', }), retrieve: stripeMethod({ method: 'GET', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), update: stripeMethod({ method: 'POST', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/plans', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), }); diff --git a/src/resources/Prices.js b/src/resources/Prices.js index c509fdcbc0..e290429ecb 100644 --- a/src/resources/Prices.js +++ b/src/resources/Prices.js @@ -6,32 +6,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'prices', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/prices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), update: stripeMethod({ method: 'POST', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/prices', methodType: 'list', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/prices/search', methodType: 'search', }), }); diff --git a/src/resources/Products.js b/src/resources/Products.js index 3886020cf8..5a995c89f1 100644 --- a/src/resources/Products.js +++ b/src/resources/Products.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'products', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/products', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/products/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/products/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/products', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{id}', + fullPath: '/v1/products/{id}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/products/search', methodType: 'search', }), }); diff --git a/src/resources/PromotionCodes.js b/src/resources/PromotionCodes.js index c8afa0e478..be942e9999 100644 --- a/src/resources/PromotionCodes.js +++ b/src/resources/PromotionCodes.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'promotion_codes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/promotion_codes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), update: stripeMethod({ method: 'POST', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/promotion_codes', methodType: 'list', }), }); diff --git a/src/resources/Quotes.js b/src/resources/Quotes.js index 62aebb65a9..0631c6f116 100644 --- a/src/resources/Quotes.js +++ b/src/resources/Quotes.js @@ -6,60 +6,58 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quotes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/quotes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), update: stripeMethod({ method: 'POST', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quotes', methodType: 'list', }), accept: stripeMethod({ method: 'POST', - path: '/{quote}/accept', + fullPath: '/v1/quotes/{quote}/accept', }), cancel: stripeMethod({ method: 'POST', - path: '/{quote}/cancel', + fullPath: '/v1/quotes/{quote}/cancel', }), finalizeQuote: stripeMethod({ method: 'POST', - path: '/{quote}/finalize', + fullPath: '/v1/quotes/{quote}/finalize', }), listComputedUpfrontLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/computed_upfront_line_items', + fullPath: '/v1/quotes/{quote}/computed_upfront_line_items', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/line_items', + fullPath: '/v1/quotes/{quote}/line_items', methodType: 'list', }), pdf: stripeMethod({ host: 'files.stripe.com', method: 'GET', - path: '/{quote}/pdf', + fullPath: '/v1/quotes/{quote}/pdf', streaming: true, }), }); diff --git a/src/resources/Radar/EarlyFraudWarnings.js b/src/resources/Radar/EarlyFraudWarnings.js index 9282648d86..4e38d1c655 100644 --- a/src/resources/Radar/EarlyFraudWarnings.js +++ b/src/resources/Radar/EarlyFraudWarnings.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/early_fraud_warnings', - retrieve: stripeMethod({ method: 'GET', - path: '/{earlyFraudWarning}', + fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/early_fraud_warnings', methodType: 'list', }), }); diff --git a/src/resources/Radar/ValueListItems.js b/src/resources/Radar/ValueListItems.js index 75bcb8947c..df0b8c9800 100644 --- a/src/resources/Radar/ValueListItems.js +++ b/src/resources/Radar/ValueListItems.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_list_items', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_list_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_list_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), }); diff --git a/src/resources/Radar/ValueLists.js b/src/resources/Radar/ValueLists.js index ace1edaa2d..68025810e3 100644 --- a/src/resources/Radar/ValueLists.js +++ b/src/resources/Radar/ValueLists.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_lists', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_lists', }), retrieve: stripeMethod({ method: 'GET', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), update: stripeMethod({ method: 'POST', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_lists', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), }); diff --git a/src/resources/Refunds.js b/src/resources/Refunds.js index c859fc577c..380688d9b0 100644 --- a/src/resources/Refunds.js +++ b/src/resources/Refunds.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'refunds', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/refunds', }), retrieve: stripeMethod({ method: 'GET', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), update: stripeMethod({ method: 'POST', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/refunds', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{refund}/cancel', + fullPath: '/v1/refunds/{refund}/cancel', }), }); diff --git a/src/resources/Reporting/ReportRuns.js b/src/resources/Reporting/ReportRuns.js index 84eb179f90..c3ecf96c83 100644 --- a/src/resources/Reporting/ReportRuns.js +++ b/src/resources/Reporting/ReportRuns.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_runs', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/reporting/report_runs', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reportRun}', + fullPath: '/v1/reporting/report_runs/{report_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_runs', methodType: 'list', }), }); diff --git a/src/resources/Reporting/ReportTypes.js b/src/resources/Reporting/ReportTypes.js index b4b25f8043..48e08548d9 100644 --- a/src/resources/Reporting/ReportTypes.js +++ b/src/resources/Reporting/ReportTypes.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_types', - retrieve: stripeMethod({ method: 'GET', - path: '/{reportType}', + fullPath: '/v1/reporting/report_types/{report_type}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_types', methodType: 'list', }), }); diff --git a/src/resources/Reviews.js b/src/resources/Reviews.js index 9400e8b89a..f9b515b464 100644 --- a/src/resources/Reviews.js +++ b/src/resources/Reviews.js @@ -6,21 +6,19 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', - retrieve: stripeMethod({ method: 'GET', - path: '/{review}', + fullPath: '/v1/reviews/{review}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reviews', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{review}/approve', + fullPath: '/v1/reviews/{review}/approve', }), }); diff --git a/src/resources/SKUs.js b/src/resources/SKUs.js deleted file mode 100644 index 26812405ff..0000000000 --- a/src/resources/SKUs.js +++ /dev/null @@ -1,36 +0,0 @@ -// File generated from our OpenAPI spec - -'use strict'; - -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; - -module.exports = StripeResource.extend({ - path: 'skus', - - create: stripeMethod({ - method: 'POST', - path: '', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - - del: stripeMethod({ - method: 'DELETE', - path: '/{id}', - }), -}); diff --git a/src/resources/SetupAttempts.js b/src/resources/SetupAttempts.js index 9bb8c1d3e3..7076944edf 100644 --- a/src/resources/SetupAttempts.js +++ b/src/resources/SetupAttempts.js @@ -6,11 +6,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_attempts', - list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_attempts', methodType: 'list', }), }); diff --git a/src/resources/SetupIntents.js b/src/resources/SetupIntents.js index 7aea8dcf75..507c8c9b13 100644 --- a/src/resources/SetupIntents.js +++ b/src/resources/SetupIntents.js @@ -6,41 +6,39 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_intents', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/setup_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_intents', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/setup_intents/{intent}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/setup_intents/{intent}/confirm', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/setup_intents/{intent}/verify_microdeposits', }), }); diff --git a/src/resources/ShippingRates.js b/src/resources/ShippingRates.js index d7eb52ac16..a24e83468d 100644 --- a/src/resources/ShippingRates.js +++ b/src/resources/ShippingRates.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'shipping_rates', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/shipping_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), update: stripeMethod({ method: 'POST', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/shipping_rates', methodType: 'list', }), }); diff --git a/src/resources/Sigma/ScheduledQueryRuns.js b/src/resources/Sigma/ScheduledQueryRuns.js index a8cb8e60a6..0396103a9b 100644 --- a/src/resources/Sigma/ScheduledQueryRuns.js +++ b/src/resources/Sigma/ScheduledQueryRuns.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sigma/scheduled_query_runs', - retrieve: stripeMethod({ method: 'GET', - path: '/{scheduledQueryRun}', + fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/sigma/scheduled_query_runs', methodType: 'list', }), }); diff --git a/src/resources/Sources.js b/src/resources/Sources.js index 5008001c5c..258245ce2a 100644 --- a/src/resources/Sources.js +++ b/src/resources/Sources.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/sources', }), retrieve: stripeMethod({ method: 'GET', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), update: stripeMethod({ method: 'POST', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), listSourceTransactions: stripeMethod({ method: 'GET', - path: '/{source}/source_transactions', + fullPath: '/v1/sources/{source}/source_transactions', methodType: 'list', }), verify: stripeMethod({ method: 'POST', - path: '/{source}/verify', + fullPath: '/v1/sources/{source}/verify', }), }); diff --git a/src/resources/SubscriptionItems.js b/src/resources/SubscriptionItems.js index 62423a22cb..a58a6e45cb 100644 --- a/src/resources/SubscriptionItems.js +++ b/src/resources/SubscriptionItems.js @@ -6,42 +6,41 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_items', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), update: stripeMethod({ method: 'POST', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), createUsageRecord: stripeMethod({ method: 'POST', - path: '/{subscriptionItem}/usage_records', + fullPath: '/v1/subscription_items/{subscription_item}/usage_records', }), listUsageRecordSummaries: stripeMethod({ method: 'GET', - path: '/{subscriptionItem}/usage_record_summaries', + fullPath: + '/v1/subscription_items/{subscription_item}/usage_record_summaries', methodType: 'list', }), }); diff --git a/src/resources/SubscriptionSchedules.js b/src/resources/SubscriptionSchedules.js index 9c9249e3d9..9932c3fa78 100644 --- a/src/resources/SubscriptionSchedules.js +++ b/src/resources/SubscriptionSchedules.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_schedules', }), retrieve: stripeMethod({ method: 'GET', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), update: stripeMethod({ method: 'POST', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_schedules', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{schedule}/cancel', + fullPath: '/v1/subscription_schedules/{schedule}/cancel', }), release: stripeMethod({ method: 'POST', - path: '/{schedule}/release', + fullPath: '/v1/subscription_schedules/{schedule}/release', }), }); diff --git a/src/resources/Subscriptions.js b/src/resources/Subscriptions.js index bd0dc644c7..834abd3bd9 100644 --- a/src/resources/Subscriptions.js +++ b/src/resources/Subscriptions.js @@ -6,47 +6,45 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscriptions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), update: stripeMethod({ method: 'POST', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscriptions', methodType: 'list', }), cancel: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), del: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}/discount', + fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/subscriptions/search', methodType: 'search', }), }); diff --git a/src/resources/TaxCodes.js b/src/resources/TaxCodes.js index 57bf52ff3e..828617b2a8 100644 --- a/src/resources/TaxCodes.js +++ b/src/resources/TaxCodes.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_codes', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/tax_codes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_codes', methodType: 'list', }), }); diff --git a/src/resources/TaxRates.js b/src/resources/TaxRates.js index e429895f7b..dbe45632e0 100644 --- a/src/resources/TaxRates.js +++ b/src/resources/TaxRates.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_rates', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tax_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), update: stripeMethod({ method: 'POST', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_rates', methodType: 'list', }), }); diff --git a/src/resources/Terminal/Configurations.js b/src/resources/Terminal/Configurations.js index 4a7d069a8e..efdf67cc12 100644 --- a/src/resources/Terminal/Configurations.js +++ b/src/resources/Terminal/Configurations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/configurations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/configurations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), }); diff --git a/src/resources/Terminal/ConnectionTokens.js b/src/resources/Terminal/ConnectionTokens.js index 2e1a1b5155..d210bb9388 100644 --- a/src/resources/Terminal/ConnectionTokens.js +++ b/src/resources/Terminal/ConnectionTokens.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/connection_tokens', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/connection_tokens', }), }); diff --git a/src/resources/Terminal/Locations.js b/src/resources/Terminal/Locations.js index 161e0dd014..3d87dce2a4 100644 --- a/src/resources/Terminal/Locations.js +++ b/src/resources/Terminal/Locations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/locations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/locations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), update: stripeMethod({ method: 'POST', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/locations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), }); diff --git a/src/resources/Terminal/Readers.js b/src/resources/Terminal/Readers.js index 05a8a53ef5..7f19d13d29 100644 --- a/src/resources/Terminal/Readers.js +++ b/src/resources/Terminal/Readers.js @@ -6,51 +6,49 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/readers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/readers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), update: stripeMethod({ method: 'POST', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/readers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), cancelAction: stripeMethod({ method: 'POST', - path: '/{reader}/cancel_action', + fullPath: '/v1/terminal/readers/{reader}/cancel_action', }), processPaymentIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_payment_intent', + fullPath: '/v1/terminal/readers/{reader}/process_payment_intent', }), processSetupIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_setup_intent', + fullPath: '/v1/terminal/readers/{reader}/process_setup_intent', }), setReaderDisplay: stripeMethod({ method: 'POST', - path: '/{reader}/set_reader_display', + fullPath: '/v1/terminal/readers/{reader}/set_reader_display', }), }); diff --git a/src/resources/TestHelpers/Customers.js b/src/resources/TestHelpers/Customers.js index 64796a11da..c0671f9b0a 100644 --- a/src/resources/TestHelpers/Customers.js +++ b/src/resources/TestHelpers/Customers.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/customers', - fundCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/fund_cash_balance', + fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance', }), }); diff --git a/src/resources/TestHelpers/Issuing/Cards.js b/src/resources/TestHelpers/Issuing/Cards.js index 0f8c50f7d0..a814ff6503 100644 --- a/src/resources/TestHelpers/Issuing/Cards.js +++ b/src/resources/TestHelpers/Issuing/Cards.js @@ -6,25 +6,23 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/issuing/cards', - deliverCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/deliver', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver', }), failCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/fail', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail', }), returnCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/return', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return', }), shipCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/ship', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship', }), }); diff --git a/src/resources/TestHelpers/Refunds.js b/src/resources/TestHelpers/Refunds.js index 7aac415e77..5302e65277 100644 --- a/src/resources/TestHelpers/Refunds.js +++ b/src/resources/TestHelpers/Refunds.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/refunds', - expire: stripeMethod({ method: 'POST', - path: '/{refund}/expire', + fullPath: '/v1/test_helpers/refunds/{refund}/expire', }), }); diff --git a/src/resources/TestHelpers/Terminal/Readers.js b/src/resources/TestHelpers/Terminal/Readers.js index ab660b0f95..f303abc122 100644 --- a/src/resources/TestHelpers/Terminal/Readers.js +++ b/src/resources/TestHelpers/Terminal/Readers.js @@ -6,10 +6,9 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/terminal/readers', - presentPaymentMethod: stripeMethod({ method: 'POST', - path: '/{reader}/present_payment_method', + fullPath: + '/v1/test_helpers/terminal/readers/{reader}/present_payment_method', }), }); diff --git a/src/resources/TestHelpers/TestClocks.js b/src/resources/TestHelpers/TestClocks.js index adae9ae446..a0beacd365 100644 --- a/src/resources/TestHelpers/TestClocks.js +++ b/src/resources/TestHelpers/TestClocks.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/test_clocks', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/test_clocks', }), retrieve: stripeMethod({ method: 'GET', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/test_helpers/test_clocks', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), advance: stripeMethod({ method: 'POST', - path: '/{testClock}/advance', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance', }), }); diff --git a/src/resources/TestHelpers/Treasury/InboundTransfers.js b/src/resources/TestHelpers/Treasury/InboundTransfers.js index 178816ad58..e1a55c0b80 100644 --- a/src/resources/TestHelpers/Treasury/InboundTransfers.js +++ b/src/resources/TestHelpers/Treasury/InboundTransfers.js @@ -6,20 +6,18 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/inbound_transfers', - fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail', }), returnInboundTransfer: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return', }), succeed: stripeMethod({ method: 'POST', - path: '/{id}/succeed', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed', }), }); diff --git a/src/resources/TestHelpers/Treasury/OutboundPayments.js b/src/resources/TestHelpers/Treasury/OutboundPayments.js index 3a1b4d6516..b7da93e659 100644 --- a/src/resources/TestHelpers/Treasury/OutboundPayments.js +++ b/src/resources/TestHelpers/Treasury/OutboundPayments.js @@ -6,20 +6,18 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_payments', - fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{id}/post', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post', }), returnOutboundPayment: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return', }), }); diff --git a/src/resources/TestHelpers/Treasury/OutboundTransfers.js b/src/resources/TestHelpers/Treasury/OutboundTransfers.js index 90d7d6236b..55b1a25064 100644 --- a/src/resources/TestHelpers/Treasury/OutboundTransfers.js +++ b/src/resources/TestHelpers/Treasury/OutboundTransfers.js @@ -6,20 +6,21 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_transfers', - fail: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/fail', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/post', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post', }), returnOutboundTransfer: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/return', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return', }), }); diff --git a/src/resources/TestHelpers/Treasury/ReceivedCredits.js b/src/resources/TestHelpers/Treasury/ReceivedCredits.js index 8c3e5f0286..53614059ca 100644 --- a/src/resources/TestHelpers/Treasury/ReceivedCredits.js +++ b/src/resources/TestHelpers/Treasury/ReceivedCredits.js @@ -6,10 +6,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_credits', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_credits', }), }); diff --git a/src/resources/TestHelpers/Treasury/ReceivedDebits.js b/src/resources/TestHelpers/Treasury/ReceivedDebits.js index e25dc03bd2..e19cf15581 100644 --- a/src/resources/TestHelpers/Treasury/ReceivedDebits.js +++ b/src/resources/TestHelpers/Treasury/ReceivedDebits.js @@ -6,10 +6,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_debits', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_debits', }), }); diff --git a/src/resources/Tokens.js b/src/resources/Tokens.js index 76e4d33774..b1a5ae070f 100644 --- a/src/resources/Tokens.js +++ b/src/resources/Tokens.js @@ -6,15 +6,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tokens', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tokens', }), retrieve: stripeMethod({ method: 'GET', - path: '/{token}', + fullPath: '/v1/tokens/{token}', }), }); diff --git a/src/resources/Topups.js b/src/resources/Topups.js index e65fe5d14a..31c005d946 100644 --- a/src/resources/Topups.js +++ b/src/resources/Topups.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'topups', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/topups', }), retrieve: stripeMethod({ method: 'GET', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), update: stripeMethod({ method: 'POST', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/topups', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{topup}/cancel', + fullPath: '/v1/topups/{topup}/cancel', }), }); diff --git a/src/resources/Transfers.js b/src/resources/Transfers.js index 656128c392..743c887335 100644 --- a/src/resources/Transfers.js +++ b/src/resources/Transfers.js @@ -6,47 +6,45 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), update: stripeMethod({ method: 'POST', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/transfers', methodType: 'list', }), createReversal: stripeMethod({ method: 'POST', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', }), retrieveReversal: stripeMethod({ method: 'GET', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), updateReversal: stripeMethod({ method: 'POST', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), listReversals: stripeMethod({ method: 'GET', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/CreditReversals.js b/src/resources/Treasury/CreditReversals.js index 9039b816a2..952693666c 100644 --- a/src/resources/Treasury/CreditReversals.js +++ b/src/resources/Treasury/CreditReversals.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/credit_reversals', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/credit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{creditReversal}', + fullPath: '/v1/treasury/credit_reversals/{credit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/credit_reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/DebitReversals.js b/src/resources/Treasury/DebitReversals.js index f95bfe5372..abbab8694b 100644 --- a/src/resources/Treasury/DebitReversals.js +++ b/src/resources/Treasury/DebitReversals.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/debit_reversals', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/debit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{debitReversal}', + fullPath: '/v1/treasury/debit_reversals/{debit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/debit_reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/FinancialAccounts.js b/src/resources/Treasury/FinancialAccounts.js index a30b1273b6..0a1a47ba14 100644 --- a/src/resources/Treasury/FinancialAccounts.js +++ b/src/resources/Treasury/FinancialAccounts.js @@ -6,36 +6,34 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/financial_accounts', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/financial_accounts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), update: stripeMethod({ method: 'POST', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/financial_accounts', methodType: 'list', }), retrieveFeatures: stripeMethod({ method: 'GET', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), updateFeatures: stripeMethod({ method: 'POST', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), }); diff --git a/src/resources/Treasury/InboundTransfers.js b/src/resources/Treasury/InboundTransfers.js index 468adba0e7..84ecb300f7 100644 --- a/src/resources/Treasury/InboundTransfers.js +++ b/src/resources/Treasury/InboundTransfers.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/inbound_transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/inbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/inbound_transfers/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/inbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{inboundTransfer}/cancel', + fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel', }), }); diff --git a/src/resources/Treasury/OutboundPayments.js b/src/resources/Treasury/OutboundPayments.js index 5d08eaad0d..b4c6191816 100644 --- a/src/resources/Treasury/OutboundPayments.js +++ b/src/resources/Treasury/OutboundPayments.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_payments', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_payments', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/outbound_payments/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_payments', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/treasury/outbound_payments/{id}/cancel', }), }); diff --git a/src/resources/Treasury/OutboundTransfers.js b/src/resources/Treasury/OutboundTransfers.js index 40d72465dd..b5dfa874e9 100644 --- a/src/resources/Treasury/OutboundTransfers.js +++ b/src/resources/Treasury/OutboundTransfers.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{outboundTransfer}', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/cancel', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel', }), }); diff --git a/src/resources/Treasury/ReceivedCredits.js b/src/resources/Treasury/ReceivedCredits.js index 98b11b1699..160f659c19 100644 --- a/src/resources/Treasury/ReceivedCredits.js +++ b/src/resources/Treasury/ReceivedCredits.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_credits', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_credits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_credits', methodType: 'list', }), }); diff --git a/src/resources/Treasury/ReceivedDebits.js b/src/resources/Treasury/ReceivedDebits.js index c472144aa9..b946b42ee9 100644 --- a/src/resources/Treasury/ReceivedDebits.js +++ b/src/resources/Treasury/ReceivedDebits.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_debits', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_debits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_debits', methodType: 'list', }), }); diff --git a/src/resources/Treasury/TransactionEntries.js b/src/resources/Treasury/TransactionEntries.js index a52c432d68..067109bd81 100644 --- a/src/resources/Treasury/TransactionEntries.js +++ b/src/resources/Treasury/TransactionEntries.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transaction_entries', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transaction_entries/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transaction_entries', methodType: 'list', }), }); diff --git a/src/resources/Treasury/Transactions.js b/src/resources/Treasury/Transactions.js index a810413116..db1c5788f3 100644 --- a/src/resources/Treasury/Transactions.js +++ b/src/resources/Treasury/Transactions.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transactions', methodType: 'list', }), }); diff --git a/src/resources/WebhookEndpoints.js b/src/resources/WebhookEndpoints.js index 2f73d65031..b98d09e906 100644 --- a/src/resources/WebhookEndpoints.js +++ b/src/resources/WebhookEndpoints.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'webhook_endpoints', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/webhook_endpoints', }), retrieve: stripeMethod({ method: 'GET', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), update: stripeMethod({ method: 'POST', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/webhook_endpoints', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), }); diff --git a/src/stripe.ts b/src/stripe.ts index b53719fa77..a662ccda54 100644 --- a/src/stripe.ts +++ b/src/stripe.ts @@ -186,7 +186,7 @@ Stripe.createSubtleCryptoProvider = ( Stripe.prototype = { // Properties are set in the constructor above - _appInfo: null!, + _appInfo: undefined!, on: null!, off: null!, once: null!, @@ -199,98 +199,6 @@ Stripe.prototype = { _emitter: null!, _enableTelemetry: null!, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * host: 'example.com', - * port: '8080', - * protocol: 'http', - * }); - * - */ - setHost(host: string, port: number, protocol: string): void { - emitWarning( - '`setHost` is deprecated. Use the `host` config option instead.' - ); - this._setApiField('host', host); - if (port) { - this.setPort(port); - } - if (protocol) { - this.setProtocol(protocol); - } - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * protocol: 'http', - * }); - * - */ - setProtocol(protocol: string): void { - emitWarning( - '`setProtocol` is deprecated. Use the `protocol` config option instead.' - ); - this._setApiField('protocol', protocol.toLowerCase()); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * port: 3000, - * }); - * - */ - setPort(port: number): void { - emitWarning( - '`setPort` is deprecated. Use the `port` config option instead.' - ); - this._setApiField('port', port); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * apiVersion: API_VERSION, - * }); - * - */ - setApiVersion(version: string): void { - emitWarning( - '`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.' - ); - if (version) { - this._setApiField('version', version); - } - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY); - * - * Or, for Stripe Connect, use `stripeAccount` instead: - * - * const stripe = new Stripe(API_KEY, { - * stripeAccount: 'acct_...', - * }); - * - * Or, to use a different apiKey on a given request: - * - * stripe.customers.create(params, {apiKey: 'sk_test_...'}); - */ - setApiKey(key: string): void { - emitWarning( - '`setApiKey` is deprecated. Use the `apiKey` request option instead.' - ); - this._setApiKey(key); - }, - /** * @private */ @@ -300,39 +208,6 @@ Stripe.prototype = { } }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * timeout: TIMEOUT_MS, - * }); - */ - setTimeout(timeout: number): void { - emitWarning( - '`setTimeout` is deprecated. Use the `timeout` config or request option instead.' - ); - this._setApiField('timeout', timeout == null ? DEFAULT_TIMEOUT : timeout); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * appInfo: { - * name: 'MyPlugin', - * version: '1.4.2', - * url: 'https://myplugin.com', - * partner_id: '1234', - * }, - * }); - */ - setAppInfo(info: AppInfo): void { - emitWarning( - '`setAppInfo` is deprecated. Use the `appInfo` config option instead.' - ); - this._setAppInfo(info); - }, - /** * @private * This may be removed in the future. @@ -363,22 +238,6 @@ Stripe.prototype = { ); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const ProxyAgent = require('https-proxy-agent'); - * const stripe = new Stripe(API_KEY, { - * httpAgent: new ProxyAgent(process.env.http_proxy), - * }); - * - */ - setHttpAgent(agent: string): void { - emitWarning( - '`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.' - ); - this._setApiField('agent', agent); - }, - /** * @private * This may be removed in the future. @@ -442,18 +301,6 @@ Stripe.prototype = { return this.getApiField('maxNetworkRetries'); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * maxNetworkRetries: 2, - * }); - * - */ - setMaxNetworkRetries(maxNetworkRetries: number): void { - this._setApiNumberField('maxNetworkRetries', maxNetworkRetries); - }, - /** * @private * This may be removed in the future. @@ -565,21 +412,6 @@ Stripe.prototype = { return formatted; }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * telemetry: false, - * }); - * - */ - setTelemetryEnabled(enableTelemetry: boolean): void { - emitWarning( - '`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.' - ); - this._enableTelemetry = enableTelemetry; - }, - getTelemetryEnabled(): boolean { return this._enableTelemetry; }, diff --git a/src/utils.ts b/src/utils.ts index 9eb3971cc9..2e289937bf 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -25,15 +25,6 @@ const OPTIONS_KEYS = [ 'host', ]; -const DEPRECATED_OPTIONS = { - api_key: 'apiKey', - idempotency_key: 'idempotencyKey', - stripe_account: 'stripeAccount', - stripe_version: 'apiVersion', - stripeVersion: 'apiVersion', -} as Record; -const DEPRECATED_OPTIONS_KEYS = Object.keys(DEPRECATED_OPTIONS); - type Settings = { timeout?: number; maxNetworkRetries?: number; @@ -52,12 +43,7 @@ const utils = { return ( o && typeof o === 'object' && - (OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - ) || - DEPRECATED_OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - )) + OPTIONS_KEYS.some((prop) => Object.prototype.hasOwnProperty.call(o, prop)) ); }, @@ -172,27 +158,9 @@ const utils = { ); if (extraKeys.length) { - const nonDeprecated = extraKeys.filter((key) => { - if (!DEPRECATED_OPTIONS[key]) { - return true; - } - const newParam = DEPRECATED_OPTIONS[key]; - if (params[newParam]) { - throw Error( - `Both '${newParam}' and '${key}' were provided; please remove '${key}', which is deprecated.` - ); - } - /** - * TODO turn this into a hard error in a future major version (once we have fixed our docs). - */ - emitWarning(`'${key}' is deprecated; use '${newParam}' instead.`); - params[newParam] = params[key]; - }); - if (nonDeprecated.length) { - emitWarning( - `Invalid options found (${extraKeys.join(', ')}); ignoring.` - ); - } + emitWarning( + `Invalid options found (${extraKeys.join(', ')}); ignoring.` + ); } if (params.apiKey) { diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index 78b999aedb..d852c9f95f 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -22,23 +22,33 @@ const { describe('StripeResource', () => { describe('createResourcePathWithSymbols', () => { + let testResource; + before(() => { + testResource = new (StripeResource.extend({ + path: 'widgets', + create: stripeMethod({ + method: 'POST', + path: '', + }), + }))(stripe); + }); it('Generates a path when there is a symbol', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols('{id}'); - expect(path).to.equal('/invoices/{id}'); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols('{id}'); + expect(path).to.equal('/widgets/{id}'); }); it('Generates a path when there is nothing beyond the resource path', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols(''); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols(''); // This explicitly shouldn't have a trailing slash. - expect(path).to.equal('/invoices'); + expect(path).to.equal('/widgets'); }); it('Handles accidental double slashes', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols('/{id}'); - expect(path).to.equal('/invoices/{id}'); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols('/{id}'); + expect(path).to.equal('/widgets/{id}'); }); }); @@ -1023,8 +1033,6 @@ describe('StripeResource', () => { describe('Request Timeout', () => { it('should allow the setting of a request timeout on a per-request basis', (done) => { - stripe.setTimeout(1000); - stripe.charges.create({}); expect(stripe.LAST_REQUEST.settings).to.deep.equal({}); diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 2a64f5a978..e77866ea29 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -1,9 +1,9 @@ 'use strict'; -const stripe = require('../../testUtils').getSpyableStripe(); +const getSpyableStripe = require('../../testUtils').getSpyableStripe; const expect = require('chai').expect; -function errorsOnNoStripeVersion() { +function errorsOnNoStripeVersion(stripe) { return expect( stripe.ephemeralKeys.create({customer: 'cus_123'}) ).to.be.eventually.rejectedWith( @@ -11,7 +11,7 @@ function errorsOnNoStripeVersion() { ); } -function sendsCorrectStripeVersion() { +function sendsCorrectStripeVersion(stripe) { stripe.ephemeralKeys.create( {customer: 'cus_123'}, {apiVersion: '2017-06-05'} @@ -32,6 +32,8 @@ function sendsCorrectStripeVersion() { describe('EphemeralKey Resource', () => { describe('create', () => { + const stripe = getSpyableStripe(); + it('Sends the correct request', () => { stripe.ephemeralKeys.create( {customer: 'cus_123'}, @@ -51,43 +53,35 @@ describe('EphemeralKey Resource', () => { }); describe('when an api version is set', () => { - beforeEach(function() { - this.oldVersion = stripe.getApiField('version'); - stripe.setApiVersion('2017-05-25'); - }); - - afterEach(function() { - stripe.setApiVersion(this.oldVersion); + const stripe = getSpyableStripe({ + apiVersion: '2017-05-25', }); it('Errors if no stripe-version is specified', () => - errorsOnNoStripeVersion()); + errorsOnNoStripeVersion(stripe)); it('Sends the correct stripe-version', () => { - sendsCorrectStripeVersion(); + sendsCorrectStripeVersion(stripe); }); }); describe('when no api version is set', () => { - beforeEach(function() { - this.oldVersion = stripe.getApiField('version'); - stripe.setApiVersion(null); - }); - - afterEach(function() { - stripe.setApiVersion(this.oldVersion); + const stripe = getSpyableStripe({ + apiVersion: null, }); it('Errors if no stripe-version is specified', () => - errorsOnNoStripeVersion()); + errorsOnNoStripeVersion(stripe)); it('Sends the correct stripe-version', () => { - sendsCorrectStripeVersion(); + sendsCorrectStripeVersion(stripe); }); }); }); describe('delete', () => { + const stripe = getSpyableStripe(); + it('Sends the correct request', () => { stripe.ephemeralKeys.del('ephkey_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/SKUs.spec.js b/test/resources/SKUs.spec.js deleted file mode 100644 index d165427075..0000000000 --- a/test/resources/SKUs.spec.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils').getSpyableStripe(); -const expect = require('chai').expect; - -describe('SKU Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.skus.retrieve('skuIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus/skuIdFoo123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.skus.create({ - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 500, - product: 'prodIdTest123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/skus', - data: { - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 500, - product: 'prodIdTest123', - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.skus.list({ - limit: 3, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus?limit=3', - data: {}, - headers: {}, - settings: {}, - }); - }); - - it('Supports filtering by product', () => { - stripe.skus.list({ - product: 'prodId123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus?product=prodId123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.skus.update('skuIdFoo3242', {caption: 'test'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/skus/skuIdFoo3242', - headers: {}, - data: {caption: 'test'}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.skus.del('skuIdFoo3242'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/skus/skuIdFoo3242', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 526d209001..d51bcf971a 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -2270,41 +2270,6 @@ describe('Sigma.ScheduledQueryRun', function() { }); }); -describe('Sku', function() { - it('list method', async function() { - const skus = await stripe.skus.list({limit: 3}); - expect(skus).not.to.be.null; - }); - - it('create method', async function() { - const sku = await stripe.skus.create({ - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 1500, - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - product: 'prod_xxxxxxxxxxxxx', - }); - expect(sku).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.skus.del('sku_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; - }); - - it('retrieve method', async function() { - const sku = await stripe.skus.retrieve('sku_xxxxxxxxxxxxx'); - expect(sku).not.to.be.null; - }); - - it('update method', async function() { - const sku = await stripe.skus.update('sku_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(sku).not.to.be.null; - }); -}); - describe('Source', function() { it('retrieve method', async function() { const source = await stripe.sources.retrieve('src_xxxxxxxxxxxxx'); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index c2111b39b1..f3d4c3b9c4 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -111,8 +111,8 @@ describe('Stripe Module', function() { }); cases.forEach((item) => { - const stripe = Stripe(testUtils.getUserStripeKey(), item); - expect(stripe.getApiField('version')).to.equal(null); + const newStripe = Stripe(testUtils.getUserStripeKey(), item); + expect(newStripe.getApiField('version')).to.equal(null); }); }); @@ -178,22 +178,22 @@ describe('Stripe Module', function() { it('Should include whether typescript: true was passed, respecting reinstantiations', () => { return new Promise((resolve) => resolve()) .then(() => { - const stripe = new Stripe('sk_test_123', { + const newStripe = new Stripe('sk_test_123', { typescript: true, }); return expect( new Promise((resolve, reject) => { - stripe.getClientUserAgent((c) => { + newStripe.getClientUserAgent((c) => { resolve(JSON.parse(c)); }); }) ).to.eventually.have.property('typescript', 'true'); }) .then(() => { - const stripe = new Stripe('sk_test_123', {}); + const newStripe = new Stripe('sk_test_123', {}); return expect( new Promise((resolve, reject) => { - stripe.getClientUserAgent((c) => { + newStripe.getClientUserAgent((c) => { resolve(JSON.parse(c)); }); }) @@ -276,25 +276,28 @@ describe('Stripe Module', function() { }); }); - describe('setTimeout', () => { + describe('timeout config', () => { const defaultTimeout = 80000; it('Should define a default of 80000', () => { expect(stripe.getApiField('timeout')).to.equal(defaultTimeout); }); it('Should allow me to set a custom timeout', () => { - stripe.setTimeout(900); - expect(stripe.getApiField('timeout')).to.equal(900); + const newStripe = Stripe('sk_test', { + timeout: 900, + }); + expect(newStripe.getApiField('timeout')).to.equal(900); }); it('Should allow me to set null, to reset to the default', () => { - stripe.setTimeout(null); - expect(stripe.getApiField('timeout')).to.equal(defaultTimeout); + const newStripe = Stripe('sk_test', { + timeout: null, + }); + expect(newStripe.getApiField('timeout')).to.equal(defaultTimeout); }); }); - describe('setAppInfo', () => { + describe('appInfo config', () => { describe('when given nothing or an empty object', () => { it('should unset stripe._appInfo', () => { - stripe.setAppInfo(); expect(stripe._appInfo).to.be.undefined; }); }); @@ -308,7 +311,9 @@ describe('Stripe Module', function() { describe('when given a non-object variable', () => { it('should throw an error', () => { expect(() => { - stripe.setAppInfo('foo'); + Stripe('sk_test', { + appInfo: 'foo', + }); }).to.throw(/AppInfo must be an object./); }); }); @@ -316,18 +321,24 @@ describe('Stripe Module', function() { describe('when given an object with no `name`', () => { it('should throw an error', () => { expect(() => { - stripe.setAppInfo({}); + Stripe('sk_test', { + appInfo: {}, + }); }).to.throw(/AppInfo.name is required/); expect(() => { - stripe.setAppInfo({ - version: '1.2.3', + Stripe('sk_test', { + appInfo: { + version: '1.2.3', + }, }); }).to.throw(/AppInfo.name is required/); expect(() => { - stripe.setAppInfo({ - cats: '42', + Stripe('sk_test', { + appInfo: { + cats: '42', + }, }); }).to.throw(/AppInfo.name is required/); }); @@ -335,50 +346,60 @@ describe('Stripe Module', function() { describe('when given at least a `name`', () => { it('should set name, partner ID, url, and version of stripe._appInfo', () => { - stripe.setAppInfo({ - name: 'MyAwesomeApp', + let newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - version: '1.2.345', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + version: '1.2.345', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', version: '1.2.345', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - url: 'https://myawesomeapp.info', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + url: 'https://myawesomeapp.info', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', url: 'https://myawesomeapp.info', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - partner_id: 'partner_1234', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', partner_id: 'partner_1234', }); }); it('should ignore any invalid properties', () => { - stripe.setAppInfo({ - name: 'MyAwesomeApp', - partner_id: 'partner_1234', - version: '1.2.345', - url: 'https://myawesomeapp.info', - countOfRadishes: 512, + const newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + version: '1.2.345', + url: 'https://myawesomeapp.info', + countOfRadishes: 512, + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', partner_id: 'partner_1234', version: '1.2.345', @@ -394,12 +415,14 @@ describe('Stripe Module', function() { url: 'https://myawesomeapp.info', }; - stripe.setAppInfo(appInfo); + const newStripe = Stripe('sk_test', { + appInfo, + }); - stripe.getClientUserAgent((uaString) => { + newStripe.getClientUserAgent((uaString) => { expect(JSON.parse(uaString).application).to.eql(appInfo); - expect(stripe.getAppInfoAsString()).to.eql( + expect(newStripe.getAppInfoAsString()).to.eql( `${appInfo.name}/${appInfo.version} (${appInfo.url})` ); @@ -496,7 +519,6 @@ describe('Stripe Module', function() { describe('errors', () => { it('Exports errors as types', () => { - const Stripe = require('../lib/stripe'); expect( new Stripe.errors.StripeInvalidRequestError({ message: 'error', diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index f408c92c60..c73650ac34 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -58,10 +58,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: false, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(false); - stripe.setHost(host, port, 'http'); stripe.balance .retrieve() @@ -104,10 +108,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: true, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); stripe.balance .retrieve() @@ -152,10 +160,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: true, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); Promise.all([stripe.balance.retrieve(), stripe.balance.retrieve()]) .then(() => diff --git a/test/utils.spec.js b/test/utils.spec.js index 91a6e1f9f9..5162f5dcbf 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -309,91 +309,6 @@ describe('utils', () => { }); }); - it('parses snake case for backwards compatibility', () => { - return new Promise((resolve, reject) => { - const args = [ - { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'key', - stripe_account: 'acct_123', - stripe_version: '2019-08-08', - }, - ]; - const desiredWarnings = [ - "Stripe: 'api_key' is deprecated; use 'apiKey' instead.", - "Stripe: 'idempotency_key' is deprecated; use 'idempotencyKey' instead.", - "Stripe: 'stripe_account' is deprecated; use 'stripeAccount' instead.", - "Stripe: 'stripe_version' is deprecated; use 'apiVersion' instead.", - ]; - - const warnings = []; - const onWarn = (message) => { - warnings.push(message); - if (warnings.length === desiredWarnings.length) { - expect(warnings).to.deep.equal(desiredWarnings); - resolve(); - } - }; - handleWarnings(() => { - expect(utils.getOptionsFromArgs(args)).to.deep.equal({ - auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - headers: { - 'Idempotency-Key': 'key', - 'Stripe-Version': '2019-08-08', - 'Stripe-Account': 'acct_123', - }, - settings: {}, - }); - }, onWarn); - }); - }); - - it('parses stripeVersion for backwards compatibility', () => { - return new Promise((resolve, reject) => { - const args = [ - { - apiKey: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - stripeVersion: '2019-08-08', - }, - ]; - const desiredWarnings = [ - "Stripe: 'stripeVersion' is deprecated; use 'apiVersion' instead.", - ]; - - const warnings = []; - const onWarn = (message) => { - warnings.push(message); - if (warnings.length === desiredWarnings.length) { - expect(warnings).to.deep.equal(desiredWarnings); - resolve(); - } - }; - handleWarnings(() => { - expect(utils.getOptionsFromArgs(args)).to.deep.equal({ - auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - headers: { - 'Stripe-Version': '2019-08-08', - }, - settings: {}, - }); - }, onWarn); - }); - }); - - it('errors if you pass both a deprecated and non-deprecated version of the same param', () => { - const args = [ - { - stripeVersion: 'bad', - apiVersion: 'good', - }, - ]; - expect(() => { - utils.getOptionsFromArgs(args); - }).to.throw( - "Both 'apiVersion' and 'stripeVersion' were provided; please remove 'stripeVersion', which is deprecated." - ); - }); - it('warns if the hash contains something that does not belong', (done) => { const args = [ {foo: 'bar'}, diff --git a/testUtils/index.js b/testUtils/index.js index f527a44765..4e090fc4c1 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -58,12 +58,12 @@ const utils = (module.exports = { return key; }, - getSpyableStripe: () => { + getSpyableStripe: (config) => { // Provide a testable stripe instance // That is, with mock-requests built in and hookable const stripe = require('../lib/stripe'); - const stripeInstance = stripe('fakeAuthToken'); + const stripeInstance = stripe('fakeAuthToken', config); stripeInstance.REQUESTS = []; diff --git a/types/2022-08-01/Orders.d.ts b/types/2022-08-01/Orders.d.ts deleted file mode 100644 index 06dd2e9034..0000000000 --- a/types/2022-08-01/Orders.d.ts +++ /dev/null @@ -1,3356 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * An Order describes a purchase being made by a customer, including the - * products & quantities being purchased, the order status, the payment information, - * and the billing/shipping details. - * - * Related guide: [Orders overview](https://stripe.com/docs/orders) - */ - interface Order { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'order'; - - /** - * Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - */ - amount_subtotal: number; - - /** - * Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - */ - amount_total: number; - - /** - * ID of the Connect application that created the Order, if any. - */ - application: string | Stripe.Application | null; - - automatic_tax?: Order.AutomaticTax; - - /** - * Customer billing details associated with the order. - */ - billing_details: Order.BillingDetails | null; - - /** - * The client secret of this Order. Used for client-side retrieval using a publishable key. - * - * The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. - * - * Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. - */ - client_secret: string | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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; - - /** - * The customer which this orders belongs to. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description: string | null; - - /** - * The discounts applied to the order. Use `expand[]=discounts` to expand each discount. - */ - discounts: Array | null; - - /** - * A recent IP address of the purchaser used for tax reporting and tax location inference. - */ - ip_address: string | null; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. - */ - line_items?: ApiList; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata | null; - - payment: Order.Payment; - - /** - * The details of the customer cost of shipping, including the customer chosen ShippingRate. - */ - shipping_cost: Order.ShippingCost | null; - - /** - * Customer shipping information associated with the order. - */ - shipping_details: Order.ShippingDetails | null; - - /** - * The overall status of the order. - */ - status: Order.Status; - - tax_details?: Order.TaxDetails; - - total_details: Order.TotalDetails; - } - - namespace Order { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this Order. - */ - enabled: boolean; - - /** - * The status of the most recent automated tax calculation for this Order. - */ - status: AutomaticTax.Status | null; - } - - namespace AutomaticTax { - type Status = 'complete' | 'failed' | 'requires_location_inputs'; - } - - interface BillingDetails { - /** - * Billing address for the order. - */ - address: Stripe.Address | null; - - /** - * Email address for the order. - */ - email: string | null; - - /** - * Full name for the order. - */ - name: string | null; - - /** - * Billing phone number for the order (including extension). - */ - phone: string | null; - } - - interface Payment { - /** - * ID of the payment intent associated with this order. Null when the order is `open`. - */ - payment_intent: string | Stripe.PaymentIntent | null; - - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings | null; - - /** - * The status of the underlying payment associated with this order, if any. Null when the order is `open`. - */ - status: Payment.Status | null; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount: number | null; - - /** - * Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. - */ - automatic_payment_methods: Settings.AutomaticPaymentMethods | null; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options: Settings.PaymentMethodOptions | null; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types: Array | null; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url: string | null; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor: string | null; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix: string | null; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data: Settings.TransferData | null; - } - - namespace Settings { - interface AutomaticPaymentMethods { - /** - * Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - enabled: boolean; - } - - interface PaymentMethodOptions { - acss_debit?: PaymentMethodOptions.AcssDebit; - - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - alipay?: PaymentMethodOptions.Alipay; - - bancontact?: PaymentMethodOptions.Bancontact; - - card?: PaymentMethodOptions.Card; - - customer_balance?: PaymentMethodOptions.CustomerBalance; - - ideal?: PaymentMethodOptions.Ideal; - - klarna?: PaymentMethodOptions.Klarna; - - link?: PaymentMethodOptions.Link; - - oxxo?: PaymentMethodOptions.Oxxo; - - p24?: PaymentMethodOptions.P24; - - paypal?: PaymentMethodOptions.Paypal; - - sepa_debit?: PaymentMethodOptions.SepaDebit; - - sofort?: PaymentMethodOptions.Sofort; - - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: AcssDebit.SetupFutureUsage; - - /** - * Bank account verification method. - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text - */ - custom_mandate_url?: string; - - /** - * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description: string | null; - - /** - * Payment schedule for the mandate. - */ - payment_schedule: MandateOptions.PaymentSchedule | null; - - /** - * Transaction type of the mandate. - */ - transaction_type: MandateOptions.TransactionType | null; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference: string | null; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Alipay.SetupFutureUsage; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Bancontact.SetupFutureUsage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type: 'bank_transfer' | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type | null; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: EuBankTransfer.Country; - } - - namespace EuBankTransfer { - type Country = 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Ideal.SetupFutureUsage; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the Klarna checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Token used for persistent Link logins. - */ - persistent_token: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Link.SetupFutureUsage; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Paypal { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the PayPal checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - } - - interface SepaDebit { - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: SepaDebit.SetupFutureUsage; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Preferred language of the SOFORT authorization page that the customer is redirected to. - */ - preferred_language: Sofort.PreferredLanguage | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Sofort.SetupFutureUsage; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id: string | null; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount: number | null; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string | Stripe.Account; - } - } - - type Status = - | 'canceled' - | 'complete' - | 'not_required' - | 'processing' - | 'requires_action' - | 'requires_capture' - | 'requires_confirmation' - | 'requires_payment_method'; - } - - interface ShippingCost { - /** - * Total shipping cost before any discounts or taxes are applied. - */ - amount_subtotal: number; - - /** - * Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. - */ - amount_tax: number; - - /** - * Total shipping cost after discounts and taxes are applied. - */ - amount_total: number; - - /** - * The ID of the ShippingRate for this order. - */ - shipping_rate: string | Stripe.ShippingRate | null; - - /** - * The taxes applied to the shipping rate. - */ - taxes?: Array; - } - - namespace ShippingCost { - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - - interface ShippingDetails { - /** - * Recipient shipping address. Required if the order includes products that are shippable. - */ - address: Stripe.Address | null; - - /** - * Recipient name. - */ - name: string | null; - - /** - * Recipient phone (including extension). - */ - phone: string | null; - } - - type Status = - | 'canceled' - | 'complete' - | 'open' - | 'processing' - | 'submitted'; - - interface TaxDetails { - /** - * Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt: TaxDetails.TaxExempt; - - /** - * The purchaser's tax IDs to be used in calculation of tax for this Order. - */ - tax_ids: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` - */ - type: TaxId.Type; - - /** - * The value of the tax ID. - */ - value: string | null; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'unknown' - | 'us_ein' - | 'za_vat'; - } - } - - interface TotalDetails { - /** - * This is the sum of all the discounts. - */ - amount_discount: number; - - /** - * This is the sum of all the shipping amounts. - */ - amount_shipping: number | null; - - /** - * This is the sum of all the tax amounts. - */ - amount_tax: number; - - breakdown?: TotalDetails.Breakdown; - } - - namespace TotalDetails { - interface Breakdown { - /** - * The aggregated discounts. - */ - discounts: Array; - - /** - * The aggregated tax amounts by rate. - */ - taxes: Array; - } - - namespace Breakdown { - interface Discount { - /** - * The amount discounted. - */ - amount: number; - - /** - * 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). - */ - discount: Stripe.Discount; - } - - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - } - } - - interface OrderCreateParams { - /** - * 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; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items: Array; - - /** - * Settings for automatic tax calculation for this order. - */ - automatic_tax?: OrderCreateParams.AutomaticTax; - - /** - * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. - */ - billing_details?: Stripe.Emptyable; - - /** - * The customer associated with this order. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The coupons, promotion codes, and/or discounts to apply to the order. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The IP address of the purchaser for this order. - */ - ip_address?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * Payment information associated with the order, including payment settings. - */ - payment?: OrderCreateParams.Payment; - - /** - * Settings for the customer cost of shipping for this order. - */ - shipping_cost?: Stripe.Emptyable; - - /** - * Shipping details for the order. - */ - shipping_details?: Stripe.Emptyable; - - /** - * Additional tax details about the purchaser to be used for this order. - */ - tax_details?: OrderCreateParams.TaxDetails; - } - - namespace OrderCreateParams { - interface AutomaticTax { - /** - * Enable automatic tax calculation which will automatically compute tax rates on this order. - */ - enabled: boolean; - } - - interface BillingDetails { - /** - * The billing address provided by the customer. - */ - address?: Stripe.AddressParam; - - /** - * The billing email provided by the customer. - */ - email?: string; - - /** - * The billing name provided by the customer. - */ - name?: string; - - /** - * The billing phone number provided by the customer. - */ - phone?: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - - /** - * ID of the promotion code to create a new discount for. - */ - promotion_code?: string; - } - - interface LineItem { - /** - * The description for the line item. Will default to the name of the associated product. - */ - description?: string; - - /** - * The discounts applied to this line item. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. - * - * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. - */ - price?: string; - - /** - * Data used to generate a new Price object inline. - * - * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. - * - * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. - */ - price_data?: LineItem.PriceData; - - /** - * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. - * - * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. - */ - product?: string; - - /** - * Defines a Product inline and adds it to the Order. - * - * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. - * - * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. - */ - product_data?: LineItem.ProductData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates applied to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface PriceData { - /** - * 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 product this price belongs to. - * - * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. - */ - product?: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface ProductData { - /** - * 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. - */ - description?: string; - - /** - * A unique identifier for this product. - * - * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. - */ - id: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Stripe.Emptyable>; - - /** - * 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; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: Stripe.Emptyable; - } - - namespace ProductData { - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - } - - interface Payment { - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount?: number; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options?: Settings.PaymentMethodOptions; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url?: string; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data?: Settings.TransferData; - } - - namespace Settings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. - */ - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - /** - * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. - */ - alipay?: PaymentMethodOptions.Alipay; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. - */ - bancontact?: PaymentMethodOptions.Bancontact; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. - */ - card?: PaymentMethodOptions.Card; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. - */ - customer_balance?: PaymentMethodOptions.CustomerBalance; - - /** - * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. - */ - ideal?: PaymentMethodOptions.Ideal; - - /** - * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. - */ - klarna?: PaymentMethodOptions.Klarna; - - /** - * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. - */ - link?: PaymentMethodOptions.Link; - - /** - * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. - */ - oxxo?: PaymentMethodOptions.Oxxo; - - /** - * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. - */ - p24?: PaymentMethodOptions.P24; - - /** - * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. - */ - sofort?: PaymentMethodOptions.Sofort; - - /** - * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. - */ - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - Bancontact.SetupFutureUsage - >; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string; - } - } - } - - interface ShippingCost { - /** - * The ID of the shipping rate to use for this order. - */ - shipping_rate?: string; - - /** - * Parameters to create a new ad-hoc shipping rate for this order. - */ - shipping_rate_data?: ShippingCost.ShippingRateData; - } - - namespace ShippingCost { - interface ShippingRateData { - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateData.DeliveryEstimate; - - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateData.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.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateData.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateData { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: 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; - - /** - * 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 ShippingDetails { - /** - * The shipping address for the order. - */ - address: Stripe.AddressParam; - - /** - * The name of the recipient of the order. - */ - name: string; - - /** - * The phone number (including extension) for the recipient of the order. - */ - phone?: string; - } - - interface TaxDetails { - /** - * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The purchaser's tax IDs to be used for this order. - */ - tax_ids?: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - } - - interface OrderRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderUpdateParams { - /** - * Settings for automatic tax calculation for this order. - */ - automatic_tax?: OrderUpdateParams.AutomaticTax; - - /** - * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. - */ - billing_details?: Stripe.Emptyable; - - /** - * 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 customer associated with this order. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The IP address of the purchaser for this order. - */ - ip_address?: string; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items?: Array; - - /** - * 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; - - /** - * Payment information associated with the order, including payment settings. - */ - payment?: OrderUpdateParams.Payment; - - /** - * Settings for the customer cost of shipping for this order. - */ - shipping_cost?: Stripe.Emptyable; - - /** - * Shipping details for the order. - */ - shipping_details?: Stripe.Emptyable; - - /** - * Additional tax details about the purchaser to be used for this order. - */ - tax_details?: OrderUpdateParams.TaxDetails; - } - - namespace OrderUpdateParams { - interface AutomaticTax { - /** - * Enable automatic tax calculation which will automatically compute tax rates on this order. - */ - enabled: boolean; - } - - interface BillingDetails { - /** - * The billing address provided by the customer. - */ - address?: Stripe.AddressParam; - - /** - * The billing email provided by the customer. - */ - email?: string; - - /** - * The billing name provided by the customer. - */ - name?: string; - - /** - * The billing phone number provided by the customer. - */ - phone?: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - - /** - * ID of the promotion code to create a new discount for. - */ - promotion_code?: string; - } - - interface LineItem { - /** - * The description for the line item. Will default to the name of the associated product. - */ - description?: string; - - /** - * The discounts applied to this line item. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of an existing line item on the order. - */ - id?: string; - - /** - * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. - * - * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. - */ - price?: string; - - /** - * Data used to generate a new Price object inline. - * - * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. - * - * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. - */ - price_data?: LineItem.PriceData; - - /** - * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. - * - * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. - */ - product?: string; - - /** - * Defines a Product inline and adds it to the Order. - * - * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. - * - * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. - */ - product_data?: LineItem.ProductData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates applied to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface PriceData { - /** - * 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 product this price belongs to. - * - * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. - */ - product?: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface ProductData { - /** - * 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. - */ - description?: string; - - /** - * A unique identifier for this product. - * - * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. - */ - id: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Stripe.Emptyable>; - - /** - * 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; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: Stripe.Emptyable; - } - - namespace ProductData { - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - } - - interface Payment { - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount?: Stripe.Emptyable; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options?: Settings.PaymentMethodOptions; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url?: Stripe.Emptyable; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace Settings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. - */ - afterpay_clearpay?: Stripe.Emptyable< - PaymentMethodOptions.AfterpayClearpay - >; - - /** - * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. - */ - alipay?: Stripe.Emptyable; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. - */ - ideal?: Stripe.Emptyable; - - /** - * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. - */ - klarna?: Stripe.Emptyable; - - /** - * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. - */ - link?: Stripe.Emptyable; - - /** - * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. - */ - oxxo?: Stripe.Emptyable; - - /** - * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. - */ - p24?: Stripe.Emptyable; - - /** - * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. - */ - sepa_debit?: Stripe.Emptyable; - - /** - * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. - */ - sofort?: Stripe.Emptyable; - - /** - * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. - */ - wechat_pay?: Stripe.Emptyable; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - Bancontact.SetupFutureUsage - >; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string; - } - } - } - - interface ShippingCost { - /** - * The ID of the shipping rate to use for this order. - */ - shipping_rate?: string; - - /** - * Parameters to create a new ad-hoc shipping rate for this order. - */ - shipping_rate_data?: ShippingCost.ShippingRateData; - } - - namespace ShippingCost { - interface ShippingRateData { - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateData.DeliveryEstimate; - - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateData.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.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateData.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateData { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: 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; - - /** - * 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 ShippingDetails { - /** - * The shipping address for the order. - */ - address: Stripe.AddressParam; - - /** - * The name of the recipient of the order. - */ - name: string; - - /** - * The phone number (including extension) for the recipient of the order. - */ - phone?: string; - } - - interface TaxDetails { - /** - * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The purchaser's tax IDs to be used for this order. - */ - tax_ids?: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - } - - interface OrderListParams extends PaginationParams { - /** - * Only return orders for the given customer. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderReopenParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderSubmitParams { - /** - * `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. - */ - expected_total: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class OrdersResource { - /** - * Creates a new open order object. - */ - create( - params: OrderCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. - */ - retrieve( - id: string, - params?: OrderRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: OrderUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. - */ - list( - params?: OrderListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Cancels the order as well as the payment intent if one is attached. - */ - cancel( - id: string, - params?: OrderCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: OrderListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Reopens a submitted order. - */ - reopen( - id: string, - params?: OrderReopenParams, - options?: RequestOptions - ): Promise>; - reopen( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called. - */ - submit( - id: string, - params: OrderSubmitParams, - options?: RequestOptions - ): Promise>; - } - } -} diff --git a/types/2022-08-01/SKUs.d.ts b/types/2022-08-01/SKUs.d.ts deleted file mode 100644 index 8653c30301..0000000000 --- a/types/2022-08-01/SKUs.d.ts +++ /dev/null @@ -1,453 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit). - * SKUs describe specific product variations, taking into account any combination of: attributes, - * currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents - * the `size: large`, `color: red` version of that shirt. - * - * Can also be used to manage inventory. - */ - interface Sku { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'sku'; - - /** - * Whether the SKU is available for purchase. - */ - active: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are `["size", "gender"]`, a valid SKU has the following dictionary of attributes: `{"size": "Medium", "gender": "Unisex"}`. - */ - attributes: { - [key: string]: string; - }; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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; - - deleted?: void; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image: string | null; - - inventory: Sku.Inventory; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions: Sku.PackageDimensions | null; - - /** - * The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price: number; - - /** - * The ID of the product this SKU is associated with. The product must be currently active. - */ - product: string | Stripe.Product; - - /** - * Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ - updated: number; - } - - namespace Sku { - interface Inventory { - /** - * The count of inventory available. Will be present if and only if `type` is `finite`. - */ - quantity: number | null; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type: string; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value: string | null; - } - - interface PackageDimensions { - /** - * Height, in inches. - */ - height: number; - - /** - * Length, in inches. - */ - length: number; - - /** - * Weight, in ounces. - */ - weight: number; - - /** - * Width, in inches. - */ - width: number; - } - } - - /** - * The DeletedSku object. - */ - interface DeletedSku { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'sku'; - - /** - * Always true for a deleted object - */ - deleted: true; - } - - interface SkuCreateParams { - /** - * 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; - - /** - * Description of the SKU's inventory. - */ - inventory: SkuCreateParams.Inventory; - - /** - * The cost of the item as a nonnegative integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price: number; - - /** - * The ID of the product this SKU is associated with. Must be a product with type `good`. - */ - product: string; - - /** - * Whether the SKU is available for purchase. Default to `true`. - */ - active?: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are `["size", "gender"]`, a valid SKU has the following dictionary of attributes: `{"size": "Medium", "gender": "Unisex"}`. - */ - attributes?: { - [key: string]: string; - }; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly generated. - */ - id?: string; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions?: SkuCreateParams.PackageDimensions; - } - - namespace SkuCreateParams { - interface Inventory { - /** - * The count of inventory available. Required if `type` is `finite`. - */ - quantity?: number; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type: Inventory.Type; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value?: Stripe.Emptyable; - } - - namespace Inventory { - type Type = 'bucket' | 'finite' | 'infinite'; - - type Value = 'in_stock' | 'limited' | 'out_of_stock'; - } - - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - - interface SkuRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SkuUpdateParams { - /** - * Whether this SKU is available for purchase. - */ - active?: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. When specified, `attributes` will partially update the existing attributes dictionary on the product, with the postcondition that a value must be present for each attribute key on the product. - */ - attributes?: { - [key: string]: 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; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image?: string; - - /** - * Description of the SKU's inventory. - */ - inventory?: SkuUpdateParams.Inventory; - - /** - * 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; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price?: number; - - /** - * The ID of the product that this SKU should belong to. The product must exist, have the same set of attribute names as the SKU's current product, and be of type `good`. - */ - product?: string; - } - - namespace SkuUpdateParams { - interface Inventory { - /** - * The count of inventory available. Required if `type` is `finite`. - */ - quantity?: number; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type?: Inventory.Type; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value?: Stripe.Emptyable; - } - - namespace Inventory { - type Type = 'bucket' | 'finite' | 'infinite'; - - type Value = 'in_stock' | 'limited' | 'out_of_stock'; - } - - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - - interface SkuListParams extends PaginationParams { - /** - * Only return SKUs that are active or inactive (e.g., pass `false` to list all inactive products). - */ - active?: boolean; - - /** - * Only return SKUs that have the specified key-value pairs in this partially constructed dictionary. Can be specified only if `product` is also supplied. For instance, if the associated product has attributes `["color", "size"]`, passing in `attributes[color]=red` returns all the SKUs for this product that have `color` set to `red`. - */ - attributes?: { - [key: string]: string; - }; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return SKUs with the given IDs. - */ - ids?: Array; - - /** - * Only return SKUs that are either in stock or out of stock (e.g., pass `false` to list all SKUs that are out of stock). If no value is provided, all SKUs are returned. - */ - in_stock?: boolean; - - /** - * The ID of the product whose SKUs will be retrieved. Must be a product with type `good`. - */ - product?: string; - } - - interface SkuDeleteParams {} - - class SkusResource { - /** - * Creates a new SKU associated with a product. - */ - create( - params: SkuCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information. - */ - retrieve( - id: string, - params?: SkuRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * Note that a SKU's attributes are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values. - */ - update( - id: string, - params?: SkuUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first. - */ - list( - params?: SkuListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Delete a SKU. Deleting a SKU is only possible until it has been used in an order. - */ - del( - id: string, - params?: SkuDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } - } -} diff --git a/types/2022-08-01/AccountLinks.d.ts b/types/2022-11-15/AccountLinks.d.ts similarity index 100% rename from types/2022-08-01/AccountLinks.d.ts rename to types/2022-11-15/AccountLinks.d.ts diff --git a/types/2022-08-01/Accounts.d.ts b/types/2022-11-15/Accounts.d.ts similarity index 100% rename from types/2022-08-01/Accounts.d.ts rename to types/2022-11-15/Accounts.d.ts diff --git a/types/2022-08-01/ApplePayDomains.d.ts b/types/2022-11-15/ApplePayDomains.d.ts similarity index 100% rename from types/2022-08-01/ApplePayDomains.d.ts rename to types/2022-11-15/ApplePayDomains.d.ts diff --git a/types/2022-08-01/ApplicationFees.d.ts b/types/2022-11-15/ApplicationFees.d.ts similarity index 100% rename from types/2022-08-01/ApplicationFees.d.ts rename to types/2022-11-15/ApplicationFees.d.ts diff --git a/types/2022-08-01/Applications.d.ts b/types/2022-11-15/Applications.d.ts similarity index 100% rename from types/2022-08-01/Applications.d.ts rename to types/2022-11-15/Applications.d.ts diff --git a/types/2022-08-01/Apps/Secrets.d.ts b/types/2022-11-15/Apps/Secrets.d.ts similarity index 100% rename from types/2022-08-01/Apps/Secrets.d.ts rename to types/2022-11-15/Apps/Secrets.d.ts diff --git a/types/2022-08-01/Balance.d.ts b/types/2022-11-15/Balance.d.ts similarity index 100% rename from types/2022-08-01/Balance.d.ts rename to types/2022-11-15/Balance.d.ts diff --git a/types/2022-08-01/BalanceTransactions.d.ts b/types/2022-11-15/BalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/BalanceTransactions.d.ts rename to types/2022-11-15/BalanceTransactions.d.ts diff --git a/types/2022-08-01/BankAccounts.d.ts b/types/2022-11-15/BankAccounts.d.ts similarity index 100% rename from types/2022-08-01/BankAccounts.d.ts rename to types/2022-11-15/BankAccounts.d.ts diff --git a/types/2022-08-01/BillingPortal/Configurations.d.ts b/types/2022-11-15/BillingPortal/Configurations.d.ts similarity index 100% rename from types/2022-08-01/BillingPortal/Configurations.d.ts rename to types/2022-11-15/BillingPortal/Configurations.d.ts diff --git a/types/2022-08-01/BillingPortal/Sessions.d.ts b/types/2022-11-15/BillingPortal/Sessions.d.ts similarity index 100% rename from types/2022-08-01/BillingPortal/Sessions.d.ts rename to types/2022-11-15/BillingPortal/Sessions.d.ts diff --git a/types/2022-08-01/Capabilities.d.ts b/types/2022-11-15/Capabilities.d.ts similarity index 100% rename from types/2022-08-01/Capabilities.d.ts rename to types/2022-11-15/Capabilities.d.ts diff --git a/types/2022-08-01/Cards.d.ts b/types/2022-11-15/Cards.d.ts similarity index 100% rename from types/2022-08-01/Cards.d.ts rename to types/2022-11-15/Cards.d.ts diff --git a/types/2022-08-01/CashBalances.d.ts b/types/2022-11-15/CashBalances.d.ts similarity index 100% rename from types/2022-08-01/CashBalances.d.ts rename to types/2022-11-15/CashBalances.d.ts diff --git a/types/2022-08-01/Charges.d.ts b/types/2022-11-15/Charges.d.ts similarity index 99% rename from types/2022-08-01/Charges.d.ts rename to types/2022-11-15/Charges.d.ts index 752f3b41ca..177f810fa7 100644 --- a/types/2022-08-01/Charges.d.ts +++ b/types/2022-11-15/Charges.d.ts @@ -204,7 +204,7 @@ declare module 'stripe' { /** * A list of refunds that have been applied to the charge. */ - refunds?: ApiList; + refunds: ApiList | null; /** * ID of the review associated with this charge if one exists. diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-11-15/Checkout/Sessions.d.ts similarity index 99% rename from types/2022-08-01/Checkout/Sessions.d.ts rename to types/2022-11-15/Checkout/Sessions.d.ts index 2b6fd8e96c..dc63b7c02a 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-11-15/Checkout/Sessions.d.ts @@ -1728,11 +1728,6 @@ declare module 'stripe' { */ adjustable_quantity?: LineItem.AdjustableQuantity; - /** - * [Deprecated] The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`. - */ - amount?: number; - /** * The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. */ @@ -3130,11 +3125,6 @@ declare module 'stripe' { */ description?: string; - /** - * This parameter is deprecated. Use the line_items parameter on the Session instead. - */ - items?: Array; - /** * 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`. */ @@ -3170,24 +3160,6 @@ declare module 'stripe' { } namespace SubscriptionData { - interface Item { - /** - * Plan ID for this item. - */ - plan: string; - - /** - * The quantity of the subscription item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. - */ - quantity?: number; - - /** - * The tax rates which apply to this item. When set, the `default_tax_rates` - * on `subscription_data` do not apply to this item. - */ - tax_rates?: Array; - } - interface TransferData { /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. diff --git a/types/2022-08-01/ConnectCollectionTransfers.d.ts b/types/2022-11-15/ConnectCollectionTransfers.d.ts similarity index 100% rename from types/2022-08-01/ConnectCollectionTransfers.d.ts rename to types/2022-11-15/ConnectCollectionTransfers.d.ts diff --git a/types/2022-08-01/CountrySpecs.d.ts b/types/2022-11-15/CountrySpecs.d.ts similarity index 100% rename from types/2022-08-01/CountrySpecs.d.ts rename to types/2022-11-15/CountrySpecs.d.ts diff --git a/types/2022-08-01/Coupons.d.ts b/types/2022-11-15/Coupons.d.ts similarity index 100% rename from types/2022-08-01/Coupons.d.ts rename to types/2022-11-15/Coupons.d.ts diff --git a/types/2022-08-01/CreditNoteLineItems.d.ts b/types/2022-11-15/CreditNoteLineItems.d.ts similarity index 100% rename from types/2022-08-01/CreditNoteLineItems.d.ts rename to types/2022-11-15/CreditNoteLineItems.d.ts diff --git a/types/2022-08-01/CreditNotes.d.ts b/types/2022-11-15/CreditNotes.d.ts similarity index 100% rename from types/2022-08-01/CreditNotes.d.ts rename to types/2022-11-15/CreditNotes.d.ts diff --git a/types/2022-08-01/CustomerBalanceTransactions.d.ts b/types/2022-11-15/CustomerBalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/CustomerBalanceTransactions.d.ts rename to types/2022-11-15/CustomerBalanceTransactions.d.ts diff --git a/types/2022-08-01/CustomerCashBalanceTransactions.d.ts b/types/2022-11-15/CustomerCashBalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/CustomerCashBalanceTransactions.d.ts rename to types/2022-11-15/CustomerCashBalanceTransactions.d.ts diff --git a/types/2022-08-01/CustomerSources.d.ts b/types/2022-11-15/CustomerSources.d.ts similarity index 100% rename from types/2022-08-01/CustomerSources.d.ts rename to types/2022-11-15/CustomerSources.d.ts diff --git a/types/2022-08-01/Customers.d.ts b/types/2022-11-15/Customers.d.ts similarity index 100% rename from types/2022-08-01/Customers.d.ts rename to types/2022-11-15/Customers.d.ts diff --git a/types/2022-08-01/Discounts.d.ts b/types/2022-11-15/Discounts.d.ts similarity index 100% rename from types/2022-08-01/Discounts.d.ts rename to types/2022-11-15/Discounts.d.ts diff --git a/types/2022-08-01/Disputes.d.ts b/types/2022-11-15/Disputes.d.ts similarity index 100% rename from types/2022-08-01/Disputes.d.ts rename to types/2022-11-15/Disputes.d.ts diff --git a/types/2022-08-01/EphemeralKeys.d.ts b/types/2022-11-15/EphemeralKeys.d.ts similarity index 100% rename from types/2022-08-01/EphemeralKeys.d.ts rename to types/2022-11-15/EphemeralKeys.d.ts diff --git a/types/2022-08-01/Events.d.ts b/types/2022-11-15/Events.d.ts similarity index 100% rename from types/2022-08-01/Events.d.ts rename to types/2022-11-15/Events.d.ts diff --git a/types/2022-08-01/ExchangeRates.d.ts b/types/2022-11-15/ExchangeRates.d.ts similarity index 100% rename from types/2022-08-01/ExchangeRates.d.ts rename to types/2022-11-15/ExchangeRates.d.ts diff --git a/types/2022-08-01/ExternalAccounts.d.ts b/types/2022-11-15/ExternalAccounts.d.ts similarity index 100% rename from types/2022-08-01/ExternalAccounts.d.ts rename to types/2022-11-15/ExternalAccounts.d.ts diff --git a/types/2022-08-01/FeeRefunds.d.ts b/types/2022-11-15/FeeRefunds.d.ts similarity index 100% rename from types/2022-08-01/FeeRefunds.d.ts rename to types/2022-11-15/FeeRefunds.d.ts diff --git a/types/2022-08-01/FileLinks.d.ts b/types/2022-11-15/FileLinks.d.ts similarity index 100% rename from types/2022-08-01/FileLinks.d.ts rename to types/2022-11-15/FileLinks.d.ts diff --git a/types/2022-08-01/Files.d.ts b/types/2022-11-15/Files.d.ts similarity index 100% rename from types/2022-08-01/Files.d.ts rename to types/2022-11-15/Files.d.ts diff --git a/types/2022-08-01/FinancialConnections/AccountOwners.d.ts b/types/2022-11-15/FinancialConnections/AccountOwners.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/AccountOwners.d.ts rename to types/2022-11-15/FinancialConnections/AccountOwners.d.ts diff --git a/types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts b/types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts rename to types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts diff --git a/types/2022-08-01/FinancialConnections/Accounts.d.ts b/types/2022-11-15/FinancialConnections/Accounts.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/Accounts.d.ts rename to types/2022-11-15/FinancialConnections/Accounts.d.ts diff --git a/types/2022-08-01/FinancialConnections/Sessions.d.ts b/types/2022-11-15/FinancialConnections/Sessions.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/Sessions.d.ts rename to types/2022-11-15/FinancialConnections/Sessions.d.ts diff --git a/types/2022-08-01/FundingInstructions.d.ts b/types/2022-11-15/FundingInstructions.d.ts similarity index 100% rename from types/2022-08-01/FundingInstructions.d.ts rename to types/2022-11-15/FundingInstructions.d.ts diff --git a/types/2022-08-01/Identity/VerificationReports.d.ts b/types/2022-11-15/Identity/VerificationReports.d.ts similarity index 100% rename from types/2022-08-01/Identity/VerificationReports.d.ts rename to types/2022-11-15/Identity/VerificationReports.d.ts diff --git a/types/2022-08-01/Identity/VerificationSessions.d.ts b/types/2022-11-15/Identity/VerificationSessions.d.ts similarity index 100% rename from types/2022-08-01/Identity/VerificationSessions.d.ts rename to types/2022-11-15/Identity/VerificationSessions.d.ts diff --git a/types/2022-08-01/InvoiceItems.d.ts b/types/2022-11-15/InvoiceItems.d.ts similarity index 100% rename from types/2022-08-01/InvoiceItems.d.ts rename to types/2022-11-15/InvoiceItems.d.ts diff --git a/types/2022-08-01/InvoiceLineItems.d.ts b/types/2022-11-15/InvoiceLineItems.d.ts similarity index 100% rename from types/2022-08-01/InvoiceLineItems.d.ts rename to types/2022-11-15/InvoiceLineItems.d.ts diff --git a/types/2022-08-01/Invoices.d.ts b/types/2022-11-15/Invoices.d.ts similarity index 100% rename from types/2022-08-01/Invoices.d.ts rename to types/2022-11-15/Invoices.d.ts diff --git a/types/2022-08-01/Issuing/Authorizations.d.ts b/types/2022-11-15/Issuing/Authorizations.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Authorizations.d.ts rename to types/2022-11-15/Issuing/Authorizations.d.ts diff --git a/types/2022-08-01/Issuing/Cardholders.d.ts b/types/2022-11-15/Issuing/Cardholders.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Cardholders.d.ts rename to types/2022-11-15/Issuing/Cardholders.d.ts diff --git a/types/2022-08-01/Issuing/Cards.d.ts b/types/2022-11-15/Issuing/Cards.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Cards.d.ts rename to types/2022-11-15/Issuing/Cards.d.ts diff --git a/types/2022-08-01/Issuing/Disputes.d.ts b/types/2022-11-15/Issuing/Disputes.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Disputes.d.ts rename to types/2022-11-15/Issuing/Disputes.d.ts diff --git a/types/2022-08-01/Issuing/Transactions.d.ts b/types/2022-11-15/Issuing/Transactions.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Transactions.d.ts rename to types/2022-11-15/Issuing/Transactions.d.ts diff --git a/types/2022-08-01/LineItems.d.ts b/types/2022-11-15/LineItems.d.ts similarity index 93% rename from types/2022-08-01/LineItems.d.ts rename to types/2022-11-15/LineItems.d.ts index eff3ec0f3c..9c88c9a8ba 100644 --- a/types/2022-08-01/LineItems.d.ts +++ b/types/2022-11-15/LineItems.d.ts @@ -56,13 +56,6 @@ declare module 'stripe' { */ price: Stripe.Price | null; - /** - * The ID of the product for this line item. - * - * This will always be the same as `price.product`. - */ - product?: string | Stripe.Product | Stripe.DeletedProduct; - /** * The quantity of products being purchased. */ diff --git a/types/2022-08-01/LoginLinks.d.ts b/types/2022-11-15/LoginLinks.d.ts similarity index 100% rename from types/2022-08-01/LoginLinks.d.ts rename to types/2022-11-15/LoginLinks.d.ts diff --git a/types/2022-08-01/Mandates.d.ts b/types/2022-11-15/Mandates.d.ts similarity index 100% rename from types/2022-08-01/Mandates.d.ts rename to types/2022-11-15/Mandates.d.ts diff --git a/types/2022-08-01/PaymentIntents.d.ts b/types/2022-11-15/PaymentIntents.d.ts similarity index 99% rename from types/2022-08-01/PaymentIntents.d.ts rename to types/2022-11-15/PaymentIntents.d.ts index 83b8bd9406..d9af3bb497 100644 --- a/types/2022-08-01/PaymentIntents.d.ts +++ b/types/2022-11-15/PaymentIntents.d.ts @@ -73,11 +73,6 @@ declare module 'stripe' { */ capture_method: PaymentIntent.CaptureMethod; - /** - * Charges that were created by this PaymentIntent, if any. - */ - charges?: ApiList; - /** * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. * @@ -123,6 +118,11 @@ declare module 'stripe' { */ last_payment_error: PaymentIntent.LastPaymentError | null; + /** + * The latest charge created by this payment intent. + */ + latest_charge?: string | Stripe.Charge | null; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ diff --git a/types/2022-08-01/PaymentLinks.d.ts b/types/2022-11-15/PaymentLinks.d.ts similarity index 100% rename from types/2022-08-01/PaymentLinks.d.ts rename to types/2022-11-15/PaymentLinks.d.ts diff --git a/types/2022-08-01/PaymentMethods.d.ts b/types/2022-11-15/PaymentMethods.d.ts similarity index 100% rename from types/2022-08-01/PaymentMethods.d.ts rename to types/2022-11-15/PaymentMethods.d.ts diff --git a/types/2022-08-01/Payouts.d.ts b/types/2022-11-15/Payouts.d.ts similarity index 100% rename from types/2022-08-01/Payouts.d.ts rename to types/2022-11-15/Payouts.d.ts diff --git a/types/2022-08-01/Persons.d.ts b/types/2022-11-15/Persons.d.ts similarity index 100% rename from types/2022-08-01/Persons.d.ts rename to types/2022-11-15/Persons.d.ts diff --git a/types/2022-08-01/Plans.d.ts b/types/2022-11-15/Plans.d.ts similarity index 100% rename from types/2022-08-01/Plans.d.ts rename to types/2022-11-15/Plans.d.ts diff --git a/types/2022-08-01/PlatformTaxFees.d.ts b/types/2022-11-15/PlatformTaxFees.d.ts similarity index 100% rename from types/2022-08-01/PlatformTaxFees.d.ts rename to types/2022-11-15/PlatformTaxFees.d.ts diff --git a/types/2022-08-01/Prices.d.ts b/types/2022-11-15/Prices.d.ts similarity index 100% rename from types/2022-08-01/Prices.d.ts rename to types/2022-11-15/Prices.d.ts diff --git a/types/2022-08-01/Products.d.ts b/types/2022-11-15/Products.d.ts similarity index 100% rename from types/2022-08-01/Products.d.ts rename to types/2022-11-15/Products.d.ts diff --git a/types/2022-08-01/PromotionCodes.d.ts b/types/2022-11-15/PromotionCodes.d.ts similarity index 100% rename from types/2022-08-01/PromotionCodes.d.ts rename to types/2022-11-15/PromotionCodes.d.ts diff --git a/types/2022-08-01/Quotes.d.ts b/types/2022-11-15/Quotes.d.ts similarity index 100% rename from types/2022-08-01/Quotes.d.ts rename to types/2022-11-15/Quotes.d.ts diff --git a/types/2022-08-01/Radar/EarlyFraudWarnings.d.ts b/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts similarity index 100% rename from types/2022-08-01/Radar/EarlyFraudWarnings.d.ts rename to types/2022-11-15/Radar/EarlyFraudWarnings.d.ts diff --git a/types/2022-08-01/Radar/ValueListItems.d.ts b/types/2022-11-15/Radar/ValueListItems.d.ts similarity index 100% rename from types/2022-08-01/Radar/ValueListItems.d.ts rename to types/2022-11-15/Radar/ValueListItems.d.ts diff --git a/types/2022-08-01/Radar/ValueLists.d.ts b/types/2022-11-15/Radar/ValueLists.d.ts similarity index 100% rename from types/2022-08-01/Radar/ValueLists.d.ts rename to types/2022-11-15/Radar/ValueLists.d.ts diff --git a/types/2022-08-01/Refunds.d.ts b/types/2022-11-15/Refunds.d.ts similarity index 97% rename from types/2022-08-01/Refunds.d.ts rename to types/2022-11-15/Refunds.d.ts index 97e274cd4b..f620ad25da 100644 --- a/types/2022-08-01/Refunds.d.ts +++ b/types/2022-11-15/Refunds.d.ts @@ -7,10 +7,6 @@ declare module 'stripe' { * but not yet refunded. Funds will be refunded to the credit or debit card that * was originally charged. * - * Stripe Tax users with recurring payments and invoices can create [Credit Notes](https://stripe.com/docs/api/credit_notes), - * which reduce overall tax liability because tax is correctly recalculated and - * apportioned to the related invoice. - * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ interface Refund { diff --git a/types/2022-08-01/Reporting/ReportRuns.d.ts b/types/2022-11-15/Reporting/ReportRuns.d.ts similarity index 100% rename from types/2022-08-01/Reporting/ReportRuns.d.ts rename to types/2022-11-15/Reporting/ReportRuns.d.ts diff --git a/types/2022-08-01/Reporting/ReportTypes.d.ts b/types/2022-11-15/Reporting/ReportTypes.d.ts similarity index 100% rename from types/2022-08-01/Reporting/ReportTypes.d.ts rename to types/2022-11-15/Reporting/ReportTypes.d.ts diff --git a/types/2022-08-01/ReserveTransactions.d.ts b/types/2022-11-15/ReserveTransactions.d.ts similarity index 100% rename from types/2022-08-01/ReserveTransactions.d.ts rename to types/2022-11-15/ReserveTransactions.d.ts diff --git a/types/2022-08-01/Reviews.d.ts b/types/2022-11-15/Reviews.d.ts similarity index 100% rename from types/2022-08-01/Reviews.d.ts rename to types/2022-11-15/Reviews.d.ts diff --git a/types/2022-08-01/SetupAttempts.d.ts b/types/2022-11-15/SetupAttempts.d.ts similarity index 100% rename from types/2022-08-01/SetupAttempts.d.ts rename to types/2022-11-15/SetupAttempts.d.ts diff --git a/types/2022-08-01/SetupIntents.d.ts b/types/2022-11-15/SetupIntents.d.ts similarity index 100% rename from types/2022-08-01/SetupIntents.d.ts rename to types/2022-11-15/SetupIntents.d.ts diff --git a/types/2022-08-01/ShippingRates.d.ts b/types/2022-11-15/ShippingRates.d.ts similarity index 100% rename from types/2022-08-01/ShippingRates.d.ts rename to types/2022-11-15/ShippingRates.d.ts diff --git a/types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts b/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts similarity index 100% rename from types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts rename to types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts diff --git a/types/2022-08-01/SourceMandateNotifications.d.ts b/types/2022-11-15/SourceMandateNotifications.d.ts similarity index 100% rename from types/2022-08-01/SourceMandateNotifications.d.ts rename to types/2022-11-15/SourceMandateNotifications.d.ts diff --git a/types/2022-08-01/SourceTransactions.d.ts b/types/2022-11-15/SourceTransactions.d.ts similarity index 100% rename from types/2022-08-01/SourceTransactions.d.ts rename to types/2022-11-15/SourceTransactions.d.ts diff --git a/types/2022-08-01/Sources.d.ts b/types/2022-11-15/Sources.d.ts similarity index 100% rename from types/2022-08-01/Sources.d.ts rename to types/2022-11-15/Sources.d.ts diff --git a/types/2022-08-01/SubscriptionItems.d.ts b/types/2022-11-15/SubscriptionItems.d.ts similarity index 100% rename from types/2022-08-01/SubscriptionItems.d.ts rename to types/2022-11-15/SubscriptionItems.d.ts diff --git a/types/2022-08-01/SubscriptionSchedules.d.ts b/types/2022-11-15/SubscriptionSchedules.d.ts similarity index 100% rename from types/2022-08-01/SubscriptionSchedules.d.ts rename to types/2022-11-15/SubscriptionSchedules.d.ts diff --git a/types/2022-08-01/Subscriptions.d.ts b/types/2022-11-15/Subscriptions.d.ts similarity index 100% rename from types/2022-08-01/Subscriptions.d.ts rename to types/2022-11-15/Subscriptions.d.ts diff --git a/types/2022-08-01/TaxCodes.d.ts b/types/2022-11-15/TaxCodes.d.ts similarity index 100% rename from types/2022-08-01/TaxCodes.d.ts rename to types/2022-11-15/TaxCodes.d.ts diff --git a/types/2022-08-01/TaxDeductedAtSources.d.ts b/types/2022-11-15/TaxDeductedAtSources.d.ts similarity index 100% rename from types/2022-08-01/TaxDeductedAtSources.d.ts rename to types/2022-11-15/TaxDeductedAtSources.d.ts diff --git a/types/2022-08-01/TaxIds.d.ts b/types/2022-11-15/TaxIds.d.ts similarity index 100% rename from types/2022-08-01/TaxIds.d.ts rename to types/2022-11-15/TaxIds.d.ts diff --git a/types/2022-08-01/TaxRates.d.ts b/types/2022-11-15/TaxRates.d.ts similarity index 100% rename from types/2022-08-01/TaxRates.d.ts rename to types/2022-11-15/TaxRates.d.ts diff --git a/types/2022-08-01/Terminal/Configurations.d.ts b/types/2022-11-15/Terminal/Configurations.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Configurations.d.ts rename to types/2022-11-15/Terminal/Configurations.d.ts diff --git a/types/2022-08-01/Terminal/ConnectionTokens.d.ts b/types/2022-11-15/Terminal/ConnectionTokens.d.ts similarity index 100% rename from types/2022-08-01/Terminal/ConnectionTokens.d.ts rename to types/2022-11-15/Terminal/ConnectionTokens.d.ts diff --git a/types/2022-08-01/Terminal/Locations.d.ts b/types/2022-11-15/Terminal/Locations.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Locations.d.ts rename to types/2022-11-15/Terminal/Locations.d.ts diff --git a/types/2022-08-01/Terminal/Readers.d.ts b/types/2022-11-15/Terminal/Readers.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Readers.d.ts rename to types/2022-11-15/Terminal/Readers.d.ts diff --git a/types/2022-08-01/TestHelpers/Customers.d.ts b/types/2022-11-15/TestHelpers/Customers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Customers.d.ts rename to types/2022-11-15/TestHelpers/Customers.d.ts diff --git a/types/2022-08-01/TestHelpers/Issuing/Cards.d.ts b/types/2022-11-15/TestHelpers/Issuing/Cards.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Issuing/Cards.d.ts rename to types/2022-11-15/TestHelpers/Issuing/Cards.d.ts diff --git a/types/2022-08-01/TestHelpers/Refunds.d.ts b/types/2022-11-15/TestHelpers/Refunds.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Refunds.d.ts rename to types/2022-11-15/TestHelpers/Refunds.d.ts diff --git a/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts b/types/2022-11-15/TestHelpers/Terminal/Readers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Terminal/Readers.d.ts rename to types/2022-11-15/TestHelpers/Terminal/Readers.d.ts diff --git a/types/2022-08-01/TestHelpers/TestClocks.d.ts b/types/2022-11-15/TestHelpers/TestClocks.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/TestClocks.d.ts rename to types/2022-11-15/TestHelpers/TestClocks.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts diff --git a/types/2022-08-01/Tokens.d.ts b/types/2022-11-15/Tokens.d.ts similarity index 100% rename from types/2022-08-01/Tokens.d.ts rename to types/2022-11-15/Tokens.d.ts diff --git a/types/2022-08-01/Topups.d.ts b/types/2022-11-15/Topups.d.ts similarity index 100% rename from types/2022-08-01/Topups.d.ts rename to types/2022-11-15/Topups.d.ts diff --git a/types/2022-08-01/TransferReversals.d.ts b/types/2022-11-15/TransferReversals.d.ts similarity index 100% rename from types/2022-08-01/TransferReversals.d.ts rename to types/2022-11-15/TransferReversals.d.ts diff --git a/types/2022-08-01/Transfers.d.ts b/types/2022-11-15/Transfers.d.ts similarity index 100% rename from types/2022-08-01/Transfers.d.ts rename to types/2022-11-15/Transfers.d.ts diff --git a/types/2022-08-01/Treasury/CreditReversals.d.ts b/types/2022-11-15/Treasury/CreditReversals.d.ts similarity index 100% rename from types/2022-08-01/Treasury/CreditReversals.d.ts rename to types/2022-11-15/Treasury/CreditReversals.d.ts diff --git a/types/2022-08-01/Treasury/DebitReversals.d.ts b/types/2022-11-15/Treasury/DebitReversals.d.ts similarity index 100% rename from types/2022-08-01/Treasury/DebitReversals.d.ts rename to types/2022-11-15/Treasury/DebitReversals.d.ts diff --git a/types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts b/types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts similarity index 100% rename from types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts rename to types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts diff --git a/types/2022-08-01/Treasury/FinancialAccounts.d.ts b/types/2022-11-15/Treasury/FinancialAccounts.d.ts similarity index 100% rename from types/2022-08-01/Treasury/FinancialAccounts.d.ts rename to types/2022-11-15/Treasury/FinancialAccounts.d.ts diff --git a/types/2022-08-01/Treasury/InboundTransfers.d.ts b/types/2022-11-15/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/Treasury/InboundTransfers.d.ts rename to types/2022-11-15/Treasury/InboundTransfers.d.ts diff --git a/types/2022-08-01/Treasury/OutboundPayments.d.ts b/types/2022-11-15/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2022-08-01/Treasury/OutboundPayments.d.ts rename to types/2022-11-15/Treasury/OutboundPayments.d.ts diff --git a/types/2022-08-01/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/Treasury/OutboundTransfers.d.ts rename to types/2022-11-15/Treasury/OutboundTransfers.d.ts diff --git a/types/2022-08-01/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2022-08-01/Treasury/ReceivedCredits.d.ts rename to types/2022-11-15/Treasury/ReceivedCredits.d.ts diff --git a/types/2022-08-01/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2022-08-01/Treasury/ReceivedDebits.d.ts rename to types/2022-11-15/Treasury/ReceivedDebits.d.ts diff --git a/types/2022-08-01/Treasury/TransactionEntries.d.ts b/types/2022-11-15/Treasury/TransactionEntries.d.ts similarity index 100% rename from types/2022-08-01/Treasury/TransactionEntries.d.ts rename to types/2022-11-15/Treasury/TransactionEntries.d.ts diff --git a/types/2022-08-01/Treasury/Transactions.d.ts b/types/2022-11-15/Treasury/Transactions.d.ts similarity index 100% rename from types/2022-08-01/Treasury/Transactions.d.ts rename to types/2022-11-15/Treasury/Transactions.d.ts diff --git a/types/2022-08-01/UsageRecordSummaries.d.ts b/types/2022-11-15/UsageRecordSummaries.d.ts similarity index 100% rename from types/2022-08-01/UsageRecordSummaries.d.ts rename to types/2022-11-15/UsageRecordSummaries.d.ts diff --git a/types/2022-08-01/UsageRecords.d.ts b/types/2022-11-15/UsageRecords.d.ts similarity index 100% rename from types/2022-08-01/UsageRecords.d.ts rename to types/2022-11-15/UsageRecords.d.ts diff --git a/types/2022-08-01/WebhookEndpoints.d.ts b/types/2022-11-15/WebhookEndpoints.d.ts similarity index 99% rename from types/2022-08-01/WebhookEndpoints.d.ts rename to types/2022-11-15/WebhookEndpoints.d.ts index 17d2b739e1..fcdb1516f5 100644 --- a/types/2022-08-01/WebhookEndpoints.d.ts +++ b/types/2022-11-15/WebhookEndpoints.d.ts @@ -230,7 +230,8 @@ declare module 'stripe' { | '2019-12-03' | '2020-03-02' | '2020-08-27' - | '2022-08-01'; + | '2022-08-01' + | '2022-11-15'; type EnabledEvent = | '*' diff --git a/types/2022-08-01/index.d.ts b/types/2022-11-15/index.d.ts similarity index 91% rename from types/2022-08-01/index.d.ts rename to types/2022-11-15/index.d.ts index ab72cdea9f..d53f23723c 100644 --- a/types/2022-08-01/index.d.ts +++ b/types/2022-11-15/index.d.ts @@ -59,7 +59,6 @@ /// /// /// -/// /// /// /// @@ -79,7 +78,6 @@ /// /// /// -/// /// /// /// @@ -136,8 +134,6 @@ declare module 'stripe' { constructor(apiKey: string, config: Stripe.StripeConfig); - setAppInfo(info: Stripe.AppInfo): void; - StripeResource: Stripe.StripeResource; /** @@ -163,7 +159,6 @@ declare module 'stripe' { invoices: Stripe.InvoicesResource; invoiceItems: Stripe.InvoiceItemsResource; mandates: Stripe.MandatesResource; - orders: Stripe.OrdersResource; paymentIntents: Stripe.PaymentIntentsResource; paymentLinks: Stripe.PaymentLinksResource; paymentMethods: Stripe.PaymentMethodsResource; @@ -178,7 +173,6 @@ declare module 'stripe' { setupAttempts: Stripe.SetupAttemptsResource; setupIntents: Stripe.SetupIntentsResource; shippingRates: Stripe.ShippingRatesResource; - skus: Stripe.SkusResource; sources: Stripe.SourcesResource; subscriptions: Stripe.SubscriptionsResource; subscriptionItems: Stripe.SubscriptionItemsResource; @@ -285,27 +279,6 @@ declare module 'stripe' { event: 'response', handler: (event: Stripe.ResponseEvent) => void ): void; - - setProtocol(protocol: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setHost(host: string, port?: string | number, protocol?: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setPort(port: string | number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setApiVersion(version: Stripe.LatestApiVersion): void; - /** @deprecated Please use the StripeConfig object instead. */ - setApiKey(key: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setTimeout(timeout?: number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setMaxNetworkRetries(maxNetworkRetries: number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setTelemetryEnabled(enabled: boolean): void; - /** @deprecated Please use the StripeConfig object instead. */ - setHttpAgent(agent: Stripe.HttpAgent): void; } export default Stripe; diff --git a/types/lib.d.ts b/types/lib.d.ts index cf4b19e211..f63308e3a4 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -52,7 +52,7 @@ declare module 'stripe' { }; static MAX_BUFFERED_REQUEST_METRICS: number; } - export type LatestApiVersion = '2022-08-01'; + export type LatestApiVersion = '2022-11-15'; export type HttpAgent = Agent; export type HttpProtocol = 'http' | 'https'; diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index ebd0b7da64..08c2418b2b 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -5,11 +5,11 @@ * and to perform a basic sanity check that types are exported as intended. */ -/// +/// import Stripe from 'stripe'; let stripe = new Stripe('sk_test_123', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); // @ts-ignore lazily ignore apiVersion requirement. @@ -27,7 +27,7 @@ stripe = new Stripe('sk_test_123', { // Check config object. stripe = new Stripe('sk_test_123', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', typescript: true, maxNetworkRetries: 1, timeout: 1000, @@ -35,21 +35,17 @@ stripe = new Stripe('sk_test_123', { port: 123, telemetry: true, httpClient: Stripe.createNodeHttpClient(), + appInfo: { + name: 'my-wordpress-plugin', + }, }); -stripe.setTimeout(3000); -stripe.setAppInfo({ - name: 'my-wordpress-plugin', -}); - -stripe.setHost('host', 'port', 'protocol'); - (async (): Promise => { const params: Stripe.CustomerCreateParams = { description: 'test', }; const opts: Stripe.RequestOptions = { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }; const customer: Stripe.Customer = await stripe.customers.create(params, opts); From a2114a5990169c02b04eec7c284ab338ea059c33 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 16 Nov 2022 12:03:39 -0800 Subject: [PATCH 04/23] Bump version to 11.0.0 --- CHANGELOG.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd888d4bbb..e8782ff526 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,74 @@ # Changelog +## 11.0.0 - 2022-11-16 + +This release includes breaking changes resulting from moving to use the new API version "2022-11-15". To learn more about these changes to Stripe products, see https://stripe.com/docs/upgrades#2022-11-15 + +"⚠️" symbol highlights breaking changes. + +* [#1608](https://github.com/stripe/stripe-node/pull/1608) Next major release changes +* [#1619](https://github.com/stripe/stripe-node/pull/1619) Annotate prototypes with types +* [#1612](https://github.com/stripe/stripe-node/pull/1612) Add type information here and there +* [#1615](https://github.com/stripe/stripe-node/pull/1615) API Updates + * ⚠️ Remove support for `tos_shown_and_accepted` on `CheckoutSessionCreateParams.payment_method_options.paynow`. The property was mistakenly released and never worked. + +### ⚠️ Changed +* Drop support for Node.js 8 and 10. We now support Node.js 12+. ((#1579) +* Change `StripeSignatureVerificationError` to have `header` and `payload` fields instead of `detail`. To access these properties, use `err.header` and `err.payload` instead of `err.detail.header` and `err.detail.payload`. (#1574) + +### ⚠️ Removed +* Remove `Orders` resource. (#1580) +* Remove `SKU` resource (#1583) +* Remove deprecated `CheckoutSessionCreateParams.subscription_data.items`. (#1580) +* Remove deprecated configuration setter methods (`setHost`, `setProtocol`, `setPort`, `setApiVersion`, `setApiKey`, `setTimeout`, `setAppInfo`, `setHttpAgent`, `setMaxNetworkRetries`, and `setTelemetryEnabled`). (#1597) + + Use the config object to set these options instead, for example: + ```typescript + const stripe = Stripe('sk_test_...', { + apiVersion: '2019-08-08', + maxNetworkRetries: 1, + httpAgent: new ProxyAgent(process.env.http_proxy), + timeout: 1000, + host: 'api.example.com', + port: 123, + telemetry: true, + }); + ``` +* Remove deprecated basic method definitions. (#1600) + Use basic methods defined on the resource instead. + ```typescript + // Before + basicMethods: true + + // After + create: stripeMethod({ + method: 'POST', + fullPath: '/v1/resource', + }), + list: stripeMethod({ + method: 'GET', + methodType: 'list', + fullPath: '/v1/resource', + }), + retrieve: stripeMethod({ + method: 'GET', + fullPath: '/v1/resource/{id}', + }), + update: stripeMethod({ + method: 'POST', + fullPath: '/v1/resource/{id}', + }), + // Avoid 'delete' keyword in JS + del: stripeMethod({ + method: 'DELETE', + fullPath: '/v1/resource/{id}', + }), + ``` +* Remove deprecated option names. Use the following option names instead (`OLD`->`NEW`): `api_key`->`apiKey`, `idempotency_key`->`idempotencyKey`, `stripe_account`->`stripeAccount`, `stripe_version`->`apiVersion`, `stripeVersion`->`apiVersion`. (#1600) +* Remove `charges` field on `PaymentIntent` and replace it with `latest_charge`. (#1614 ) +* Remove deprecated `amount` field on `Checkout.Session.LineItem`. (#1614 ) +* Remove support for `tos_shown_and_accepted` on `Checkout.Session.PaymentMethodOptions.Paynow`. (#1614 ) + ## 10.17.0 - 2022-11-08 * [#1610](https://github.com/stripe/stripe-node/pull/1610) API Updates * Add support for new values `eg_tin`, `ph_tin`, and `tr_tin` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, `Order.tax_details.tax_ids[].type`, and `TaxId.type` diff --git a/VERSION b/VERSION index 73bffb0393..275283a18f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.17.0 +11.0.0 diff --git a/package.json b/package.json index e7c6cb83c5..a70a9b7406 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.17.0", + "version": "11.0.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 250a35f826453d293abcc9dd639faf0165126e25 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 17 Nov 2022 13:13:09 -0800 Subject: [PATCH 05/23] API Updates (#1622) Codegen for openapi v209 --- OPENAPI_VERSION | 2 +- types/2022-11-15/Checkout/Sessions.d.ts | 63 ++++++++++++++++ types/2022-11-15/PaymentIntents.d.ts | 5 ++ types/2022-11-15/PaymentLinks.d.ts | 96 +++++++++++++++++++++++++ 4 files changed, 165 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1f9307ddf2..87d0d4f1ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v207 \ No newline at end of file +v209 \ No newline at end of file diff --git a/types/2022-11-15/Checkout/Sessions.d.ts b/types/2022-11-15/Checkout/Sessions.d.ts index dc63b7c02a..1cc233e916 100644 --- a/types/2022-11-15/Checkout/Sessions.d.ts +++ b/types/2022-11-15/Checkout/Sessions.d.ts @@ -90,6 +90,8 @@ declare module 'stripe' { */ currency: string | null; + custom_text: Session.CustomText; + /** * The ID of the customer for this Session. * For Checkout Sessions in `payment` or `subscription` mode, Checkout @@ -446,6 +448,34 @@ declare module 'stripe' { } } + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address: CustomText.ShippingAddress | null; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit: CustomText.Submit | null; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + type Locale = | 'auto' | 'bg' @@ -1464,6 +1494,11 @@ declare module 'stripe' { */ currency?: string; + /** + * Display additional text for your customers using custom text. + */ + custom_text?: SessionCreateParams.CustomText; + /** * 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 @@ -1710,6 +1745,34 @@ declare module 'stripe' { type Shipping = 'auto' | 'never'; } + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface Discount { /** * The ID of the coupon to apply to this Session. diff --git a/types/2022-11-15/PaymentIntents.d.ts b/types/2022-11-15/PaymentIntents.d.ts index d9af3bb497..0f445dbb2a 100644 --- a/types/2022-11-15/PaymentIntents.d.ts +++ b/types/2022-11-15/PaymentIntents.d.ts @@ -745,6 +745,11 @@ declare module 'stripe' { */ data: string; + /** + * The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. + */ + hosted_instructions_url: string | null; + /** * The image_url_png string used to render QR code */ diff --git a/types/2022-11-15/PaymentLinks.d.ts b/types/2022-11-15/PaymentLinks.d.ts index b3fa8238e6..074b5c706f 100644 --- a/types/2022-11-15/PaymentLinks.d.ts +++ b/types/2022-11-15/PaymentLinks.d.ts @@ -59,6 +59,8 @@ declare module 'stripe' { */ currency: string; + custom_text: PaymentLink.CustomText; + /** * Configuration for Customer creation during checkout. */ @@ -193,6 +195,34 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address: CustomText.ShippingAddress | null; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit: CustomText.Submit | null; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface PaymentIntentData { /** * Indicates when the funds will be captured from the customer's account. @@ -587,6 +617,11 @@ declare module 'stripe' { */ currency?: string; + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkCreateParams.CustomText; + /** * 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). */ @@ -732,6 +767,34 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. @@ -1158,6 +1221,11 @@ declare module 'stripe' { */ billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection; + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkUpdateParams.CustomText; + /** * 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). */ @@ -1249,6 +1317,34 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. From bf2790146f24de9d3e39d5354dbb996e88aa6f77 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 17 Nov 2022 15:17:56 -0800 Subject: [PATCH 06/23] API Updates (#1623) Codegen for openapi v210 --- OPENAPI_VERSION | 2 +- types/2022-11-15/PaymentIntents.d.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 87d0d4f1ad..807458b5fa 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v209 \ No newline at end of file +v210 \ No newline at end of file diff --git a/types/2022-11-15/PaymentIntents.d.ts b/types/2022-11-15/PaymentIntents.d.ts index 0f445dbb2a..5e3cef4340 100644 --- a/types/2022-11-15/PaymentIntents.d.ts +++ b/types/2022-11-15/PaymentIntents.d.ts @@ -800,12 +800,12 @@ declare module 'stripe' { hosted_instructions_url: string; /** - * The image_url_png string used to render QR code, can be used as + * The PNG path used to render the QR code, can be used as the source in an HTML img tag */ image_url_png: string; /** - * The image_url_svg string used to render QR code, can be used as + * The SVG path used to render the QR code, can be used as the source in an HTML img tag */ image_url_svg: string; } @@ -851,6 +851,11 @@ declare module 'stripe' { */ data: string; + /** + * The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. + */ + hosted_instructions_url: string; + /** * The base64 image data for a pre-generated QR code */ From 90361ac06cf421b1d4d9ffd21a371d946e39f056 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 17 Nov 2022 15:24:44 -0800 Subject: [PATCH 07/23] Bump version to 11.1.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8782ff526..0139e99f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 11.1.0 - 2022-11-17 +* [#1623](https://github.com/stripe/stripe-node/pull/1623) API Updates + * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.wechat_pay_display_qr_code` +* [#1622](https://github.com/stripe/stripe-node/pull/1622) API Updates + * Add support for `custom_text` on `Checkout.Session`, `CheckoutSessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink` + * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.paynow_display_qr_code` + + ## 11.0.0 - 2022-11-16 This release includes breaking changes resulting from moving to use the new API version "2022-11-15". To learn more about these changes to Stripe products, see https://stripe.com/docs/upgrades#2022-11-15 diff --git a/VERSION b/VERSION index 275283a18f..68d8f15e23 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.0.0 +11.1.0 diff --git a/package.json b/package.json index a70a9b7406..b303c839f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "11.0.0", + "version": "11.1.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 38fe8961d49003c95aa47d2b142cbd1a78074c45 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Tue, 22 Nov 2022 13:55:45 -0800 Subject: [PATCH 08/23] Split resource and service types (#1624) --- test/stripe.spec.js | 3 +- testProjects/cjs/package.json | 2 +- testProjects/mjs-ts/index.ts | 39 + testProjects/mjs-ts/package.json | 13 + testProjects/mjs/package.json | 2 +- types/2022-11-15/AccountLinks.d.ts | 52 - types/2022-11-15/AccountLinksResource.d.ts | 57 + types/2022-11-15/Accounts.d.ts | 2690 -------- types/2022-11-15/AccountsResource.d.ts | 2695 ++++++++ types/2022-11-15/ApplePayDomains.d.ts | 72 - types/2022-11-15/ApplePayDomainsResource.d.ts | 77 + types/2022-11-15/ApplicationFees.d.ts | 106 - types/2022-11-15/ApplicationFeesResource.d.ts | 111 + types/2022-11-15/Apps/Secrets.d.ts | 179 - types/2022-11-15/Apps/SecretsResource.d.ts | 186 + types/2022-11-15/Balance.d.ts | 21 - types/2022-11-15/BalanceResource.d.ts | 26 + types/2022-11-15/BalanceTransactions.d.ts | 69 - .../BalanceTransactionsResource.d.ts | 74 + types/2022-11-15/BankAccountsResource.d.ts | 5 + .../BillingPortal/Configurations.d.ts | 546 -- .../BillingPortal/ConfigurationsResource.d.ts | 553 ++ types/2022-11-15/BillingPortal/Sessions.d.ts | 93 - .../BillingPortal/SessionsResource.d.ts | 100 + types/2022-11-15/Capabilities.d.ts | 26 - types/2022-11-15/CapabilitiesResource.d.ts | 31 + types/2022-11-15/CardsResource.d.ts | 5 + types/2022-11-15/CashBalances.d.ts | 32 - types/2022-11-15/CashBalancesResource.d.ts | 37 + types/2022-11-15/Charges.d.ts | 410 -- types/2022-11-15/ChargesResource.d.ts | 415 ++ types/2022-11-15/Checkout/Sessions.d.ts | 1918 ------ .../2022-11-15/Checkout/SessionsResource.d.ts | 1925 ++++++ types/2022-11-15/CountrySpecs.d.ts | 38 - types/2022-11-15/CountrySpecsResource.d.ts | 43 + types/2022-11-15/Coupons.d.ts | 198 - types/2022-11-15/CouponsResource.d.ts | 203 + types/2022-11-15/CreditNoteLineItems.d.ts | 7 - .../CreditNoteLineItemsResource.d.ts | 12 + types/2022-11-15/CreditNotes.d.ts | 477 -- types/2022-11-15/CreditNotesResource.d.ts | 482 ++ .../CustomerBalanceTransactions.d.ts | 58 - .../CustomerBalanceTransactionsResource.d.ts | 63 + .../CustomerCashBalanceTransactions.d.ts | 15 - ...stomerCashBalanceTransactionsResource.d.ts | 20 + ...rces.d.ts => CustomerSourcesResource.d.ts} | 0 types/2022-11-15/Customers.d.ts | 992 --- types/2022-11-15/CustomersResource.d.ts | 997 +++ types/2022-11-15/Disputes.d.ts | 244 - types/2022-11-15/DisputesResource.d.ts | 249 + types/2022-11-15/EphemeralKeys.d.ts | 50 - types/2022-11-15/EphemeralKeysResource.d.ts | 55 + types/2022-11-15/Events.d.ts | 55 - types/2022-11-15/EventsResource.d.ts | 60 + types/2022-11-15/ExchangeRates.d.ts | 38 - types/2022-11-15/ExchangeRatesResource.d.ts | 43 + ...nts.d.ts => ExternalAccountsResource.d.ts} | 0 types/2022-11-15/FeeRefunds.d.ts | 43 - types/2022-11-15/FeeRefundsResource.d.ts | 48 + types/2022-11-15/FileLinks.d.ts | 106 - types/2022-11-15/FileLinksResource.d.ts | 111 + types/2022-11-15/Files.d.ts | 77 - types/2022-11-15/FilesResource.d.ts | 82 + .../FinancialConnections/Accounts.d.ts | 130 - .../AccountsResource.d.ts | 137 + .../FinancialConnections/Sessions.d.ts | 95 - .../SessionsResource.d.ts | 102 + .../Identity/VerificationReports.d.ts | 56 - .../Identity/VerificationReportsResource.d.ts | 63 + .../Identity/VerificationSessions.d.ts | 267 - .../VerificationSessionsResource.d.ts | 274 + types/2022-11-15/InvoiceItems.d.ts | 379 -- types/2022-11-15/InvoiceItemsResource.d.ts | 384 ++ types/2022-11-15/InvoiceLineItems.d.ts | 7 - .../2022-11-15/InvoiceLineItemsResource.d.ts | 12 + types/2022-11-15/Invoices.d.ts | 2217 ------- types/2022-11-15/InvoicesResource.d.ts | 2222 +++++++ types/2022-11-15/Issuing/Authorizations.d.ts | 142 - .../Issuing/AuthorizationsResource.d.ts | 149 + types/2022-11-15/Issuing/Cardholders.d.ts | 2264 ------- .../Issuing/CardholdersResource.d.ts | 2271 +++++++ types/2022-11-15/Issuing/Cards.d.ts | 2117 ------ types/2022-11-15/Issuing/CardsResource.d.ts | 2124 ++++++ types/2022-11-15/Issuing/Disputes.d.ts | 729 --- .../2022-11-15/Issuing/DisputesResource.d.ts | 736 +++ types/2022-11-15/Issuing/Transactions.d.ts | 85 - .../Issuing/TransactionsResource.d.ts | 92 + types/2022-11-15/LoginLinks.d.ts | 7 - types/2022-11-15/LoginLinksResource.d.ts | 12 + types/2022-11-15/Mandates.d.ts | 22 - types/2022-11-15/MandatesResource.d.ts | 27 + types/2022-11-15/PaymentIntents.d.ts | 5770 ---------------- types/2022-11-15/PaymentIntentsResource.d.ts | 5775 +++++++++++++++++ types/2022-11-15/PaymentLinks.d.ts | 1162 ---- types/2022-11-15/PaymentLinksResource.d.ts | 1167 ++++ types/2022-11-15/PaymentMethods.d.ts | 843 --- types/2022-11-15/PaymentMethodsResource.d.ts | 848 +++ types/2022-11-15/Payouts.d.ts | 185 - types/2022-11-15/PayoutsResource.d.ts | 190 + types/2022-11-15/Persons.d.ts | 577 -- types/2022-11-15/PersonsResource.d.ts | 582 ++ types/2022-11-15/Plans.d.ts | 300 - types/2022-11-15/PlansResource.d.ts | 305 + types/2022-11-15/Prices.d.ts | 615 -- types/2022-11-15/PricesResource.d.ts | 620 ++ types/2022-11-15/Products.d.ts | 503 -- types/2022-11-15/ProductsResource.d.ts | 508 ++ types/2022-11-15/PromotionCodes.d.ts | 204 - types/2022-11-15/PromotionCodesResource.d.ts | 209 + types/2022-11-15/Quotes.d.ts | 688 -- types/2022-11-15/QuotesResource.d.ts | 693 ++ .../2022-11-15/Radar/EarlyFraudWarnings.d.ts | 52 - .../Radar/EarlyFraudWarningsResource.d.ts | 59 + types/2022-11-15/Radar/ValueListItems.d.ts | 89 - .../Radar/ValueListItemsResource.d.ts | 96 + types/2022-11-15/Radar/ValueLists.d.ts | 143 - .../2022-11-15/Radar/ValueListsResource.d.ts | 150 + types/2022-11-15/Refunds.d.ts | 155 - types/2022-11-15/RefundsResource.d.ts | 160 + types/2022-11-15/Reporting/ReportRuns.d.ts | 748 --- .../Reporting/ReportRunsResource.d.ts | 755 +++ types/2022-11-15/Reporting/ReportTypes.d.ts | 40 - .../Reporting/ReportTypesResource.d.ts | 47 + types/2022-11-15/Reviews.d.ts | 60 - types/2022-11-15/ReviewsResource.d.ts | 65 + types/2022-11-15/SetupAttempts.d.ts | 30 - types/2022-11-15/SetupAttemptsResource.d.ts | 35 + types/2022-11-15/SetupIntents.d.ts | 2884 -------- types/2022-11-15/SetupIntentsResource.d.ts | 2889 +++++++++ types/2022-11-15/ShippingRates.d.ts | 257 - types/2022-11-15/ShippingRatesResource.d.ts | 262 + .../2022-11-15/Sigma/ScheduledQueryRuns.d.ts | 40 - .../Sigma/ScheduledQueryRunsResource.d.ts | 47 + types/2022-11-15/Sources.d.ts | 606 -- types/2022-11-15/SourcesResource.d.ts | 611 ++ types/2022-11-15/SubscriptionItems.d.ts | 401 -- .../2022-11-15/SubscriptionItemsResource.d.ts | 406 ++ types/2022-11-15/SubscriptionSchedules.d.ts | 1038 --- .../SubscriptionSchedulesResource.d.ts | 1043 +++ types/2022-11-15/Subscriptions.d.ts | 1505 ----- types/2022-11-15/SubscriptionsResource.d.ts | 1510 +++++ types/2022-11-15/TaxCodes.d.ts | 38 - types/2022-11-15/TaxCodesResource.d.ts | 43 + types/2022-11-15/TaxIds.d.ts | 88 - types/2022-11-15/TaxIdsResource.d.ts | 93 + types/2022-11-15/TaxRates.d.ts | 198 - types/2022-11-15/TaxRatesResource.d.ts | 203 + types/2022-11-15/Terminal/Configurations.d.ts | 796 --- .../Terminal/ConfigurationsResource.d.ts | 803 +++ .../2022-11-15/Terminal/ConnectionTokens.d.ts | 25 - .../Terminal/ConnectionTokensResource.d.ts | 32 + types/2022-11-15/Terminal/Locations.d.ts | 173 - .../Terminal/LocationsResource.d.ts | 180 + types/2022-11-15/Terminal/Readers.d.ts | 317 - .../2022-11-15/Terminal/ReadersResource.d.ts | 324 + ...{Customers.d.ts => CustomersResource.d.ts} | 0 .../{Cards.d.ts => CardsResource.d.ts} | 0 .../{Refunds.d.ts => RefundsResource.d.ts} | 0 .../{Readers.d.ts => ReadersResource.d.ts} | 0 types/2022-11-15/TestHelpers/TestClocks.d.ts | 101 - .../TestHelpers/TestClocksResource.d.ts | 108 + ...ers.d.ts => InboundTransfersResource.d.ts} | 0 ...nts.d.ts => OutboundPaymentsResource.d.ts} | 0 ...rs.d.ts => OutboundTransfersResource.d.ts} | 0 ...dits.d.ts => ReceivedCreditsResource.d.ts} | 0 ...ebits.d.ts => ReceivedDebitsResource.d.ts} | 0 types/2022-11-15/Tokens.d.ts | 767 --- types/2022-11-15/TokensResource.d.ts | 772 +++ types/2022-11-15/Topups.d.ts | 153 - types/2022-11-15/TopupsResource.d.ts | 158 + types/2022-11-15/TransferReversals.d.ts | 53 - .../2022-11-15/TransferReversalsResource.d.ts | 58 + types/2022-11-15/Transfers.d.ts | 194 - types/2022-11-15/TransfersResource.d.ts | 199 + .../2022-11-15/Treasury/CreditReversals.d.ts | 81 - .../Treasury/CreditReversalsResource.d.ts | 88 + types/2022-11-15/Treasury/DebitReversals.d.ts | 88 - .../Treasury/DebitReversalsResource.d.ts | 95 + .../Treasury/FinancialAccounts.d.ts | 630 -- .../Treasury/FinancialAccountsResource.d.ts | 637 ++ .../2022-11-15/Treasury/InboundTransfers.d.ts | 121 - .../Treasury/InboundTransfersResource.d.ts | 128 + .../2022-11-15/Treasury/OutboundPayments.d.ts | 273 - .../Treasury/OutboundPaymentsResource.d.ts | 280 + .../Treasury/OutboundTransfers.d.ts | 155 - .../Treasury/OutboundTransfersResource.d.ts | 162 + .../2022-11-15/Treasury/ReceivedCredits.d.ts | 71 - .../Treasury/ReceivedCreditsResource.d.ts | 78 + types/2022-11-15/Treasury/ReceivedDebits.d.ts | 51 - .../Treasury/ReceivedDebitsResource.d.ts | 58 + .../Treasury/TransactionEntries.d.ts | 60 - .../Treasury/TransactionEntriesResource.d.ts | 67 + types/2022-11-15/Treasury/Transactions.d.ts | 72 - .../Treasury/TransactionsResource.d.ts | 79 + types/2022-11-15/UsageRecordSummaries.d.ts | 7 - .../UsageRecordSummariesResource.d.ts | 12 + types/2022-11-15/UsageRecords.d.ts | 26 - types/2022-11-15/UsageRecordsResource.d.ts | 31 + types/2022-11-15/WebhookEndpoints.d.ts | 683 -- .../2022-11-15/WebhookEndpointsResource.d.ts | 688 ++ types/2022-11-15/index.d.ts | 115 +- 201 files changed, 41938 insertions(+), 41259 deletions(-) create mode 100644 testProjects/mjs-ts/index.ts create mode 100644 testProjects/mjs-ts/package.json create mode 100644 types/2022-11-15/AccountLinksResource.d.ts create mode 100644 types/2022-11-15/AccountsResource.d.ts create mode 100644 types/2022-11-15/ApplePayDomainsResource.d.ts create mode 100644 types/2022-11-15/ApplicationFeesResource.d.ts create mode 100644 types/2022-11-15/Apps/SecretsResource.d.ts create mode 100644 types/2022-11-15/BalanceResource.d.ts create mode 100644 types/2022-11-15/BalanceTransactionsResource.d.ts create mode 100644 types/2022-11-15/BankAccountsResource.d.ts create mode 100644 types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts create mode 100644 types/2022-11-15/BillingPortal/SessionsResource.d.ts create mode 100644 types/2022-11-15/CapabilitiesResource.d.ts create mode 100644 types/2022-11-15/CardsResource.d.ts create mode 100644 types/2022-11-15/CashBalancesResource.d.ts create mode 100644 types/2022-11-15/ChargesResource.d.ts create mode 100644 types/2022-11-15/Checkout/SessionsResource.d.ts create mode 100644 types/2022-11-15/CountrySpecsResource.d.ts create mode 100644 types/2022-11-15/CouponsResource.d.ts create mode 100644 types/2022-11-15/CreditNoteLineItemsResource.d.ts create mode 100644 types/2022-11-15/CreditNotesResource.d.ts create mode 100644 types/2022-11-15/CustomerBalanceTransactionsResource.d.ts create mode 100644 types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts rename types/2022-11-15/{CustomerSources.d.ts => CustomerSourcesResource.d.ts} (100%) create mode 100644 types/2022-11-15/CustomersResource.d.ts create mode 100644 types/2022-11-15/DisputesResource.d.ts create mode 100644 types/2022-11-15/EphemeralKeysResource.d.ts create mode 100644 types/2022-11-15/EventsResource.d.ts create mode 100644 types/2022-11-15/ExchangeRatesResource.d.ts rename types/2022-11-15/{ExternalAccounts.d.ts => ExternalAccountsResource.d.ts} (100%) create mode 100644 types/2022-11-15/FeeRefundsResource.d.ts create mode 100644 types/2022-11-15/FileLinksResource.d.ts create mode 100644 types/2022-11-15/FilesResource.d.ts create mode 100644 types/2022-11-15/FinancialConnections/AccountsResource.d.ts create mode 100644 types/2022-11-15/FinancialConnections/SessionsResource.d.ts create mode 100644 types/2022-11-15/Identity/VerificationReportsResource.d.ts create mode 100644 types/2022-11-15/Identity/VerificationSessionsResource.d.ts create mode 100644 types/2022-11-15/InvoiceItemsResource.d.ts create mode 100644 types/2022-11-15/InvoiceLineItemsResource.d.ts create mode 100644 types/2022-11-15/InvoicesResource.d.ts create mode 100644 types/2022-11-15/Issuing/AuthorizationsResource.d.ts create mode 100644 types/2022-11-15/Issuing/CardholdersResource.d.ts create mode 100644 types/2022-11-15/Issuing/CardsResource.d.ts create mode 100644 types/2022-11-15/Issuing/DisputesResource.d.ts create mode 100644 types/2022-11-15/Issuing/TransactionsResource.d.ts create mode 100644 types/2022-11-15/LoginLinksResource.d.ts create mode 100644 types/2022-11-15/MandatesResource.d.ts create mode 100644 types/2022-11-15/PaymentIntentsResource.d.ts create mode 100644 types/2022-11-15/PaymentLinksResource.d.ts create mode 100644 types/2022-11-15/PaymentMethodsResource.d.ts create mode 100644 types/2022-11-15/PayoutsResource.d.ts create mode 100644 types/2022-11-15/PersonsResource.d.ts create mode 100644 types/2022-11-15/PlansResource.d.ts create mode 100644 types/2022-11-15/PricesResource.d.ts create mode 100644 types/2022-11-15/ProductsResource.d.ts create mode 100644 types/2022-11-15/PromotionCodesResource.d.ts create mode 100644 types/2022-11-15/QuotesResource.d.ts create mode 100644 types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts create mode 100644 types/2022-11-15/Radar/ValueListItemsResource.d.ts create mode 100644 types/2022-11-15/Radar/ValueListsResource.d.ts create mode 100644 types/2022-11-15/RefundsResource.d.ts create mode 100644 types/2022-11-15/Reporting/ReportRunsResource.d.ts create mode 100644 types/2022-11-15/Reporting/ReportTypesResource.d.ts create mode 100644 types/2022-11-15/ReviewsResource.d.ts create mode 100644 types/2022-11-15/SetupAttemptsResource.d.ts create mode 100644 types/2022-11-15/SetupIntentsResource.d.ts create mode 100644 types/2022-11-15/ShippingRatesResource.d.ts create mode 100644 types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts create mode 100644 types/2022-11-15/SourcesResource.d.ts create mode 100644 types/2022-11-15/SubscriptionItemsResource.d.ts create mode 100644 types/2022-11-15/SubscriptionSchedulesResource.d.ts create mode 100644 types/2022-11-15/SubscriptionsResource.d.ts create mode 100644 types/2022-11-15/TaxCodesResource.d.ts create mode 100644 types/2022-11-15/TaxIdsResource.d.ts create mode 100644 types/2022-11-15/TaxRatesResource.d.ts create mode 100644 types/2022-11-15/Terminal/ConfigurationsResource.d.ts create mode 100644 types/2022-11-15/Terminal/ConnectionTokensResource.d.ts create mode 100644 types/2022-11-15/Terminal/LocationsResource.d.ts create mode 100644 types/2022-11-15/Terminal/ReadersResource.d.ts rename types/2022-11-15/TestHelpers/{Customers.d.ts => CustomersResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Issuing/{Cards.d.ts => CardsResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/{Refunds.d.ts => RefundsResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Terminal/{Readers.d.ts => ReadersResource.d.ts} (100%) create mode 100644 types/2022-11-15/TestHelpers/TestClocksResource.d.ts rename types/2022-11-15/TestHelpers/Treasury/{InboundTransfers.d.ts => InboundTransfersResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Treasury/{OutboundPayments.d.ts => OutboundPaymentsResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Treasury/{OutboundTransfers.d.ts => OutboundTransfersResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Treasury/{ReceivedCredits.d.ts => ReceivedCreditsResource.d.ts} (100%) rename types/2022-11-15/TestHelpers/Treasury/{ReceivedDebits.d.ts => ReceivedDebitsResource.d.ts} (100%) create mode 100644 types/2022-11-15/TokensResource.d.ts create mode 100644 types/2022-11-15/TopupsResource.d.ts create mode 100644 types/2022-11-15/TransferReversalsResource.d.ts create mode 100644 types/2022-11-15/TransfersResource.d.ts create mode 100644 types/2022-11-15/Treasury/CreditReversalsResource.d.ts create mode 100644 types/2022-11-15/Treasury/DebitReversalsResource.d.ts create mode 100644 types/2022-11-15/Treasury/FinancialAccountsResource.d.ts create mode 100644 types/2022-11-15/Treasury/InboundTransfersResource.d.ts create mode 100644 types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts create mode 100644 types/2022-11-15/Treasury/OutboundTransfersResource.d.ts create mode 100644 types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts create mode 100644 types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts create mode 100644 types/2022-11-15/Treasury/TransactionEntriesResource.d.ts create mode 100644 types/2022-11-15/Treasury/TransactionsResource.d.ts create mode 100644 types/2022-11-15/UsageRecordSummariesResource.d.ts create mode 100644 types/2022-11-15/UsageRecordsResource.d.ts create mode 100644 types/2022-11-15/WebhookEndpointsResource.d.ts diff --git a/test/stripe.spec.js b/test/stripe.spec.js index f3d4c3b9c4..68da46964e 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -641,7 +641,7 @@ describe('Stripe Module', function() { const script = ` cd testProjects/${projectName} npm install - node index.js ${testUtils.getUserStripeKey()} + npm run-script runtestproject -- ${testUtils.getUserStripeKey()} `; require('child_process').execSync(script); }; @@ -657,6 +657,7 @@ describe('Stripe Module', function() { } expect(runTestProject.bind(null, 'mjs')).to.not.throw(); + expect(runTestProject.bind(null, 'mjs-ts')).to.not.throw(); }); }); }); diff --git a/testProjects/cjs/package.json b/testProjects/cjs/package.json index 0415d9242f..a4ef78be00 100644 --- a/testProjects/cjs/package.json +++ b/testProjects/cjs/package.json @@ -8,6 +8,6 @@ "stripe": "file:../../" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "runtestproject": "node index.js" } } diff --git a/testProjects/mjs-ts/index.ts b/testProjects/mjs-ts/index.ts new file mode 100644 index 0000000000..5789677248 --- /dev/null +++ b/testProjects/mjs-ts/index.ts @@ -0,0 +1,39 @@ +import {Stripe} from 'stripe'; +import DefaultStripe from 'stripe'; + +const stripe = new Stripe(process.argv[2], {apiVersion: '2022-11-15'}); +const defaultStripe = new DefaultStripe(process.argv[2], {apiVersion: '2022-11-15'}); + +try { + throw new stripe.errors.StripeError({ + charge: 'foo', + unknown_prop: 'bar', + } as any); +} catch (e) { + if (e instanceof stripe.errors.StripeError) { + console.log("Caught StripeError"); + } else { + throw e; + } +} + +async function exampleFunction(args: Stripe.PaymentIntentCreateParams) { + try { + const pi: Stripe.PaymentIntent = await stripe.paymentIntents.create(args); + } catch (e) { + if (e instanceof stripe.errors.StripeInvalidRequestError) { + console.log("Caught StripeInvalidRequestError"); + } else { + throw e; + } + } +} + +exampleFunction( + //@ts-ignore + { + // The required parameter currency is missing + amount: 2000, + confirm: true, + payment_method: 'pm_card_visa', +}); diff --git a/testProjects/mjs-ts/package.json b/testProjects/mjs-ts/package.json new file mode 100644 index 0000000000..3883a09409 --- /dev/null +++ b/testProjects/mjs-ts/package.json @@ -0,0 +1,13 @@ +{ + "name": "mjs", + "version": "1.0.0", + "description": "", + "main": "index.js", + "dependencies": { + "stripe": "file:../../", + "ts-node": "^10.9.1" + }, + "scripts": { + "runtestproject": "ts-node index.ts" + } +} diff --git a/testProjects/mjs/package.json b/testProjects/mjs/package.json index 0a66a1509b..66c7af04fb 100644 --- a/testProjects/mjs/package.json +++ b/testProjects/mjs/package.json @@ -8,6 +8,6 @@ "stripe": "file:../../" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "runtestproject": "node index.js" } } diff --git a/types/2022-11-15/AccountLinks.d.ts b/types/2022-11-15/AccountLinks.d.ts index 2fa99baf1b..c74fac1baa 100644 --- a/types/2022-11-15/AccountLinks.d.ts +++ b/types/2022-11-15/AccountLinks.d.ts @@ -29,57 +29,5 @@ declare module 'stripe' { */ url: string; } - - interface AccountLinkCreateParams { - /** - * The identifier of the account to create an account link for. - */ - account: string; - - /** - * The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. - */ - type: AccountLinkCreateParams.Type; - - /** - * Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`. - */ - collect?: AccountLinkCreateParams.Collect; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. - */ - refresh_url?: string; - - /** - * The URL that the user will be redirected to upon leaving or completing the linked flow. - */ - return_url?: string; - } - - namespace AccountLinkCreateParams { - type Collect = 'currently_due' | 'eventually_due'; - - type Type = - | 'account_onboarding' - | 'account_update' - | 'custom_account_update' - | 'custom_account_verification'; - } - - class AccountLinksResource { - /** - * Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. - */ - create( - params: AccountLinkCreateParams, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/AccountLinksResource.d.ts b/types/2022-11-15/AccountLinksResource.d.ts new file mode 100644 index 0000000000..e7dc6554d5 --- /dev/null +++ b/types/2022-11-15/AccountLinksResource.d.ts @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface AccountLinkCreateParams { + /** + * The identifier of the account to create an account link for. + */ + account: string; + + /** + * The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. + */ + type: AccountLinkCreateParams.Type; + + /** + * Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`. + */ + collect?: AccountLinkCreateParams.Collect; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. + */ + refresh_url?: string; + + /** + * The URL that the user will be redirected to upon leaving or completing the linked flow. + */ + return_url?: string; + } + + namespace AccountLinkCreateParams { + type Collect = 'currently_due' | 'eventually_due'; + + type Type = + | 'account_onboarding' + | 'account_update' + | 'custom_account_update' + | 'custom_account_verification'; + } + + class AccountLinksResource { + /** + * Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. + */ + create( + params: AccountLinkCreateParams, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Accounts.d.ts b/types/2022-11-15/Accounts.d.ts index b5846be44b..5f3b45178d 100644 --- a/types/2022-11-15/Accounts.d.ts +++ b/types/2022-11-15/Accounts.d.ts @@ -1143,2695 +1143,5 @@ declare module 'stripe' { */ deleted: true; } - - interface AccountCreateParams { - /** - * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - */ - account_token?: string; - - /** - * Business information about the account. - */ - business_profile?: AccountCreateParams.BusinessProfile; - - /** - * The business type. - */ - business_type?: AccountCreateParams.BusinessType; - - /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. - */ - capabilities?: AccountCreateParams.Capabilities; - - /** - * Information about the company or business. This field is available for any `business_type`. - */ - company?: AccountCreateParams.Company; - - /** - * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. - */ - country?: string; - - /** - * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - */ - default_currency?: string; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: AccountCreateParams.Documents; - - /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - */ - external_account?: string | AccountCreateParams.ExternalAccount; - - /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. - */ - individual?: AccountCreateParams.Individual; - - /** - * 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; - - /** - * Options for customizing how the account functions within Stripe. - */ - settings?: AccountCreateParams.Settings; - - /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - */ - tos_acceptance?: AccountCreateParams.TosAcceptance; - - /** - * The type of Stripe account to create. May be one of `custom`, `express` or `standard`. - */ - type?: AccountCreateParams.Type; - } - - namespace AccountCreateParams { - interface BusinessProfile { - /** - * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. - */ - mcc?: string; - - /** - * The customer-facing business name. - */ - name?: string; - - /** - * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. - */ - product_description?: string; - - /** - * A publicly available mailing address for sending support issues to. - */ - support_address?: Stripe.AddressParam; - - /** - * A publicly available email address for sending support issues to. - */ - support_email?: string; - - /** - * A publicly available phone number to call with support issues. - */ - support_phone?: string; - - /** - * A publicly available website for handling support issues. - */ - support_url?: Stripe.Emptyable; - - /** - * The business's publicly available website. - */ - url?: string; - } - - type BusinessType = - | 'company' - | 'government_entity' - | 'individual' - | 'non_profit'; - - interface Capabilities { - /** - * The acss_debit_payments capability. - */ - acss_debit_payments?: Capabilities.AcssDebitPayments; - - /** - * The affirm_payments capability. - */ - affirm_payments?: Capabilities.AffirmPayments; - - /** - * The afterpay_clearpay_payments capability. - */ - afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; - - /** - * The au_becs_debit_payments capability. - */ - au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; - - /** - * The bacs_debit_payments capability. - */ - bacs_debit_payments?: Capabilities.BacsDebitPayments; - - /** - * The bancontact_payments capability. - */ - bancontact_payments?: Capabilities.BancontactPayments; - - /** - * The bank_transfer_payments capability. - */ - bank_transfer_payments?: Capabilities.BankTransferPayments; - - /** - * The blik_payments capability. - */ - blik_payments?: Capabilities.BlikPayments; - - /** - * The boleto_payments capability. - */ - boleto_payments?: Capabilities.BoletoPayments; - - /** - * The card_issuing capability. - */ - card_issuing?: Capabilities.CardIssuing; - - /** - * The card_payments capability. - */ - card_payments?: Capabilities.CardPayments; - - /** - * The cartes_bancaires_payments capability. - */ - cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; - - /** - * The eps_payments capability. - */ - eps_payments?: Capabilities.EpsPayments; - - /** - * The fpx_payments capability. - */ - fpx_payments?: Capabilities.FpxPayments; - - /** - * The giropay_payments capability. - */ - giropay_payments?: Capabilities.GiropayPayments; - - /** - * The grabpay_payments capability. - */ - grabpay_payments?: Capabilities.GrabpayPayments; - - /** - * The ideal_payments capability. - */ - ideal_payments?: Capabilities.IdealPayments; - - /** - * The jcb_payments capability. - */ - jcb_payments?: Capabilities.JcbPayments; - - /** - * The klarna_payments capability. - */ - klarna_payments?: Capabilities.KlarnaPayments; - - /** - * The konbini_payments capability. - */ - konbini_payments?: Capabilities.KonbiniPayments; - - /** - * The legacy_payments capability. - */ - legacy_payments?: Capabilities.LegacyPayments; - - /** - * The link_payments capability. - */ - link_payments?: Capabilities.LinkPayments; - - /** - * The oxxo_payments capability. - */ - oxxo_payments?: Capabilities.OxxoPayments; - - /** - * The p24_payments capability. - */ - p24_payments?: Capabilities.P24Payments; - - /** - * The paynow_payments capability. - */ - paynow_payments?: Capabilities.PaynowPayments; - - /** - * The promptpay_payments capability. - */ - promptpay_payments?: Capabilities.PromptpayPayments; - - /** - * The sepa_debit_payments capability. - */ - sepa_debit_payments?: Capabilities.SepaDebitPayments; - - /** - * The sofort_payments capability. - */ - sofort_payments?: Capabilities.SofortPayments; - - /** - * The tax_reporting_us_1099_k capability. - */ - tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; - - /** - * The tax_reporting_us_1099_misc capability. - */ - tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; - - /** - * The transfers capability. - */ - transfers?: Capabilities.Transfers; - - /** - * The treasury capability. - */ - treasury?: Capabilities.Treasury; - - /** - * The us_bank_account_ach_payments capability. - */ - us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; - } - - namespace Capabilities { - interface AcssDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AffirmPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AfterpayClearpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AuBecsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BacsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BancontactPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BankTransferPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BlikPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BoletoPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CardIssuing { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CardPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CartesBancairesPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface EpsPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface FpxPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface GiropayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface GrabpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface IdealPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface JcbPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface KlarnaPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface KonbiniPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface LegacyPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface LinkPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface OxxoPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface P24Payments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface PaynowPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface PromptpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface SepaDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface SofortPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface TaxReportingUs1099K { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface TaxReportingUs1099Misc { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface Transfers { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface Treasury { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface UsBankAccountAchPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - } - - interface Company { - /** - * The company's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the company's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the company's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. - */ - directors_provided?: boolean; - - /** - * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - */ - executives_provided?: boolean; - - /** - * The company's legal name. - */ - name?: string; - - /** - * The Kana variation of the company's legal name (Japan only). - */ - name_kana?: string; - - /** - * The Kanji variation of the company's legal name (Japan only). - */ - name_kanji?: string; - - /** - * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - */ - owners_provided?: boolean; - - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - */ - ownership_declaration?: Company.OwnershipDeclaration; - - /** - * The company's phone number (used for verification). - */ - phone?: string; - - /** - * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - */ - registration_number?: string; - - /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - */ - structure?: Stripe.Emptyable; - - /** - * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) - */ - tax_id?: string; - - /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - */ - tax_id_registrar?: string; - - /** - * The VAT number of the company. - */ - vat_id?: string; - - /** - * Information on the verification state of the company. - */ - verification?: Company.Verification; - } - - namespace Company { - interface OwnershipDeclaration { - /** - * The Unix timestamp marking when the beneficial owner attestation was made. - */ - date?: number; - - /** - * The IP address from which the beneficial owner attestation was made. - */ - ip?: string; - - /** - * The user agent of the browser from which the beneficial owner attestation was made. - */ - user_agent?: string; - } - - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; - - interface Verification { - /** - * A document verifying the business. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Documents { - /** - * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - */ - bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; - - /** - * One or more documents that demonstrate proof of a company's license to operate. - */ - company_license?: Documents.CompanyLicense; - - /** - * One or more documents showing the company's Memorandum of Association. - */ - company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; - - /** - * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - */ - company_ministerial_decree?: Documents.CompanyMinisterialDecree; - - /** - * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - */ - company_registration_verification?: Documents.CompanyRegistrationVerification; - - /** - * One or more documents that demonstrate proof of a company's tax ID. - */ - company_tax_id_verification?: Documents.CompanyTaxIdVerification; - - /** - * One or more documents showing the company's proof of registration with the national business registry. - */ - proof_of_registration?: Documents.ProofOfRegistration; - } - - namespace Documents { - interface BankAccountOwnershipVerification { - /** - * 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; - } - - interface CompanyLicense { - /** - * 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; - } - - interface CompanyMemorandumOfAssociation { - /** - * 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; - } - - interface CompanyMinisterialDecree { - /** - * 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; - } - - interface CompanyRegistrationVerification { - /** - * 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; - } - - interface CompanyTaxIdVerification { - /** - * 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; - } - - 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`. - */ - files?: Array; - } - } - - interface ExternalAccount { - /** - * The type of external account. Should be bank_account. - */ - object: string; - - /** - * The country in which the bank account is located. - */ - country: string; - - /** - * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports](https://stripe.com/docs/payouts). - */ - currency: string; - - /** - * The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. - */ - account_holder_name?: string; - - /** - * The type of entity that holds the account. This can be either individual or company. This field is required when attaching the bank account to a Customer object. - */ - account_holder_type?: string; - - /** - * The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for account_number, this field is not required. - */ - routing_number?: string; - - /** - * The account number for the bank account, in string form. Must be a checking account. - */ - account_number: string; - } - - interface Individual { - /** - * The individual's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the the individual's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the the individual's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The individual's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * The individual's email address. - */ - email?: string; - - /** - * The individual's first name. - */ - first_name?: string; - - /** - * The Kana variation of the the individual's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the individual's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the individual is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The individual's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The individual's last name. - */ - last_name?: string; - - /** - * The Kana variation of the individual's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the individual's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The individual's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The individual's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: Individual.PoliticalExposure; - - /** - * The individual's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The last four digits of the individual's Social Security Number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The individual's verification document information. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - type PoliticalExposure = 'existing' | 'none'; - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Settings { - /** - * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. - */ - branding?: Settings.Branding; - - /** - * Settings specific to the account's use of the Card Issuing product. - */ - card_issuing?: Settings.CardIssuing; - - /** - * Settings specific to card charging on the account. - */ - card_payments?: Settings.CardPayments; - - /** - * Settings that apply across payment methods for charging on the account. - */ - payments?: Settings.Payments; - - /** - * Settings specific to the account's payouts. - */ - payouts?: Settings.Payouts; - - /** - * Settings specific to the account's Treasury FinancialAccounts. - */ - treasury?: Settings.Treasury; - } - - namespace Settings { - interface Branding { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. - */ - icon?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. - */ - logo?: string; - - /** - * A CSS hex color value representing the primary branding color for this account. - */ - primary_color?: string; - - /** - * A CSS hex color value representing the secondary branding color for this account. - */ - secondary_color?: string; - } - - interface CardIssuing { - /** - * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). - */ - tos_acceptance?: CardIssuing.TosAcceptance; - } - - namespace CardIssuing { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - - interface CardPayments { - /** - * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. - */ - decline_on?: CardPayments.DeclineOn; - - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix?: string; - - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kana?: Stripe.Emptyable; - - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kanji?: Stripe.Emptyable; - } - - namespace CardPayments { - interface DeclineOn { - /** - * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. - */ - avs_failure?: boolean; - - /** - * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. - */ - cvc_failure?: boolean; - } - } - - interface Payments { - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. - */ - statement_descriptor?: string; - - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - */ - statement_descriptor_kana?: string; - - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - */ - statement_descriptor_kanji?: string; - } - - interface Payouts { - /** - * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). - */ - debit_negative_balances?: boolean; - - /** - * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. - */ - schedule?: Payouts.Schedule; - - /** - * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - */ - statement_descriptor?: string; - } - - namespace Payouts { - interface Schedule { - /** - * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. - */ - delay_days?: 'minimum' | number; - - /** - * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. - */ - interval?: Schedule.Interval; - - /** - * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. - */ - monthly_anchor?: number; - - /** - * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) - */ - weekly_anchor?: Schedule.WeeklyAnchor; - } - - namespace Schedule { - type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; - - type WeeklyAnchor = - | 'friday' - | 'monday' - | 'saturday' - | 'sunday' - | 'thursday' - | 'tuesday' - | 'wednesday'; - } - } - - interface Treasury { - /** - * Details on the account's acceptance of the Stripe Treasury Services Agreement. - */ - tos_acceptance?: Treasury.TosAcceptance; - } - - namespace Treasury { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - } - - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted their service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted their service agreement. - */ - ip?: string; - - /** - * The user's service agreement type. - */ - service_agreement?: string; - - /** - * The user agent of the browser from which the account representative accepted their service agreement. - */ - user_agent?: string; - } - - type Type = 'custom' | 'express' | 'standard'; - } - - interface AccountRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountUpdateParams { - /** - * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - */ - account_token?: string; - - /** - * Business information about the account. - */ - business_profile?: AccountUpdateParams.BusinessProfile; - - /** - * The business type. - */ - business_type?: AccountUpdateParams.BusinessType; - - /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. - */ - capabilities?: AccountUpdateParams.Capabilities; - - /** - * Information about the company or business. This field is available for any `business_type`. - */ - company?: AccountUpdateParams.Company; - - /** - * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - */ - default_currency?: string; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: AccountUpdateParams.Documents; - - /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - */ - external_account?: string; - - /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. - */ - individual?: AccountUpdateParams.Individual; - - /** - * 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; - - /** - * Options for customizing how the account functions within Stripe. - */ - settings?: AccountUpdateParams.Settings; - - /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - */ - tos_acceptance?: AccountUpdateParams.TosAcceptance; - } - - namespace AccountUpdateParams { - interface BusinessProfile { - /** - * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. - */ - mcc?: string; - - /** - * The customer-facing business name. - */ - name?: string; - - /** - * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. - */ - product_description?: string; - - /** - * A publicly available mailing address for sending support issues to. - */ - support_address?: Stripe.AddressParam; - - /** - * A publicly available email address for sending support issues to. - */ - support_email?: string; - - /** - * A publicly available phone number to call with support issues. - */ - support_phone?: string; - - /** - * A publicly available website for handling support issues. - */ - support_url?: Stripe.Emptyable; - - /** - * The business's publicly available website. - */ - url?: string; - } - - type BusinessType = - | 'company' - | 'government_entity' - | 'individual' - | 'non_profit'; - - interface Capabilities { - /** - * The acss_debit_payments capability. - */ - acss_debit_payments?: Capabilities.AcssDebitPayments; - - /** - * The affirm_payments capability. - */ - affirm_payments?: Capabilities.AffirmPayments; - - /** - * The afterpay_clearpay_payments capability. - */ - afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; - - /** - * The au_becs_debit_payments capability. - */ - au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; - - /** - * The bacs_debit_payments capability. - */ - bacs_debit_payments?: Capabilities.BacsDebitPayments; - - /** - * The bancontact_payments capability. - */ - bancontact_payments?: Capabilities.BancontactPayments; - - /** - * The bank_transfer_payments capability. - */ - bank_transfer_payments?: Capabilities.BankTransferPayments; - - /** - * The blik_payments capability. - */ - blik_payments?: Capabilities.BlikPayments; - - /** - * The boleto_payments capability. - */ - boleto_payments?: Capabilities.BoletoPayments; - - /** - * The card_issuing capability. - */ - card_issuing?: Capabilities.CardIssuing; - - /** - * The card_payments capability. - */ - card_payments?: Capabilities.CardPayments; - - /** - * The cartes_bancaires_payments capability. - */ - cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; - - /** - * The eps_payments capability. - */ - eps_payments?: Capabilities.EpsPayments; - - /** - * The fpx_payments capability. - */ - fpx_payments?: Capabilities.FpxPayments; - - /** - * The giropay_payments capability. - */ - giropay_payments?: Capabilities.GiropayPayments; - - /** - * The grabpay_payments capability. - */ - grabpay_payments?: Capabilities.GrabpayPayments; - - /** - * The ideal_payments capability. - */ - ideal_payments?: Capabilities.IdealPayments; - - /** - * The jcb_payments capability. - */ - jcb_payments?: Capabilities.JcbPayments; - - /** - * The klarna_payments capability. - */ - klarna_payments?: Capabilities.KlarnaPayments; - - /** - * The konbini_payments capability. - */ - konbini_payments?: Capabilities.KonbiniPayments; - - /** - * The legacy_payments capability. - */ - legacy_payments?: Capabilities.LegacyPayments; - - /** - * The link_payments capability. - */ - link_payments?: Capabilities.LinkPayments; - - /** - * The oxxo_payments capability. - */ - oxxo_payments?: Capabilities.OxxoPayments; - - /** - * The p24_payments capability. - */ - p24_payments?: Capabilities.P24Payments; - - /** - * The paynow_payments capability. - */ - paynow_payments?: Capabilities.PaynowPayments; - - /** - * The promptpay_payments capability. - */ - promptpay_payments?: Capabilities.PromptpayPayments; - - /** - * The sepa_debit_payments capability. - */ - sepa_debit_payments?: Capabilities.SepaDebitPayments; - - /** - * The sofort_payments capability. - */ - sofort_payments?: Capabilities.SofortPayments; - - /** - * The tax_reporting_us_1099_k capability. - */ - tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; - - /** - * The tax_reporting_us_1099_misc capability. - */ - tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; - - /** - * The transfers capability. - */ - transfers?: Capabilities.Transfers; - - /** - * The treasury capability. - */ - treasury?: Capabilities.Treasury; - - /** - * The us_bank_account_ach_payments capability. - */ - us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; - } - - namespace Capabilities { - interface AcssDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AffirmPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AfterpayClearpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface AuBecsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BacsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BancontactPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BankTransferPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BlikPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface BoletoPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CardIssuing { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CardPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CartesBancairesPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface EpsPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface FpxPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface GiropayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface GrabpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface IdealPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface JcbPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface KlarnaPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface KonbiniPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface LegacyPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface LinkPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface OxxoPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface P24Payments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface PaynowPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface PromptpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface SepaDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface SofortPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface TaxReportingUs1099K { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface TaxReportingUs1099Misc { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface Transfers { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface Treasury { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface UsBankAccountAchPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - } - - interface Company { - /** - * The company's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the company's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the company's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. - */ - directors_provided?: boolean; - - /** - * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - */ - executives_provided?: boolean; - - /** - * The company's legal name. - */ - name?: string; - - /** - * The Kana variation of the company's legal name (Japan only). - */ - name_kana?: string; - - /** - * The Kanji variation of the company's legal name (Japan only). - */ - name_kanji?: string; - - /** - * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - */ - owners_provided?: boolean; - - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - */ - ownership_declaration?: Company.OwnershipDeclaration; - - /** - * The company's phone number (used for verification). - */ - phone?: string; - - /** - * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - */ - registration_number?: string; - - /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - */ - structure?: Stripe.Emptyable; - - /** - * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) - */ - tax_id?: string; - - /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - */ - tax_id_registrar?: string; - - /** - * The VAT number of the company. - */ - vat_id?: string; - - /** - * Information on the verification state of the company. - */ - verification?: Company.Verification; - } - - namespace Company { - interface OwnershipDeclaration { - /** - * The Unix timestamp marking when the beneficial owner attestation was made. - */ - date?: number; - - /** - * The IP address from which the beneficial owner attestation was made. - */ - ip?: string; - - /** - * The user agent of the browser from which the beneficial owner attestation was made. - */ - user_agent?: string; - } - - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; - - interface Verification { - /** - * A document verifying the business. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Documents { - /** - * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - */ - bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; - - /** - * One or more documents that demonstrate proof of a company's license to operate. - */ - company_license?: Documents.CompanyLicense; - - /** - * One or more documents showing the company's Memorandum of Association. - */ - company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; - - /** - * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - */ - company_ministerial_decree?: Documents.CompanyMinisterialDecree; - - /** - * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - */ - company_registration_verification?: Documents.CompanyRegistrationVerification; - - /** - * One or more documents that demonstrate proof of a company's tax ID. - */ - company_tax_id_verification?: Documents.CompanyTaxIdVerification; - - /** - * One or more documents showing the company's proof of registration with the national business registry. - */ - proof_of_registration?: Documents.ProofOfRegistration; - } - - namespace Documents { - interface BankAccountOwnershipVerification { - /** - * 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; - } - - interface CompanyLicense { - /** - * 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; - } - - interface CompanyMemorandumOfAssociation { - /** - * 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; - } - - interface CompanyMinisterialDecree { - /** - * 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; - } - - interface CompanyRegistrationVerification { - /** - * 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; - } - - interface CompanyTaxIdVerification { - /** - * 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; - } - - 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`. - */ - files?: Array; - } - } - - interface Individual { - /** - * The individual's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the the individual's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the the individual's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The individual's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * The individual's email address. - */ - email?: string; - - /** - * The individual's first name. - */ - first_name?: string; - - /** - * The Kana variation of the the individual's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the individual's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the individual is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The individual's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The individual's last name. - */ - last_name?: string; - - /** - * The Kana variation of the individual's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the individual's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The individual's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The individual's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: Individual.PoliticalExposure; - - /** - * The individual's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The last four digits of the individual's Social Security Number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The individual's verification document information. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - type PoliticalExposure = 'existing' | 'none'; - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Settings { - /** - * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. - */ - branding?: Settings.Branding; - - /** - * Settings specific to the account's use of the Card Issuing product. - */ - card_issuing?: Settings.CardIssuing; - - /** - * Settings specific to card charging on the account. - */ - card_payments?: Settings.CardPayments; - - /** - * Settings that apply across payment methods for charging on the account. - */ - payments?: Settings.Payments; - - /** - * Settings specific to the account's payouts. - */ - payouts?: Settings.Payouts; - - /** - * Settings specific to the account's Treasury FinancialAccounts. - */ - treasury?: Settings.Treasury; - } - - namespace Settings { - interface Branding { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. - */ - icon?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. - */ - logo?: string; - - /** - * A CSS hex color value representing the primary branding color for this account. - */ - primary_color?: string; - - /** - * A CSS hex color value representing the secondary branding color for this account. - */ - secondary_color?: string; - } - - interface CardIssuing { - /** - * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). - */ - tos_acceptance?: CardIssuing.TosAcceptance; - } - - namespace CardIssuing { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - - interface CardPayments { - /** - * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. - */ - decline_on?: CardPayments.DeclineOn; - - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix?: string; - - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kana?: Stripe.Emptyable; - - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kanji?: Stripe.Emptyable; - } - - namespace CardPayments { - interface DeclineOn { - /** - * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. - */ - avs_failure?: boolean; - - /** - * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. - */ - cvc_failure?: boolean; - } - } - - interface Payments { - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. - */ - statement_descriptor?: string; - - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - */ - statement_descriptor_kana?: string; - - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - */ - statement_descriptor_kanji?: string; - } - - interface Payouts { - /** - * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). - */ - debit_negative_balances?: boolean; - - /** - * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. - */ - schedule?: Payouts.Schedule; - - /** - * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - */ - statement_descriptor?: string; - } - - namespace Payouts { - interface Schedule { - /** - * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. - */ - delay_days?: 'minimum' | number; - - /** - * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. - */ - interval?: Schedule.Interval; - - /** - * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. - */ - monthly_anchor?: number; - - /** - * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) - */ - weekly_anchor?: Schedule.WeeklyAnchor; - } - - namespace Schedule { - type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; - - type WeeklyAnchor = - | 'friday' - | 'monday' - | 'saturday' - | 'sunday' - | 'thursday' - | 'tuesday' - | 'wednesday'; - } - } - - interface Treasury { - /** - * Details on the account's acceptance of the Stripe Treasury Services Agreement. - */ - tos_acceptance?: Treasury.TosAcceptance; - } - - namespace Treasury { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - } - - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted their service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted their service agreement. - */ - ip?: string; - - /** - * The user's service agreement type. - */ - service_agreement?: string; - - /** - * The user agent of the browser from which the account representative accepted their service agreement. - */ - user_agent?: string; - } - } - - interface AccountListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountDeleteParams {} - - interface AccountRejectParams { - /** - * The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. - */ - reason: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class AccountsResource { - /** - * With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. - * To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - */ - create( - params?: AccountCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an account. - */ - retrieve( - params?: AccountRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an account. - */ - retrieve( - id: string, - params?: AccountRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. Most parameters can be changed only for Custom accounts. (These are marked Custom Only below.) Parameters marked Custom and Express are not supported for Standard accounts. - * - * To update your own account, use the [Dashboard](https://dashboard.stripe.com/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. - */ - update( - id: string, - params?: AccountUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. - */ - list( - params?: AccountListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. - * - * Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. - * - * If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/account) instead. - */ - del( - id: string, - params?: AccountDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. - * - * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. - */ - reject( - id: string, - params: AccountRejectParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves information about the specified Account Capability. - */ - retrieveCapability( - accountId: string, - id: string, - params?: CapabilityRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveCapability( - accountId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing Account Capability. - */ - updateCapability( - accountId: string, - id: string, - params?: CapabilityUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. - */ - listCapabilities( - id: string, - params?: CapabilityListParams, - options?: RequestOptions - ): ApiListPromise; - listCapabilities( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Create an external account for a given account. - */ - createExternalAccount( - id: string, - params: ExternalAccountCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve a specified external account for a given account. - */ - retrieveExternalAccount( - accountId: string, - id: string, - params?: ExternalAccountRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveExternalAccount( - accountId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. - * - * You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. - */ - updateExternalAccount( - accountId: string, - id: string, - params?: ExternalAccountUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * List external accounts for an account. - */ - listExternalAccounts( - id: string, - params?: ExternalAccountListParams, - options?: RequestOptions - ): ApiListPromise; - listExternalAccounts( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Delete a specified external account for a given account. - */ - deleteExternalAccount( - accountId: string, - id: string, - params?: ExternalAccountDeleteParams, - options?: RequestOptions - ): Promise< - Stripe.Response - >; - deleteExternalAccount( - accountId: string, - id: string, - options?: RequestOptions - ): Promise< - Stripe.Response - >; - - /** - * Creates a single-use login link for an Express account to access their Stripe dashboard. - * - * You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. - */ - createLoginLink( - id: string, - params?: LoginLinkCreateParams, - options?: RequestOptions - ): Promise>; - createLoginLink( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Creates a new person. - */ - createPerson( - id: string, - params?: PersonCreateParams, - options?: RequestOptions - ): Promise>; - createPerson( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves an existing person. - */ - retrievePerson( - accountId: string, - id: string, - params?: PersonRetrieveParams, - options?: RequestOptions - ): Promise>; - retrievePerson( - accountId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing person. - */ - updatePerson( - accountId: string, - id: string, - params?: PersonUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. - */ - listPersons( - id: string, - params?: PersonListParams, - options?: RequestOptions - ): ApiListPromise; - listPersons( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. - */ - deletePerson( - accountId: string, - id: string, - params?: PersonDeleteParams, - options?: RequestOptions - ): Promise>; - deletePerson( - accountId: string, - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/AccountsResource.d.ts b/types/2022-11-15/AccountsResource.d.ts new file mode 100644 index 0000000000..952dfbe459 --- /dev/null +++ b/types/2022-11-15/AccountsResource.d.ts @@ -0,0 +1,2695 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface AccountCreateParams { + /** + * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + */ + account_token?: string; + + /** + * Business information about the account. + */ + business_profile?: AccountCreateParams.BusinessProfile; + + /** + * The business type. + */ + business_type?: AccountCreateParams.BusinessType; + + /** + * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + */ + capabilities?: AccountCreateParams.Capabilities; + + /** + * Information about the company or business. This field is available for any `business_type`. + */ + company?: AccountCreateParams.Company; + + /** + * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. + */ + country?: string; + + /** + * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + */ + default_currency?: string; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: AccountCreateParams.Documents; + + /** + * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + * + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + */ + external_account?: string | AccountCreateParams.ExternalAccount; + + /** + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. + */ + individual?: AccountCreateParams.Individual; + + /** + * 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; + + /** + * Options for customizing how the account functions within Stripe. + */ + settings?: AccountCreateParams.Settings; + + /** + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + */ + tos_acceptance?: AccountCreateParams.TosAcceptance; + + /** + * The type of Stripe account to create. May be one of `custom`, `express` or `standard`. + */ + type?: AccountCreateParams.Type; + } + + namespace AccountCreateParams { + interface BusinessProfile { + /** + * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + */ + mcc?: string; + + /** + * The customer-facing business name. + */ + name?: string; + + /** + * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. + */ + product_description?: string; + + /** + * A publicly available mailing address for sending support issues to. + */ + support_address?: Stripe.AddressParam; + + /** + * A publicly available email address for sending support issues to. + */ + support_email?: string; + + /** + * A publicly available phone number to call with support issues. + */ + support_phone?: string; + + /** + * A publicly available website for handling support issues. + */ + support_url?: Stripe.Emptyable; + + /** + * The business's publicly available website. + */ + url?: string; + } + + type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + + interface Capabilities { + /** + * The acss_debit_payments capability. + */ + acss_debit_payments?: Capabilities.AcssDebitPayments; + + /** + * The affirm_payments capability. + */ + affirm_payments?: Capabilities.AffirmPayments; + + /** + * The afterpay_clearpay_payments capability. + */ + afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; + + /** + * The au_becs_debit_payments capability. + */ + au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; + + /** + * The bacs_debit_payments capability. + */ + bacs_debit_payments?: Capabilities.BacsDebitPayments; + + /** + * The bancontact_payments capability. + */ + bancontact_payments?: Capabilities.BancontactPayments; + + /** + * The bank_transfer_payments capability. + */ + bank_transfer_payments?: Capabilities.BankTransferPayments; + + /** + * The blik_payments capability. + */ + blik_payments?: Capabilities.BlikPayments; + + /** + * The boleto_payments capability. + */ + boleto_payments?: Capabilities.BoletoPayments; + + /** + * The card_issuing capability. + */ + card_issuing?: Capabilities.CardIssuing; + + /** + * The card_payments capability. + */ + card_payments?: Capabilities.CardPayments; + + /** + * The cartes_bancaires_payments capability. + */ + cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; + + /** + * The eps_payments capability. + */ + eps_payments?: Capabilities.EpsPayments; + + /** + * The fpx_payments capability. + */ + fpx_payments?: Capabilities.FpxPayments; + + /** + * The giropay_payments capability. + */ + giropay_payments?: Capabilities.GiropayPayments; + + /** + * The grabpay_payments capability. + */ + grabpay_payments?: Capabilities.GrabpayPayments; + + /** + * The ideal_payments capability. + */ + ideal_payments?: Capabilities.IdealPayments; + + /** + * The jcb_payments capability. + */ + jcb_payments?: Capabilities.JcbPayments; + + /** + * The klarna_payments capability. + */ + klarna_payments?: Capabilities.KlarnaPayments; + + /** + * The konbini_payments capability. + */ + konbini_payments?: Capabilities.KonbiniPayments; + + /** + * The legacy_payments capability. + */ + legacy_payments?: Capabilities.LegacyPayments; + + /** + * The link_payments capability. + */ + link_payments?: Capabilities.LinkPayments; + + /** + * The oxxo_payments capability. + */ + oxxo_payments?: Capabilities.OxxoPayments; + + /** + * The p24_payments capability. + */ + p24_payments?: Capabilities.P24Payments; + + /** + * The paynow_payments capability. + */ + paynow_payments?: Capabilities.PaynowPayments; + + /** + * The promptpay_payments capability. + */ + promptpay_payments?: Capabilities.PromptpayPayments; + + /** + * The sepa_debit_payments capability. + */ + sepa_debit_payments?: Capabilities.SepaDebitPayments; + + /** + * The sofort_payments capability. + */ + sofort_payments?: Capabilities.SofortPayments; + + /** + * The tax_reporting_us_1099_k capability. + */ + tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; + + /** + * The tax_reporting_us_1099_misc capability. + */ + tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; + + /** + * The transfers capability. + */ + transfers?: Capabilities.Transfers; + + /** + * The treasury capability. + */ + treasury?: Capabilities.Treasury; + + /** + * The us_bank_account_ach_payments capability. + */ + us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; + } + + namespace Capabilities { + interface AcssDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AffirmPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AfterpayClearpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AuBecsDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BacsDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BancontactPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BankTransferPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BlikPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BoletoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CardIssuing { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CardPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CartesBancairesPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface EpsPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface FpxPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface GiropayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface GrabpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface IdealPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface JcbPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface KlarnaPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface KonbiniPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface LegacyPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface LinkPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface OxxoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface P24Payments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PaynowPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PromptpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SepaDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SofortPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099K { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099Misc { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Transfers { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Treasury { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface UsBankAccountAchPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + } + + interface Company { + /** + * The company's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the company's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the company's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + */ + directors_provided?: boolean; + + /** + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + */ + executives_provided?: boolean; + + /** + * The company's legal name. + */ + name?: string; + + /** + * The Kana variation of the company's legal name (Japan only). + */ + name_kana?: string; + + /** + * The Kanji variation of the company's legal name (Japan only). + */ + name_kanji?: string; + + /** + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + */ + owners_provided?: boolean; + + /** + * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + */ + ownership_declaration?: Company.OwnershipDeclaration; + + /** + * The company's phone number (used for verification). + */ + phone?: string; + + /** + * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + */ + registration_number?: string; + + /** + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ + structure?: Stripe.Emptyable; + + /** + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + */ + tax_id?: string; + + /** + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + */ + tax_id_registrar?: string; + + /** + * The VAT number of the company. + */ + vat_id?: string; + + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; + } + + namespace Company { + interface OwnershipDeclaration { + /** + * The Unix timestamp marking when the beneficial owner attestation was made. + */ + date?: number; + + /** + * The IP address from which the beneficial owner attestation was made. + */ + ip?: string; + + /** + * The user agent of the browser from which the beneficial owner attestation was made. + */ + user_agent?: string; + } + + type Structure = + | 'free_zone_establishment' + | 'free_zone_llc' + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'llc' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'single_member_llc' + | 'sole_establishment' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Documents { + /** + * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + */ + bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; + + /** + * One or more documents that demonstrate proof of a company's license to operate. + */ + company_license?: Documents.CompanyLicense; + + /** + * One or more documents showing the company's Memorandum of Association. + */ + company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; + + /** + * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + */ + company_ministerial_decree?: Documents.CompanyMinisterialDecree; + + /** + * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + */ + company_registration_verification?: Documents.CompanyRegistrationVerification; + + /** + * One or more documents that demonstrate proof of a company's tax ID. + */ + company_tax_id_verification?: Documents.CompanyTaxIdVerification; + + /** + * One or more documents showing the company's proof of registration with the national business registry. + */ + proof_of_registration?: Documents.ProofOfRegistration; + } + + namespace Documents { + interface BankAccountOwnershipVerification { + /** + * 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; + } + + interface CompanyLicense { + /** + * 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; + } + + interface CompanyMemorandumOfAssociation { + /** + * 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; + } + + interface CompanyMinisterialDecree { + /** + * 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; + } + + interface CompanyRegistrationVerification { + /** + * 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; + } + + interface CompanyTaxIdVerification { + /** + * 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; + } + + 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`. + */ + files?: Array; + } + } + + interface ExternalAccount { + /** + * The type of external account. Should be bank_account. + */ + object: string; + + /** + * The country in which the bank account is located. + */ + country: string; + + /** + * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports](https://stripe.com/docs/payouts). + */ + currency: string; + + /** + * The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. + */ + account_holder_name?: string; + + /** + * The type of entity that holds the account. This can be either individual or company. This field is required when attaching the bank account to a Customer object. + */ + account_holder_type?: string; + + /** + * The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for account_number, this field is not required. + */ + routing_number?: string; + + /** + * The account number for the bank account, in string form. Must be a checking account. + */ + account_number: string; + } + + interface Individual { + /** + * The individual's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The individual's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * The individual's email address. + */ + email?: string; + + /** + * The individual's first name. + */ + first_name?: string; + + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the individual is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The individual's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The individual's last name. + */ + last_name?: string; + + /** + * The Kana variation of the individual's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the individual's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The individual's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The individual's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: Individual.PoliticalExposure; + + /** + * The individual's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The last four digits of the individual's Social Security Number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The individual's verification document information. + */ + verification?: Individual.Verification; + } + + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + type PoliticalExposure = 'existing' | 'none'; + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Settings { + /** + * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + */ + branding?: Settings.Branding; + + /** + * Settings specific to the account's use of the Card Issuing product. + */ + card_issuing?: Settings.CardIssuing; + + /** + * Settings specific to card charging on the account. + */ + card_payments?: Settings.CardPayments; + + /** + * Settings that apply across payment methods for charging on the account. + */ + payments?: Settings.Payments; + + /** + * Settings specific to the account's payouts. + */ + payouts?: Settings.Payouts; + + /** + * Settings specific to the account's Treasury FinancialAccounts. + */ + treasury?: Settings.Treasury; + } + + namespace Settings { + interface Branding { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + */ + icon?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + */ + logo?: string; + + /** + * A CSS hex color value representing the primary branding color for this account. + */ + primary_color?: string; + + /** + * A CSS hex color value representing the secondary branding color for this account. + */ + secondary_color?: string; + } + + interface CardIssuing { + /** + * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + */ + tos_acceptance?: CardIssuing.TosAcceptance; + } + + namespace CardIssuing { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } + } + + interface CardPayments { + /** + * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + */ + decline_on?: CardPayments.DeclineOn; + + /** + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix?: string; + + /** + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix_kana?: Stripe.Emptyable; + + /** + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix_kanji?: Stripe.Emptyable; + } + + namespace CardPayments { + interface DeclineOn { + /** + * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + */ + avs_failure?: boolean; + + /** + * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + */ + cvc_failure?: boolean; + } + } + + interface Payments { + /** + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + */ + statement_descriptor?: string; + + /** + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + */ + statement_descriptor_kana?: string; + + /** + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + */ + statement_descriptor_kanji?: string; + } + + interface Payouts { + /** + * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + */ + debit_negative_balances?: boolean; + + /** + * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + */ + schedule?: Payouts.Schedule; + + /** + * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + */ + statement_descriptor?: string; + } + + namespace Payouts { + interface Schedule { + /** + * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. + */ + delay_days?: 'minimum' | number; + + /** + * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + */ + interval?: Schedule.Interval; + + /** + * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + */ + monthly_anchor?: number; + + /** + * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) + */ + weekly_anchor?: Schedule.WeeklyAnchor; + } + + namespace Schedule { + type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; + + type WeeklyAnchor = + | 'friday' + | 'monday' + | 'saturday' + | 'sunday' + | 'thursday' + | 'tuesday' + | 'wednesday'; + } + } + + interface Treasury { + /** + * Details on the account's acceptance of the Stripe Treasury Services Agreement. + */ + tos_acceptance?: Treasury.TosAcceptance; + } + + namespace Treasury { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } + } + } + + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted their service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted their service agreement. + */ + ip?: string; + + /** + * The user's service agreement type. + */ + service_agreement?: string; + + /** + * The user agent of the browser from which the account representative accepted their service agreement. + */ + user_agent?: string; + } + + type Type = 'custom' | 'express' | 'standard'; + } + + interface AccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountUpdateParams { + /** + * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + */ + account_token?: string; + + /** + * Business information about the account. + */ + business_profile?: AccountUpdateParams.BusinessProfile; + + /** + * The business type. + */ + business_type?: AccountUpdateParams.BusinessType; + + /** + * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + */ + capabilities?: AccountUpdateParams.Capabilities; + + /** + * Information about the company or business. This field is available for any `business_type`. + */ + company?: AccountUpdateParams.Company; + + /** + * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + */ + default_currency?: string; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: AccountUpdateParams.Documents; + + /** + * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + * + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + */ + external_account?: string; + + /** + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. + */ + individual?: AccountUpdateParams.Individual; + + /** + * 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; + + /** + * Options for customizing how the account functions within Stripe. + */ + settings?: AccountUpdateParams.Settings; + + /** + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + */ + tos_acceptance?: AccountUpdateParams.TosAcceptance; + } + + namespace AccountUpdateParams { + interface BusinessProfile { + /** + * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + */ + mcc?: string; + + /** + * The customer-facing business name. + */ + name?: string; + + /** + * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. + */ + product_description?: string; + + /** + * A publicly available mailing address for sending support issues to. + */ + support_address?: Stripe.AddressParam; + + /** + * A publicly available email address for sending support issues to. + */ + support_email?: string; + + /** + * A publicly available phone number to call with support issues. + */ + support_phone?: string; + + /** + * A publicly available website for handling support issues. + */ + support_url?: Stripe.Emptyable; + + /** + * The business's publicly available website. + */ + url?: string; + } + + type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + + interface Capabilities { + /** + * The acss_debit_payments capability. + */ + acss_debit_payments?: Capabilities.AcssDebitPayments; + + /** + * The affirm_payments capability. + */ + affirm_payments?: Capabilities.AffirmPayments; + + /** + * The afterpay_clearpay_payments capability. + */ + afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; + + /** + * The au_becs_debit_payments capability. + */ + au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; + + /** + * The bacs_debit_payments capability. + */ + bacs_debit_payments?: Capabilities.BacsDebitPayments; + + /** + * The bancontact_payments capability. + */ + bancontact_payments?: Capabilities.BancontactPayments; + + /** + * The bank_transfer_payments capability. + */ + bank_transfer_payments?: Capabilities.BankTransferPayments; + + /** + * The blik_payments capability. + */ + blik_payments?: Capabilities.BlikPayments; + + /** + * The boleto_payments capability. + */ + boleto_payments?: Capabilities.BoletoPayments; + + /** + * The card_issuing capability. + */ + card_issuing?: Capabilities.CardIssuing; + + /** + * The card_payments capability. + */ + card_payments?: Capabilities.CardPayments; + + /** + * The cartes_bancaires_payments capability. + */ + cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; + + /** + * The eps_payments capability. + */ + eps_payments?: Capabilities.EpsPayments; + + /** + * The fpx_payments capability. + */ + fpx_payments?: Capabilities.FpxPayments; + + /** + * The giropay_payments capability. + */ + giropay_payments?: Capabilities.GiropayPayments; + + /** + * The grabpay_payments capability. + */ + grabpay_payments?: Capabilities.GrabpayPayments; + + /** + * The ideal_payments capability. + */ + ideal_payments?: Capabilities.IdealPayments; + + /** + * The jcb_payments capability. + */ + jcb_payments?: Capabilities.JcbPayments; + + /** + * The klarna_payments capability. + */ + klarna_payments?: Capabilities.KlarnaPayments; + + /** + * The konbini_payments capability. + */ + konbini_payments?: Capabilities.KonbiniPayments; + + /** + * The legacy_payments capability. + */ + legacy_payments?: Capabilities.LegacyPayments; + + /** + * The link_payments capability. + */ + link_payments?: Capabilities.LinkPayments; + + /** + * The oxxo_payments capability. + */ + oxxo_payments?: Capabilities.OxxoPayments; + + /** + * The p24_payments capability. + */ + p24_payments?: Capabilities.P24Payments; + + /** + * The paynow_payments capability. + */ + paynow_payments?: Capabilities.PaynowPayments; + + /** + * The promptpay_payments capability. + */ + promptpay_payments?: Capabilities.PromptpayPayments; + + /** + * The sepa_debit_payments capability. + */ + sepa_debit_payments?: Capabilities.SepaDebitPayments; + + /** + * The sofort_payments capability. + */ + sofort_payments?: Capabilities.SofortPayments; + + /** + * The tax_reporting_us_1099_k capability. + */ + tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; + + /** + * The tax_reporting_us_1099_misc capability. + */ + tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; + + /** + * The transfers capability. + */ + transfers?: Capabilities.Transfers; + + /** + * The treasury capability. + */ + treasury?: Capabilities.Treasury; + + /** + * The us_bank_account_ach_payments capability. + */ + us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; + } + + namespace Capabilities { + interface AcssDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AffirmPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AfterpayClearpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface AuBecsDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BacsDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BancontactPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BankTransferPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BlikPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface BoletoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CardIssuing { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CardPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CartesBancairesPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface EpsPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface FpxPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface GiropayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface GrabpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface IdealPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface JcbPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface KlarnaPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface KonbiniPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface LegacyPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface LinkPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface OxxoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface P24Payments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PaynowPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PromptpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SepaDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SofortPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099K { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099Misc { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Transfers { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Treasury { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface UsBankAccountAchPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + } + + interface Company { + /** + * The company's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the company's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the company's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + */ + directors_provided?: boolean; + + /** + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + */ + executives_provided?: boolean; + + /** + * The company's legal name. + */ + name?: string; + + /** + * The Kana variation of the company's legal name (Japan only). + */ + name_kana?: string; + + /** + * The Kanji variation of the company's legal name (Japan only). + */ + name_kanji?: string; + + /** + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + */ + owners_provided?: boolean; + + /** + * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + */ + ownership_declaration?: Company.OwnershipDeclaration; + + /** + * The company's phone number (used for verification). + */ + phone?: string; + + /** + * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + */ + registration_number?: string; + + /** + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ + structure?: Stripe.Emptyable; + + /** + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + */ + tax_id?: string; + + /** + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + */ + tax_id_registrar?: string; + + /** + * The VAT number of the company. + */ + vat_id?: string; + + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; + } + + namespace Company { + interface OwnershipDeclaration { + /** + * The Unix timestamp marking when the beneficial owner attestation was made. + */ + date?: number; + + /** + * The IP address from which the beneficial owner attestation was made. + */ + ip?: string; + + /** + * The user agent of the browser from which the beneficial owner attestation was made. + */ + user_agent?: string; + } + + type Structure = + | 'free_zone_establishment' + | 'free_zone_llc' + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'llc' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'single_member_llc' + | 'sole_establishment' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Documents { + /** + * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + */ + bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; + + /** + * One or more documents that demonstrate proof of a company's license to operate. + */ + company_license?: Documents.CompanyLicense; + + /** + * One or more documents showing the company's Memorandum of Association. + */ + company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; + + /** + * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + */ + company_ministerial_decree?: Documents.CompanyMinisterialDecree; + + /** + * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + */ + company_registration_verification?: Documents.CompanyRegistrationVerification; + + /** + * One or more documents that demonstrate proof of a company's tax ID. + */ + company_tax_id_verification?: Documents.CompanyTaxIdVerification; + + /** + * One or more documents showing the company's proof of registration with the national business registry. + */ + proof_of_registration?: Documents.ProofOfRegistration; + } + + namespace Documents { + interface BankAccountOwnershipVerification { + /** + * 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; + } + + interface CompanyLicense { + /** + * 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; + } + + interface CompanyMemorandumOfAssociation { + /** + * 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; + } + + interface CompanyMinisterialDecree { + /** + * 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; + } + + interface CompanyRegistrationVerification { + /** + * 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; + } + + interface CompanyTaxIdVerification { + /** + * 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; + } + + 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`. + */ + files?: Array; + } + } + + interface Individual { + /** + * The individual's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The individual's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * The individual's email address. + */ + email?: string; + + /** + * The individual's first name. + */ + first_name?: string; + + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the individual is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The individual's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The individual's last name. + */ + last_name?: string; + + /** + * The Kana variation of the individual's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the individual's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The individual's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The individual's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: Individual.PoliticalExposure; + + /** + * The individual's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The last four digits of the individual's Social Security Number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The individual's verification document information. + */ + verification?: Individual.Verification; + } + + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + type PoliticalExposure = 'existing' | 'none'; + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Settings { + /** + * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + */ + branding?: Settings.Branding; + + /** + * Settings specific to the account's use of the Card Issuing product. + */ + card_issuing?: Settings.CardIssuing; + + /** + * Settings specific to card charging on the account. + */ + card_payments?: Settings.CardPayments; + + /** + * Settings that apply across payment methods for charging on the account. + */ + payments?: Settings.Payments; + + /** + * Settings specific to the account's payouts. + */ + payouts?: Settings.Payouts; + + /** + * Settings specific to the account's Treasury FinancialAccounts. + */ + treasury?: Settings.Treasury; + } + + namespace Settings { + interface Branding { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + */ + icon?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + */ + logo?: string; + + /** + * A CSS hex color value representing the primary branding color for this account. + */ + primary_color?: string; + + /** + * A CSS hex color value representing the secondary branding color for this account. + */ + secondary_color?: string; + } + + interface CardIssuing { + /** + * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + */ + tos_acceptance?: CardIssuing.TosAcceptance; + } + + namespace CardIssuing { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } + } + + interface CardPayments { + /** + * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + */ + decline_on?: CardPayments.DeclineOn; + + /** + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix?: string; + + /** + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix_kana?: Stripe.Emptyable; + + /** + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + */ + statement_descriptor_prefix_kanji?: Stripe.Emptyable; + } + + namespace CardPayments { + interface DeclineOn { + /** + * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + */ + avs_failure?: boolean; + + /** + * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + */ + cvc_failure?: boolean; + } + } + + interface Payments { + /** + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + */ + statement_descriptor?: string; + + /** + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + */ + statement_descriptor_kana?: string; + + /** + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + */ + statement_descriptor_kanji?: string; + } + + interface Payouts { + /** + * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + */ + debit_negative_balances?: boolean; + + /** + * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + */ + schedule?: Payouts.Schedule; + + /** + * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + */ + statement_descriptor?: string; + } + + namespace Payouts { + interface Schedule { + /** + * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. + */ + delay_days?: 'minimum' | number; + + /** + * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + */ + interval?: Schedule.Interval; + + /** + * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + */ + monthly_anchor?: number; + + /** + * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) + */ + weekly_anchor?: Schedule.WeeklyAnchor; + } + + namespace Schedule { + type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; + + type WeeklyAnchor = + | 'friday' + | 'monday' + | 'saturday' + | 'sunday' + | 'thursday' + | 'tuesday' + | 'wednesday'; + } + } + + interface Treasury { + /** + * Details on the account's acceptance of the Stripe Treasury Services Agreement. + */ + tos_acceptance?: Treasury.TosAcceptance; + } + + namespace Treasury { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } + } + } + + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted their service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted their service agreement. + */ + ip?: string; + + /** + * The user's service agreement type. + */ + service_agreement?: string; + + /** + * The user agent of the browser from which the account representative accepted their service agreement. + */ + user_agent?: string; + } + } + + interface AccountListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountDeleteParams {} + + interface AccountRejectParams { + /** + * The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. + */ + reason: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class AccountsResource { + /** + * With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. + * To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). + */ + create( + params?: AccountCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an account. + */ + retrieve( + params?: AccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an account. + */ + retrieve( + id: string, + params?: AccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. Most parameters can be changed only for Custom accounts. (These are marked Custom Only below.) Parameters marked Custom and Express are not supported for Standard accounts. + * + * To update your own account, use the [Dashboard](https://dashboard.stripe.com/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. + */ + update( + id: string, + params?: AccountUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. + */ + list( + params?: AccountListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + * + * Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + * + * If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/account) instead. + */ + del( + id: string, + params?: AccountDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + * + * Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero. + */ + reject( + id: string, + params: AccountRejectParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves information about the specified Account Capability. + */ + retrieveCapability( + accountId: string, + id: string, + params?: CapabilityRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveCapability( + accountId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing Account Capability. + */ + updateCapability( + accountId: string, + id: string, + params?: CapabilityUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. + */ + listCapabilities( + id: string, + params?: CapabilityListParams, + options?: RequestOptions + ): ApiListPromise; + listCapabilities( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Create an external account for a given account. + */ + createExternalAccount( + id: string, + params: ExternalAccountCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve a specified external account for a given account. + */ + retrieveExternalAccount( + accountId: string, + id: string, + params?: ExternalAccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveExternalAccount( + accountId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design. + * + * You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + */ + updateExternalAccount( + accountId: string, + id: string, + params?: ExternalAccountUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * List external accounts for an account. + */ + listExternalAccounts( + id: string, + params?: ExternalAccountListParams, + options?: RequestOptions + ): ApiListPromise; + listExternalAccounts( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Delete a specified external account for a given account. + */ + deleteExternalAccount( + accountId: string, + id: string, + params?: ExternalAccountDeleteParams, + options?: RequestOptions + ): Promise< + Stripe.Response + >; + deleteExternalAccount( + accountId: string, + id: string, + options?: RequestOptions + ): Promise< + Stripe.Response + >; + + /** + * Creates a single-use login link for an Express account to access their Stripe dashboard. + * + * You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform. + */ + createLoginLink( + id: string, + params?: LoginLinkCreateParams, + options?: RequestOptions + ): Promise>; + createLoginLink( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Creates a new person. + */ + createPerson( + id: string, + params?: PersonCreateParams, + options?: RequestOptions + ): Promise>; + createPerson( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves an existing person. + */ + retrievePerson( + accountId: string, + id: string, + params?: PersonRetrieveParams, + options?: RequestOptions + ): Promise>; + retrievePerson( + accountId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing person. + */ + updatePerson( + accountId: string, + id: string, + params?: PersonUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. + */ + listPersons( + id: string, + params?: PersonListParams, + options?: RequestOptions + ): ApiListPromise; + listPersons( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + */ + deletePerson( + accountId: string, + id: string, + params?: PersonDeleteParams, + options?: RequestOptions + ): Promise>; + deletePerson( + accountId: string, + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/ApplePayDomains.d.ts b/types/2022-11-15/ApplePayDomains.d.ts index 169f59babf..c235a65476 100644 --- a/types/2022-11-15/ApplePayDomains.d.ts +++ b/types/2022-11-15/ApplePayDomains.d.ts @@ -50,77 +50,5 @@ declare module 'stripe' { */ deleted: true; } - - interface ApplePayDomainCreateParams { - domain_name: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ApplePayDomainRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ApplePayDomainListParams extends PaginationParams { - domain_name?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ApplePayDomainDeleteParams {} - - class ApplePayDomainsResource { - /** - * Create an apple pay domain. - */ - create( - params: ApplePayDomainCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve an apple pay domain. - */ - retrieve( - id: string, - params?: ApplePayDomainRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * List apple pay domains. - */ - list( - params?: ApplePayDomainListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Delete an apple pay domain. - */ - del( - id: string, - params?: ApplePayDomainDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/ApplePayDomainsResource.d.ts b/types/2022-11-15/ApplePayDomainsResource.d.ts new file mode 100644 index 0000000000..43ca884421 --- /dev/null +++ b/types/2022-11-15/ApplePayDomainsResource.d.ts @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ApplePayDomainCreateParams { + domain_name: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ApplePayDomainRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ApplePayDomainListParams extends PaginationParams { + domain_name?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ApplePayDomainDeleteParams {} + + class ApplePayDomainsResource { + /** + * Create an apple pay domain. + */ + create( + params: ApplePayDomainCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve an apple pay domain. + */ + retrieve( + id: string, + params?: ApplePayDomainRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * List apple pay domains. + */ + list( + params?: ApplePayDomainListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Delete an apple pay domain. + */ + del( + id: string, + params?: ApplePayDomainDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/ApplicationFees.d.ts b/types/2022-11-15/ApplicationFees.d.ts index 7f0c257c8e..c695fdeb20 100644 --- a/types/2022-11-15/ApplicationFees.d.ts +++ b/types/2022-11-15/ApplicationFees.d.ts @@ -76,111 +76,5 @@ declare module 'stripe' { */ refunds: ApiList; } - - interface ApplicationFeeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ApplicationFeeListParams extends PaginationParams { - /** - * Only return application fees for the charge specified by this charge ID. - */ - charge?: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ApplicationFeesResource { - /** - * Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. - */ - retrieve( - id: string, - params?: ApplicationFeeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. - */ - list( - params?: ApplicationFeeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Refunds an application fee that has previously been collected but not yet refunded. - * Funds will be refunded to the Stripe account from which the fee was originally collected. - * - * You can optionally refund only part of an application fee. - * You can do so multiple times, until the entire fee has been refunded. - * - * Once entirely refunded, an application fee can't be refunded again. - * This method will raise an error when called on an already-refunded application fee, - * or when trying to refund more money than is left on an application fee. - */ - createRefund( - id: string, - params?: FeeRefundCreateParams, - options?: RequestOptions - ): Promise>; - createRefund( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. - */ - retrieveRefund( - feeId: string, - id: string, - params?: FeeRefundRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveRefund( - feeId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - */ - updateRefund( - feeId: string, - id: string, - params?: FeeRefundUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. - */ - listRefunds( - id: string, - params?: FeeRefundListParams, - options?: RequestOptions - ): ApiListPromise; - listRefunds( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/ApplicationFeesResource.d.ts b/types/2022-11-15/ApplicationFeesResource.d.ts new file mode 100644 index 0000000000..8ca36dd61c --- /dev/null +++ b/types/2022-11-15/ApplicationFeesResource.d.ts @@ -0,0 +1,111 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ApplicationFeeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ApplicationFeeListParams extends PaginationParams { + /** + * Only return application fees for the charge specified by this charge ID. + */ + charge?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ApplicationFeesResource { + /** + * Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. + */ + retrieve( + id: string, + params?: ApplicationFeeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. + */ + list( + params?: ApplicationFeeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Refunds an application fee that has previously been collected but not yet refunded. + * Funds will be refunded to the Stripe account from which the fee was originally collected. + * + * You can optionally refund only part of an application fee. + * You can do so multiple times, until the entire fee has been refunded. + * + * Once entirely refunded, an application fee can't be refunded again. + * This method will raise an error when called on an already-refunded application fee, + * or when trying to refund more money than is left on an application fee. + */ + createRefund( + id: string, + params?: FeeRefundCreateParams, + options?: RequestOptions + ): Promise>; + createRefund( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. + */ + retrieveRefund( + feeId: string, + id: string, + params?: FeeRefundRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveRefund( + feeId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + */ + updateRefund( + feeId: string, + id: string, + params?: FeeRefundUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. + */ + listRefunds( + id: string, + params?: FeeRefundListParams, + options?: RequestOptions + ): ApiListPromise; + listRefunds( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Apps/Secrets.d.ts b/types/2022-11-15/Apps/Secrets.d.ts index 41cb1d0867..0fd6b7b0d1 100644 --- a/types/2022-11-15/Apps/Secrets.d.ts +++ b/types/2022-11-15/Apps/Secrets.d.ts @@ -75,185 +75,6 @@ declare module 'stripe' { type Type = 'account' | 'user'; } } - - interface SecretCreateParams { - /** - * A name for the secret that's unique within the scope. - */ - name: string; - - /** - * The plaintext secret value to be stored. - */ - payload: string; - - /** - * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. - */ - scope: SecretCreateParams.Scope; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The Unix timestamp for the expiry time of the secret, after which the secret deletes. - */ - expires_at?: number; - } - - namespace SecretCreateParams { - interface Scope { - /** - * The secret scope type. - */ - type: Scope.Type; - - /** - * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. - */ - user?: string; - } - - namespace Scope { - type Type = 'account' | 'user'; - } - } - - interface SecretListParams extends PaginationParams { - /** - * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. - */ - scope: SecretListParams.Scope; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace SecretListParams { - interface Scope { - /** - * The secret scope type. - */ - type: Scope.Type; - - /** - * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. - */ - user?: string; - } - - namespace Scope { - type Type = 'account' | 'user'; - } - } - - interface SecretDeleteWhereParams { - /** - * A name for the secret that's unique within the scope. - */ - name: string; - - /** - * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. - */ - scope: SecretDeleteWhereParams.Scope; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace SecretDeleteWhereParams { - interface Scope { - /** - * The secret scope type. - */ - type: Scope.Type; - - /** - * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. - */ - user?: string; - } - - namespace Scope { - type Type = 'account' | 'user'; - } - } - - interface SecretFindParams { - /** - * A name for the secret that's unique within the scope. - */ - name: string; - - /** - * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. - */ - scope: SecretFindParams.Scope; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace SecretFindParams { - interface Scope { - /** - * The secret scope type. - */ - type: Scope.Type; - - /** - * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. - */ - user?: string; - } - - namespace Scope { - type Type = 'account' | 'user'; - } - } - - class SecretsResource { - /** - * Create or replace a secret in the secret store. - */ - create( - params: SecretCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * List all secrets stored on the given scope. - */ - list( - params: SecretListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes a secret from the secret store by name and scope. - */ - deleteWhere( - params: SecretDeleteWhereParams, - options?: RequestOptions - ): Promise>; - - /** - * Finds a secret in the secret store by name and scope. - */ - find( - params: SecretFindParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Apps/SecretsResource.d.ts b/types/2022-11-15/Apps/SecretsResource.d.ts new file mode 100644 index 0000000000..1be2f19e28 --- /dev/null +++ b/types/2022-11-15/Apps/SecretsResource.d.ts @@ -0,0 +1,186 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Apps { + interface SecretCreateParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * The plaintext secret value to be stored. + */ + payload: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretCreateParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The Unix timestamp for the expiry time of the secret, after which the secret deletes. + */ + expires_at?: number; + } + + namespace SecretCreateParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretListParams extends PaginationParams { + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretListParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretListParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretDeleteWhereParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretDeleteWhereParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretDeleteWhereParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + interface SecretFindParams { + /** + * A name for the secret that's unique within the scope. + */ + name: string; + + /** + * Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + */ + scope: SecretFindParams.Scope; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SecretFindParams { + interface Scope { + /** + * The secret scope type. + */ + type: Scope.Type; + + /** + * The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + */ + user?: string; + } + + namespace Scope { + type Type = 'account' | 'user'; + } + } + + class SecretsResource { + /** + * Create or replace a secret in the secret store. + */ + create( + params: SecretCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * List all secrets stored on the given scope. + */ + list( + params: SecretListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a secret from the secret store by name and scope. + */ + deleteWhere( + params: SecretDeleteWhereParams, + options?: RequestOptions + ): Promise>; + + /** + * Finds a secret in the secret store by name and scope. + */ + find( + params: SecretFindParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Balance.d.ts b/types/2022-11-15/Balance.d.ts index ba6397aa59..556dd516b7 100644 --- a/types/2022-11-15/Balance.d.ts +++ b/types/2022-11-15/Balance.d.ts @@ -224,26 +224,5 @@ declare module 'stripe' { } } } - - interface BalanceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class BalanceResource { - /** - * Retrieves the current account balance, based on the authentication that was used to make the request. - * For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). - */ - retrieve( - params?: BalanceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/BalanceResource.d.ts b/types/2022-11-15/BalanceResource.d.ts new file mode 100644 index 0000000000..2f2d34d034 --- /dev/null +++ b/types/2022-11-15/BalanceResource.d.ts @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface BalanceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class BalanceResource { + /** + * Retrieves the current account balance, based on the authentication that was used to make the request. + * For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). + */ + retrieve( + params?: BalanceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/BalanceTransactions.d.ts b/types/2022-11-15/BalanceTransactions.d.ts index 36e23934bb..7539c27ab9 100644 --- a/types/2022-11-15/BalanceTransactions.d.ts +++ b/types/2022-11-15/BalanceTransactions.d.ts @@ -165,74 +165,5 @@ declare module 'stripe' { | 'transfer_failure' | 'transfer_refund'; } - - interface BalanceTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface BalanceTransactionListParams extends PaginationParams { - /** - * This parameter is deprecated and we recommend listing by created and filtering in memory instead. - */ - available_on?: Stripe.RangeQueryParam | number; - - created?: Stripe.RangeQueryParam | number; - - /** - * Only return transactions in a certain currency. 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; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. - */ - payout?: string; - - /** - * Only returns the original transaction. - */ - source?: string; - - /** - * Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. - */ - type?: string; - } - - class BalanceTransactionsResource { - /** - * Retrieves the balance transaction with the given ID. - * - * Note that this endpoint previously used the path /v1/balance/history/:id. - */ - retrieve( - id: string, - params?: BalanceTransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. - * - * Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. - */ - list( - params?: BalanceTransactionListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/BalanceTransactionsResource.d.ts b/types/2022-11-15/BalanceTransactionsResource.d.ts new file mode 100644 index 0000000000..ddbeb8a6eb --- /dev/null +++ b/types/2022-11-15/BalanceTransactionsResource.d.ts @@ -0,0 +1,74 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface BalanceTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface BalanceTransactionListParams extends PaginationParams { + /** + * This parameter is deprecated and we recommend listing by created and filtering in memory instead. + */ + available_on?: Stripe.RangeQueryParam | number; + + created?: Stripe.RangeQueryParam | number; + + /** + * Only return transactions in a certain currency. 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; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. + */ + payout?: string; + + /** + * Only returns the original transaction. + */ + source?: string; + + /** + * Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + */ + type?: string; + } + + class BalanceTransactionsResource { + /** + * Retrieves the balance transaction with the given ID. + * + * Note that this endpoint previously used the path /v1/balance/history/:id. + */ + retrieve( + id: string, + params?: BalanceTransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. + * + * Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. + */ + list( + params?: BalanceTransactionListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/BankAccountsResource.d.ts b/types/2022-11-15/BankAccountsResource.d.ts new file mode 100644 index 0000000000..f5652f6bdc --- /dev/null +++ b/types/2022-11-15/BankAccountsResource.d.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe {} +} diff --git a/types/2022-11-15/BillingPortal/Configurations.d.ts b/types/2022-11-15/BillingPortal/Configurations.d.ts index 30cc5d3049..25a969bcb3 100644 --- a/types/2022-11-15/BillingPortal/Configurations.d.ts +++ b/types/2022-11-15/BillingPortal/Configurations.d.ts @@ -255,552 +255,6 @@ declare module 'stripe' { url: string | null; } } - - interface ConfigurationCreateParams { - /** - * The business information shown to customers in the portal. - */ - business_profile: ConfigurationCreateParams.BusinessProfile; - - /** - * Information about the features available in the portal. - */ - features: ConfigurationCreateParams.Features; - - /** - * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. - */ - default_return_url?: Stripe.Emptyable; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). - */ - login_page?: ConfigurationCreateParams.LoginPage; - - /** - * 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.MetadataParam; - } - - namespace ConfigurationCreateParams { - interface BusinessProfile { - /** - * The messaging shown to customers in the portal. - */ - headline?: string; - - /** - * A link to the business's publicly available privacy policy. - */ - privacy_policy_url?: string; - - /** - * A link to the business's publicly available terms of service. - */ - terms_of_service_url?: string; - } - - interface Features { - /** - * Information about updating the customer details in the portal. - */ - customer_update?: Features.CustomerUpdate; - - /** - * Information about showing the billing history in the portal. - */ - invoice_history?: Features.InvoiceHistory; - - /** - * Information about updating payment methods in the portal. - */ - payment_method_update?: Features.PaymentMethodUpdate; - - /** - * Information about canceling subscriptions in the portal. - */ - subscription_cancel?: Features.SubscriptionCancel; - - /** - * Information about pausing subscriptions in the portal. - */ - subscription_pause?: Features.SubscriptionPause; - - /** - * Information about updating subscriptions in the portal. - */ - subscription_update?: Features.SubscriptionUpdate; - } - - namespace Features { - interface CustomerUpdate { - /** - * The types of customer updates that are supported. When empty, customers are not updateable. - */ - allowed_updates?: Stripe.Emptyable< - Array - >; - - /** - * Whether the feature is enabled. - */ - enabled: boolean; - } - - namespace CustomerUpdate { - type AllowedUpdate = - | 'address' - | 'email' - | 'phone' - | 'shipping' - | 'tax_id'; - } - - interface InvoiceHistory { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - } - - interface PaymentMethodUpdate { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - } - - interface SubscriptionCancel { - /** - * Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer - */ - cancellation_reason?: SubscriptionCancel.CancellationReason; - - /** - * Whether the feature is enabled. - */ - enabled: boolean; - - /** - * Whether to cancel subscriptions immediately or at the end of the billing period. - */ - mode?: SubscriptionCancel.Mode; - - /** - * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. - */ - proration_behavior?: SubscriptionCancel.ProrationBehavior; - } - - namespace SubscriptionCancel { - interface CancellationReason { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - - /** - * Which cancellation reasons will be given as options to the customer. - */ - options: Stripe.Emptyable>; - } - - namespace CancellationReason { - type Option = - | 'customer_service' - | 'low_quality' - | 'missing_features' - | 'other' - | 'switched_service' - | 'too_complex' - | 'too_expensive' - | 'unused'; - } - - type Mode = 'at_period_end' | 'immediately'; - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - - interface SubscriptionPause { - /** - * Whether the feature is enabled. - */ - enabled?: boolean; - } - - interface SubscriptionUpdate { - /** - * The types of subscription updates that are supported. When empty, subscriptions are not updateable. - */ - default_allowed_updates: Stripe.Emptyable< - Array - >; - - /** - * Whether the feature is enabled. - */ - enabled: boolean; - - /** - * The list of products that support subscription updates. - */ - products: Stripe.Emptyable>; - - /** - * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. - */ - proration_behavior?: SubscriptionUpdate.ProrationBehavior; - } - - namespace SubscriptionUpdate { - type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity'; - - interface Product { - /** - * The list of price IDs for the product that a subscription can be updated to. - */ - prices: Array; - - /** - * The product id. - */ - product: string; - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - } - - interface LoginPage { - /** - * Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. - */ - enabled: boolean; - } - } - - interface ConfigurationRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ConfigurationUpdateParams { - /** - * Whether the configuration is active and can be used to create portal sessions. - */ - active?: boolean; - - /** - * The business information shown to customers in the portal. - */ - business_profile?: ConfigurationUpdateParams.BusinessProfile; - - /** - * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. - */ - default_return_url?: Stripe.Emptyable; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Information about the features available in the portal. - */ - features?: ConfigurationUpdateParams.Features; - - /** - * The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). - */ - login_page?: ConfigurationUpdateParams.LoginPage; - - /** - * 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; - } - - namespace ConfigurationUpdateParams { - interface BusinessProfile { - /** - * The messaging shown to customers in the portal. - */ - headline?: string; - - /** - * A link to the business's publicly available privacy policy. - */ - privacy_policy_url?: Stripe.Emptyable; - - /** - * A link to the business's publicly available terms of service. - */ - terms_of_service_url?: Stripe.Emptyable; - } - - interface Features { - /** - * Information about updating the customer details in the portal. - */ - customer_update?: Features.CustomerUpdate; - - /** - * Information about showing the billing history in the portal. - */ - invoice_history?: Features.InvoiceHistory; - - /** - * Information about updating payment methods in the portal. - */ - payment_method_update?: Features.PaymentMethodUpdate; - - /** - * Information about canceling subscriptions in the portal. - */ - subscription_cancel?: Features.SubscriptionCancel; - - /** - * Information about pausing subscriptions in the portal. - */ - subscription_pause?: Features.SubscriptionPause; - - /** - * Information about updating subscriptions in the portal. - */ - subscription_update?: Features.SubscriptionUpdate; - } - - namespace Features { - interface CustomerUpdate { - /** - * The types of customer updates that are supported. When empty, customers are not updateable. - */ - allowed_updates?: Stripe.Emptyable< - Array - >; - - /** - * Whether the feature is enabled. - */ - enabled?: boolean; - } - - namespace CustomerUpdate { - type AllowedUpdate = - | 'address' - | 'email' - | 'phone' - | 'shipping' - | 'tax_id'; - } - - interface InvoiceHistory { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - } - - interface PaymentMethodUpdate { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - } - - interface SubscriptionCancel { - /** - * Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer - */ - cancellation_reason?: SubscriptionCancel.CancellationReason; - - /** - * Whether the feature is enabled. - */ - enabled?: boolean; - - /** - * Whether to cancel subscriptions immediately or at the end of the billing period. - */ - mode?: SubscriptionCancel.Mode; - - /** - * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. - */ - proration_behavior?: SubscriptionCancel.ProrationBehavior; - } - - namespace SubscriptionCancel { - interface CancellationReason { - /** - * Whether the feature is enabled. - */ - enabled: boolean; - - /** - * Which cancellation reasons will be given as options to the customer. - */ - options?: Stripe.Emptyable>; - } - - namespace CancellationReason { - type Option = - | 'customer_service' - | 'low_quality' - | 'missing_features' - | 'other' - | 'switched_service' - | 'too_complex' - | 'too_expensive' - | 'unused'; - } - - type Mode = 'at_period_end' | 'immediately'; - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - - interface SubscriptionPause { - /** - * Whether the feature is enabled. - */ - enabled?: boolean; - } - - interface SubscriptionUpdate { - /** - * The types of subscription updates that are supported. When empty, subscriptions are not updateable. - */ - default_allowed_updates?: Stripe.Emptyable< - Array - >; - - /** - * Whether the feature is enabled. - */ - enabled?: boolean; - - /** - * The list of products that support subscription updates. - */ - products?: Stripe.Emptyable>; - - /** - * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. - */ - proration_behavior?: SubscriptionUpdate.ProrationBehavior; - } - - namespace SubscriptionUpdate { - type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity'; - - interface Product { - /** - * The list of price IDs for the product that a subscription can be updated to. - */ - prices: Array; - - /** - * The product id. - */ - product: string; - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - } - - interface LoginPage { - /** - * Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. - * - * Set to `false` to deactivate the `login_page.url`. - */ - enabled: boolean; - } - } - - interface ConfigurationListParams extends PaginationParams { - /** - * Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). - */ - is_default?: boolean; - } - - class ConfigurationsResource { - /** - * Creates a configuration that describes the functionality and behavior of a PortalSession - */ - create( - params: ConfigurationCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a configuration that describes the functionality of the customer portal. - */ - retrieve( - id: string, - params?: ConfigurationRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a configuration that describes the functionality of the customer portal. - */ - update( - id: string, - params?: ConfigurationUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of configurations that describe the functionality of the customer portal. - */ - list( - params?: ConfigurationListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts b/types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts new file mode 100644 index 0000000000..fdb4882e6e --- /dev/null +++ b/types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts @@ -0,0 +1,553 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace BillingPortal { + interface ConfigurationCreateParams { + /** + * The business information shown to customers in the portal. + */ + business_profile: ConfigurationCreateParams.BusinessProfile; + + /** + * Information about the features available in the portal. + */ + features: ConfigurationCreateParams.Features; + + /** + * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + */ + default_return_url?: Stripe.Emptyable; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + */ + login_page?: ConfigurationCreateParams.LoginPage; + + /** + * 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.MetadataParam; + } + + namespace ConfigurationCreateParams { + interface BusinessProfile { + /** + * The messaging shown to customers in the portal. + */ + headline?: string; + + /** + * A link to the business's publicly available privacy policy. + */ + privacy_policy_url?: string; + + /** + * A link to the business's publicly available terms of service. + */ + terms_of_service_url?: string; + } + + interface Features { + /** + * Information about updating the customer details in the portal. + */ + customer_update?: Features.CustomerUpdate; + + /** + * Information about showing the billing history in the portal. + */ + invoice_history?: Features.InvoiceHistory; + + /** + * Information about updating payment methods in the portal. + */ + payment_method_update?: Features.PaymentMethodUpdate; + + /** + * Information about canceling subscriptions in the portal. + */ + subscription_cancel?: Features.SubscriptionCancel; + + /** + * Information about pausing subscriptions in the portal. + */ + subscription_pause?: Features.SubscriptionPause; + + /** + * Information about updating subscriptions in the portal. + */ + subscription_update?: Features.SubscriptionUpdate; + } + + namespace Features { + interface CustomerUpdate { + /** + * The types of customer updates that are supported. When empty, customers are not updateable. + */ + allowed_updates?: Stripe.Emptyable< + Array + >; + + /** + * Whether the feature is enabled. + */ + enabled: boolean; + } + + namespace CustomerUpdate { + type AllowedUpdate = + | 'address' + | 'email' + | 'phone' + | 'shipping' + | 'tax_id'; + } + + interface InvoiceHistory { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + } + + interface PaymentMethodUpdate { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + } + + interface SubscriptionCancel { + /** + * Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer + */ + cancellation_reason?: SubscriptionCancel.CancellationReason; + + /** + * Whether the feature is enabled. + */ + enabled: boolean; + + /** + * Whether to cancel subscriptions immediately or at the end of the billing period. + */ + mode?: SubscriptionCancel.Mode; + + /** + * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + */ + proration_behavior?: SubscriptionCancel.ProrationBehavior; + } + + namespace SubscriptionCancel { + interface CancellationReason { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + + /** + * Which cancellation reasons will be given as options to the customer. + */ + options: Stripe.Emptyable>; + } + + namespace CancellationReason { + type Option = + | 'customer_service' + | 'low_quality' + | 'missing_features' + | 'other' + | 'switched_service' + | 'too_complex' + | 'too_expensive' + | 'unused'; + } + + type Mode = 'at_period_end' | 'immediately'; + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface SubscriptionPause { + /** + * Whether the feature is enabled. + */ + enabled?: boolean; + } + + interface SubscriptionUpdate { + /** + * The types of subscription updates that are supported. When empty, subscriptions are not updateable. + */ + default_allowed_updates: Stripe.Emptyable< + Array + >; + + /** + * Whether the feature is enabled. + */ + enabled: boolean; + + /** + * The list of products that support subscription updates. + */ + products: Stripe.Emptyable>; + + /** + * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. + */ + proration_behavior?: SubscriptionUpdate.ProrationBehavior; + } + + namespace SubscriptionUpdate { + type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity'; + + interface Product { + /** + * The list of price IDs for the product that a subscription can be updated to. + */ + prices: Array; + + /** + * The product id. + */ + product: string; + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + } + + interface LoginPage { + /** + * Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + */ + enabled: boolean; + } + } + + interface ConfigurationRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ConfigurationUpdateParams { + /** + * Whether the configuration is active and can be used to create portal sessions. + */ + active?: boolean; + + /** + * The business information shown to customers in the portal. + */ + business_profile?: ConfigurationUpdateParams.BusinessProfile; + + /** + * The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + */ + default_return_url?: Stripe.Emptyable; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Information about the features available in the portal. + */ + features?: ConfigurationUpdateParams.Features; + + /** + * The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + */ + login_page?: ConfigurationUpdateParams.LoginPage; + + /** + * 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; + } + + namespace ConfigurationUpdateParams { + interface BusinessProfile { + /** + * The messaging shown to customers in the portal. + */ + headline?: string; + + /** + * A link to the business's publicly available privacy policy. + */ + privacy_policy_url?: Stripe.Emptyable; + + /** + * A link to the business's publicly available terms of service. + */ + terms_of_service_url?: Stripe.Emptyable; + } + + interface Features { + /** + * Information about updating the customer details in the portal. + */ + customer_update?: Features.CustomerUpdate; + + /** + * Information about showing the billing history in the portal. + */ + invoice_history?: Features.InvoiceHistory; + + /** + * Information about updating payment methods in the portal. + */ + payment_method_update?: Features.PaymentMethodUpdate; + + /** + * Information about canceling subscriptions in the portal. + */ + subscription_cancel?: Features.SubscriptionCancel; + + /** + * Information about pausing subscriptions in the portal. + */ + subscription_pause?: Features.SubscriptionPause; + + /** + * Information about updating subscriptions in the portal. + */ + subscription_update?: Features.SubscriptionUpdate; + } + + namespace Features { + interface CustomerUpdate { + /** + * The types of customer updates that are supported. When empty, customers are not updateable. + */ + allowed_updates?: Stripe.Emptyable< + Array + >; + + /** + * Whether the feature is enabled. + */ + enabled?: boolean; + } + + namespace CustomerUpdate { + type AllowedUpdate = + | 'address' + | 'email' + | 'phone' + | 'shipping' + | 'tax_id'; + } + + interface InvoiceHistory { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + } + + interface PaymentMethodUpdate { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + } + + interface SubscriptionCancel { + /** + * Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer + */ + cancellation_reason?: SubscriptionCancel.CancellationReason; + + /** + * Whether the feature is enabled. + */ + enabled?: boolean; + + /** + * Whether to cancel subscriptions immediately or at the end of the billing period. + */ + mode?: SubscriptionCancel.Mode; + + /** + * Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + */ + proration_behavior?: SubscriptionCancel.ProrationBehavior; + } + + namespace SubscriptionCancel { + interface CancellationReason { + /** + * Whether the feature is enabled. + */ + enabled: boolean; + + /** + * Which cancellation reasons will be given as options to the customer. + */ + options?: Stripe.Emptyable>; + } + + namespace CancellationReason { + type Option = + | 'customer_service' + | 'low_quality' + | 'missing_features' + | 'other' + | 'switched_service' + | 'too_complex' + | 'too_expensive' + | 'unused'; + } + + type Mode = 'at_period_end' | 'immediately'; + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface SubscriptionPause { + /** + * Whether the feature is enabled. + */ + enabled?: boolean; + } + + interface SubscriptionUpdate { + /** + * The types of subscription updates that are supported. When empty, subscriptions are not updateable. + */ + default_allowed_updates?: Stripe.Emptyable< + Array + >; + + /** + * Whether the feature is enabled. + */ + enabled?: boolean; + + /** + * The list of products that support subscription updates. + */ + products?: Stripe.Emptyable>; + + /** + * Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. + */ + proration_behavior?: SubscriptionUpdate.ProrationBehavior; + } + + namespace SubscriptionUpdate { + type DefaultAllowedUpdate = 'price' | 'promotion_code' | 'quantity'; + + interface Product { + /** + * The list of price IDs for the product that a subscription can be updated to. + */ + prices: Array; + + /** + * The product id. + */ + product: string; + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + } + + interface LoginPage { + /** + * Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + * + * Set to `false` to deactivate the `login_page.url`. + */ + enabled: boolean; + } + } + + interface ConfigurationListParams extends PaginationParams { + /** + * Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). + */ + is_default?: boolean; + } + + class ConfigurationsResource { + /** + * Creates a configuration that describes the functionality and behavior of a PortalSession + */ + create( + params: ConfigurationCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a configuration that describes the functionality of the customer portal. + */ + retrieve( + id: string, + params?: ConfigurationRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a configuration that describes the functionality of the customer portal. + */ + update( + id: string, + params?: ConfigurationUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of configurations that describe the functionality of the customer portal. + */ + list( + params?: ConfigurationListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/BillingPortal/Sessions.d.ts b/types/2022-11-15/BillingPortal/Sessions.d.ts index b3f99d7132..a0e9a767b0 100644 --- a/types/2022-11-15/BillingPortal/Sessions.d.ts +++ b/types/2022-11-15/BillingPortal/Sessions.d.ts @@ -121,99 +121,6 @@ declare module 'stripe' { | 'zh-HK' | 'zh-TW'; } - - interface SessionCreateParams { - /** - * The ID of an existing customer. - */ - customer: string; - - /** - * The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. - */ - configuration?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. - */ - locale?: SessionCreateParams.Locale; - - /** - * The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. - */ - on_behalf_of?: string; - - /** - * The default URL to redirect customers to when they click on the portal's link to return to your website. - */ - return_url?: string; - } - - namespace SessionCreateParams { - type Locale = - | 'auto' - | 'bg' - | 'cs' - | 'da' - | 'de' - | 'el' - | 'en' - | 'en-AU' - | 'en-CA' - | 'en-GB' - | 'en-IE' - | 'en-IN' - | 'en-NZ' - | 'en-SG' - | 'es' - | 'es-419' - | 'et' - | 'fi' - | 'fil' - | 'fr' - | 'fr-CA' - | 'hr' - | 'hu' - | 'id' - | 'it' - | 'ja' - | 'ko' - | 'lt' - | 'lv' - | 'ms' - | 'mt' - | 'nb' - | 'nl' - | 'pl' - | 'pt' - | 'pt-BR' - | 'ro' - | 'ru' - | 'sk' - | 'sl' - | 'sv' - | 'th' - | 'tr' - | 'vi' - | 'zh' - | 'zh-HK' - | 'zh-TW'; - } - - class SessionsResource { - /** - * Creates a session of the customer portal. - */ - create( - params: SessionCreateParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/BillingPortal/SessionsResource.d.ts b/types/2022-11-15/BillingPortal/SessionsResource.d.ts new file mode 100644 index 0000000000..10b8bf8042 --- /dev/null +++ b/types/2022-11-15/BillingPortal/SessionsResource.d.ts @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace BillingPortal { + interface SessionCreateParams { + /** + * The ID of an existing customer. + */ + customer: string; + + /** + * The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. + */ + configuration?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. + */ + locale?: SessionCreateParams.Locale; + + /** + * The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + */ + on_behalf_of?: string; + + /** + * The default URL to redirect customers to when they click on the portal's link to return to your website. + */ + return_url?: string; + } + + namespace SessionCreateParams { + type Locale = + | 'auto' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-AU' + | 'en-CA' + | 'en-GB' + | 'en-IE' + | 'en-IN' + | 'en-NZ' + | 'en-SG' + | 'es' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'hr' + | 'hu' + | 'id' + | 'it' + | 'ja' + | 'ko' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'vi' + | 'zh' + | 'zh-HK' + | 'zh-TW'; + } + + class SessionsResource { + /** + * Creates a session of the customer portal. + */ + create( + params: SessionCreateParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Capabilities.d.ts b/types/2022-11-15/Capabilities.d.ts index 13d9f297f2..e8988de265 100644 --- a/types/2022-11-15/Capabilities.d.ts +++ b/types/2022-11-15/Capabilities.d.ts @@ -309,31 +309,5 @@ declare module 'stripe' { | 'pending' | 'unrequested'; } - - interface CapabilityRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CapabilityUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CapabilityListParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/CapabilitiesResource.d.ts b/types/2022-11-15/CapabilitiesResource.d.ts new file mode 100644 index 0000000000..73202bce6e --- /dev/null +++ b/types/2022-11-15/CapabilitiesResource.d.ts @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CapabilityRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CapabilityUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CapabilityListParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/CardsResource.d.ts b/types/2022-11-15/CardsResource.d.ts new file mode 100644 index 0000000000..f5652f6bdc --- /dev/null +++ b/types/2022-11-15/CardsResource.d.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe {} +} diff --git a/types/2022-11-15/CashBalances.d.ts b/types/2022-11-15/CashBalances.d.ts index b9bc17decb..69de3e435e 100644 --- a/types/2022-11-15/CashBalances.d.ts +++ b/types/2022-11-15/CashBalances.d.ts @@ -43,37 +43,5 @@ declare module 'stripe' { type ReconciliationMode = 'automatic' | 'manual'; } } - - interface CashBalanceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CashBalanceUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A hash of settings for this cash balance. - */ - settings?: CashBalanceUpdateParams.Settings; - } - - namespace CashBalanceUpdateParams { - interface Settings { - /** - * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - */ - reconciliation_mode?: Settings.ReconciliationMode; - } - - namespace Settings { - type ReconciliationMode = 'automatic' | 'manual'; - } - } } } diff --git a/types/2022-11-15/CashBalancesResource.d.ts b/types/2022-11-15/CashBalancesResource.d.ts new file mode 100644 index 0000000000..1f9b55fbd4 --- /dev/null +++ b/types/2022-11-15/CashBalancesResource.d.ts @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CashBalanceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CashBalanceUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A hash of settings for this cash balance. + */ + settings?: CashBalanceUpdateParams.Settings; + } + + namespace CashBalanceUpdateParams { + interface Settings { + /** + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + */ + reconciliation_mode?: Settings.ReconciliationMode; + } + + namespace Settings { + type ReconciliationMode = 'automatic' | 'manual'; + } + } + } +} diff --git a/types/2022-11-15/Charges.d.ts b/types/2022-11-15/Charges.d.ts index 177f810fa7..a989ccded9 100644 --- a/types/2022-11-15/Charges.d.ts +++ b/types/2022-11-15/Charges.d.ts @@ -1794,415 +1794,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - interface ChargeCreateParams { - /** - * Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount?: number; - - application_fee?: number; - - /** - * A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). - */ - application_fee_amount?: number; - - /** - * Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. - */ - capture?: boolean; - - /** - * 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 ID of an existing customer that will be charged in this request. - */ - customer?: string; - - /** - * An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - */ - description?: string; - - destination?: ChargeCreateParams.Destination; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). - */ - on_behalf_of?: string; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: ChargeCreateParams.RadarOptions; - - /** - * The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email?: string; - - /** - * Shipping information for the charge. Helps prevent fraud on charges for physical goods. - */ - shipping?: ChargeCreateParams.Shipping; - - /** - * A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. - */ - source?: string; - - /** - * For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - */ - transfer_data?: ChargeCreateParams.TransferData; - - /** - * A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/charges-transfers#transfer-options). - */ - transfer_group?: string; - } - - namespace ChargeCreateParams { - interface Destination { - /** - * ID of an existing, connected Stripe account. - */ - account: string; - - /** - * The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. - */ - amount?: number; - } - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.AddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - - interface TransferData { - /** - * The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. - */ - amount?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface ChargeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ChargeUpdateParams { - /** - * The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. - */ - customer?: string; - - /** - * An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. - */ - fraud_details?: ChargeUpdateParams.FraudDetails; - - /** - * 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; - - /** - * This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. - */ - receipt_email?: string; - - /** - * Shipping information for the charge. Helps prevent fraud on charges for physical goods. - */ - shipping?: ChargeUpdateParams.Shipping; - - /** - * A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. - */ - transfer_group?: string; - } - - namespace ChargeUpdateParams { - interface FraudDetails { - /** - * Either `safe` or `fraudulent`. - */ - user_report: Stripe.Emptyable; - } - - namespace FraudDetails { - type UserReport = 'fraudulent' | 'safe'; - } - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.AddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - } - - interface ChargeListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Only return charges for the customer specified by this customer ID. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. - */ - payment_intent?: string; - - /** - * Only return charges for this transfer group. - */ - transfer_group?: string; - } - - interface ChargeCaptureParams { - /** - * The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. - */ - amount?: number; - - /** - * An application fee to add on to this charge. - */ - application_fee?: number; - - /** - * An application fee amount to add on to this charge, which must be less than or equal to the original amount. - */ - application_fee_amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. - */ - receipt_email?: string; - - /** - * For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - */ - transfer_data?: ChargeCaptureParams.TransferData; - - /** - * A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. - */ - transfer_group?: string; - } - - namespace ChargeCaptureParams { - interface TransferData { - /** - * The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. - */ - amount?: number; - } - } - - interface ChargeSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - class ChargesResource { - /** - * To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won't actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully). - */ - create( - params?: ChargeCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. - */ - retrieve( - id: string, - params?: ChargeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: ChargeUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. - */ - list( - params?: ChargeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you [created a charge](https://stripe.com/docs/api#create_charge) with the capture option set to false. - * - * Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)). If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable. - */ - capture( - id: string, - params?: ChargeCaptureParams, - options?: RequestOptions - ): Promise>; - capture( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: ChargeSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - } } } diff --git a/types/2022-11-15/ChargesResource.d.ts b/types/2022-11-15/ChargesResource.d.ts new file mode 100644 index 0000000000..fe863a966c --- /dev/null +++ b/types/2022-11-15/ChargesResource.d.ts @@ -0,0 +1,415 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ChargeCreateParams { + /** + * Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount?: number; + + application_fee?: number; + + /** + * A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + */ + application_fee_amount?: number; + + /** + * Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + */ + capture?: boolean; + + /** + * 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 ID of an existing customer that will be charged in this request. + */ + customer?: string; + + /** + * An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + */ + description?: string; + + destination?: ChargeCreateParams.Destination; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). + */ + on_behalf_of?: string; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: ChargeCreateParams.RadarOptions; + + /** + * The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + */ + receipt_email?: string; + + /** + * Shipping information for the charge. Helps prevent fraud on charges for physical goods. + */ + shipping?: ChargeCreateParams.Shipping; + + /** + * A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + */ + source?: string; + + /** + * For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + */ + transfer_data?: ChargeCreateParams.TransferData; + + /** + * A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/charges-transfers#transfer-options). + */ + transfer_group?: string; + } + + namespace ChargeCreateParams { + interface Destination { + /** + * ID of an existing, connected Stripe account. + */ + account: string; + + /** + * The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. + */ + amount?: number; + } + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + + interface TransferData { + /** + * The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + */ + amount?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface ChargeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ChargeUpdateParams { + /** + * The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. + */ + customer?: string; + + /** + * An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. + */ + fraud_details?: ChargeUpdateParams.FraudDetails; + + /** + * 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; + + /** + * This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. + */ + receipt_email?: string; + + /** + * Shipping information for the charge. Helps prevent fraud on charges for physical goods. + */ + shipping?: ChargeUpdateParams.Shipping; + + /** + * A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. + */ + transfer_group?: string; + } + + namespace ChargeUpdateParams { + interface FraudDetails { + /** + * Either `safe` or `fraudulent`. + */ + user_report: Stripe.Emptyable; + } + + namespace FraudDetails { + type UserReport = 'fraudulent' | 'safe'; + } + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + + interface ChargeListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Only return charges for the customer specified by this customer ID. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + */ + payment_intent?: string; + + /** + * Only return charges for this transfer group. + */ + transfer_group?: string; + } + + interface ChargeCaptureParams { + /** + * The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. + */ + amount?: number; + + /** + * An application fee to add on to this charge. + */ + application_fee?: number; + + /** + * An application fee amount to add on to this charge, which must be less than or equal to the original amount. + */ + application_fee_amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. + */ + receipt_email?: string; + + /** + * For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + */ + transfer_data?: ChargeCaptureParams.TransferData; + + /** + * A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. + */ + transfer_group?: string; + } + + namespace ChargeCaptureParams { + interface TransferData { + /** + * The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + */ + amount?: number; + } + } + + interface ChargeSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + class ChargesResource { + /** + * To charge a credit card or other payment source, you create a Charge object. If your API key is in test mode, the supplied payment source (e.g., card) won't actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully). + */ + create( + params?: ChargeCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. + */ + retrieve( + id: string, + params?: ChargeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: ChargeUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. + */ + list( + params?: ChargeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you [created a charge](https://stripe.com/docs/api#create_charge) with the capture option set to false. + * + * Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)). If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable. + */ + capture( + id: string, + params?: ChargeCaptureParams, + options?: RequestOptions + ): Promise>; + capture( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: ChargeSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + } + } +} diff --git a/types/2022-11-15/Checkout/Sessions.d.ts b/types/2022-11-15/Checkout/Sessions.d.ts index 1cc233e916..c14042bb1f 100644 --- a/types/2022-11-15/Checkout/Sessions.d.ts +++ b/types/2022-11-15/Checkout/Sessions.d.ts @@ -1442,1924 +1442,6 @@ declare module 'stripe' { } } } - - interface SessionCreateParams { - /** - * The URL the customer will be directed to if they decide to cancel payment and return to your website. - */ - cancel_url: string; - - /** - * 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. - */ - after_expiration?: SessionCreateParams.AfterExpiration; - - /** - * Enables user redeemable promotion codes. - */ - allow_promotion_codes?: boolean; - - /** - * Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. - */ - automatic_tax?: SessionCreateParams.AutomaticTax; - - /** - * Specify whether Checkout should collect the customer's billing address. - */ - billing_address_collection?: SessionCreateParams.BillingAddressCollection; - - /** - * A unique string to reference the Checkout Session. This can be a - * customer ID, a cart ID, or similar, and can be used to reconcile the - * session with your internal systems. - */ - client_reference_id?: string; - - /** - * Configure fields for the Checkout Session to gather active consent from customers. - */ - 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; - - /** - * Display additional text for your customers using custom text. - */ - custom_text?: SessionCreateParams.CustomText; - - /** - * 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 - * on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) - * will be used if it's a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. - * - * If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. - * If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. - * - * If blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow. - * - * You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. - */ - customer?: string; - - /** - * Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. - * - * When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout - * with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). - * - * Sessions that don't create Customers instead create [Guest Customers](https://support.stripe.com/questions/guest-customer-faq) - * in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions. - * - * Can only be set in `payment` and `setup` mode. - */ - customer_creation?: SessionCreateParams.CustomerCreation; - - /** - * If provided, this value will be used when the Customer object is created. - * If not provided, customers will be asked to enter their email address. - * Use this parameter to prefill customer data if you already have an email - * on file. To access information about the customer once a session is - * complete, use the `customer` field. - */ - customer_email?: string; - - /** - * Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. - */ - customer_update?: SessionCreateParams.CustomerUpdate; - - /** - * The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. - */ - discounts?: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation. - */ - expires_at?: number; - - /** - * A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). - * - * 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. - * - * For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. - */ - line_items?: Array; - - /** - * The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. - */ - locale?: SessionCreateParams.Locale; - - /** - * 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.MetadataParam; - - /** - * The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. - */ - mode?: SessionCreateParams.Mode; - - /** - * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - */ - payment_intent_data?: SessionCreateParams.PaymentIntentData; - - /** - * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. - * This may occur if the Checkout Session includes a free trial or a discount. - * - * Can only be set in `subscription` mode. - * - * If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - */ - payment_method_collection?: SessionCreateParams.PaymentMethodCollection; - - /** - * Payment-method-specific configuration. - */ - payment_method_options?: SessionCreateParams.PaymentMethodOptions; - - /** - * A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. - * - * In `payment` and `subscription` mode, you can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - * It is required in `setup` mode. - * - * Read more about the supported payment methods and their requirements in our [payment - * method details guide](https://stripe.com/docs/payments/checkout/payment-methods). - * - * If multiple payment methods are passed, Checkout will dynamically reorder them to - * prioritize the most relevant payment methods based on the customer's location and - * other characteristics. - */ - payment_method_types?: Array; - - /** - * Controls phone number collection settings for the session. - * - * We recommend that you review your privacy policy and check with your legal contacts - * before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). - */ - phone_number_collection?: SessionCreateParams.PhoneNumberCollection; - - /** - * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. - */ - setup_intent_data?: SessionCreateParams.SetupIntentData; - - /** - * When set, provides configuration for Checkout to collect a shipping address from a customer. - */ - shipping_address_collection?: SessionCreateParams.ShippingAddressCollection; - - /** - * The shipping rate options to apply to this Session. - */ - shipping_options?: Array; - - /** - * [Deprecated] The shipping rate to apply to this Session. Only up to one may be specified. - */ - shipping_rates?: Array; - - /** - * Describes the type of transaction being performed by Checkout in order to customize - * relevant text on the page, such as the submit button. `submit_type` can only be - * specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - * in `subscription` or `setup` mode. - */ - submit_type?: SessionCreateParams.SubmitType; - - /** - * A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. - */ - subscription_data?: SessionCreateParams.SubscriptionData; - - /** - * Controls tax ID collection settings for the session. - */ - tax_id_collection?: SessionCreateParams.TaxIdCollection; - } - - namespace SessionCreateParams { - interface AfterExpiration { - /** - * Configure a Checkout Session that can be used to recover an expired session. - */ - recovery?: AfterExpiration.Recovery; - } - - namespace AfterExpiration { - interface Recovery { - /** - * Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` - */ - allow_promotion_codes?: boolean; - - /** - * If `true`, a recovery URL will be generated to recover this Checkout Session if it - * expires before a successful transaction is completed. It will be attached to the - * Checkout Session object upon expiration. - */ - enabled: boolean; - } - } - - interface AutomaticTax { - /** - * Set to true to enable automatic taxes. - */ - enabled: boolean; - } - - type BillingAddressCollection = 'auto' | 'required'; - - interface ConsentCollection { - /** - * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout - * Session will determine whether to display an option to opt into promotional communication - * from the merchant depending on the customer's locale. Only available to US merchants. - */ - promotions?: ConsentCollection.Promotions; - - /** - * If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - * There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - */ - terms_of_service?: ConsentCollection.TermsOfService; - } - - namespace ConsentCollection { - type Promotions = 'auto' | 'none'; - - type TermsOfService = 'none' | 'required'; - } - - type CustomerCreation = 'always' | 'if_required'; - - interface CustomerUpdate { - /** - * Describes whether Checkout saves the billing address onto `customer.address`. - * To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. - */ - address?: CustomerUpdate.Address; - - /** - * Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. - */ - name?: CustomerUpdate.Name; - - /** - * Describes whether Checkout saves shipping information onto `customer.shipping`. - * To collect shipping information, use `shipping_address_collection`. Defaults to `never`. - */ - shipping?: CustomerUpdate.Shipping; - } - - namespace CustomerUpdate { - type Address = 'auto' | 'never'; - - type Name = 'auto' | 'never'; - - type Shipping = 'auto' | 'never'; - } - - interface CustomText { - /** - * Custom text that should be displayed alongside shipping address collection. - */ - shipping_address?: Stripe.Emptyable; - - /** - * Custom text that should be displayed alongside the payment confirmation button. - */ - submit?: Stripe.Emptyable; - } - - namespace CustomText { - interface ShippingAddress { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - - interface Submit { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - } - - interface Discount { - /** - * The ID of the coupon to apply to this Session. - */ - coupon?: string; - - /** - * The ID of a promotion code to apply to this Session. - */ - promotion_code?: string; - } - - interface LineItem { - /** - * When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. - */ - adjustable_quantity?: LineItem.AdjustableQuantity; - - /** - * The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. - */ - dynamic_tax_rates?: Array; - - /** - * The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - */ - price_data?: LineItem.PriceData; - - /** - * The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. - */ - quantity?: number; - - /** - * The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. - */ - tax_rates?: Array; - } - - namespace LineItem { - interface AdjustableQuantity { - /** - * Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. - */ - enabled: boolean; - - /** - * The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. - */ - maximum?: number; - - /** - * The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. - */ - minimum?: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. One of `product` or `product_data` is required. - */ - product?: string; - - /** - * Data used to generate a new product object inline. One of `product` or `product_data` is required. - */ - product_data?: PriceData.ProductData; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring?: PriceData.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?: PriceData.TaxBehavior; - - /** - * A non-negative integer in cents (or local equivalent) 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 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 PriceData { - interface ProductData { - /** - * 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. - */ - description?: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Array; - - /** - * 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.MetadataParam; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - } - - 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'; - } - } - - type Locale = - | 'auto' - | 'bg' - | 'cs' - | 'da' - | 'de' - | 'el' - | 'en' - | 'en-GB' - | 'es' - | 'es-419' - | 'et' - | 'fi' - | 'fil' - | 'fr' - | 'fr-CA' - | 'hr' - | 'hu' - | 'id' - | 'it' - | 'ja' - | 'ko' - | 'lt' - | 'lv' - | 'ms' - | 'mt' - | 'nb' - | 'nl' - | 'pl' - | 'pt' - | 'pt-BR' - | 'ro' - | 'ru' - | 'sk' - | 'sl' - | 'sv' - | 'th' - | 'tr' - | 'vi' - | 'zh' - | 'zh-HK' - | 'zh-TW'; - - type Mode = 'payment' | 'setup' | 'subscription'; - - interface PaymentIntentData { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount?: number; - - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: PaymentIntentData.CaptureMethod; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The Stripe account ID for which these funds are intended. For details, - * see the PaymentIntents [use case for connected - * accounts](https://stripe.com/docs/payments/connected-accounts). - */ - on_behalf_of?: string; - - /** - * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email?: string; - - /** - * Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment - * method collected by this Checkout Session. - * - * When setting this to `on_session`, Checkout will show a notice to the - * customer that their payment details will be saved. - * - * When setting this to `off_session`, Checkout will show a notice to the - * customer that their payment details will be saved and used for future - * payments. - * - * If a Customer has been provided or Checkout creates a new Customer, - * Checkout will attach the payment method to the Customer. - * - * If Checkout does not create a Customer, the payment method is not attached - * to a Customer. To reuse the payment method, you can retrieve it from the - * Checkout Session's PaymentIntent. - * - * When processing card payments, Checkout also uses `setup_future_usage` - * to dynamically optimize your payment flow and comply with regional - * legislation and network rules, such as SCA. - */ - setup_future_usage?: PaymentIntentData.SetupFutureUsage; - - /** - * Shipping information for this payment. - */ - shipping?: PaymentIntentData.Shipping; - - /** - * Extra information about the payment. This will appear on your - * customer's statement when this payment succeeds in creating a charge. - */ - statement_descriptor?: string; - - /** - * Provides information about the charge that customers see on their statements. Concatenated with the - * prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete - * statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * The parameters used to automatically create a Transfer when the payment succeeds. - * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - transfer_data?: PaymentIntentData.TransferData; - - /** - * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - transfer_group?: string; - } - - namespace PaymentIntentData { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'off_session' | 'on_session'; - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.ShippingAddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - */ - amount?: number; - - /** - * If specified, successful charges will be attributed to the destination - * account for tax reporting, and the funds from charges will be transferred - * to the destination account. The ID of the resulting transfer will be - * returned on the successful charge's `transfer` field. - */ - destination: string; - } - } - - type PaymentMethodCollection = 'always' | 'if_required'; - - interface PaymentMethodOptions { - /** - * contains details about the ACSS Debit payment method options. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * contains details about the Affirm payment method options. - */ - affirm?: PaymentMethodOptions.Affirm; - - /** - * contains details about the Afterpay Clearpay payment method options. - */ - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - /** - * contains details about the Alipay payment method options. - */ - alipay?: PaymentMethodOptions.Alipay; - - /** - * contains details about the AU Becs Debit payment method options. - */ - au_becs_debit?: PaymentMethodOptions.AuBecsDebit; - - /** - * contains details about the Bacs Debit payment method options. - */ - bacs_debit?: PaymentMethodOptions.BacsDebit; - - /** - * contains details about the Bancontact payment method options. - */ - bancontact?: PaymentMethodOptions.Bancontact; - - /** - * contains details about the Boleto payment method options. - */ - boleto?: PaymentMethodOptions.Boleto; - - /** - * contains details about the Card payment method options. - */ - card?: PaymentMethodOptions.Card; - - /** - * contains details about the Customer Balance payment method options. - */ - customer_balance?: PaymentMethodOptions.CustomerBalance; - - /** - * contains details about the EPS payment method options. - */ - eps?: PaymentMethodOptions.Eps; - - /** - * contains details about the FPX payment method options. - */ - fpx?: PaymentMethodOptions.Fpx; - - /** - * contains details about the Giropay payment method options. - */ - giropay?: PaymentMethodOptions.Giropay; - - /** - * contains details about the Grabpay payment method options. - */ - grabpay?: PaymentMethodOptions.Grabpay; - - /** - * contains details about the Ideal payment method options. - */ - ideal?: PaymentMethodOptions.Ideal; - - /** - * contains details about the Klarna payment method options. - */ - klarna?: PaymentMethodOptions.Klarna; - - /** - * contains details about the Konbini payment method options. - */ - konbini?: PaymentMethodOptions.Konbini; - - /** - * contains details about the OXXO payment method options. - */ - oxxo?: PaymentMethodOptions.Oxxo; - - /** - * contains details about the P24 payment method options. - */ - p24?: PaymentMethodOptions.P24; - - /** - * contains details about the PayNow payment method options. - */ - paynow?: PaymentMethodOptions.Paynow; - - /** - * contains details about the Pix payment method options. - */ - pix?: PaymentMethodOptions.Pix; - - /** - * contains details about the Sepa Debit payment method options. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * contains details about the Sofort payment method options. - */ - sofort?: PaymentMethodOptions.Sofort; - - /** - * contains details about the Us Bank Account payment method options. - */ - us_bank_account?: PaymentMethodOptions.UsBankAccount; - - /** - * contains details about the WeChat Pay payment method options. - */ - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * 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). This is only accepted for Checkout Sessions in `setup` mode. - */ - currency?: AcssDebit.Currency; - - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: AcssDebit.SetupFutureUsage; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - type Currency = 'cad' | 'usd'; - - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. - */ - default_for?: Array; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type DefaultFor = 'invoice' | 'subscription'; - - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Affirm { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface AfterpayClearpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface AuBecsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface BacsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: BacsDebit.SetupFutureUsage; - } - - namespace BacsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Bancontact { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Boleto { - /** - * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Boleto.SetupFutureUsage; - } - - namespace Boleto { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Card { - /** - * Installment options for card payments - */ - installments?: Card.Installments; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Card.SetupFutureUsage; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - */ - statement_descriptor_suffix_kana?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - */ - statement_descriptor_suffix_kanji?: string; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this Checkout Session. - * Setting to false will prevent any installment plan from applying to a payment. - */ - enabled?: boolean; - } - - type SetupFutureUsage = 'off_session' | 'on_session'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Eps { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Fpx { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Giropay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Grabpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Klarna { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Konbini { - /** - * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface Paynow { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Pix { - /** - * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. - */ - expires_after_seconds?: number; - } - - interface SepaDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: SepaDebit.SetupFutureUsage; - } - - namespace SepaDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: UsBankAccount.SetupFutureUsage; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface PhoneNumberCollection { - /** - * Set to `true` to enable phone number collection. - */ - enabled: boolean; - } - - interface SetupIntentData { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The Stripe account for which the setup is intended. - */ - on_behalf_of?: string; - } - - interface ShippingAddressCollection { - /** - * An array of two-letter ISO country codes representing which countries Checkout should provide as options for - * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - */ - allowed_countries: Array; - } - - namespace ShippingAddressCollection { - type AllowedCountry = - | 'AC' - | 'AD' - | 'AE' - | 'AF' - | 'AG' - | 'AI' - | 'AL' - | 'AM' - | 'AO' - | 'AQ' - | 'AR' - | 'AT' - | 'AU' - | 'AW' - | 'AX' - | 'AZ' - | 'BA' - | 'BB' - | 'BD' - | 'BE' - | 'BF' - | 'BG' - | 'BH' - | 'BI' - | 'BJ' - | 'BL' - | 'BM' - | 'BN' - | 'BO' - | 'BQ' - | 'BR' - | 'BS' - | 'BT' - | 'BV' - | 'BW' - | 'BY' - | 'BZ' - | 'CA' - | 'CD' - | 'CF' - | 'CG' - | 'CH' - | 'CI' - | 'CK' - | 'CL' - | 'CM' - | 'CN' - | 'CO' - | 'CR' - | 'CV' - | 'CW' - | 'CY' - | 'CZ' - | 'DE' - | 'DJ' - | 'DK' - | 'DM' - | 'DO' - | 'DZ' - | 'EC' - | 'EE' - | 'EG' - | 'EH' - | 'ER' - | 'ES' - | 'ET' - | 'FI' - | 'FJ' - | 'FK' - | 'FO' - | 'FR' - | 'GA' - | 'GB' - | 'GD' - | 'GE' - | 'GF' - | 'GG' - | 'GH' - | 'GI' - | 'GL' - | 'GM' - | 'GN' - | 'GP' - | 'GQ' - | 'GR' - | 'GS' - | 'GT' - | 'GU' - | 'GW' - | 'GY' - | 'HK' - | 'HN' - | 'HR' - | 'HT' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IM' - | 'IN' - | 'IO' - | 'IQ' - | 'IS' - | 'IT' - | 'JE' - | 'JM' - | 'JO' - | 'JP' - | 'KE' - | 'KG' - | 'KH' - | 'KI' - | 'KM' - | 'KN' - | 'KR' - | 'KW' - | 'KY' - | 'KZ' - | 'LA' - | 'LB' - | 'LC' - | 'LI' - | 'LK' - | 'LR' - | 'LS' - | 'LT' - | 'LU' - | 'LV' - | 'LY' - | 'MA' - | 'MC' - | 'MD' - | 'ME' - | 'MF' - | 'MG' - | 'MK' - | 'ML' - | 'MM' - | 'MN' - | 'MO' - | 'MQ' - | 'MR' - | 'MS' - | 'MT' - | 'MU' - | 'MV' - | 'MW' - | 'MX' - | 'MY' - | 'MZ' - | 'NA' - | 'NC' - | 'NE' - | 'NG' - | 'NI' - | 'NL' - | 'NO' - | 'NP' - | 'NR' - | 'NU' - | 'NZ' - | 'OM' - | 'PA' - | 'PE' - | 'PF' - | 'PG' - | 'PH' - | 'PK' - | 'PL' - | 'PM' - | 'PN' - | 'PR' - | 'PS' - | 'PT' - | 'PY' - | 'QA' - | 'RE' - | 'RO' - | 'RS' - | 'RU' - | 'RW' - | 'SA' - | 'SB' - | 'SC' - | 'SE' - | 'SG' - | 'SH' - | 'SI' - | 'SJ' - | 'SK' - | 'SL' - | 'SM' - | 'SN' - | 'SO' - | 'SR' - | 'SS' - | 'ST' - | 'SV' - | 'SX' - | 'SZ' - | 'TA' - | 'TC' - | 'TD' - | 'TF' - | 'TG' - | 'TH' - | 'TJ' - | 'TK' - | 'TL' - | 'TM' - | 'TN' - | 'TO' - | 'TR' - | 'TT' - | 'TV' - | 'TW' - | 'TZ' - | 'UA' - | 'UG' - | 'US' - | 'UY' - | 'UZ' - | 'VA' - | 'VC' - | 'VE' - | 'VG' - | 'VN' - | 'VU' - | 'WF' - | 'WS' - | 'XK' - | 'YE' - | 'YT' - | 'ZA' - | 'ZM' - | 'ZW' - | 'ZZ'; - } - - interface ShippingOption { - /** - * The ID of the Shipping Rate to use for this shipping option. - */ - shipping_rate?: string; - - /** - * Parameters to be passed to Shipping Rate creation for this shipping option - */ - shipping_rate_data?: ShippingOption.ShippingRateData; - } - - namespace ShippingOption { - interface ShippingRateData { - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateData.DeliveryEstimate; - - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateData.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.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateData.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateData { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: 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; - - /** - * 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'; - } - } - - type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; - - interface SubscriptionData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. - */ - coupon?: string; - - /** - * The tax rates that will apply to any subscription item that does not have - * `tax_rates` set. Invoices created will have their `default_tax_rates` populated - * from the subscription. - */ - default_tax_rates?: Array; - - /** - * The subscription's description, meant to be displayable to the customer. - * Use this field to optionally store an explanation of the subscription - * for rendering in Stripe hosted surfaces. - */ - description?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The account on behalf of which to charge, for each of the subscription's invoices. - */ - on_behalf_of?: string; - - /** - * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - */ - 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. - */ - trial_end?: number; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` on `subscription_data` is preferred. Defaults to `false`. - */ - trial_from_plan?: boolean; - - /** - * 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; - } - - namespace SubscriptionData { - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface TaxIdCollection { - /** - * Set to true to enable Tax ID collection. - */ - enabled: boolean; - } - } - - interface SessionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SessionListParams extends PaginationParams { - /** - * Only return the Checkout Sessions for the Customer specified. - */ - customer?: string; - - /** - * Only return the Checkout Sessions for the Customer details specified. - */ - customer_details?: SessionListParams.CustomerDetails; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return the Checkout Session for the PaymentIntent specified. - */ - payment_intent?: string; - - /** - * Only return the Checkout Session for the subscription specified. - */ - subscription?: string; - } - - namespace SessionListParams { - interface CustomerDetails { - /** - * Customer's email address. - */ - email: string; - } - } - - interface SessionExpireParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SessionListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class SessionsResource { - /** - * Creates a Session object. - */ - create( - params: SessionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a Session object. - */ - retrieve( - id: string, - params?: SessionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Checkout Sessions. - */ - list( - params?: SessionListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * A Session can be expired when it is in one of these statuses: open - * - * After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. - */ - expire( - id: string, - params?: SessionExpireParams, - options?: RequestOptions - ): Promise>; - expire( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: SessionListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Checkout/SessionsResource.d.ts b/types/2022-11-15/Checkout/SessionsResource.d.ts new file mode 100644 index 0000000000..4f51a7aa7c --- /dev/null +++ b/types/2022-11-15/Checkout/SessionsResource.d.ts @@ -0,0 +1,1925 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Checkout { + interface SessionCreateParams { + /** + * The URL the customer will be directed to if they decide to cancel payment and return to your website. + */ + cancel_url: string; + + /** + * 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. + */ + after_expiration?: SessionCreateParams.AfterExpiration; + + /** + * Enables user redeemable promotion codes. + */ + allow_promotion_codes?: boolean; + + /** + * Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. + */ + automatic_tax?: SessionCreateParams.AutomaticTax; + + /** + * Specify whether Checkout should collect the customer's billing address. + */ + billing_address_collection?: SessionCreateParams.BillingAddressCollection; + + /** + * A unique string to reference the Checkout Session. This can be a + * customer ID, a cart ID, or similar, and can be used to reconcile the + * session with your internal systems. + */ + client_reference_id?: string; + + /** + * Configure fields for the Checkout Session to gather active consent from customers. + */ + 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; + + /** + * Display additional text for your customers using custom text. + */ + custom_text?: SessionCreateParams.CustomText; + + /** + * 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 + * on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) + * will be used if it's a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. + * + * If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. + * If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. + * + * If blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow. + * + * You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. + */ + customer?: string; + + /** + * Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. + * + * When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout + * with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). + * + * Sessions that don't create Customers instead create [Guest Customers](https://support.stripe.com/questions/guest-customer-faq) + * in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions. + * + * Can only be set in `payment` and `setup` mode. + */ + customer_creation?: SessionCreateParams.CustomerCreation; + + /** + * If provided, this value will be used when the Customer object is created. + * If not provided, customers will be asked to enter their email address. + * Use this parameter to prefill customer data if you already have an email + * on file. To access information about the customer once a session is + * complete, use the `customer` field. + */ + customer_email?: string; + + /** + * Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. + */ + customer_update?: SessionCreateParams.CustomerUpdate; + + /** + * The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. + */ + discounts?: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation. + */ + expires_at?: number; + + /** + * A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + * + * 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. + * + * For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. + */ + line_items?: Array; + + /** + * The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. + */ + locale?: SessionCreateParams.Locale; + + /** + * 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.MetadataParam; + + /** + * The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. + */ + mode?: SessionCreateParams.Mode; + + /** + * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + */ + payment_intent_data?: SessionCreateParams.PaymentIntentData; + + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. + * This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: SessionCreateParams.PaymentMethodCollection; + + /** + * Payment-method-specific configuration. + */ + payment_method_options?: SessionCreateParams.PaymentMethodOptions; + + /** + * A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. + * + * In `payment` and `subscription` mode, you can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + * It is required in `setup` mode. + * + * Read more about the supported payment methods and their requirements in our [payment + * method details guide](https://stripe.com/docs/payments/checkout/payment-methods). + * + * If multiple payment methods are passed, Checkout will dynamically reorder them to + * prioritize the most relevant payment methods based on the customer's location and + * other characteristics. + */ + payment_method_types?: Array; + + /** + * Controls phone number collection settings for the session. + * + * We recommend that you review your privacy policy and check with your legal contacts + * before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). + */ + phone_number_collection?: SessionCreateParams.PhoneNumberCollection; + + /** + * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. + */ + setup_intent_data?: SessionCreateParams.SetupIntentData; + + /** + * When set, provides configuration for Checkout to collect a shipping address from a customer. + */ + shipping_address_collection?: SessionCreateParams.ShippingAddressCollection; + + /** + * The shipping rate options to apply to this Session. + */ + shipping_options?: Array; + + /** + * [Deprecated] The shipping rate to apply to this Session. Only up to one may be specified. + */ + shipping_rates?: Array; + + /** + * Describes the type of transaction being performed by Checkout in order to customize + * relevant text on the page, such as the submit button. `submit_type` can only be + * specified on Checkout Sessions in `payment` mode, but not Checkout Sessions + * in `subscription` or `setup` mode. + */ + submit_type?: SessionCreateParams.SubmitType; + + /** + * A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. + */ + subscription_data?: SessionCreateParams.SubscriptionData; + + /** + * Controls tax ID collection settings for the session. + */ + tax_id_collection?: SessionCreateParams.TaxIdCollection; + } + + namespace SessionCreateParams { + interface AfterExpiration { + /** + * Configure a Checkout Session that can be used to recover an expired session. + */ + recovery?: AfterExpiration.Recovery; + } + + namespace AfterExpiration { + interface Recovery { + /** + * Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` + */ + allow_promotion_codes?: boolean; + + /** + * If `true`, a recovery URL will be generated to recover this Checkout Session if it + * expires before a successful transaction is completed. It will be attached to the + * Checkout Session object upon expiration. + */ + enabled: boolean; + } + } + + interface AutomaticTax { + /** + * Set to true to enable automatic taxes. + */ + enabled: boolean; + } + + type BillingAddressCollection = 'auto' | 'required'; + + interface ConsentCollection { + /** + * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + * Session will determine whether to display an option to opt into promotional communication + * from the merchant depending on the customer's locale. Only available to US merchants. + */ + promotions?: ConsentCollection.Promotions; + + /** + * If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + * There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + */ + terms_of_service?: ConsentCollection.TermsOfService; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; + + type TermsOfService = 'none' | 'required'; + } + + type CustomerCreation = 'always' | 'if_required'; + + interface CustomerUpdate { + /** + * Describes whether Checkout saves the billing address onto `customer.address`. + * To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. + */ + address?: CustomerUpdate.Address; + + /** + * Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. + */ + name?: CustomerUpdate.Name; + + /** + * Describes whether Checkout saves shipping information onto `customer.shipping`. + * To collect shipping information, use `shipping_address_collection`. Defaults to `never`. + */ + shipping?: CustomerUpdate.Shipping; + } + + namespace CustomerUpdate { + type Address = 'auto' | 'never'; + + type Name = 'auto' | 'never'; + + type Shipping = 'auto' | 'never'; + } + + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + + interface Discount { + /** + * The ID of the coupon to apply to this Session. + */ + coupon?: string; + + /** + * The ID of a promotion code to apply to this Session. + */ + promotion_code?: string; + } + + interface LineItem { + /** + * When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. + */ + adjustable_quantity?: LineItem.AdjustableQuantity; + + /** + * The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. + */ + dynamic_tax_rates?: Array; + + /** + * The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + */ + price_data?: LineItem.PriceData; + + /** + * The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. + */ + quantity?: number; + + /** + * The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. + */ + tax_rates?: Array; + } + + namespace LineItem { + interface AdjustableQuantity { + /** + * Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. + */ + enabled: boolean; + + /** + * The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. + */ + maximum?: number; + + /** + * The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. + */ + minimum?: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. One of `product` or `product_data` is required. + */ + product?: string; + + /** + * Data used to generate a new product object inline. One of `product` or `product_data` is required. + */ + product_data?: PriceData.ProductData; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring?: PriceData.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?: PriceData.TaxBehavior; + + /** + * A non-negative integer in cents (or local equivalent) 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 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 PriceData { + interface ProductData { + /** + * 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. + */ + description?: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Array; + + /** + * 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.MetadataParam; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + } + + 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'; + } + } + + type Locale = + | 'auto' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-GB' + | 'es' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'hr' + | 'hu' + | 'id' + | 'it' + | 'ja' + | 'ko' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'vi' + | 'zh' + | 'zh-HK' + | 'zh-TW'; + + type Mode = 'payment' | 'setup' | 'subscription'; + + interface PaymentIntentData { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: number; + + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentData.CaptureMethod; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The Stripe account ID for which these funds are intended. For details, + * see the PaymentIntents [use case for connected + * accounts](https://stripe.com/docs/payments/connected-accounts). + */ + on_behalf_of?: string; + + /** + * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + */ + receipt_email?: string; + + /** + * Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment + * method collected by this Checkout Session. + * + * When setting this to `on_session`, Checkout will show a notice to the + * customer that their payment details will be saved. + * + * When setting this to `off_session`, Checkout will show a notice to the + * customer that their payment details will be saved and used for future + * payments. + * + * If a Customer has been provided or Checkout creates a new Customer, + * Checkout will attach the payment method to the Customer. + * + * If Checkout does not create a Customer, the payment method is not attached + * to a Customer. To reuse the payment method, you can retrieve it from the + * Checkout Session's PaymentIntent. + * + * When processing card payments, Checkout also uses `setup_future_usage` + * to dynamically optimize your payment flow and comply with regional + * legislation and network rules, such as SCA. + */ + setup_future_usage?: PaymentIntentData.SetupFutureUsage; + + /** + * Shipping information for this payment. + */ + shipping?: PaymentIntentData.Shipping; + + /** + * Extra information about the payment. This will appear on your + * customer's statement when this payment succeeds in creating a charge. + */ + statement_descriptor?: string; + + /** + * Provides information about the charge that customers see on their statements. Concatenated with the + * prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete + * statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * The parameters used to automatically create a Transfer when the payment succeeds. + * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + transfer_data?: PaymentIntentData.TransferData; + + /** + * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + */ + transfer_group?: string; + } + + namespace PaymentIntentData { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'off_session' | 'on_session'; + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.ShippingAddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + */ + amount?: number; + + /** + * If specified, successful charges will be attributed to the destination + * account for tax reporting, and the funds from charges will be transferred + * to the destination account. The ID of the resulting transfer will be + * returned on the successful charge's `transfer` field. + */ + destination: string; + } + } + + type PaymentMethodCollection = 'always' | 'if_required'; + + interface PaymentMethodOptions { + /** + * contains details about the ACSS Debit payment method options. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * contains details about the Affirm payment method options. + */ + affirm?: PaymentMethodOptions.Affirm; + + /** + * contains details about the Afterpay Clearpay payment method options. + */ + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + + /** + * contains details about the Alipay payment method options. + */ + alipay?: PaymentMethodOptions.Alipay; + + /** + * contains details about the AU Becs Debit payment method options. + */ + au_becs_debit?: PaymentMethodOptions.AuBecsDebit; + + /** + * contains details about the Bacs Debit payment method options. + */ + bacs_debit?: PaymentMethodOptions.BacsDebit; + + /** + * contains details about the Bancontact payment method options. + */ + bancontact?: PaymentMethodOptions.Bancontact; + + /** + * contains details about the Boleto payment method options. + */ + boleto?: PaymentMethodOptions.Boleto; + + /** + * contains details about the Card payment method options. + */ + card?: PaymentMethodOptions.Card; + + /** + * contains details about the Customer Balance payment method options. + */ + customer_balance?: PaymentMethodOptions.CustomerBalance; + + /** + * contains details about the EPS payment method options. + */ + eps?: PaymentMethodOptions.Eps; + + /** + * contains details about the FPX payment method options. + */ + fpx?: PaymentMethodOptions.Fpx; + + /** + * contains details about the Giropay payment method options. + */ + giropay?: PaymentMethodOptions.Giropay; + + /** + * contains details about the Grabpay payment method options. + */ + grabpay?: PaymentMethodOptions.Grabpay; + + /** + * contains details about the Ideal payment method options. + */ + ideal?: PaymentMethodOptions.Ideal; + + /** + * contains details about the Klarna payment method options. + */ + klarna?: PaymentMethodOptions.Klarna; + + /** + * contains details about the Konbini payment method options. + */ + konbini?: PaymentMethodOptions.Konbini; + + /** + * contains details about the OXXO payment method options. + */ + oxxo?: PaymentMethodOptions.Oxxo; + + /** + * contains details about the P24 payment method options. + */ + p24?: PaymentMethodOptions.P24; + + /** + * contains details about the PayNow payment method options. + */ + paynow?: PaymentMethodOptions.Paynow; + + /** + * contains details about the Pix payment method options. + */ + pix?: PaymentMethodOptions.Pix; + + /** + * contains details about the Sepa Debit payment method options. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * contains details about the Sofort payment method options. + */ + sofort?: PaymentMethodOptions.Sofort; + + /** + * contains details about the Us Bank Account payment method options. + */ + us_bank_account?: PaymentMethodOptions.UsBankAccount; + + /** + * contains details about the WeChat Pay payment method options. + */ + wechat_pay?: PaymentMethodOptions.WechatPay; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * 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). This is only accepted for Checkout Sessions in `setup` mode. + */ + currency?: AcssDebit.Currency; + + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AcssDebit.SetupFutureUsage; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + type Currency = 'cad' | 'usd'; + + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. + */ + default_for?: Array; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type DefaultFor = 'invoice' | 'subscription'; + + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Affirm { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: BacsDebit.SetupFutureUsage; + } + + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Bancontact { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Boleto { + /** + * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Boleto.SetupFutureUsage; + } + + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Card { + /** + * Installment options for card payments + */ + installments?: Card.Installments; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Card.SetupFutureUsage; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + */ + statement_descriptor_suffix_kana?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + */ + statement_descriptor_suffix_kanji?: string; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this Checkout Session. + * Setting to false will prevent any installment plan from applying to a payment. + */ + enabled?: boolean; + } + + type SetupFutureUsage = 'off_session' | 'on_session'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array< + BankTransfer.RequestedAddressType + >; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Klarna { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Konbini { + /** + * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + */ + expires_after_seconds?: number; + } + + interface SepaDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: SepaDebit.SetupFutureUsage; + } + + namespace SepaDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: UsBankAccount.SetupFutureUsage; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface PhoneNumberCollection { + /** + * Set to `true` to enable phone number collection. + */ + enabled: boolean; + } + + interface SetupIntentData { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The Stripe account for which the setup is intended. + */ + on_behalf_of?: string; + } + + interface ShippingAddressCollection { + /** + * An array of two-letter ISO country codes representing which countries Checkout should provide as options for + * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + */ + allowed_countries: Array; + } + + namespace ShippingAddressCollection { + type AllowedCountry = + | 'AC' + | 'AD' + | 'AE' + | 'AF' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AQ' + | 'AR' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BY' + | 'BZ' + | 'CA' + | 'CD' + | 'CF' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CV' + | 'CW' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HN' + | 'HR' + | 'HT' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'LY' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MK' + | 'ML' + | 'MM' + | 'MN' + | 'MO' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NG' + | 'NI' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RU' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SO' + | 'SR' + | 'SS' + | 'ST' + | 'SV' + | 'SX' + | 'SZ' + | 'TA' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VE' + | 'VG' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'XK' + | 'YE' + | 'YT' + | 'ZA' + | 'ZM' + | 'ZW' + | 'ZZ'; + } + + interface ShippingOption { + /** + * The ID of the Shipping Rate to use for this shipping option. + */ + shipping_rate?: string; + + /** + * Parameters to be passed to Shipping Rate creation for this shipping option + */ + shipping_rate_data?: ShippingOption.ShippingRateData; + } + + namespace ShippingOption { + interface ShippingRateData { + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateData.DeliveryEstimate; + + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateData.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.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateData.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateData { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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; + + /** + * 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'; + } + } + + type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; + + interface SubscriptionData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + */ + coupon?: string; + + /** + * The tax rates that will apply to any subscription item that does not have + * `tax_rates` set. Invoices created will have their `default_tax_rates` populated + * from the subscription. + */ + default_tax_rates?: Array; + + /** + * The subscription's description, meant to be displayable to the customer. + * Use this field to optionally store an explanation of the subscription + * for rendering in Stripe hosted surfaces. + */ + description?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the subscription's invoices. + */ + on_behalf_of?: string; + + /** + * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. + */ + 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. + */ + trial_end?: number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` on `subscription_data` is preferred. Defaults to `false`. + */ + trial_from_plan?: boolean; + + /** + * 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; + } + + namespace SubscriptionData { + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface TaxIdCollection { + /** + * Set to true to enable Tax ID collection. + */ + enabled: boolean; + } + } + + interface SessionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SessionListParams extends PaginationParams { + /** + * Only return the Checkout Sessions for the Customer specified. + */ + customer?: string; + + /** + * Only return the Checkout Sessions for the Customer details specified. + */ + customer_details?: SessionListParams.CustomerDetails; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return the Checkout Session for the PaymentIntent specified. + */ + payment_intent?: string; + + /** + * Only return the Checkout Session for the subscription specified. + */ + subscription?: string; + } + + namespace SessionListParams { + interface CustomerDetails { + /** + * Customer's email address. + */ + email: string; + } + } + + interface SessionExpireParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SessionListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SessionsResource { + /** + * Creates a Session object. + */ + create( + params: SessionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a Session object. + */ + retrieve( + id: string, + params?: SessionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Checkout Sessions. + */ + list( + params?: SessionListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * A Session can be expired when it is in one of these statuses: open + * + * After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. + */ + expire( + id: string, + params?: SessionExpireParams, + options?: RequestOptions + ): Promise>; + expire( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: SessionListLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/CountrySpecs.d.ts b/types/2022-11-15/CountrySpecs.d.ts index 1777df2e04..724022e35b 100644 --- a/types/2022-11-15/CountrySpecs.d.ts +++ b/types/2022-11-15/CountrySpecs.d.ts @@ -84,43 +84,5 @@ declare module 'stripe' { } } } - - interface CountrySpecRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CountrySpecListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class CountrySpecsResource { - /** - * Returns a Country Spec for a given Country code. - */ - retrieve( - id: string, - params?: CountrySpecRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Lists all Country Spec objects available in the API. - */ - list( - params?: CountrySpecListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/CountrySpecsResource.d.ts b/types/2022-11-15/CountrySpecsResource.d.ts new file mode 100644 index 0000000000..75e2d20298 --- /dev/null +++ b/types/2022-11-15/CountrySpecsResource.d.ts @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CountrySpecRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CountrySpecListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class CountrySpecsResource { + /** + * Returns a Country Spec for a given Country code. + */ + retrieve( + id: string, + params?: CountrySpecRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Lists all Country Spec objects available in the API. + */ + list( + params?: CountrySpecListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Coupons.d.ts b/types/2022-11-15/Coupons.d.ts index c4768190ad..d8c6909f46 100644 --- a/types/2022-11-15/Coupons.d.ts +++ b/types/2022-11-15/Coupons.d.ts @@ -132,203 +132,5 @@ declare module 'stripe' { */ deleted: true; } - - interface CouponCreateParams { - /** - * A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). - */ - amount_off?: number; - - /** - * A hash containing directions for what this Coupon will apply discounts to. - */ - applies_to?: CouponCreateParams.AppliesTo; - - /** - * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). - */ - 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. Defaults to `once`. - */ - duration?: CouponCreateParams.Duration; - - /** - * Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. - */ - duration_in_months?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. - */ - id?: string; - - /** - * A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. - */ - max_redemptions?: number; - - /** - * 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; - - /** - * Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. - */ - name?: string; - - /** - * A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). - */ - percent_off?: number; - - /** - * Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. - */ - redeem_by?: number; - } - - namespace CouponCreateParams { - interface AppliesTo { - /** - * An array of Product IDs that this Coupon will apply to. - */ - products?: Array; - } - - interface CurrencyOptions { - /** - * A positive integer representing the amount to subtract from an invoice total. - */ - amount_off: number; - } - - type Duration = 'forever' | 'once' | 'repeating'; - } - - interface CouponRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - 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. - */ - expand?: Array; - - /** - * 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; - - /** - * Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. - */ - 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CouponDeleteParams {} - - class CouponsResource { - /** - * You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. - * - * A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. - */ - create( - params?: CouponCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the coupon with the given ID. - */ - retrieve( - id: string, - params?: CouponRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. - */ - update( - id: string, - params?: CouponUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your coupons. - */ - list( - params?: CouponListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. - */ - del( - id: string, - params?: CouponDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/CouponsResource.d.ts b/types/2022-11-15/CouponsResource.d.ts new file mode 100644 index 0000000000..6e992133a4 --- /dev/null +++ b/types/2022-11-15/CouponsResource.d.ts @@ -0,0 +1,203 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CouponCreateParams { + /** + * A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). + */ + amount_off?: number; + + /** + * A hash containing directions for what this Coupon will apply discounts to. + */ + applies_to?: CouponCreateParams.AppliesTo; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). + */ + 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. Defaults to `once`. + */ + duration?: CouponCreateParams.Duration; + + /** + * Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. + */ + duration_in_months?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. + */ + id?: string; + + /** + * A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. + */ + max_redemptions?: number; + + /** + * 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; + + /** + * Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. + */ + name?: string; + + /** + * A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). + */ + percent_off?: number; + + /** + * Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. + */ + redeem_by?: number; + } + + namespace CouponCreateParams { + interface AppliesTo { + /** + * An array of Product IDs that this Coupon will apply to. + */ + products?: Array; + } + + interface CurrencyOptions { + /** + * A positive integer representing the amount to subtract from an invoice total. + */ + amount_off: number; + } + + type Duration = 'forever' | 'once' | 'repeating'; + } + + interface CouponRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + 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. + */ + expand?: Array; + + /** + * 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; + + /** + * Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. + */ + 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CouponDeleteParams {} + + class CouponsResource { + /** + * You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. + * + * A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. + */ + create( + params?: CouponCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the coupon with the given ID. + */ + retrieve( + id: string, + params?: CouponRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. + */ + update( + id: string, + params?: CouponUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your coupons. + */ + list( + params?: CouponListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. + */ + del( + id: string, + params?: CouponDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/CreditNoteLineItems.d.ts b/types/2022-11-15/CreditNoteLineItems.d.ts index 83c385bbe6..2055f827be 100644 --- a/types/2022-11-15/CreditNoteLineItems.d.ts +++ b/types/2022-11-15/CreditNoteLineItems.d.ts @@ -119,12 +119,5 @@ declare module 'stripe' { type Type = 'custom_line_item' | 'invoice_line_item'; } - - interface CreditNoteLineItemListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/CreditNoteLineItemsResource.d.ts b/types/2022-11-15/CreditNoteLineItemsResource.d.ts new file mode 100644 index 0000000000..0f209bc927 --- /dev/null +++ b/types/2022-11-15/CreditNoteLineItemsResource.d.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CreditNoteLineItemListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/CreditNotes.d.ts b/types/2022-11-15/CreditNotes.d.ts index 541666b537..7dd291c5ff 100644 --- a/types/2022-11-15/CreditNotes.d.ts +++ b/types/2022-11-15/CreditNotes.d.ts @@ -187,482 +187,5 @@ declare module 'stripe' { type Type = 'post_payment' | 'pre_payment'; } - - interface CreditNoteCreateParams { - /** - * ID of the invoice. - */ - invoice: string; - - /** - * The integer amount in cents (or local equivalent) representing the total amount of the credit note. - */ - amount?: number; - - /** - * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. - */ - credit_amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Line items that make up the credit note. - */ - lines?: Array; - - /** - * The credit note's memo appears on the credit note PDF. - */ - memo?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. - */ - out_of_band_amount?: number; - - /** - * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` - */ - reason?: CreditNoteCreateParams.Reason; - - /** - * ID of an existing refund to link this credit note to. - */ - refund?: string; - - /** - * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. - */ - refund_amount?: number; - } - - namespace CreditNoteCreateParams { - interface Line { - /** - * The line item amount to credit. Only valid when `type` is `invoice_line_item`. - */ - amount?: number; - - /** - * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - description?: string; - - /** - * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. - */ - invoice_line_item?: string; - - /** - * The line item quantity to credit. - */ - quantity?: number; - - /** - * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` - */ - type: Line.Type; - - /** - * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. - */ - 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 Line { - type Type = 'custom_line_item' | 'invoice_line_item'; - } - - type Reason = - | 'duplicate' - | 'fraudulent' - | 'order_change' - | 'product_unsatisfactory'; - } - - interface CreditNoteRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CreditNoteUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Credit note memo. - */ - memo?: 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`. - */ - metadata?: Stripe.MetadataParam; - } - - interface CreditNoteListParams extends PaginationParams { - /** - * Only return credit notes for the customer specified by this customer ID. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return credit notes for the invoice specified by this invoice ID. - */ - invoice?: string; - } - - interface CreditNoteListPreviewLineItemsParams extends PaginationParams { - /** - * ID of the invoice. - */ - invoice: string; - - /** - * The integer amount in cents (or local equivalent) representing the total amount of the credit note. - */ - amount?: number; - - /** - * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. - */ - credit_amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Line items that make up the credit note. - */ - lines?: Array; - - /** - * The credit note's memo appears on the credit note PDF. - */ - memo?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. - */ - out_of_band_amount?: number; - - /** - * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` - */ - reason?: CreditNoteListPreviewLineItemsParams.Reason; - - /** - * ID of an existing refund to link this credit note to. - */ - refund?: string; - - /** - * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. - */ - refund_amount?: number; - } - - namespace CreditNoteListPreviewLineItemsParams { - interface Line { - /** - * The line item amount to credit. Only valid when `type` is `invoice_line_item`. - */ - amount?: number; - - /** - * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - description?: string; - - /** - * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. - */ - invoice_line_item?: string; - - /** - * The line item quantity to credit. - */ - quantity?: number; - - /** - * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` - */ - type: Line.Type; - - /** - * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. - */ - 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 Line { - type Type = 'custom_line_item' | 'invoice_line_item'; - } - - type Reason = - | 'duplicate' - | 'fraudulent' - | 'order_change' - | 'product_unsatisfactory'; - } - - interface CreditNotePreviewParams { - /** - * ID of the invoice. - */ - invoice: string; - - /** - * The integer amount in cents (or local equivalent) representing the total amount of the credit note. - */ - amount?: number; - - /** - * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. - */ - credit_amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Line items that make up the credit note. - */ - lines?: Array; - - /** - * The credit note's memo appears on the credit note PDF. - */ - memo?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. - */ - out_of_band_amount?: number; - - /** - * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` - */ - reason?: CreditNotePreviewParams.Reason; - - /** - * ID of an existing refund to link this credit note to. - */ - refund?: string; - - /** - * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. - */ - refund_amount?: number; - } - - namespace CreditNotePreviewParams { - interface Line { - /** - * The line item amount to credit. Only valid when `type` is `invoice_line_item`. - */ - amount?: number; - - /** - * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - description?: string; - - /** - * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. - */ - invoice_line_item?: string; - - /** - * The line item quantity to credit. - */ - quantity?: number; - - /** - * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` - */ - type: Line.Type; - - /** - * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. - */ - 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 Line { - type Type = 'custom_line_item' | 'invoice_line_item'; - } - - type Reason = - | 'duplicate' - | 'fraudulent' - | 'order_change' - | 'product_unsatisfactory'; - } - - interface CreditNoteVoidCreditNoteParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class CreditNotesResource { - /** - * Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces - * its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result - * in any combination of the following: - * - * - * Refund: create a new refund (using refund_amount) or link an existing refund (using refund). - * Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. - * Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). - * - * - * For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. - * - * You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount - * or post_payment_credit_notes_amount depending on its status at the time of credit note creation. - */ - create( - params: CreditNoteCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the credit note object with the given identifier. - */ - retrieve( - id: string, - params?: CreditNoteRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing credit note. - */ - update( - id: string, - params?: CreditNoteUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of credit notes. - */ - list( - params?: CreditNoteListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. - */ - listPreviewLineItems( - params: CreditNoteListPreviewLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Get a preview of a credit note without creating it. - */ - preview( - params: CreditNotePreviewParams, - options?: RequestOptions - ): Promise>; - - /** - * Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). - */ - voidCreditNote( - id: string, - params?: CreditNoteVoidCreditNoteParams, - options?: RequestOptions - ): Promise>; - voidCreditNote( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: CreditNoteLineItemListParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/CreditNotesResource.d.ts b/types/2022-11-15/CreditNotesResource.d.ts new file mode 100644 index 0000000000..3b7e9de4b1 --- /dev/null +++ b/types/2022-11-15/CreditNotesResource.d.ts @@ -0,0 +1,482 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CreditNoteCreateParams { + /** + * ID of the invoice. + */ + invoice: string; + + /** + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. + */ + amount?: number; + + /** + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + */ + credit_amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Line items that make up the credit note. + */ + lines?: Array; + + /** + * The credit note's memo appears on the credit note PDF. + */ + memo?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + */ + out_of_band_amount?: number; + + /** + * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + */ + reason?: CreditNoteCreateParams.Reason; + + /** + * ID of an existing refund to link this credit note to. + */ + refund?: string; + + /** + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + */ + refund_amount?: number; + } + + namespace CreditNoteCreateParams { + interface Line { + /** + * The line item amount to credit. Only valid when `type` is `invoice_line_item`. + */ + amount?: number; + + /** + * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + description?: string; + + /** + * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + */ + invoice_line_item?: string; + + /** + * The line item quantity to credit. + */ + quantity?: number; + + /** + * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + */ + type: Line.Type; + + /** + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + */ + 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 Line { + type Type = 'custom_line_item' | 'invoice_line_item'; + } + + type Reason = + | 'duplicate' + | 'fraudulent' + | 'order_change' + | 'product_unsatisfactory'; + } + + interface CreditNoteRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CreditNoteUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Credit note memo. + */ + memo?: 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`. + */ + metadata?: Stripe.MetadataParam; + } + + interface CreditNoteListParams extends PaginationParams { + /** + * Only return credit notes for the customer specified by this customer ID. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return credit notes for the invoice specified by this invoice ID. + */ + invoice?: string; + } + + interface CreditNoteListPreviewLineItemsParams extends PaginationParams { + /** + * ID of the invoice. + */ + invoice: string; + + /** + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. + */ + amount?: number; + + /** + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + */ + credit_amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Line items that make up the credit note. + */ + lines?: Array; + + /** + * The credit note's memo appears on the credit note PDF. + */ + memo?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + */ + out_of_band_amount?: number; + + /** + * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + */ + reason?: CreditNoteListPreviewLineItemsParams.Reason; + + /** + * ID of an existing refund to link this credit note to. + */ + refund?: string; + + /** + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + */ + refund_amount?: number; + } + + namespace CreditNoteListPreviewLineItemsParams { + interface Line { + /** + * The line item amount to credit. Only valid when `type` is `invoice_line_item`. + */ + amount?: number; + + /** + * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + description?: string; + + /** + * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + */ + invoice_line_item?: string; + + /** + * The line item quantity to credit. + */ + quantity?: number; + + /** + * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + */ + type: Line.Type; + + /** + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + */ + 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 Line { + type Type = 'custom_line_item' | 'invoice_line_item'; + } + + type Reason = + | 'duplicate' + | 'fraudulent' + | 'order_change' + | 'product_unsatisfactory'; + } + + interface CreditNotePreviewParams { + /** + * ID of the invoice. + */ + invoice: string; + + /** + * The integer amount in cents (or local equivalent) representing the total amount of the credit note. + */ + amount?: number; + + /** + * The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + */ + credit_amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Line items that make up the credit note. + */ + lines?: Array; + + /** + * The credit note's memo appears on the credit note PDF. + */ + memo?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + */ + out_of_band_amount?: number; + + /** + * Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + */ + reason?: CreditNotePreviewParams.Reason; + + /** + * ID of an existing refund to link this credit note to. + */ + refund?: string; + + /** + * The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + */ + refund_amount?: number; + } + + namespace CreditNotePreviewParams { + interface Line { + /** + * The line item amount to credit. Only valid when `type` is `invoice_line_item`. + */ + amount?: number; + + /** + * The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + description?: string; + + /** + * The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + */ + invoice_line_item?: string; + + /** + * The line item quantity to credit. + */ + quantity?: number; + + /** + * The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + */ + type: Line.Type; + + /** + * The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + */ + 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 Line { + type Type = 'custom_line_item' | 'invoice_line_item'; + } + + type Reason = + | 'duplicate' + | 'fraudulent' + | 'order_change' + | 'product_unsatisfactory'; + } + + interface CreditNoteVoidCreditNoteParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class CreditNotesResource { + /** + * Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces + * its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result + * in any combination of the following: + * + * + * Refund: create a new refund (using refund_amount) or link an existing refund (using refund). + * Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. + * Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). + * + * + * For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. + * + * You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount + * or post_payment_credit_notes_amount depending on its status at the time of credit note creation. + */ + create( + params: CreditNoteCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the credit note object with the given identifier. + */ + retrieve( + id: string, + params?: CreditNoteRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing credit note. + */ + update( + id: string, + params?: CreditNoteUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of credit notes. + */ + list( + params?: CreditNoteListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. + */ + listPreviewLineItems( + params: CreditNoteListPreviewLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Get a preview of a credit note without creating it. + */ + preview( + params: CreditNotePreviewParams, + options?: RequestOptions + ): Promise>; + + /** + * Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + */ + voidCreditNote( + id: string, + params?: CreditNoteVoidCreditNoteParams, + options?: RequestOptions + ): Promise>; + voidCreditNote( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: CreditNoteLineItemListParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/CustomerBalanceTransactions.d.ts b/types/2022-11-15/CustomerBalanceTransactions.d.ts index c1405c0e70..25b100927c 100644 --- a/types/2022-11-15/CustomerBalanceTransactions.d.ts +++ b/types/2022-11-15/CustomerBalanceTransactions.d.ts @@ -89,63 +89,5 @@ declare module 'stripe' { | 'unapplied_from_invoice' | 'unspent_receiver_credit'; } - - interface CustomerBalanceTransactionCreateParams { - /** - * The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. - */ - amount: 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. - */ - currency: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface CustomerBalanceTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerBalanceTransactionUpdateParams { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface CustomerBalanceTransactionListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts b/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts new file mode 100644 index 0000000000..f75d8d3b4a --- /dev/null +++ b/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CustomerBalanceTransactionCreateParams { + /** + * The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. + */ + amount: 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface CustomerBalanceTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerBalanceTransactionUpdateParams { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface CustomerBalanceTransactionListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/CustomerCashBalanceTransactions.d.ts b/types/2022-11-15/CustomerCashBalanceTransactions.d.ts index 1acd2c834a..a955fe76f7 100644 --- a/types/2022-11-15/CustomerCashBalanceTransactions.d.ts +++ b/types/2022-11-15/CustomerCashBalanceTransactions.d.ts @@ -138,20 +138,5 @@ declare module 'stripe' { payment_intent: string | Stripe.PaymentIntent; } } - - interface CustomerCashBalanceTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerCashBalanceTransactionListParams - extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts b/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts new file mode 100644 index 0000000000..1a0d654d63 --- /dev/null +++ b/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts @@ -0,0 +1,20 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CustomerCashBalanceTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerCashBalanceTransactionListParams + extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/CustomerSources.d.ts b/types/2022-11-15/CustomerSourcesResource.d.ts similarity index 100% rename from types/2022-11-15/CustomerSources.d.ts rename to types/2022-11-15/CustomerSourcesResource.d.ts diff --git a/types/2022-11-15/Customers.d.ts b/types/2022-11-15/Customers.d.ts index 8af9d27b91..9de25296bf 100644 --- a/types/2022-11-15/Customers.d.ts +++ b/types/2022-11-15/Customers.d.ts @@ -291,997 +291,5 @@ declare module 'stripe' { */ deleted: true; } - - interface CustomerCreateParams { - /** - * The customer's address. - */ - address?: Stripe.Emptyable; - - /** - * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - */ - balance?: number; - - /** - * Balance information and default balance settings for this customer. - */ - cash_balance?: CustomerCreateParams.CashBalance; - - coupon?: string; - - /** - * An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. - */ - description?: string; - - /** - * Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. - */ - invoice_prefix?: string; - - /** - * Default invoice settings for this customer. - */ - invoice_settings?: CustomerCreateParams.InvoiceSettings; - - /** - * 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; - - /** - * The customer's full name or business name. - */ - name?: string; - - /** - * The sequence to be used on the customer's next invoice. Defaults to 1. - */ - next_invoice_sequence?: number; - - payment_method?: string; - - /** - * The customer's phone number. - */ - phone?: string; - - /** - * Customer's preferred languages, ordered by preference. - */ - preferred_locales?: Array; - - /** - * The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - */ - promotion_code?: string; - - /** - * The customer's shipping information. Appears on invoices emailed to this customer. - */ - shipping?: Stripe.Emptyable; - - source?: string; - - /** - * Tax details about the customer. - */ - tax?: CustomerCreateParams.Tax; - - /** - * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The customer's tax IDs. - */ - tax_id_data?: Array; - - /** - * ID of the test clock to attach to the customer. - */ - test_clock?: string; - - validate?: boolean; - } - - namespace CustomerCreateParams { - interface CashBalance { - /** - * Settings controlling the behavior of the customer's cash balance, - * such as reconciliation of funds received. - */ - settings?: CashBalance.Settings; - } - - namespace CashBalance { - interface Settings { - /** - * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - */ - reconciliation_mode?: Settings.ReconciliationMode; - } - - namespace Settings { - type ReconciliationMode = 'automatic' | 'manual'; - } - } - - interface InvoiceSettings { - /** - * Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. - */ - custom_fields?: Stripe.Emptyable>; - - /** - * ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - */ - default_payment_method?: string; - - /** - * Default footer to be displayed on invoices for this customer. - */ - footer?: string; - - /** - * Default options for invoice PDF rendering for this customer. - */ - rendering_options?: Stripe.Emptyable; - } - - namespace InvoiceSettings { - interface CustomField { - /** - * The name of the custom field. This may be up to 30 characters. - */ - name: string; - - /** - * The value of the custom field. This may be up to 30 characters. - */ - value: string; - } - - interface RenderingOptions { - /** - * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - */ - amount_tax_display?: Stripe.Emptyable< - RenderingOptions.AmountTaxDisplay - >; - } - - namespace RenderingOptions { - type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; - } - } - - interface Shipping { - /** - * Customer shipping address. - */ - address: Stripe.AddressParam; - - /** - * Customer name. - */ - name: string; - - /** - * Customer phone (including extension). - */ - phone?: string; - } - - interface Tax { - /** - * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - */ - ip_address?: Stripe.Emptyable; - } - - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxIdDatum { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxIdDatum.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxIdDatum { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - - interface CustomerRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerUpdateParams { - /** - * The customer's address. - */ - address?: Stripe.Emptyable; - - /** - * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - */ - balance?: number; - - /** - * Balance information and default balance settings for this customer. - */ - cash_balance?: CustomerUpdateParams.CashBalance; - - coupon?: string; - - /** - * If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. - * - * Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. - * - * If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. - */ - default_source?: string; - - /** - * An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. - */ - description?: string; - - /** - * Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. - */ - invoice_prefix?: string; - - /** - * Default invoice settings for this customer. - */ - invoice_settings?: CustomerUpdateParams.InvoiceSettings; - - /** - * 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; - - /** - * The customer's full name or business name. - */ - name?: string; - - /** - * The sequence to be used on the customer's next invoice. Defaults to 1. - */ - next_invoice_sequence?: number; - - /** - * The customer's phone number. - */ - phone?: string; - - /** - * Customer's preferred languages, ordered by preference. - */ - preferred_locales?: Array; - - /** - * The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. - */ - promotion_code?: string; - - /** - * The customer's shipping information. Appears on invoices emailed to this customer. - */ - shipping?: Stripe.Emptyable; - - source?: string; - - /** - * Tax details about the customer. - */ - tax?: CustomerUpdateParams.Tax; - - /** - * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - validate?: boolean; - } - - namespace CustomerUpdateParams { - interface CashBalance { - /** - * Settings controlling the behavior of the customer's cash balance, - * such as reconciliation of funds received. - */ - settings?: CashBalance.Settings; - } - - namespace CashBalance { - interface Settings { - /** - * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - */ - reconciliation_mode?: Settings.ReconciliationMode; - } - - namespace Settings { - type ReconciliationMode = 'automatic' | 'manual'; - } - } - - interface InvoiceSettings { - /** - * Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. - */ - custom_fields?: Stripe.Emptyable>; - - /** - * ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - */ - default_payment_method?: string; - - /** - * Default footer to be displayed on invoices for this customer. - */ - footer?: string; - - /** - * Default options for invoice PDF rendering for this customer. - */ - rendering_options?: Stripe.Emptyable; - } - - namespace InvoiceSettings { - interface CustomField { - /** - * The name of the custom field. This may be up to 30 characters. - */ - name: string; - - /** - * The value of the custom field. This may be up to 30 characters. - */ - value: string; - } - - interface RenderingOptions { - /** - * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - */ - amount_tax_display?: Stripe.Emptyable< - RenderingOptions.AmountTaxDisplay - >; - } - - namespace RenderingOptions { - type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; - } - } - - interface Shipping { - /** - * Customer shipping address. - */ - address: Stripe.AddressParam; - - /** - * Customer name. - */ - name: string; - - /** - * Customer phone (including extension). - */ - phone?: string; - } - - interface Tax { - /** - * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - */ - ip_address?: Stripe.Emptyable; - } - - type TaxExempt = 'exempt' | 'none' | 'reverse'; - } - - interface CustomerListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. - */ - test_clock?: string; - } - - interface CustomerDeleteParams {} - - interface CustomerCreateFundingInstructionsParams { - /** - * Additional parameters for `bank_transfer` funding types - */ - bank_transfer: CustomerCreateFundingInstructionsParams.BankTransfer; - - /** - * 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 `funding_type` to get the instructions for. - */ - funding_type: 'bank_transfer'; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace CustomerCreateFundingInstructionsParams { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array; - - /** - * The type of the `bank_transfer` - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = 'iban' | 'sort_code' | 'spei' | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface CustomerDeleteDiscountParams {} - - interface CustomerListPaymentMethodsParams extends PaginationParams { - /** - * A required filter on the list, based on the object `type` field. - */ - type: CustomerListPaymentMethodsParams.Type; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace CustomerListPaymentMethodsParams { - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'card_present' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - } - - interface CustomerRetrievePaymentMethodParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - class CustomersResource { - /** - * Creates a new customer object. - */ - create( - params?: CustomerCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a Customer object. - */ - retrieve( - id: string, - params?: CustomerRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. - * - * This request accepts mostly the same arguments as the customer creation call. - */ - update( - id: string, - params?: CustomerUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. - */ - list( - params?: CustomerListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. - */ - del( - id: string, - params?: CustomerDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new - * funding instructions will be created. If funding instructions have already been created for a given customer, the same - * funding instructions will be retrieved. In other words, we will return the same funding instructions each time. - */ - createFundingInstructions( - id: string, - params: CustomerCreateFundingInstructionsParams, - options?: RequestOptions - ): Promise>; - - /** - * Removes the currently applied discount on a customer. - */ - deleteDiscount( - id: string, - params?: CustomerDeleteDiscountParams, - options?: RequestOptions - ): Promise>; - deleteDiscount( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of PaymentMethods for a given Customer - */ - listPaymentMethods( - id: string, - params: CustomerListPaymentMethodsParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Retrieves a PaymentMethod object for a given Customer. - */ - retrievePaymentMethod( - customerId: string, - id: string, - params?: CustomerRetrievePaymentMethodParams, - options?: RequestOptions - ): Promise>; - retrievePaymentMethod( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: CustomerSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - - /** - * Retrieves a customer's cash balance. - */ - retrieveCashBalance( - id: string, - params?: CashBalanceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveCashBalance( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Changes the settings on a customer's cash balance. - */ - updateCashBalance( - id: string, - params?: CashBalanceUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). - */ - createBalanceTransaction( - id: string, - params: CustomerBalanceTransactionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). - */ - retrieveBalanceTransaction( - customerId: string, - id: string, - params?: CustomerBalanceTransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveBalanceTransaction( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Most credit balance transaction fields are immutable, but you may update its description and metadata. - */ - updateBalanceTransaction( - customerId: string, - id: string, - params?: CustomerBalanceTransactionUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). - */ - listBalanceTransactions( - id: string, - params?: CustomerBalanceTransactionListParams, - options?: RequestOptions - ): ApiListPromise; - listBalanceTransactions( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). - */ - retrieveCashBalanceTransaction( - customerId: string, - id: string, - params?: CustomerCashBalanceTransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveCashBalanceTransaction( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). - */ - listCashBalanceTransactions( - id: string, - params?: CustomerCashBalanceTransactionListParams, - options?: RequestOptions - ): ApiListPromise; - listCashBalanceTransactions( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * When you create a new credit card, you must specify a customer or recipient on which to create it. - * - * If the card's owner has no default card, then the new card will become the default. - * However, if the owner already has a default, then it will not change. - * To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. - */ - createSource( - id: string, - params: CustomerSourceCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve a specified source for a given customer. - */ - retrieveSource( - customerId: string, - id: string, - params?: CustomerSourceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveSource( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Update a specified source for a given customer. - */ - updateSource( - customerId: string, - id: string, - params?: CustomerSourceUpdateParams, - options?: RequestOptions - ): Promise< - Stripe.Response - >; - - /** - * List sources for a specified customer. - */ - listSources( - id: string, - params?: CustomerSourceListParams, - options?: RequestOptions - ): ApiListPromise; - listSources( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Delete a specified source for a given customer. - */ - deleteSource( - customerId: string, - id: string, - params?: CustomerSourceDeleteParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.CustomerSource | Stripe.DeletedBankAccount | Stripe.DeletedCard - > - >; - deleteSource( - customerId: string, - id: string, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.CustomerSource | Stripe.DeletedBankAccount | Stripe.DeletedCard - > - >; - - /** - * Verify a specified bank account for a given customer. - */ - verifySource( - customerId: string, - id: string, - params?: CustomerSourceVerifyParams, - options?: RequestOptions - ): Promise>; - verifySource( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Creates a new TaxID object for a customer. - */ - createTaxId( - id: string, - params: TaxIdCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the TaxID object with the given identifier. - */ - retrieveTaxId( - customerId: string, - id: string, - params?: TaxIdRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveTaxId( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of tax IDs for a customer. - */ - listTaxIds( - id: string, - params?: TaxIdListParams, - options?: RequestOptions - ): ApiListPromise; - listTaxIds( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes an existing TaxID object. - */ - deleteTaxId( - customerId: string, - id: string, - params?: TaxIdDeleteParams, - options?: RequestOptions - ): Promise>; - deleteTaxId( - customerId: string, - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/CustomersResource.d.ts b/types/2022-11-15/CustomersResource.d.ts new file mode 100644 index 0000000000..a740acd0d8 --- /dev/null +++ b/types/2022-11-15/CustomersResource.d.ts @@ -0,0 +1,997 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface CustomerCreateParams { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + */ + balance?: number; + + /** + * Balance information and default balance settings for this customer. + */ + cash_balance?: CustomerCreateParams.CashBalance; + + coupon?: string; + + /** + * An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. + */ + description?: string; + + /** + * Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + */ + invoice_prefix?: string; + + /** + * Default invoice settings for this customer. + */ + invoice_settings?: CustomerCreateParams.InvoiceSettings; + + /** + * 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; + + /** + * The customer's full name or business name. + */ + name?: string; + + /** + * The sequence to be used on the customer's next invoice. Defaults to 1. + */ + next_invoice_sequence?: number; + + payment_method?: string; + + /** + * The customer's phone number. + */ + phone?: string; + + /** + * Customer's preferred languages, ordered by preference. + */ + preferred_locales?: Array; + + /** + * The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + */ + promotion_code?: string; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + source?: string; + + /** + * Tax details about the customer. + */ + tax?: CustomerCreateParams.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The customer's tax IDs. + */ + tax_id_data?: Array; + + /** + * ID of the test clock to attach to the customer. + */ + test_clock?: string; + + validate?: boolean; + } + + namespace CustomerCreateParams { + interface CashBalance { + /** + * Settings controlling the behavior of the customer's cash balance, + * such as reconciliation of funds received. + */ + settings?: CashBalance.Settings; + } + + namespace CashBalance { + interface Settings { + /** + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + */ + reconciliation_mode?: Settings.ReconciliationMode; + } + + namespace Settings { + type ReconciliationMode = 'automatic' | 'manual'; + } + } + + interface InvoiceSettings { + /** + * Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. + */ + custom_fields?: Stripe.Emptyable>; + + /** + * ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + */ + default_payment_method?: string; + + /** + * Default footer to be displayed on invoices for this customer. + */ + footer?: string; + + /** + * Default options for invoice PDF rendering for this customer. + */ + rendering_options?: Stripe.Emptyable; + } + + namespace InvoiceSettings { + interface CustomField { + /** + * The name of the custom field. This may be up to 30 characters. + */ + name: string; + + /** + * The value of the custom field. This may be up to 30 characters. + */ + value: string; + } + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + */ + amount_tax_display?: Stripe.Emptyable< + RenderingOptions.AmountTaxDisplay + >; + } + + namespace RenderingOptions { + type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; + } + } + + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxIdDatum { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxIdDatum.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxIdDatum { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + + interface CustomerRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerUpdateParams { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + */ + balance?: number; + + /** + * Balance information and default balance settings for this customer. + */ + cash_balance?: CustomerUpdateParams.CashBalance; + + coupon?: string; + + /** + * If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. + * + * Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. + * + * If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. + */ + default_source?: string; + + /** + * An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. + */ + description?: string; + + /** + * Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + */ + invoice_prefix?: string; + + /** + * Default invoice settings for this customer. + */ + invoice_settings?: CustomerUpdateParams.InvoiceSettings; + + /** + * 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; + + /** + * The customer's full name or business name. + */ + name?: string; + + /** + * The sequence to be used on the customer's next invoice. Defaults to 1. + */ + next_invoice_sequence?: number; + + /** + * The customer's phone number. + */ + phone?: string; + + /** + * Customer's preferred languages, ordered by preference. + */ + preferred_locales?: Array; + + /** + * The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. + */ + promotion_code?: string; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + source?: string; + + /** + * Tax details about the customer. + */ + tax?: CustomerUpdateParams.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + validate?: boolean; + } + + namespace CustomerUpdateParams { + interface CashBalance { + /** + * Settings controlling the behavior of the customer's cash balance, + * such as reconciliation of funds received. + */ + settings?: CashBalance.Settings; + } + + namespace CashBalance { + interface Settings { + /** + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + */ + reconciliation_mode?: Settings.ReconciliationMode; + } + + namespace Settings { + type ReconciliationMode = 'automatic' | 'manual'; + } + } + + interface InvoiceSettings { + /** + * Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. + */ + custom_fields?: Stripe.Emptyable>; + + /** + * ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + */ + default_payment_method?: string; + + /** + * Default footer to be displayed on invoices for this customer. + */ + footer?: string; + + /** + * Default options for invoice PDF rendering for this customer. + */ + rendering_options?: Stripe.Emptyable; + } + + namespace InvoiceSettings { + interface CustomField { + /** + * The name of the custom field. This may be up to 30 characters. + */ + name: string; + + /** + * The value of the custom field. This may be up to 30 characters. + */ + value: string; + } + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + */ + amount_tax_display?: Stripe.Emptyable< + RenderingOptions.AmountTaxDisplay + >; + } + + namespace RenderingOptions { + type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; + } + } + + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + } + + interface CustomerListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. + */ + test_clock?: string; + } + + interface CustomerDeleteParams {} + + interface CustomerCreateFundingInstructionsParams { + /** + * Additional parameters for `bank_transfer` funding types + */ + bank_transfer: CustomerCreateFundingInstructionsParams.BankTransfer; + + /** + * 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 `funding_type` to get the instructions for. + */ + funding_type: 'bank_transfer'; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace CustomerCreateFundingInstructionsParams { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array; + + /** + * The type of the `bank_transfer` + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = 'iban' | 'sort_code' | 'spei' | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface CustomerDeleteDiscountParams {} + + interface CustomerListPaymentMethodsParams extends PaginationParams { + /** + * A required filter on the list, based on the object `type` field. + */ + type: CustomerListPaymentMethodsParams.Type; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace CustomerListPaymentMethodsParams { + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'card_present' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + } + + interface CustomerRetrievePaymentMethodParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + class CustomersResource { + /** + * Creates a new customer object. + */ + create( + params?: CustomerCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a Customer object. + */ + retrieve( + id: string, + params?: CustomerRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. + * + * This request accepts mostly the same arguments as the customer creation call. + */ + update( + id: string, + params?: CustomerUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. + */ + list( + params?: CustomerListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. + */ + del( + id: string, + params?: CustomerDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new + * funding instructions will be created. If funding instructions have already been created for a given customer, the same + * funding instructions will be retrieved. In other words, we will return the same funding instructions each time. + */ + createFundingInstructions( + id: string, + params: CustomerCreateFundingInstructionsParams, + options?: RequestOptions + ): Promise>; + + /** + * Removes the currently applied discount on a customer. + */ + deleteDiscount( + id: string, + params?: CustomerDeleteDiscountParams, + options?: RequestOptions + ): Promise>; + deleteDiscount( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of PaymentMethods for a given Customer + */ + listPaymentMethods( + id: string, + params: CustomerListPaymentMethodsParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Retrieves a PaymentMethod object for a given Customer. + */ + retrievePaymentMethod( + customerId: string, + id: string, + params?: CustomerRetrievePaymentMethodParams, + options?: RequestOptions + ): Promise>; + retrievePaymentMethod( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: CustomerSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + + /** + * Retrieves a customer's cash balance. + */ + retrieveCashBalance( + id: string, + params?: CashBalanceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveCashBalance( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Changes the settings on a customer's cash balance. + */ + updateCashBalance( + id: string, + params?: CashBalanceUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). + */ + createBalanceTransaction( + id: string, + params: CustomerBalanceTransactionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + */ + retrieveBalanceTransaction( + customerId: string, + id: string, + params?: CustomerBalanceTransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveBalanceTransaction( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Most credit balance transaction fields are immutable, but you may update its description and metadata. + */ + updateBalanceTransaction( + customerId: string, + id: string, + params?: CustomerBalanceTransactionUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). + */ + listBalanceTransactions( + id: string, + params?: CustomerBalanceTransactionListParams, + options?: RequestOptions + ): ApiListPromise; + listBalanceTransactions( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + */ + retrieveCashBalanceTransaction( + customerId: string, + id: string, + params?: CustomerCashBalanceTransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveCashBalanceTransaction( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). + */ + listCashBalanceTransactions( + id: string, + params?: CustomerCashBalanceTransactionListParams, + options?: RequestOptions + ): ApiListPromise; + listCashBalanceTransactions( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * When you create a new credit card, you must specify a customer or recipient on which to create it. + * + * If the card's owner has no default card, then the new card will become the default. + * However, if the owner already has a default, then it will not change. + * To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. + */ + createSource( + id: string, + params: CustomerSourceCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve a specified source for a given customer. + */ + retrieveSource( + customerId: string, + id: string, + params?: CustomerSourceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveSource( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Update a specified source for a given customer. + */ + updateSource( + customerId: string, + id: string, + params?: CustomerSourceUpdateParams, + options?: RequestOptions + ): Promise< + Stripe.Response + >; + + /** + * List sources for a specified customer. + */ + listSources( + id: string, + params?: CustomerSourceListParams, + options?: RequestOptions + ): ApiListPromise; + listSources( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Delete a specified source for a given customer. + */ + deleteSource( + customerId: string, + id: string, + params?: CustomerSourceDeleteParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.CustomerSource | Stripe.DeletedBankAccount | Stripe.DeletedCard + > + >; + deleteSource( + customerId: string, + id: string, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.CustomerSource | Stripe.DeletedBankAccount | Stripe.DeletedCard + > + >; + + /** + * Verify a specified bank account for a given customer. + */ + verifySource( + customerId: string, + id: string, + params?: CustomerSourceVerifyParams, + options?: RequestOptions + ): Promise>; + verifySource( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Creates a new TaxID object for a customer. + */ + createTaxId( + id: string, + params: TaxIdCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the TaxID object with the given identifier. + */ + retrieveTaxId( + customerId: string, + id: string, + params?: TaxIdRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveTaxId( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of tax IDs for a customer. + */ + listTaxIds( + id: string, + params?: TaxIdListParams, + options?: RequestOptions + ): ApiListPromise; + listTaxIds( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes an existing TaxID object. + */ + deleteTaxId( + customerId: string, + id: string, + params?: TaxIdDeleteParams, + options?: RequestOptions + ): Promise>; + deleteTaxId( + customerId: string, + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Disputes.d.ts b/types/2022-11-15/Disputes.d.ts index e3c6ac17f8..2cb0f0a748 100644 --- a/types/2022-11-15/Disputes.d.ts +++ b/types/2022-11-15/Disputes.d.ts @@ -257,249 +257,5 @@ declare module 'stripe' { | 'warning_under_review' | 'won'; } - - interface DisputeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface DisputeUpdateParams { - /** - * Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. - */ - evidence?: DisputeUpdateParams.Evidence; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). - */ - submit?: boolean; - } - - namespace DisputeUpdateParams { - interface Evidence { - /** - * Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. - */ - access_activity_log?: string; - - /** - * The billing address provided by the customer. - */ - billing_address?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. - */ - cancellation_policy?: string; - - /** - * An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. - */ - cancellation_policy_disclosure?: string; - - /** - * A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. - */ - cancellation_rebuttal?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. - */ - customer_communication?: string; - - /** - * The email address of the customer. - */ - customer_email_address?: string; - - /** - * The name of the customer. - */ - customer_name?: string; - - /** - * The IP address that the customer used when making the purchase. - */ - customer_purchase_ip?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. - */ - customer_signature?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. - */ - duplicate_charge_documentation?: string; - - /** - * An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. - */ - duplicate_charge_explanation?: string; - - /** - * The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. - */ - duplicate_charge_id?: string; - - /** - * A description of the product or service that was sold. Has a maximum character count of 20,000. - */ - product_description?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. - */ - receipt?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. - */ - refund_policy?: string; - - /** - * Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. - */ - refund_policy_disclosure?: string; - - /** - * A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. - */ - refund_refusal_explanation?: string; - - /** - * The date on which the customer received or began receiving the purchased service, in a clear human-readable format. - */ - service_date?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. - */ - service_documentation?: string; - - /** - * The address to which a physical product was shipped. You should try to include as complete address information as possible. - */ - shipping_address?: string; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. - */ - shipping_carrier?: string; - - /** - * The date on which a physical product began its route to the shipping address, in a clear human-readable format. - */ - shipping_date?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. - */ - shipping_documentation?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - shipping_tracking_number?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. - */ - uncategorized_file?: string; - - /** - * Any additional evidence or statements. Has a maximum character count of 20,000. - */ - uncategorized_text?: string; - } - } - - interface DisputeListParams extends PaginationParams { - /** - * Only return disputes associated to the charge specified by this charge ID. - */ - charge?: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. - */ - payment_intent?: string; - } - - interface DisputeCloseParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class DisputesResource { - /** - * Retrieves the dispute with the given ID. - */ - retrieve( - id: string, - params?: DisputeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. - * - * Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). - */ - update( - id: string, - params?: DisputeUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your disputes. - */ - list( - params?: DisputeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. - * - * The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. - */ - close( - id: string, - params?: DisputeCloseParams, - options?: RequestOptions - ): Promise>; - close( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/DisputesResource.d.ts b/types/2022-11-15/DisputesResource.d.ts new file mode 100644 index 0000000000..af27aeaa7d --- /dev/null +++ b/types/2022-11-15/DisputesResource.d.ts @@ -0,0 +1,249 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface DisputeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface DisputeUpdateParams { + /** + * Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. + */ + evidence?: DisputeUpdateParams.Evidence; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). + */ + submit?: boolean; + } + + namespace DisputeUpdateParams { + interface Evidence { + /** + * Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. + */ + access_activity_log?: string; + + /** + * The billing address provided by the customer. + */ + billing_address?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + */ + cancellation_policy?: string; + + /** + * An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. + */ + cancellation_policy_disclosure?: string; + + /** + * A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. + */ + cancellation_rebuttal?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + */ + customer_communication?: string; + + /** + * The email address of the customer. + */ + customer_email_address?: string; + + /** + * The name of the customer. + */ + customer_name?: string; + + /** + * The IP address that the customer used when making the purchase. + */ + customer_purchase_ip?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + */ + customer_signature?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + */ + duplicate_charge_documentation?: string; + + /** + * An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. + */ + duplicate_charge_explanation?: string; + + /** + * The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + */ + duplicate_charge_id?: string; + + /** + * A description of the product or service that was sold. Has a maximum character count of 20,000. + */ + product_description?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + */ + receipt?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + */ + refund_policy?: string; + + /** + * Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. + */ + refund_policy_disclosure?: string; + + /** + * A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. + */ + refund_refusal_explanation?: string; + + /** + * The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + */ + service_date?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. + */ + service_documentation?: string; + + /** + * The address to which a physical product was shipped. You should try to include as complete address information as possible. + */ + shipping_address?: string; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. + */ + shipping_carrier?: string; + + /** + * The date on which a physical product began its route to the shipping address, in a clear human-readable format. + */ + shipping_date?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. + */ + shipping_documentation?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + shipping_tracking_number?: string; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + */ + uncategorized_file?: string; + + /** + * Any additional evidence or statements. Has a maximum character count of 20,000. + */ + uncategorized_text?: string; + } + } + + interface DisputeListParams extends PaginationParams { + /** + * Only return disputes associated to the charge specified by this charge ID. + */ + charge?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. + */ + payment_intent?: string; + } + + interface DisputeCloseParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class DisputesResource { + /** + * Retrieves the dispute with the given ID. + */ + retrieve( + id: string, + params?: DisputeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. + * + * Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). + */ + update( + id: string, + params?: DisputeUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your disputes. + */ + list( + params?: DisputeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + * + * The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. + */ + close( + id: string, + params?: DisputeCloseParams, + options?: RequestOptions + ): Promise>; + close( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/EphemeralKeys.d.ts b/types/2022-11-15/EphemeralKeys.d.ts index ca443ba858..ffaf6eab72 100644 --- a/types/2022-11-15/EphemeralKeys.d.ts +++ b/types/2022-11-15/EphemeralKeys.d.ts @@ -36,55 +36,5 @@ declare module 'stripe' { */ secret?: string; } - - interface EphemeralKeyCreateParams { - /** - * The ID of the Customer you'd like to modify using the resulting ephemeral key. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The ID of the Issuing Card you'd like to access using the resulting ephemeral key. - */ - issuing_card?: string; - } - - interface EphemeralKeyDeleteParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class EphemeralKeysResource { - /** - * Creates a short-lived API key for a given resource. - */ - create( - params?: EphemeralKeyCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Invalidates a short-lived API key for a given resource. - */ - del( - id: string, - params?: EphemeralKeyDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/EphemeralKeysResource.d.ts b/types/2022-11-15/EphemeralKeysResource.d.ts new file mode 100644 index 0000000000..1fb86e51d2 --- /dev/null +++ b/types/2022-11-15/EphemeralKeysResource.d.ts @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface EphemeralKeyCreateParams { + /** + * The ID of the Customer you'd like to modify using the resulting ephemeral key. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The ID of the Issuing Card you'd like to access using the resulting ephemeral key. + */ + issuing_card?: string; + } + + interface EphemeralKeyDeleteParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class EphemeralKeysResource { + /** + * Creates a short-lived API key for a given resource. + */ + create( + params?: EphemeralKeyCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Invalidates a short-lived API key for a given resource. + */ + del( + id: string, + params?: EphemeralKeyDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Events.d.ts b/types/2022-11-15/Events.d.ts index 6f020e04a3..65322d0136 100644 --- a/types/2022-11-15/Events.d.ts +++ b/types/2022-11-15/Events.d.ts @@ -113,60 +113,5 @@ declare module 'stripe' { idempotency_key: string | null; } } - - interface EventRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface EventListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. - */ - delivery_success?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. - */ - type?: string; - - /** - * An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. - */ - types?: Array; - } - - class EventsResource { - /** - * Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. - */ - retrieve( - id: string, - params?: EventRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). - */ - list( - params?: EventListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/EventsResource.d.ts b/types/2022-11-15/EventsResource.d.ts new file mode 100644 index 0000000000..794dce9edd --- /dev/null +++ b/types/2022-11-15/EventsResource.d.ts @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface EventRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface EventListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. + */ + delivery_success?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. + */ + type?: string; + + /** + * An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. + */ + types?: Array; + } + + class EventsResource { + /** + * Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. + */ + retrieve( + id: string, + params?: EventRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). + */ + list( + params?: EventListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/ExchangeRates.d.ts b/types/2022-11-15/ExchangeRates.d.ts index 165e0cb738..e857ba5a77 100644 --- a/types/2022-11-15/ExchangeRates.d.ts +++ b/types/2022-11-15/ExchangeRates.d.ts @@ -33,43 +33,5 @@ declare module 'stripe' { [key: string]: number; }; } - - interface ExchangeRateRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ExchangeRateListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ExchangeRatesResource { - /** - * Retrieves the exchange rates from the given currency to every supported currency. - */ - retrieve( - id: string, - params?: ExchangeRateRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. - */ - list( - params?: ExchangeRateListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/ExchangeRatesResource.d.ts b/types/2022-11-15/ExchangeRatesResource.d.ts new file mode 100644 index 0000000000..fd4eb26e49 --- /dev/null +++ b/types/2022-11-15/ExchangeRatesResource.d.ts @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ExchangeRateRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ExchangeRateListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ExchangeRatesResource { + /** + * Retrieves the exchange rates from the given currency to every supported currency. + */ + retrieve( + id: string, + params?: ExchangeRateRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. + */ + list( + params?: ExchangeRateListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/ExternalAccounts.d.ts b/types/2022-11-15/ExternalAccountsResource.d.ts similarity index 100% rename from types/2022-11-15/ExternalAccounts.d.ts rename to types/2022-11-15/ExternalAccountsResource.d.ts diff --git a/types/2022-11-15/FeeRefunds.d.ts b/types/2022-11-15/FeeRefunds.d.ts index e793411ebe..8681898c75 100644 --- a/types/2022-11-15/FeeRefunds.d.ts +++ b/types/2022-11-15/FeeRefunds.d.ts @@ -50,48 +50,5 @@ declare module 'stripe' { */ metadata: Stripe.Metadata | null; } - - interface FeeRefundCreateParams { - /** - * A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. - */ - amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - interface FeeRefundRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FeeRefundUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface FeeRefundListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/FeeRefundsResource.d.ts b/types/2022-11-15/FeeRefundsResource.d.ts new file mode 100644 index 0000000000..c5c821686d --- /dev/null +++ b/types/2022-11-15/FeeRefundsResource.d.ts @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface FeeRefundCreateParams { + /** + * A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. + */ + amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + interface FeeRefundRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FeeRefundUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface FeeRefundListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/FileLinks.d.ts b/types/2022-11-15/FileLinks.d.ts index 7ae6dc56bf..4ac78737ca 100644 --- a/types/2022-11-15/FileLinks.d.ts +++ b/types/2022-11-15/FileLinks.d.ts @@ -53,111 +53,5 @@ declare module 'stripe' { */ url: string | null; } - - interface FileLinkCreateParams { - /** - * The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. - */ - file: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A future timestamp after which the link will no longer be usable. - */ - expires_at?: number; - - /** - * 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; - } - - interface FileLinkRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FileLinkUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. - */ - expires_at?: Stripe.Emptyable<'now' | number>; - - /** - * 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; - } - - interface FileLinkListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Filter links by their expiration status. By default, all links are returned. - */ - expired?: boolean; - - /** - * Only return links for the given file. - */ - file?: string; - } - - class FileLinksResource { - /** - * Creates a new file link object. - */ - create( - params: FileLinkCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the file link with the given ID. - */ - retrieve( - id: string, - params?: FileLinkRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing file link object. Expired links can no longer be updated. - */ - update( - id: string, - params?: FileLinkUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of file links. - */ - list( - params?: FileLinkListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/FileLinksResource.d.ts b/types/2022-11-15/FileLinksResource.d.ts new file mode 100644 index 0000000000..a73f03c8cf --- /dev/null +++ b/types/2022-11-15/FileLinksResource.d.ts @@ -0,0 +1,111 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface FileLinkCreateParams { + /** + * The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + */ + file: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A future timestamp after which the link will no longer be usable. + */ + expires_at?: number; + + /** + * 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; + } + + interface FileLinkRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FileLinkUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. + */ + expires_at?: Stripe.Emptyable<'now' | number>; + + /** + * 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; + } + + interface FileLinkListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filter links by their expiration status. By default, all links are returned. + */ + expired?: boolean; + + /** + * Only return links for the given file. + */ + file?: string; + } + + class FileLinksResource { + /** + * Creates a new file link object. + */ + create( + params: FileLinkCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the file link with the given ID. + */ + retrieve( + id: string, + params?: FileLinkRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing file link object. Expired links can no longer be updated. + */ + update( + id: string, + params?: FileLinkUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of file links. + */ + list( + params?: FileLinkListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Files.d.ts b/types/2022-11-15/Files.d.ts index 8f1d6d8b49..2a6f2771ee 100644 --- a/types/2022-11-15/Files.d.ts +++ b/types/2022-11-15/Files.d.ts @@ -86,82 +86,5 @@ declare module 'stripe' { | 'tax_document_user_upload' | 'terminal_reader_splashscreen'; } - - interface FileCreateParams {} - - interface FileRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FileListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The file purpose to filter queries by. If none is provided, files will not be filtered by purpose. - */ - purpose?: FileListParams.Purpose; - } - - namespace FileListParams { - type Purpose = - | 'account_requirement' - | 'additional_verification' - | 'business_icon' - | 'business_logo' - | 'customer_signature' - | 'dispute_evidence' - | 'document_provider_identity_document' - | 'finance_report_run' - | 'identity_document' - | 'identity_document_downloadable' - | 'pci_document' - | 'selfie' - | 'sigma_scheduled_query' - | 'tax_document_user_upload' - | 'terminal_reader_splashscreen'; - } - - class FilesResource { - /** - * To upload a file to Stripe, you'll need to send a request of type multipart/form-data. The request should contain the file you would like to upload, as well as the parameters for creating a file. - * - * All of Stripe's officially supported Client libraries should have support for sending multipart/form-data. - */ - create( - params?: FileCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the details of an existing file object. Supply the unique file ID from a file, and Stripe will return the corresponding file object. To access file contents, see the [File Upload Guide](https://stripe.com/docs/file-upload#download-file-contents). - */ - retrieve( - id: string, - params?: FileRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of the files that your account has access to. The files are returned sorted by creation date, with the most recently created files appearing first. - */ - list( - params?: FileListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/FilesResource.d.ts b/types/2022-11-15/FilesResource.d.ts new file mode 100644 index 0000000000..05330cb3f3 --- /dev/null +++ b/types/2022-11-15/FilesResource.d.ts @@ -0,0 +1,82 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface FileCreateParams {} + + interface FileRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FileListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The file purpose to filter queries by. If none is provided, files will not be filtered by purpose. + */ + purpose?: FileListParams.Purpose; + } + + namespace FileListParams { + type Purpose = + | 'account_requirement' + | 'additional_verification' + | 'business_icon' + | 'business_logo' + | 'customer_signature' + | 'dispute_evidence' + | 'document_provider_identity_document' + | 'finance_report_run' + | 'identity_document' + | 'identity_document_downloadable' + | 'pci_document' + | 'selfie' + | 'sigma_scheduled_query' + | 'tax_document_user_upload' + | 'terminal_reader_splashscreen'; + } + + class FilesResource { + /** + * To upload a file to Stripe, you'll need to send a request of type multipart/form-data. The request should contain the file you would like to upload, as well as the parameters for creating a file. + * + * All of Stripe's officially supported Client libraries should have support for sending multipart/form-data. + */ + create( + params?: FileCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the details of an existing file object. Supply the unique file ID from a file, and Stripe will return the corresponding file object. To access file contents, see the [File Upload Guide](https://stripe.com/docs/file-upload#download-file-contents). + */ + retrieve( + id: string, + params?: FileRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of the files that your account has access to. The files are returned sorted by creation date, with the most recently created files appearing first. + */ + list( + params?: FileListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/FinancialConnections/Accounts.d.ts b/types/2022-11-15/FinancialConnections/Accounts.d.ts index a23b32f151..d5e5f98049 100644 --- a/types/2022-11-15/FinancialConnections/Accounts.d.ts +++ b/types/2022-11-15/FinancialConnections/Accounts.d.ts @@ -239,136 +239,6 @@ declare module 'stripe' { type SupportedPaymentMethodType = 'link' | 'us_bank_account'; } - - interface AccountRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountListParams extends PaginationParams { - /** - * If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. - */ - account_holder?: AccountListParams.AccountHolder; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * If present, only return accounts that were collected as part of the given session. - */ - session?: string; - } - - namespace AccountListParams { - interface AccountHolder { - /** - * The ID of the Stripe account whose accounts will be retrieved. - */ - account?: string; - - /** - * The ID of the Stripe customer whose accounts will be retrieved. - */ - customer?: string; - } - } - - interface AccountDisconnectParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountListOwnersParams extends PaginationParams { - /** - * The ID of the ownership object to fetch owners from. - */ - ownership: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountRefreshParams { - /** - * The list of account features that you would like to refresh. - */ - features: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace AccountRefreshParams { - type Feature = 'balance' | 'ownership'; - } - - class AccountsResource { - /** - * Retrieves the details of an Financial Connections Account. - */ - retrieve( - id: string, - params?: AccountRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Financial Connections Account objects. - */ - list( - params?: AccountListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). - */ - disconnect( - id: string, - params?: AccountDisconnectParams, - options?: RequestOptions - ): Promise>; - disconnect( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Lists all owners for a given Account - */ - listOwners( - id: string, - params: AccountListOwnersParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Refreshes the data associated with a Financial Connections Account. - */ - refresh( - id: string, - params: AccountRefreshParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/FinancialConnections/AccountsResource.d.ts b/types/2022-11-15/FinancialConnections/AccountsResource.d.ts new file mode 100644 index 0000000000..980a08cb8e --- /dev/null +++ b/types/2022-11-15/FinancialConnections/AccountsResource.d.ts @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + interface AccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountListParams extends PaginationParams { + /** + * If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. + */ + account_holder?: AccountListParams.AccountHolder; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * If present, only return accounts that were collected as part of the given session. + */ + session?: string; + } + + namespace AccountListParams { + interface AccountHolder { + /** + * The ID of the Stripe account whose accounts will be retrieved. + */ + account?: string; + + /** + * The ID of the Stripe customer whose accounts will be retrieved. + */ + customer?: string; + } + } + + interface AccountDisconnectParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountListOwnersParams extends PaginationParams { + /** + * The ID of the ownership object to fetch owners from. + */ + ownership: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AccountRefreshParams { + /** + * The list of account features that you would like to refresh. + */ + features: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace AccountRefreshParams { + type Feature = 'balance' | 'ownership'; + } + + class AccountsResource { + /** + * Retrieves the details of an Financial Connections Account. + */ + retrieve( + id: string, + params?: AccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Financial Connections Account objects. + */ + list( + params?: AccountListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). + */ + disconnect( + id: string, + params?: AccountDisconnectParams, + options?: RequestOptions + ): Promise>; + disconnect( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Lists all owners for a given Account + */ + listOwners( + id: string, + params: AccountListOwnersParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Refreshes the data associated with a Financial Connections Account. + */ + refresh( + id: string, + params: AccountRefreshParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/FinancialConnections/Sessions.d.ts b/types/2022-11-15/FinancialConnections/Sessions.d.ts index 9d570259c5..a6997c7666 100644 --- a/types/2022-11-15/FinancialConnections/Sessions.d.ts +++ b/types/2022-11-15/FinancialConnections/Sessions.d.ts @@ -85,101 +85,6 @@ declare module 'stripe' { | 'payment_method' | 'transactions'; } - - interface SessionCreateParams { - /** - * The account holder to link accounts for. - */ - account_holder: SessionCreateParams.AccountHolder; - - /** - * List of data features that you would like to request access to. - * - * Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. - */ - permissions: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Filters to restrict the kinds of accounts to collect. - */ - filters?: SessionCreateParams.Filters; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace SessionCreateParams { - interface AccountHolder { - /** - * The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. - */ - account?: string; - - /** - * The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. - */ - customer?: string; - - /** - * Type of account holder to collect accounts for. - */ - type: AccountHolder.Type; - } - - namespace AccountHolder { - type Type = 'account' | 'customer'; - } - - interface Filters { - /** - * List of countries from which to collect accounts. - */ - countries: Array; - } - - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface SessionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class SessionsResource { - /** - * To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. - */ - create( - params: SessionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a Financial Connections Session - */ - retrieve( - id: string, - params?: SessionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/FinancialConnections/SessionsResource.d.ts b/types/2022-11-15/FinancialConnections/SessionsResource.d.ts new file mode 100644 index 0000000000..b3a6739c56 --- /dev/null +++ b/types/2022-11-15/FinancialConnections/SessionsResource.d.ts @@ -0,0 +1,102 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace FinancialConnections { + interface SessionCreateParams { + /** + * The account holder to link accounts for. + */ + account_holder: SessionCreateParams.AccountHolder; + + /** + * List of data features that you would like to request access to. + * + * Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. + */ + permissions: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filters to restrict the kinds of accounts to collect. + */ + filters?: SessionCreateParams.Filters; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace SessionCreateParams { + interface AccountHolder { + /** + * The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. + */ + account?: string; + + /** + * The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. + */ + customer?: string; + + /** + * Type of account holder to collect accounts for. + */ + type: AccountHolder.Type; + } + + namespace AccountHolder { + type Type = 'account' | 'customer'; + } + + interface Filters { + /** + * List of countries from which to collect accounts. + */ + countries: Array; + } + + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface SessionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SessionsResource { + /** + * To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. + */ + create( + params: SessionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a Financial Connections Session + */ + retrieve( + id: string, + params?: SessionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Identity/VerificationReports.d.ts b/types/2022-11-15/Identity/VerificationReports.d.ts index e3ac1153d5..b46ed19b91 100644 --- a/types/2022-11-15/Identity/VerificationReports.d.ts +++ b/types/2022-11-15/Identity/VerificationReports.d.ts @@ -367,62 +367,6 @@ declare module 'stripe' { type Type = 'document' | 'id_number'; } - - interface VerificationReportRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface VerificationReportListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return VerificationReports of this type - */ - type?: VerificationReportListParams.Type; - - /** - * Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. - */ - verification_session?: string; - } - - namespace VerificationReportListParams { - type Type = 'document' | 'id_number'; - } - - class VerificationReportsResource { - /** - * Retrieves an existing VerificationReport - */ - retrieve( - id: string, - params?: VerificationReportRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * List all verification reports. - */ - list( - params?: VerificationReportListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Identity/VerificationReportsResource.d.ts b/types/2022-11-15/Identity/VerificationReportsResource.d.ts new file mode 100644 index 0000000000..bb183bd746 --- /dev/null +++ b/types/2022-11-15/Identity/VerificationReportsResource.d.ts @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Identity { + interface VerificationReportRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface VerificationReportListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return VerificationReports of this type + */ + type?: VerificationReportListParams.Type; + + /** + * Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. + */ + verification_session?: string; + } + + namespace VerificationReportListParams { + type Type = 'document' | 'id_number'; + } + + class VerificationReportsResource { + /** + * Retrieves an existing VerificationReport + */ + retrieve( + id: string, + params?: VerificationReportRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * List all verification reports. + */ + list( + params?: VerificationReportListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Identity/VerificationSessions.d.ts b/types/2022-11-15/Identity/VerificationSessions.d.ts index 77b81b1812..65c63010e8 100644 --- a/types/2022-11-15/Identity/VerificationSessions.d.ts +++ b/types/2022-11-15/Identity/VerificationSessions.d.ts @@ -224,273 +224,6 @@ declare module 'stripe' { type IdNumberType = 'br_cpf' | 'sg_nric' | 'us_ssn'; } } - - interface VerificationSessionCreateParams { - /** - * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. - */ - type: VerificationSessionCreateParams.Type; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * A set of options for the session's verification checks. - */ - options?: VerificationSessionCreateParams.Options; - - /** - * The URL that the user will be redirected to upon completing the verification flow. - */ - return_url?: string; - } - - namespace VerificationSessionCreateParams { - interface Options { - /** - * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). - */ - document?: Stripe.Emptyable; - } - - namespace Options { - interface Document { - /** - * Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - */ - allowed_types?: Array; - - /** - * Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. - */ - require_id_number?: boolean; - - /** - * Disable image uploads, identity document images have to be captured using the device's camera. - */ - require_live_capture?: boolean; - - /** - * Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). - */ - require_matching_selfie?: boolean; - } - - namespace Document { - type AllowedType = 'driving_license' | 'id_card' | 'passport'; - } - } - - type Type = 'document' | 'id_number'; - } - - interface VerificationSessionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface VerificationSessionUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * A set of options for the session's verification checks. - */ - options?: VerificationSessionUpdateParams.Options; - - /** - * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. - */ - type?: VerificationSessionUpdateParams.Type; - } - - namespace VerificationSessionUpdateParams { - interface Options { - /** - * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). - */ - document?: Stripe.Emptyable; - } - - namespace Options { - interface Document { - /** - * Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - */ - allowed_types?: Array; - - /** - * Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. - */ - require_id_number?: boolean; - - /** - * Disable image uploads, identity document images have to be captured using the device's camera. - */ - require_live_capture?: boolean; - - /** - * Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). - */ - require_matching_selfie?: boolean; - } - - namespace Document { - type AllowedType = 'driving_license' | 'id_card' | 'passport'; - } - } - - type Type = 'document' | 'id_number'; - } - - interface VerificationSessionListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). - */ - status?: VerificationSessionListParams.Status; - } - - namespace VerificationSessionListParams { - type Status = 'canceled' | 'processing' | 'requires_input' | 'verified'; - } - - interface VerificationSessionCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface VerificationSessionRedactParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class VerificationSessionsResource { - /** - * Creates a VerificationSession object. - * - * After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. - * - * If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. - * - * Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents). - */ - create( - params: VerificationSessionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - * When the session status is requires_input, you can use this method to retrieve a valid - * client_secret or url to allow re-submission. - */ - retrieve( - id: string, - params?: VerificationSessionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a VerificationSession object. - * - * When the session status is requires_input, you can use this method to update the - * verification check and options. - */ - update( - id: string, - params?: VerificationSessionUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of VerificationSessions - */ - list( - params?: VerificationSessionListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). - * - * Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). - */ - cancel( - id: string, - params?: VerificationSessionCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Redact a VerificationSession to remove all collected information from Stripe. This will redact - * the VerificationSession and all objects related to it, including VerificationReports, Events, - * request logs, etc. - * - * A VerificationSession object can be redacted when it is in requires_input or verified - * [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action - * state will automatically cancel it. - * - * The redaction process may take up to four days. When the redaction process is in progress, the - * VerificationSession's redaction.status field will be set to processing; when the process is - * finished, it will change to redacted and an identity.verification_session.redacted event - * will be emitted. - * - * Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the - * fields that contain personal data will be replaced by the string [redacted] or a similar - * placeholder. The metadata field will also be erased. Redacted objects cannot be updated or - * used for any purpose. - * - * [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). - */ - redact( - id: string, - params?: VerificationSessionRedactParams, - options?: RequestOptions - ): Promise>; - redact( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Identity/VerificationSessionsResource.d.ts b/types/2022-11-15/Identity/VerificationSessionsResource.d.ts new file mode 100644 index 0000000000..a6622e614c --- /dev/null +++ b/types/2022-11-15/Identity/VerificationSessionsResource.d.ts @@ -0,0 +1,274 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Identity { + interface VerificationSessionCreateParams { + /** + * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + */ + type: VerificationSessionCreateParams.Type; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * A set of options for the session's verification checks. + */ + options?: VerificationSessionCreateParams.Options; + + /** + * The URL that the user will be redirected to upon completing the verification flow. + */ + return_url?: string; + } + + namespace VerificationSessionCreateParams { + interface Options { + /** + * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + */ + document?: Stripe.Emptyable; + } + + namespace Options { + interface Document { + /** + * Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + */ + allowed_types?: Array; + + /** + * Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. + */ + require_id_number?: boolean; + + /** + * Disable image uploads, identity document images have to be captured using the device's camera. + */ + require_live_capture?: boolean; + + /** + * Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). + */ + require_matching_selfie?: boolean; + } + + namespace Document { + type AllowedType = 'driving_license' | 'id_card' | 'passport'; + } + } + + type Type = 'document' | 'id_number'; + } + + interface VerificationSessionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface VerificationSessionUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * A set of options for the session's verification checks. + */ + options?: VerificationSessionUpdateParams.Options; + + /** + * The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + */ + type?: VerificationSessionUpdateParams.Type; + } + + namespace VerificationSessionUpdateParams { + interface Options { + /** + * Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + */ + document?: Stripe.Emptyable; + } + + namespace Options { + interface Document { + /** + * Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + */ + allowed_types?: Array; + + /** + * Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. + */ + require_id_number?: boolean; + + /** + * Disable image uploads, identity document images have to be captured using the device's camera. + */ + require_live_capture?: boolean; + + /** + * Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). + */ + require_matching_selfie?: boolean; + } + + namespace Document { + type AllowedType = 'driving_license' | 'id_card' | 'passport'; + } + } + + type Type = 'document' | 'id_number'; + } + + interface VerificationSessionListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + */ + status?: VerificationSessionListParams.Status; + } + + namespace VerificationSessionListParams { + type Status = 'canceled' | 'processing' | 'requires_input' | 'verified'; + } + + interface VerificationSessionCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface VerificationSessionRedactParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class VerificationSessionsResource { + /** + * Creates a VerificationSession object. + * + * After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. + * + * If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. + * + * Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents). + */ + create( + params: VerificationSessionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + * When the session status is requires_input, you can use this method to retrieve a valid + * client_secret or url to allow re-submission. + */ + retrieve( + id: string, + params?: VerificationSessionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a VerificationSession object. + * + * When the session status is requires_input, you can use this method to update the + * verification check and options. + */ + update( + id: string, + params?: VerificationSessionUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of VerificationSessions + */ + list( + params?: VerificationSessionListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). + * + * Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + */ + cancel( + id: string, + params?: VerificationSessionCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Redact a VerificationSession to remove all collected information from Stripe. This will redact + * the VerificationSession and all objects related to it, including VerificationReports, Events, + * request logs, etc. + * + * A VerificationSession object can be redacted when it is in requires_input or verified + * [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action + * state will automatically cancel it. + * + * The redaction process may take up to four days. When the redaction process is in progress, the + * VerificationSession's redaction.status field will be set to processing; when the process is + * finished, it will change to redacted and an identity.verification_session.redacted event + * will be emitted. + * + * Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + * fields that contain personal data will be replaced by the string [redacted] or a similar + * placeholder. The metadata field will also be erased. Redacted objects cannot be updated or + * used for any purpose. + * + * [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + */ + redact( + id: string, + params?: VerificationSessionRedactParams, + options?: RequestOptions + ): Promise>; + redact( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/InvoiceItems.d.ts b/types/2022-11-15/InvoiceItems.d.ts index 7fbdef7f3f..5b1cb6c990 100644 --- a/types/2022-11-15/InvoiceItems.d.ts +++ b/types/2022-11-15/InvoiceItems.d.ts @@ -160,384 +160,5 @@ declare module 'stripe' { */ deleted: true; } - - interface InvoiceItemCreateParams { - /** - * The ID of the customer who will be billed when this invoice item is billed. - */ - customer: string; - - /** - * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. - */ - amount?: 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; - - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - */ - description?: string; - - /** - * Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. - */ - discountable?: boolean; - - /** - * The coupons to redeem into discounts for the invoice item or invoice line item. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. - */ - invoice?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. - */ - period?: InvoiceItemCreateParams.Period; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: InvoiceItemCreateParams.PriceData; - - /** - * Non-negative integer. The quantity of units for the invoice item. - */ - quantity?: number; - - /** - * The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. - */ - subscription?: string; - - /** - * 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?: InvoiceItemCreateParams.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: Stripe.Emptyable; - - /** - * The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. - */ - tax_rates?: Array; - - /** - * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. - */ - 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 InvoiceItemCreateParams { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface Period { - /** - * The end of the period, which must be greater than or equal to the start. - */ - end: number; - - /** - * The start of the period. - */ - start: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface InvoiceItemRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceItemUpdateParams { - /** - * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. - */ - amount?: number; - - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - */ - description?: string; - - /** - * Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. - */ - discountable?: boolean; - - /** - * The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. - */ - period?: InvoiceItemUpdateParams.Period; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: InvoiceItemUpdateParams.PriceData; - - /** - * Non-negative integer. The quantity of units for the invoice item. - */ - quantity?: number; - - /** - * 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?: InvoiceItemUpdateParams.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: Stripe.Emptyable; - - /** - * The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - */ - 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 InvoiceItemUpdateParams { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface Period { - /** - * The end of the period, which must be greater than or equal to the start. - */ - end: number; - - /** - * The start of the period. - */ - start: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface InvoiceItemListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. - */ - invoice?: string; - - /** - * Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. - */ - pending?: boolean; - } - - interface InvoiceItemDeleteParams {} - - class InvoiceItemsResource { - /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. - */ - create( - params: InvoiceItemCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the invoice item with the given ID. - */ - retrieve( - id: string, - params?: InvoiceItemRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. - */ - update( - id: string, - params?: InvoiceItemUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. - */ - list( - params?: InvoiceItemListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. - */ - del( - id: string, - params?: InvoiceItemDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/InvoiceItemsResource.d.ts b/types/2022-11-15/InvoiceItemsResource.d.ts new file mode 100644 index 0000000000..c74f31a76d --- /dev/null +++ b/types/2022-11-15/InvoiceItemsResource.d.ts @@ -0,0 +1,384 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface InvoiceItemCreateParams { + /** + * The ID of the customer who will be billed when this invoice item is billed. + */ + customer: string; + + /** + * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. + */ + amount?: 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; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. + */ + discountable?: boolean; + + /** + * The coupons to redeem into discounts for the invoice item or invoice line item. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. + */ + invoice?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + */ + period?: InvoiceItemCreateParams.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItemCreateParams.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. + */ + subscription?: string; + + /** + * 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?: InvoiceItemCreateParams.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + */ + tax_rates?: Array; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. + */ + 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 InvoiceItemCreateParams { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. + */ + end: number; + + /** + * The start of the period. + */ + start: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface InvoiceItemRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceItemUpdateParams { + /** + * The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + */ + amount?: number; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. + */ + discountable?: boolean; + + /** + * The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + */ + period?: InvoiceItemUpdateParams.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItemUpdateParams.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * 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?: InvoiceItemUpdateParams.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + 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 InvoiceItemUpdateParams { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. + */ + end: number; + + /** + * The start of the period. + */ + start: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface InvoiceItemListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. + */ + invoice?: string; + + /** + * Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. + */ + pending?: boolean; + } + + interface InvoiceItemDeleteParams {} + + class InvoiceItemsResource { + /** + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. + */ + create( + params: InvoiceItemCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the invoice item with the given ID. + */ + retrieve( + id: string, + params?: InvoiceItemRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. + */ + update( + id: string, + params?: InvoiceItemUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. + */ + list( + params?: InvoiceItemListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. + */ + del( + id: string, + params?: InvoiceItemDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/InvoiceLineItems.d.ts b/types/2022-11-15/InvoiceLineItems.d.ts index 9572736ffc..92a439444a 100644 --- a/types/2022-11-15/InvoiceLineItems.d.ts +++ b/types/2022-11-15/InvoiceLineItems.d.ts @@ -189,12 +189,5 @@ declare module 'stripe' { type Type = 'invoiceitem' | 'subscription'; } - - interface InvoiceLineItemListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/InvoiceLineItemsResource.d.ts b/types/2022-11-15/InvoiceLineItemsResource.d.ts new file mode 100644 index 0000000000..81a33104f5 --- /dev/null +++ b/types/2022-11-15/InvoiceLineItemsResource.d.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface InvoiceLineItemListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/Invoices.d.ts b/types/2022-11-15/Invoices.d.ts index 90cb2573a5..ebab8c1b58 100644 --- a/types/2022-11-15/Invoices.d.ts +++ b/types/2022-11-15/Invoices.d.ts @@ -986,2222 +986,5 @@ declare module 'stripe' { */ deleted: true; } - - interface InvoiceCreateParams { - /** - * The account tax IDs associated with the invoice. Only editable when the invoice is a draft. - */ - account_tax_ids?: Stripe.Emptyable>; - - /** - * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). - */ - application_fee_amount?: number; - - /** - * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action. - */ - auto_advance?: boolean; - - /** - * Settings for automatic tax lookup for this invoice. - */ - automatic_tax?: InvoiceCreateParams.AutomaticTax; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. - */ - collection_method?: InvoiceCreateParams.CollectionMethod; - - /** - * The currency to create this invoice in. Defaults to that of `customer` if not specified. - */ - currency?: string; - - /** - * A list of up to 4 custom fields to be displayed on the invoice. - */ - custom_fields?: Stripe.Emptyable>; - - /** - * The ID of the customer who will be billed. - */ - customer?: string; - - /** - * The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. - */ - days_until_due?: number; - - /** - * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - */ - default_payment_method?: string; - - /** - * ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. - */ - default_source?: string; - - /** - * The tax rates that will apply to any line item that does not have `tax_rates` set. - */ - default_tax_rates?: Array; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. - */ - description?: string; - - /** - * The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. - */ - discounts?: Stripe.Emptyable>; - - /** - * The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. - */ - due_date?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Footer to be displayed on the invoice. - */ - footer?: string; - - /** - * Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. - */ - from_invoice?: InvoiceCreateParams.FromInvoice; - - /** - * 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; - - /** - * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - */ - on_behalf_of?: string; - - /** - * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. - */ - payment_settings?: InvoiceCreateParams.PaymentSettings; - - /** - * How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. - */ - pending_invoice_items_behavior?: InvoiceCreateParams.PendingInvoiceItemsBehavior; - - /** - * Options for invoice PDF rendering. - */ - rendering_options?: Stripe.Emptyable< - InvoiceCreateParams.RenderingOptions - >; - - /** - * Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. - */ - statement_descriptor?: string; - - /** - * The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription and pending invoice items not associated with any subscription if `pending_invoice_items_behavior` is `include`. The subscription's billing cycle and regular subscription events won't be affected. - */ - subscription?: string; - - /** - * If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. - */ - transfer_data?: InvoiceCreateParams.TransferData; - } - - namespace InvoiceCreateParams { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - */ - enabled: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface CustomField { - /** - * The name of the custom field. This may be up to 30 characters. - */ - name: string; - - /** - * The value of the custom field. This may be up to 30 characters. - */ - value: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface FromInvoice { - /** - * The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted - */ - action: 'revision'; - - /** - * The `id` of the invoice that will be cloned. - */ - invoice: string; - } - - interface PaymentSettings { - /** - * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - */ - default_mandate?: string; - - /** - * Payment-method-specific configuration to provide to the invoice's PaymentIntent. - */ - payment_method_options?: PaymentSettings.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - */ - payment_method_types?: Stripe.Emptyable< - Array - >; - } - - namespace PaymentSettings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. - */ - konbini?: Stripe.Emptyable; - - /** - * If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. - */ - us_bank_account?: Stripe.Emptyable< - PaymentMethodOptions.UsBankAccount - >; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - } - - interface Card { - /** - * Installment configuration for payments attempted on this invoice (Mexico Only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments?: Card.Installments; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this invoice. - * Setting to false will prevent any selected plan from applying to a payment. - */ - enabled?: boolean; - - /** - * The selected installment plan to use for this invoice. - */ - plan?: Stripe.Emptyable; - } - - namespace Installments { - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month'; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: string; - } - - namespace CustomerBalance { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type?: string; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - } - } - - interface Konbini {} - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type PaymentMethodType = - | 'ach_credit_transfer' - | 'ach_debit' - | 'acss_debit' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'boleto' - | 'card' - | 'customer_balance' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'konbini' - | 'link' - | 'paynow' - | 'promptpay' - | 'sepa_credit_transfer' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - } - - type PendingInvoiceItemsBehavior = - | 'exclude' - | 'include' - | 'include_and_require'; - - interface RenderingOptions { - /** - * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - */ - amount_tax_display?: Stripe.Emptyable< - RenderingOptions.AmountTaxDisplay - >; - } - - namespace RenderingOptions { - type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. - */ - amount?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface InvoiceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceUpdateParams { - /** - * The account tax IDs associated with the invoice. Only editable when the invoice is a draft. - */ - account_tax_ids?: Stripe.Emptyable>; - - /** - * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). - */ - application_fee_amount?: number; - - /** - * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. - */ - auto_advance?: boolean; - - /** - * Settings for automatic tax lookup for this invoice. - */ - automatic_tax?: InvoiceUpdateParams.AutomaticTax; - - /** - * Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. - */ - collection_method?: InvoiceUpdateParams.CollectionMethod; - - /** - * A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. - */ - custom_fields?: Stripe.Emptyable>; - - /** - * The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. - */ - days_until_due?: number; - - /** - * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - */ - default_payment_method?: string; - - /** - * ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. - */ - default_source?: string; - - /** - * The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. - */ - description?: string; - - /** - * The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. - */ - discounts?: Stripe.Emptyable>; - - /** - * The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. - */ - due_date?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Footer to be displayed on the invoice. - */ - footer?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. - */ - payment_settings?: InvoiceUpdateParams.PaymentSettings; - - /** - * Options for invoice PDF rendering. - */ - rendering_options?: Stripe.Emptyable< - InvoiceUpdateParams.RenderingOptions - >; - - /** - * Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. - */ - statement_descriptor?: string; - - /** - * If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace InvoiceUpdateParams { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - */ - enabled: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface CustomField { - /** - * The name of the custom field. This may be up to 30 characters. - */ - name: string; - - /** - * The value of the custom field. This may be up to 30 characters. - */ - value: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface PaymentSettings { - /** - * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - */ - default_mandate?: string; - - /** - * Payment-method-specific configuration to provide to the invoice's PaymentIntent. - */ - payment_method_options?: PaymentSettings.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - */ - payment_method_types?: Stripe.Emptyable< - Array - >; - } - - namespace PaymentSettings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. - */ - konbini?: Stripe.Emptyable; - - /** - * If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. - */ - us_bank_account?: Stripe.Emptyable< - PaymentMethodOptions.UsBankAccount - >; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - } - - interface Card { - /** - * Installment configuration for payments attempted on this invoice (Mexico Only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments?: Card.Installments; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this invoice. - * Setting to false will prevent any selected plan from applying to a payment. - */ - enabled?: boolean; - - /** - * The selected installment plan to use for this invoice. - */ - plan?: Stripe.Emptyable; - } - - namespace Installments { - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month'; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: string; - } - - namespace CustomerBalance { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type?: string; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - } - } - - interface Konbini {} - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type PaymentMethodType = - | 'ach_credit_transfer' - | 'ach_debit' - | 'acss_debit' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'boleto' - | 'card' - | 'customer_balance' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'konbini' - | 'link' - | 'paynow' - | 'promptpay' - | 'sepa_credit_transfer' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - } - - interface RenderingOptions { - /** - * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - */ - amount_tax_display?: Stripe.Emptyable< - RenderingOptions.AmountTaxDisplay - >; - } - - namespace RenderingOptions { - type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. - */ - amount?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface InvoiceListParams extends PaginationParams { - /** - * The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. - */ - collection_method?: InvoiceListParams.CollectionMethod; - - created?: Stripe.RangeQueryParam | number; - - /** - * Only return invoices for the customer specified by this customer ID. - */ - customer?: string; - - due_date?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) - */ - status?: InvoiceListParams.Status; - - /** - * Only return invoices for the subscription specified by this subscription ID. - */ - subscription?: string; - } - - namespace InvoiceListParams { - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - type Status = 'draft' | 'open' | 'paid' | 'uncollectible' | 'void'; - } - - interface InvoiceDeleteParams {} - - interface InvoiceFinalizeInvoiceParams { - /** - * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/invoicing/automatic-charging) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action. - */ - auto_advance?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceListUpcomingLinesParams extends PaginationParams { - /** - * Settings for automatic tax lookup for this invoice preview. - */ - automatic_tax?: InvoiceListUpcomingLinesParams.AutomaticTax; - - /** - * The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. - */ - 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. - */ - customer?: string; - - /** - * Details about the customer you want to invoice or overrides for an existing customer. - */ - customer_details?: InvoiceListUpcomingLinesParams.CustomerDetails; - - /** - * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. - */ - discounts?: Stripe.Emptyable< - Array - >; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * List of invoice items to add or update in the upcoming invoice preview. - */ - invoice_items?: Array; - - /** - * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. - */ - schedule?: string; - - /** - * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - */ - subscription?: string; - - /** - * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - */ - subscription_billing_cycle_anchor?: - | InvoiceListUpcomingLinesParams.SubscriptionBillingCycleAnchor - | number; - - /** - * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`. - */ - subscription_cancel_at?: Stripe.Emptyable; - - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - subscription_cancel_at_period_end?: boolean; - - /** - * This simulates the subscription being canceled or expired immediately. - */ - subscription_cancel_now?: boolean; - - /** - * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - */ - subscription_default_tax_rates?: Stripe.Emptyable>; - - /** - * A list of up to 20 subscription items, each with an attached price. - */ - subscription_items?: Array< - InvoiceListUpcomingLinesParams.SubscriptionItem - >; - - /** - * 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. - */ - subscription_proration_behavior?: InvoiceListUpcomingLinesParams.SubscriptionProrationBehavior; - - /** - * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. - */ - subscription_proration_date?: number; - - /** - * Date a subscription is intended to start (can be future or past) - */ - subscription_start_date?: number; - - /** - * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. - */ - subscription_trial_end?: 'now' | number; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - subscription_trial_from_plan?: boolean; - } - - namespace InvoiceListUpcomingLinesParams { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - */ - enabled: boolean; - } - - interface CustomerDetails { - /** - * The customer's address. - */ - address?: Stripe.Emptyable; - - /** - * The customer's shipping information. Appears on invoices emailed to this customer. - */ - shipping?: Stripe.Emptyable; - - /** - * Tax details about the customer. - */ - tax?: CustomerDetails.Tax; - - /** - * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The customer's tax IDs. - */ - tax_ids?: Array; - } - - namespace CustomerDetails { - interface Shipping { - /** - * Customer shipping address. - */ - address: Stripe.AddressParam; - - /** - * Customer name. - */ - name: string; - - /** - * Customer phone (including extension). - */ - phone?: string; - } - - interface Tax { - /** - * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - */ - ip_address?: Stripe.Emptyable; - } - - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface InvoiceItem { - /** - * The integer amount in cents (or local equivalent) of previewed invoice item. - */ - amount?: 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). Only applicable to new invoice items. - */ - currency?: string; - - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - */ - description?: string; - - /** - * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - */ - discountable?: boolean; - - /** - * The coupons to redeem into discounts for the invoice item in the preview. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - */ - invoiceitem?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. - */ - period?: InvoiceItem.Period; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: InvoiceItem.PriceData; - - /** - * Non-negative integer. The quantity of units for the invoice item. - */ - quantity?: number; - - /** - * 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?: InvoiceItem.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: Stripe.Emptyable; - - /** - * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - */ - 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 InvoiceItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface Period { - /** - * The end of the period, which must be greater than or equal to the start. - */ - end: number; - - /** - * The start of the period. - */ - start: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; - - interface SubscriptionItem { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionItem.BillingThresholds - >; - - /** - * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. - */ - clear_usage?: boolean; - - /** - * A flag that, if set to `true`, will delete the specified item. - */ - deleted?: boolean; - - /** - * Subscription item to update. - */ - id?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * Plan ID for this item, as a string. - */ - plan?: string; - - /** - * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: SubscriptionItem.PriceData; - - /** - * Quantity for this item. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace SubscriptionItem { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - } - - type SubscriptionProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - - interface InvoiceMarkUncollectibleParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoicePayParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. - * - * Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. - */ - forgive?: boolean; - - /** - * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. - */ - mandate?: string; - - /** - * Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). - */ - off_session?: boolean; - - /** - * Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. - */ - paid_out_of_band?: boolean; - - /** - * A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. - */ - payment_method?: string; - - /** - * A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. - */ - source?: string; - } - - interface InvoiceRetrieveUpcomingParams { - /** - * Settings for automatic tax lookup for this invoice preview. - */ - automatic_tax?: InvoiceRetrieveUpcomingParams.AutomaticTax; - - /** - * The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. - */ - 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. - */ - customer?: string; - - /** - * Details about the customer you want to invoice or overrides for an existing customer. - */ - customer_details?: InvoiceRetrieveUpcomingParams.CustomerDetails; - - /** - * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. - */ - discounts?: Stripe.Emptyable< - Array - >; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * List of invoice items to add or update in the upcoming invoice preview. - */ - invoice_items?: Array; - - /** - * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. - */ - schedule?: string; - - /** - * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. - */ - subscription?: string; - - /** - * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. - */ - subscription_billing_cycle_anchor?: - | InvoiceRetrieveUpcomingParams.SubscriptionBillingCycleAnchor - | number; - - /** - * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`. - */ - subscription_cancel_at?: Stripe.Emptyable; - - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - subscription_cancel_at_period_end?: boolean; - - /** - * This simulates the subscription being canceled or expired immediately. - */ - subscription_cancel_now?: boolean; - - /** - * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. - */ - subscription_default_tax_rates?: Stripe.Emptyable>; - - /** - * A list of up to 20 subscription items, each with an attached price. - */ - subscription_items?: Array< - InvoiceRetrieveUpcomingParams.SubscriptionItem - >; - - /** - * 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. - */ - subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior; - - /** - * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. - */ - subscription_proration_date?: number; - - /** - * Date a subscription is intended to start (can be future or past) - */ - subscription_start_date?: number; - - /** - * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. - */ - subscription_trial_end?: 'now' | number; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - subscription_trial_from_plan?: boolean; - } - - namespace InvoiceRetrieveUpcomingParams { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - */ - enabled: boolean; - } - - interface CustomerDetails { - /** - * The customer's address. - */ - address?: Stripe.Emptyable; - - /** - * The customer's shipping information. Appears on invoices emailed to this customer. - */ - shipping?: Stripe.Emptyable; - - /** - * Tax details about the customer. - */ - tax?: CustomerDetails.Tax; - - /** - * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The customer's tax IDs. - */ - tax_ids?: Array; - } - - namespace CustomerDetails { - interface Shipping { - /** - * Customer shipping address. - */ - address: Stripe.AddressParam; - - /** - * Customer name. - */ - name: string; - - /** - * Customer phone (including extension). - */ - phone?: string; - } - - interface Tax { - /** - * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - */ - ip_address?: Stripe.Emptyable; - } - - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface InvoiceItem { - /** - * The integer amount in cents (or local equivalent) of previewed invoice item. - */ - amount?: 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). Only applicable to new invoice items. - */ - currency?: string; - - /** - * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. - */ - description?: string; - - /** - * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. - */ - discountable?: boolean; - - /** - * The coupons to redeem into discounts for the invoice item in the preview. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. - */ - invoiceitem?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. - */ - period?: InvoiceItem.Period; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: InvoiceItem.PriceData; - - /** - * Non-negative integer. The quantity of units for the invoice item. - */ - quantity?: number; - - /** - * 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?: InvoiceItem.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: Stripe.Emptyable; - - /** - * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - - /** - * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. - */ - 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 InvoiceItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface Period { - /** - * The end of the period, which must be greater than or equal to the start. - */ - end: number; - - /** - * The start of the period. - */ - start: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; - - interface SubscriptionItem { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionItem.BillingThresholds - >; - - /** - * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. - */ - clear_usage?: boolean; - - /** - * A flag that, if set to `true`, will delete the specified item. - */ - deleted?: boolean; - - /** - * Subscription item to update. - */ - id?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * Plan ID for this item, as a string. - */ - plan?: string; - - /** - * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: SubscriptionItem.PriceData; - - /** - * Quantity for this item. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace SubscriptionItem { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - } - - type SubscriptionProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - - interface InvoiceSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - interface InvoiceSendInvoiceParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InvoiceVoidInvoiceParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class InvoicesResource { - /** - * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. - */ - create( - params?: InvoiceCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the invoice with the given ID. - */ - retrieve( - id: string, - params?: InvoiceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), - * monetary values, as well as collection_method, become uneditable. - * - * If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, - * sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass - * auto_advance=false. - */ - update( - id: string, - params?: InvoiceUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. - */ - list( - params?: InvoiceListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). - */ - del( - id: string, - params?: InvoiceDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. - */ - finalizeInvoice( - id: string, - params?: InvoiceFinalizeInvoiceParams, - options?: RequestOptions - ): Promise>; - finalizeInvoice( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listUpcomingLines( - params?: InvoiceListUpcomingLinesParams, - options?: RequestOptions - ): ApiListPromise; - listUpcomingLines( - options?: RequestOptions - ): ApiListPromise; - - /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. - */ - markUncollectible( - id: string, - params?: InvoiceMarkUncollectibleParams, - options?: RequestOptions - ): Promise>; - markUncollectible( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. - */ - pay( - id: string, - params?: InvoicePayParams, - options?: RequestOptions - ): Promise>; - pay( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. - * - * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. - * - * You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. - */ - retrieveUpcoming( - params?: InvoiceRetrieveUpcomingParams, - options?: RequestOptions - ): Promise>; - retrieveUpcoming( - options?: RequestOptions - ): Promise>; - - /** - * Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: InvoiceSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - - /** - * Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. - * - * Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. - */ - sendInvoice( - id: string, - params?: InvoiceSendInvoiceParams, - options?: RequestOptions - ): Promise>; - sendInvoice( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - */ - voidInvoice( - id: string, - params?: InvoiceVoidInvoiceParams, - options?: RequestOptions - ): Promise>; - voidInvoice( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: InvoiceLineItemListParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/InvoicesResource.d.ts b/types/2022-11-15/InvoicesResource.d.ts new file mode 100644 index 0000000000..36f85deda9 --- /dev/null +++ b/types/2022-11-15/InvoicesResource.d.ts @@ -0,0 +1,2222 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface InvoiceCreateParams { + /** + * The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + */ + account_tax_ids?: Stripe.Emptyable>; + + /** + * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + */ + application_fee_amount?: number; + + /** + * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action. + */ + auto_advance?: boolean; + + /** + * Settings for automatic tax lookup for this invoice. + */ + automatic_tax?: InvoiceCreateParams.AutomaticTax; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. + */ + collection_method?: InvoiceCreateParams.CollectionMethod; + + /** + * The currency to create this invoice in. Defaults to that of `customer` if not specified. + */ + currency?: string; + + /** + * A list of up to 4 custom fields to be displayed on the invoice. + */ + custom_fields?: Stripe.Emptyable>; + + /** + * The ID of the customer who will be billed. + */ + customer?: string; + + /** + * The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. + */ + days_until_due?: number; + + /** + * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + */ + default_payment_method?: string; + + /** + * ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + */ + default_source?: string; + + /** + * The tax rates that will apply to any line item that does not have `tax_rates` set. + */ + default_tax_rates?: Array; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + */ + description?: string; + + /** + * The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. + */ + discounts?: Stripe.Emptyable>; + + /** + * The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. + */ + due_date?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Footer to be displayed on the invoice. + */ + footer?: string; + + /** + * Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + */ + from_invoice?: InvoiceCreateParams.FromInvoice; + + /** + * 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; + + /** + * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + */ + on_behalf_of?: string; + + /** + * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + */ + payment_settings?: InvoiceCreateParams.PaymentSettings; + + /** + * How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. + */ + pending_invoice_items_behavior?: InvoiceCreateParams.PendingInvoiceItemsBehavior; + + /** + * Options for invoice PDF rendering. + */ + rendering_options?: Stripe.Emptyable< + InvoiceCreateParams.RenderingOptions + >; + + /** + * Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + */ + statement_descriptor?: string; + + /** + * The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. + */ + subscription?: string; + + /** + * If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. + */ + transfer_data?: InvoiceCreateParams.TransferData; + } + + namespace InvoiceCreateParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface CustomField { + /** + * The name of the custom field. This may be up to 30 characters. + */ + name: string; + + /** + * The value of the custom field. This may be up to 30 characters. + */ + value: string; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface FromInvoice { + /** + * The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted + */ + action: 'revision'; + + /** + * The `id` of the invoice that will be cloned. + */ + invoice: string; + } + + interface PaymentSettings { + /** + * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + */ + default_mandate?: string; + + /** + * Payment-method-specific configuration to provide to the invoice's PaymentIntent. + */ + payment_method_options?: PaymentSettings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + */ + payment_method_types?: Stripe.Emptyable< + Array + >; + } + + namespace PaymentSettings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + */ + konbini?: Stripe.Emptyable; + + /** + * If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + */ + us_bank_account?: Stripe.Emptyable< + PaymentMethodOptions.UsBankAccount + >; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + } + + interface Card { + /** + * Installment configuration for payments attempted on this invoice (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this invoice. + * Setting to false will prevent any selected plan from applying to a payment. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this invoice. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: string; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type?: string; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + } + } + + interface Konbini {} + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + + type PaymentMethodType = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'boleto' + | 'card' + | 'customer_balance' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'konbini' + | 'link' + | 'paynow' + | 'promptpay' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + } + + type PendingInvoiceItemsBehavior = + | 'exclude' + | 'include' + | 'include_and_require'; + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + */ + amount_tax_display?: Stripe.Emptyable< + RenderingOptions.AmountTaxDisplay + >; + } + + namespace RenderingOptions { + type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. + */ + amount?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface InvoiceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceUpdateParams { + /** + * The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + */ + account_tax_ids?: Stripe.Emptyable>; + + /** + * A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + */ + application_fee_amount?: number; + + /** + * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. + */ + auto_advance?: boolean; + + /** + * Settings for automatic tax lookup for this invoice. + */ + automatic_tax?: InvoiceUpdateParams.AutomaticTax; + + /** + * Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. + */ + collection_method?: InvoiceUpdateParams.CollectionMethod; + + /** + * A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. + */ + custom_fields?: Stripe.Emptyable>; + + /** + * The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + */ + days_until_due?: number; + + /** + * ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + */ + default_payment_method?: string; + + /** + * ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + */ + default_source?: string; + + /** + * The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + */ + description?: string; + + /** + * The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. + */ + discounts?: Stripe.Emptyable>; + + /** + * The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. + */ + due_date?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Footer to be displayed on the invoice. + */ + footer?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + */ + payment_settings?: InvoiceUpdateParams.PaymentSettings; + + /** + * Options for invoice PDF rendering. + */ + rendering_options?: Stripe.Emptyable< + InvoiceUpdateParams.RenderingOptions + >; + + /** + * Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + */ + statement_descriptor?: string; + + /** + * If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace InvoiceUpdateParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface CustomField { + /** + * The name of the custom field. This may be up to 30 characters. + */ + name: string; + + /** + * The value of the custom field. This may be up to 30 characters. + */ + value: string; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface PaymentSettings { + /** + * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + */ + default_mandate?: string; + + /** + * Payment-method-specific configuration to provide to the invoice's PaymentIntent. + */ + payment_method_options?: PaymentSettings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + */ + payment_method_types?: Stripe.Emptyable< + Array + >; + } + + namespace PaymentSettings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + */ + konbini?: Stripe.Emptyable; + + /** + * If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + */ + us_bank_account?: Stripe.Emptyable< + PaymentMethodOptions.UsBankAccount + >; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + } + + interface Card { + /** + * Installment configuration for payments attempted on this invoice (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this invoice. + * Setting to false will prevent any selected plan from applying to a payment. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this invoice. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: string; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type?: string; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + } + } + + interface Konbini {} + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + + type PaymentMethodType = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'boleto' + | 'card' + | 'customer_balance' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'konbini' + | 'link' + | 'paynow' + | 'promptpay' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + } + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + */ + amount_tax_display?: Stripe.Emptyable< + RenderingOptions.AmountTaxDisplay + >; + } + + namespace RenderingOptions { + type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. + */ + amount?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface InvoiceListParams extends PaginationParams { + /** + * The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + */ + collection_method?: InvoiceListParams.CollectionMethod; + + created?: Stripe.RangeQueryParam | number; + + /** + * Only return invoices for the customer specified by this customer ID. + */ + customer?: string; + + due_date?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + */ + status?: InvoiceListParams.Status; + + /** + * Only return invoices for the subscription specified by this subscription ID. + */ + subscription?: string; + } + + namespace InvoiceListParams { + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + type Status = 'draft' | 'open' | 'paid' | 'uncollectible' | 'void'; + } + + interface InvoiceDeleteParams {} + + interface InvoiceFinalizeInvoiceParams { + /** + * Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/invoicing/automatic-charging) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action. + */ + auto_advance?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceListUpcomingLinesParams extends PaginationParams { + /** + * Settings for automatic tax lookup for this invoice preview. + */ + automatic_tax?: InvoiceListUpcomingLinesParams.AutomaticTax; + + /** + * The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + */ + 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. + */ + customer?: string; + + /** + * Details about the customer you want to invoice or overrides for an existing customer. + */ + customer_details?: InvoiceListUpcomingLinesParams.CustomerDetails; + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + */ + discounts?: Stripe.Emptyable< + Array + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * List of invoice items to add or update in the upcoming invoice preview. + */ + invoice_items?: Array; + + /** + * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + */ + schedule?: string; + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + */ + subscription?: string; + + /** + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + */ + subscription_billing_cycle_anchor?: + | InvoiceListUpcomingLinesParams.SubscriptionBillingCycleAnchor + | number; + + /** + * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`. + */ + subscription_cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + subscription_cancel_at_period_end?: boolean; + + /** + * This simulates the subscription being canceled or expired immediately. + */ + subscription_cancel_now?: boolean; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + */ + subscription_default_tax_rates?: Stripe.Emptyable>; + + /** + * A list of up to 20 subscription items, each with an attached price. + */ + subscription_items?: Array< + InvoiceListUpcomingLinesParams.SubscriptionItem + >; + + /** + * 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. + */ + subscription_proration_behavior?: InvoiceListUpcomingLinesParams.SubscriptionProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + */ + subscription_proration_date?: number; + + /** + * Date a subscription is intended to start (can be future or past) + */ + subscription_start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + */ + subscription_trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + subscription_trial_from_plan?: boolean; + } + + namespace InvoiceListUpcomingLinesParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + } + + interface CustomerDetails { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + /** + * Tax details about the customer. + */ + tax?: CustomerDetails.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The customer's tax IDs. + */ + tax_ids?: Array; + } + + namespace CustomerDetails { + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface InvoiceItem { + /** + * The integer amount in cents (or local equivalent) of previewed invoice item. + */ + amount?: 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). Only applicable to new invoice items. + */ + currency?: string; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + */ + discountable?: boolean; + + /** + * The coupons to redeem into discounts for the invoice item in the preview. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + */ + invoiceitem?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + */ + period?: InvoiceItem.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItem.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * 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?: InvoiceItem.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + 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 InvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. + */ + end: number; + + /** + * The start of the period. + */ + start: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; + + interface SubscriptionItem { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionItem.BillingThresholds + >; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * Subscription item to update. + */ + id?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: SubscriptionItem.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace SubscriptionItem { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + } + + type SubscriptionProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface InvoiceMarkUncollectibleParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoicePayParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. + * + * Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. + */ + forgive?: boolean; + + /** + * ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + */ + mandate?: string; + + /** + * Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). + */ + off_session?: boolean; + + /** + * Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. + */ + paid_out_of_band?: boolean; + + /** + * A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + */ + payment_method?: string; + + /** + * A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. + */ + source?: string; + } + + interface InvoiceRetrieveUpcomingParams { + /** + * Settings for automatic tax lookup for this invoice preview. + */ + automatic_tax?: InvoiceRetrieveUpcomingParams.AutomaticTax; + + /** + * The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string. + */ + 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. + */ + customer?: string; + + /** + * Details about the customer you want to invoice or overrides for an existing customer. + */ + customer_details?: InvoiceRetrieveUpcomingParams.CustomerDetails; + + /** + * The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + */ + discounts?: Stripe.Emptyable< + Array + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * List of invoice items to add or update in the upcoming invoice preview. + */ + invoice_items?: Array; + + /** + * The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. + */ + schedule?: string; + + /** + * The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + */ + subscription?: string; + + /** + * For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. + */ + subscription_billing_cycle_anchor?: + | InvoiceRetrieveUpcomingParams.SubscriptionBillingCycleAnchor + | number; + + /** + * Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`. + */ + subscription_cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + subscription_cancel_at_period_end?: boolean; + + /** + * This simulates the subscription being canceled or expired immediately. + */ + subscription_cancel_now?: boolean; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. + */ + subscription_default_tax_rates?: Stripe.Emptyable>; + + /** + * A list of up to 20 subscription items, each with an attached price. + */ + subscription_items?: Array< + InvoiceRetrieveUpcomingParams.SubscriptionItem + >; + + /** + * 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. + */ + subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior; + + /** + * If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. + */ + subscription_proration_date?: number; + + /** + * Date a subscription is intended to start (can be future or past) + */ + subscription_start_date?: number; + + /** + * If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. + */ + subscription_trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + subscription_trial_from_plan?: boolean; + } + + namespace InvoiceRetrieveUpcomingParams { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + */ + enabled: boolean; + } + + interface CustomerDetails { + /** + * The customer's address. + */ + address?: Stripe.Emptyable; + + /** + * The customer's shipping information. Appears on invoices emailed to this customer. + */ + shipping?: Stripe.Emptyable; + + /** + * Tax details about the customer. + */ + tax?: CustomerDetails.Tax; + + /** + * The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The customer's tax IDs. + */ + tax_ids?: Array; + } + + namespace CustomerDetails { + interface Shipping { + /** + * Customer shipping address. + */ + address: Stripe.AddressParam; + + /** + * Customer name. + */ + name: string; + + /** + * Customer phone (including extension). + */ + phone?: string; + } + + interface Tax { + /** + * A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + */ + ip_address?: Stripe.Emptyable; + } + + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface InvoiceItem { + /** + * The integer amount in cents (or local equivalent) of previewed invoice item. + */ + amount?: 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). Only applicable to new invoice items. + */ + currency?: string; + + /** + * An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. + */ + description?: string; + + /** + * Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. + */ + discountable?: boolean; + + /** + * The coupons to redeem into discounts for the invoice item in the preview. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. + */ + invoiceitem?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + */ + period?: InvoiceItem.Period; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: InvoiceItem.PriceData; + + /** + * Non-negative integer. The quantity of units for the invoice item. + */ + quantity?: number; + + /** + * 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?: InvoiceItem.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + + /** + * The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + */ + 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 InvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface Period { + /** + * The end of the period, which must be greater than or equal to the start. + */ + end: number; + + /** + * The start of the period. + */ + start: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + type SubscriptionBillingCycleAnchor = 'now' | 'unchanged'; + + interface SubscriptionItem { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionItem.BillingThresholds + >; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * Subscription item to update. + */ + id?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: SubscriptionItem.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace SubscriptionItem { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + } + + type SubscriptionProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + + interface InvoiceSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + interface InvoiceSendInvoiceParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InvoiceVoidInvoiceParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class InvoicesResource { + /** + * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. + */ + create( + params?: InvoiceCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the invoice with the given ID. + */ + retrieve( + id: string, + params?: InvoiceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), + * monetary values, as well as collection_method, become uneditable. + * + * If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, + * sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass + * auto_advance=false. + */ + update( + id: string, + params?: InvoiceUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. + */ + list( + params?: InvoiceListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). + */ + del( + id: string, + params?: InvoiceDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. + */ + finalizeInvoice( + id: string, + params?: InvoiceFinalizeInvoiceParams, + options?: RequestOptions + ): Promise>; + finalizeInvoice( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listUpcomingLines( + params?: InvoiceListUpcomingLinesParams, + options?: RequestOptions + ): ApiListPromise; + listUpcomingLines( + options?: RequestOptions + ): ApiListPromise; + + /** + * Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + */ + markUncollectible( + id: string, + params?: InvoiceMarkUncollectibleParams, + options?: RequestOptions + ): Promise>; + markUncollectible( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + */ + pay( + id: string, + params?: InvoicePayParams, + options?: RequestOptions + ): Promise>; + pay( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. + * + * Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. + * + * You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource. + */ + retrieveUpcoming( + params?: InvoiceRetrieveUpcomingParams, + options?: RequestOptions + ): Promise>; + retrieveUpcoming( + options?: RequestOptions + ): Promise>; + + /** + * Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: InvoiceSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + + /** + * Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. + * + * Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. + */ + sendInvoice( + id: string, + params?: InvoiceSendInvoiceParams, + options?: RequestOptions + ): Promise>; + sendInvoice( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + */ + voidInvoice( + id: string, + params?: InvoiceVoidInvoiceParams, + options?: RequestOptions + ): Promise>; + voidInvoice( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: InvoiceLineItemListParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Issuing/Authorizations.d.ts b/types/2022-11-15/Issuing/Authorizations.d.ts index 3fda975cec..776163a27f 100644 --- a/types/2022-11-15/Issuing/Authorizations.d.ts +++ b/types/2022-11-15/Issuing/Authorizations.d.ts @@ -354,148 +354,6 @@ declare module 'stripe' { type ExpiryCheck = 'match' | 'mismatch' | 'not_provided'; } } - - interface AuthorizationRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AuthorizationUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface AuthorizationListParams extends PaginationParams { - /** - * Only return authorizations that belong to the given card. - */ - card?: string; - - /** - * Only return authorizations that belong to the given cardholder. - */ - cardholder?: string; - - /** - * Only return authorizations that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. - */ - status?: AuthorizationListParams.Status; - } - - namespace AuthorizationListParams { - type Status = 'closed' | 'pending' | 'reversed'; - } - - interface AuthorizationApproveParams { - /** - * If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). - */ - amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface AuthorizationDeclineParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - class AuthorizationsResource { - /** - * Retrieves an Issuing Authorization object. - */ - retrieve( - id: string, - params?: AuthorizationRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: AuthorizationUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: AuthorizationListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. - * You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found [here](https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). - */ - approve( - id: string, - params?: AuthorizationApproveParams, - options?: RequestOptions - ): Promise>; - approve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. - * You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found [here](https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). - */ - decline( - id: string, - params?: AuthorizationDeclineParams, - options?: RequestOptions - ): Promise>; - decline( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Issuing/AuthorizationsResource.d.ts b/types/2022-11-15/Issuing/AuthorizationsResource.d.ts new file mode 100644 index 0000000000..7bc05a56f0 --- /dev/null +++ b/types/2022-11-15/Issuing/AuthorizationsResource.d.ts @@ -0,0 +1,149 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Issuing { + interface AuthorizationRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface AuthorizationUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface AuthorizationListParams extends PaginationParams { + /** + * Only return authorizations that belong to the given card. + */ + card?: string; + + /** + * Only return authorizations that belong to the given cardholder. + */ + cardholder?: string; + + /** + * Only return authorizations that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. + */ + status?: AuthorizationListParams.Status; + } + + namespace AuthorizationListParams { + type Status = 'closed' | 'pending' | 'reversed'; + } + + interface AuthorizationApproveParams { + /** + * If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). + */ + amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface AuthorizationDeclineParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + class AuthorizationsResource { + /** + * Retrieves an Issuing Authorization object. + */ + retrieve( + id: string, + params?: AuthorizationRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: AuthorizationUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: AuthorizationListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + * You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found [here](https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + */ + approve( + id: string, + params?: AuthorizationApproveParams, + options?: RequestOptions + ): Promise>; + approve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + * You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found [here](https://site-admin.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + */ + decline( + id: string, + params?: AuthorizationDeclineParams, + options?: RequestOptions + ): Promise>; + decline( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Issuing/Cardholders.d.ts b/types/2022-11-15/Issuing/Cardholders.d.ts index d4fc6eec54..b4d4cd520f 100644 --- a/types/2022-11-15/Issuing/Cardholders.d.ts +++ b/types/2022-11-15/Issuing/Cardholders.d.ts @@ -1103,2270 +1103,6 @@ declare module 'stripe' { type Type = 'company' | 'individual'; } - - interface CardholderCreateParams { - /** - * The cardholder's billing address. - */ - billing: CardholderCreateParams.Billing; - - /** - * The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. - */ - name: string; - - /** - * One of `individual` or `company`. - */ - type: CardholderCreateParams.Type; - - /** - * Additional information about a `company` cardholder. - */ - company?: CardholderCreateParams.Company; - - /** - * The cardholder's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Additional information about an `individual` cardholder. - */ - individual?: CardholderCreateParams.Individual; - - /** - * 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.MetadataParam; - - /** - * The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. - */ - phone_number?: string; - - /** - * Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - */ - spending_controls?: CardholderCreateParams.SpendingControls; - - /** - * Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. - */ - status?: CardholderCreateParams.Status; - } - - namespace CardholderCreateParams { - interface Billing { - /** - * The cardholder's billing address. - */ - address: Billing.Address; - } - - namespace Billing { - interface Address { - /** - * City, district, suburb, town, or village. - */ - city: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country: string; - - /** - * Address line 1 (e.g., street, PO Box, or company name). - */ - line1: string; - - /** - * Address line 2 (e.g., apartment, suite, unit, or building). - */ - line2?: string; - - /** - * ZIP or postal code. - */ - postal_code: string; - - /** - * State, county, province, or region. - */ - state?: string; - } - } - - interface Company { - /** - * The entity's business ID number. - */ - tax_id?: string; - } - - interface Individual { - /** - * The date of birth of this cardholder. - */ - dob?: Individual.Dob; - - /** - * The first name of this cardholder. This field cannot contain any special characters or numbers. - */ - first_name: string; - - /** - * The last name of this cardholder. This field cannot contain any special characters or numbers. - */ - last_name: string; - - /** - * Government-issued ID document for this cardholder. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Verification { - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - */ - front?: string; - } - } - } - - interface SpendingControls { - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. - */ - allowed_categories?: Array; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. - */ - blocked_categories?: Array; - - /** - * Limit spending with amount-based rules that apply across this cardholder's cards. - */ - spending_limits?: Array; - - /** - * Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. - */ - spending_limits_currency?: string; - } - - namespace SpendingControls { - type AllowedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type BlockedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - interface SpendingLimit { - /** - * Maximum amount allowed to spend per interval. - */ - amount: number; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. - */ - categories?: Array; - - /** - * Interval (or event) to which the amount applies. - */ - interval: SpendingLimit.Interval; - } - - namespace SpendingLimit { - type Category = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type Interval = - | 'all_time' - | 'daily' - | 'monthly' - | 'per_authorization' - | 'weekly' - | 'yearly'; - } - } - - type Status = 'active' | 'inactive'; - - type Type = 'company' | 'individual'; - } - - interface CardholderRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CardholderUpdateParams { - /** - * The cardholder's billing address. - */ - billing?: CardholderUpdateParams.Billing; - - /** - * Additional information about a `company` cardholder. - */ - company?: CardholderUpdateParams.Company; - - /** - * The cardholder's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Additional information about an `individual` cardholder. - */ - individual?: CardholderUpdateParams.Individual; - - /** - * 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.MetadataParam; - - /** - * The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. - */ - phone_number?: string; - - /** - * Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - */ - spending_controls?: CardholderUpdateParams.SpendingControls; - - /** - * Specifies whether to permit authorizations on this cardholder's cards. - */ - status?: CardholderUpdateParams.Status; - } - - namespace CardholderUpdateParams { - interface Billing { - /** - * The cardholder's billing address. - */ - address: Billing.Address; - } - - namespace Billing { - interface Address { - /** - * City, district, suburb, town, or village. - */ - city: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country: string; - - /** - * Address line 1 (e.g., street, PO Box, or company name). - */ - line1: string; - - /** - * Address line 2 (e.g., apartment, suite, unit, or building). - */ - line2?: string; - - /** - * ZIP or postal code. - */ - postal_code: string; - - /** - * State, county, province, or region. - */ - state?: string; - } - } - - interface Company { - /** - * The entity's business ID number. - */ - tax_id?: string; - } - - interface Individual { - /** - * The date of birth of this cardholder. - */ - dob?: Individual.Dob; - - /** - * The first name of this cardholder. This field cannot contain any special characters or numbers. - */ - first_name: string; - - /** - * The last name of this cardholder. This field cannot contain any special characters or numbers. - */ - last_name: string; - - /** - * Government-issued ID document for this cardholder. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Verification { - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - */ - front?: string; - } - } - } - - interface SpendingControls { - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. - */ - allowed_categories?: Array; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. - */ - blocked_categories?: Array; - - /** - * Limit spending with amount-based rules that apply across this cardholder's cards. - */ - spending_limits?: Array; - - /** - * Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. - */ - spending_limits_currency?: string; - } - - namespace SpendingControls { - type AllowedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type BlockedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - interface SpendingLimit { - /** - * Maximum amount allowed to spend per interval. - */ - amount: number; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. - */ - categories?: Array; - - /** - * Interval (or event) to which the amount applies. - */ - interval: SpendingLimit.Interval; - } - - namespace SpendingLimit { - type Category = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type Interval = - | 'all_time' - | 'daily' - | 'monthly' - | 'per_authorization' - | 'weekly' - | 'yearly'; - } - } - - type Status = 'active' | 'inactive'; - } - - interface CardholderListParams extends PaginationParams { - /** - * Only return cardholders that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return cardholders that have the given email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return cardholders that have the given phone number. - */ - phone_number?: string; - - /** - * Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. - */ - status?: CardholderListParams.Status; - - /** - * Only return cardholders that have the given type. One of `individual` or `company`. - */ - type?: CardholderListParams.Type; - } - - namespace CardholderListParams { - type Status = 'active' | 'blocked' | 'inactive'; - - type Type = 'company' | 'individual'; - } - - class CardholdersResource { - /** - * Creates a new Issuing Cardholder object that can be issued cards. - */ - create( - params: CardholderCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves an Issuing Cardholder object. - */ - retrieve( - id: string, - params?: CardholderRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: CardholderUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: CardholderListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Issuing/CardholdersResource.d.ts b/types/2022-11-15/Issuing/CardholdersResource.d.ts new file mode 100644 index 0000000000..e546b4b10b --- /dev/null +++ b/types/2022-11-15/Issuing/CardholdersResource.d.ts @@ -0,0 +1,2271 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Issuing { + interface CardholderCreateParams { + /** + * The cardholder's billing address. + */ + billing: CardholderCreateParams.Billing; + + /** + * The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. + */ + name: string; + + /** + * One of `individual` or `company`. + */ + type: CardholderCreateParams.Type; + + /** + * Additional information about a `company` cardholder. + */ + company?: CardholderCreateParams.Company; + + /** + * The cardholder's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Additional information about an `individual` cardholder. + */ + individual?: CardholderCreateParams.Individual; + + /** + * 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.MetadataParam; + + /** + * The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + */ + phone_number?: string; + + /** + * Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + */ + spending_controls?: CardholderCreateParams.SpendingControls; + + /** + * Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. + */ + status?: CardholderCreateParams.Status; + } + + namespace CardholderCreateParams { + interface Billing { + /** + * The cardholder's billing address. + */ + address: Billing.Address; + } + + namespace Billing { + interface Address { + /** + * City, district, suburb, town, or village. + */ + city: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } + + interface Company { + /** + * The entity's business ID number. + */ + tax_id?: string; + } + + interface Individual { + /** + * The date of birth of this cardholder. + */ + dob?: Individual.Dob; + + /** + * The first name of this cardholder. This field cannot contain any special characters or numbers. + */ + first_name: string; + + /** + * The last name of this cardholder. This field cannot contain any special characters or numbers. + */ + last_name: string; + + /** + * Government-issued ID document for this cardholder. + */ + verification?: Individual.Verification; + } + + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Verification { + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + */ + front?: string; + } + } + } + + interface SpendingControls { + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + */ + allowed_categories?: Array; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + */ + blocked_categories?: Array; + + /** + * Limit spending with amount-based rules that apply across this cardholder's cards. + */ + spending_limits?: Array; + + /** + * Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. + */ + spending_limits_currency?: string; + } + + namespace SpendingControls { + type AllowedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type BlockedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + interface SpendingLimit { + /** + * Maximum amount allowed to spend per interval. + */ + amount: number; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + */ + categories?: Array; + + /** + * Interval (or event) to which the amount applies. + */ + interval: SpendingLimit.Interval; + } + + namespace SpendingLimit { + type Category = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type Interval = + | 'all_time' + | 'daily' + | 'monthly' + | 'per_authorization' + | 'weekly' + | 'yearly'; + } + } + + type Status = 'active' | 'inactive'; + + type Type = 'company' | 'individual'; + } + + interface CardholderRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CardholderUpdateParams { + /** + * The cardholder's billing address. + */ + billing?: CardholderUpdateParams.Billing; + + /** + * Additional information about a `company` cardholder. + */ + company?: CardholderUpdateParams.Company; + + /** + * The cardholder's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Additional information about an `individual` cardholder. + */ + individual?: CardholderUpdateParams.Individual; + + /** + * 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.MetadataParam; + + /** + * The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. + */ + phone_number?: string; + + /** + * Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + */ + spending_controls?: CardholderUpdateParams.SpendingControls; + + /** + * Specifies whether to permit authorizations on this cardholder's cards. + */ + status?: CardholderUpdateParams.Status; + } + + namespace CardholderUpdateParams { + interface Billing { + /** + * The cardholder's billing address. + */ + address: Billing.Address; + } + + namespace Billing { + interface Address { + /** + * City, district, suburb, town, or village. + */ + city: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } + + interface Company { + /** + * The entity's business ID number. + */ + tax_id?: string; + } + + interface Individual { + /** + * The date of birth of this cardholder. + */ + dob?: Individual.Dob; + + /** + * The first name of this cardholder. This field cannot contain any special characters or numbers. + */ + first_name: string; + + /** + * The last name of this cardholder. This field cannot contain any special characters or numbers. + */ + last_name: string; + + /** + * Government-issued ID document for this cardholder. + */ + verification?: Individual.Verification; + } + + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Verification { + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + */ + front?: string; + } + } + } + + interface SpendingControls { + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + */ + allowed_categories?: Array; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + */ + blocked_categories?: Array; + + /** + * Limit spending with amount-based rules that apply across this cardholder's cards. + */ + spending_limits?: Array; + + /** + * Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. + */ + spending_limits_currency?: string; + } + + namespace SpendingControls { + type AllowedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type BlockedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + interface SpendingLimit { + /** + * Maximum amount allowed to spend per interval. + */ + amount: number; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + */ + categories?: Array; + + /** + * Interval (or event) to which the amount applies. + */ + interval: SpendingLimit.Interval; + } + + namespace SpendingLimit { + type Category = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type Interval = + | 'all_time' + | 'daily' + | 'monthly' + | 'per_authorization' + | 'weekly' + | 'yearly'; + } + } + + type Status = 'active' | 'inactive'; + } + + interface CardholderListParams extends PaginationParams { + /** + * Only return cardholders that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return cardholders that have the given email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return cardholders that have the given phone number. + */ + phone_number?: string; + + /** + * Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. + */ + status?: CardholderListParams.Status; + + /** + * Only return cardholders that have the given type. One of `individual` or `company`. + */ + type?: CardholderListParams.Type; + } + + namespace CardholderListParams { + type Status = 'active' | 'blocked' | 'inactive'; + + type Type = 'company' | 'individual'; + } + + class CardholdersResource { + /** + * Creates a new Issuing Cardholder object that can be issued cards. + */ + create( + params: CardholderCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves an Issuing Cardholder object. + */ + retrieve( + id: string, + params?: CardholderRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: CardholderUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: CardholderListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Issuing/Cards.d.ts b/types/2022-11-15/Issuing/Cards.d.ts index 866c20f5a9..d6e5914257 100644 --- a/types/2022-11-15/Issuing/Cards.d.ts +++ b/types/2022-11-15/Issuing/Cards.d.ts @@ -1185,2123 +1185,6 @@ declare module 'stripe' { } } } - - interface CardCreateParams { - /** - * The currency for the card. - */ - currency: string; - - /** - * The type of card to issue. Possible values are `physical` or `virtual`. - */ - type: CardCreateParams.Type; - - /** - * The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. - */ - cardholder?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - financial_account?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The card this is meant to be a replacement for (if any). - */ - replacement_for?: string; - - /** - * If `replacement_for` is specified, this should indicate why that card is being replaced. - */ - replacement_reason?: CardCreateParams.ReplacementReason; - - /** - * The address where the card will be shipped. - */ - shipping?: CardCreateParams.Shipping; - - /** - * Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - */ - spending_controls?: CardCreateParams.SpendingControls; - - /** - * Whether authorizations can be approved on this card. Defaults to `inactive`. - */ - status?: CardCreateParams.Status; - } - - namespace CardCreateParams { - type ReplacementReason = 'damaged' | 'expired' | 'lost' | 'stolen'; - - interface Shipping { - /** - * The address that the card is shipped to. - */ - address: Shipping.Address; - - /** - * Customs information for the shipment. - */ - customs?: Shipping.Customs; - - /** - * The name printed on the shipping label when shipping the card. - */ - name: string; - - /** - * Phone number of the recipient of the shipment. - */ - phone_number?: string; - - /** - * Whether a signature is required for card delivery. - */ - require_signature?: boolean; - - /** - * Shipment service. - */ - service?: Shipping.Service; - - /** - * Packaging options. - */ - type?: Shipping.Type; - } - - namespace Shipping { - interface Address { - /** - * City, district, suburb, town, or village. - */ - city: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country: string; - - /** - * Address line 1 (e.g., street, PO Box, or company name). - */ - line1: string; - - /** - * Address line 2 (e.g., apartment, suite, unit, or building). - */ - line2?: string; - - /** - * ZIP or postal code. - */ - postal_code: string; - - /** - * State, county, province, or region. - */ - state?: string; - } - - interface Customs { - /** - * The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. - */ - eori_number?: string; - } - - type Service = 'express' | 'priority' | 'standard'; - - type Type = 'bulk' | 'individual'; - } - - interface SpendingControls { - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. - */ - allowed_categories?: Array; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. - */ - blocked_categories?: Array; - - /** - * Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). - */ - spending_limits?: Array; - } - - namespace SpendingControls { - type AllowedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type BlockedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - interface SpendingLimit { - /** - * Maximum amount allowed to spend per interval. - */ - amount: number; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. - */ - categories?: Array; - - /** - * Interval (or event) to which the amount applies. - */ - interval: SpendingLimit.Interval; - } - - namespace SpendingLimit { - type Category = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type Interval = - | 'all_time' - | 'daily' - | 'monthly' - | 'per_authorization' - | 'weekly' - | 'yearly'; - } - } - - type Status = 'active' | 'inactive'; - - type Type = 'physical' | 'virtual'; - } - - interface CardRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CardUpdateParams { - /** - * Reason why the `status` of this card is `canceled`. - */ - cancellation_reason?: CardUpdateParams.CancellationReason; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * The desired new PIN for this card. - */ - pin?: CardUpdateParams.Pin; - - /** - * Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - */ - spending_controls?: CardUpdateParams.SpendingControls; - - /** - * Dictates whether authorizations can be approved on this card. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. - */ - status?: CardUpdateParams.Status; - } - - namespace CardUpdateParams { - type CancellationReason = 'lost' | 'stolen'; - - interface Pin { - /** - * The card's desired new PIN, encrypted under Stripe's public key. - */ - encrypted_number?: string; - } - - interface SpendingControls { - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. - */ - allowed_categories?: Array; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. - */ - blocked_categories?: Array; - - /** - * Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). - */ - spending_limits?: Array; - } - - namespace SpendingControls { - type AllowedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type BlockedCategory = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - interface SpendingLimit { - /** - * Maximum amount allowed to spend per interval. - */ - amount: number; - - /** - * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. - */ - categories?: Array; - - /** - * Interval (or event) to which the amount applies. - */ - interval: SpendingLimit.Interval; - } - - namespace SpendingLimit { - type Category = - | 'ac_refrigeration_repair' - | 'accounting_bookkeeping_services' - | 'advertising_services' - | 'agricultural_cooperative' - | 'airlines_air_carriers' - | 'airports_flying_fields' - | 'ambulance_services' - | 'amusement_parks_carnivals' - | 'antique_reproductions' - | 'antique_shops' - | 'aquariums' - | 'architectural_surveying_services' - | 'art_dealers_and_galleries' - | 'artists_supply_and_craft_shops' - | 'auto_and_home_supply_stores' - | 'auto_body_repair_shops' - | 'auto_paint_shops' - | 'auto_service_shops' - | 'automated_cash_disburse' - | 'automated_fuel_dispensers' - | 'automobile_associations' - | 'automotive_parts_and_accessories_stores' - | 'automotive_tire_stores' - | 'bail_and_bond_payments' - | 'bakeries' - | 'bands_orchestras' - | 'barber_and_beauty_shops' - | 'betting_casino_gambling' - | 'bicycle_shops' - | 'billiard_pool_establishments' - | 'boat_dealers' - | 'boat_rentals_and_leases' - | 'book_stores' - | 'books_periodicals_and_newspapers' - | 'bowling_alleys' - | 'bus_lines' - | 'business_secretarial_schools' - | 'buying_shopping_services' - | 'cable_satellite_and_other_pay_television_and_radio' - | 'camera_and_photographic_supply_stores' - | 'candy_nut_and_confectionery_stores' - | 'car_and_truck_dealers_new_used' - | 'car_and_truck_dealers_used_only' - | 'car_rental_agencies' - | 'car_washes' - | 'carpentry_services' - | 'carpet_upholstery_cleaning' - | 'caterers' - | 'charitable_and_social_service_organizations_fundraising' - | 'chemicals_and_allied_products' - | 'child_care_services' - | 'childrens_and_infants_wear_stores' - | 'chiropodists_podiatrists' - | 'chiropractors' - | 'cigar_stores_and_stands' - | 'civic_social_fraternal_associations' - | 'cleaning_and_maintenance' - | 'clothing_rental' - | 'colleges_universities' - | 'commercial_equipment' - | 'commercial_footwear' - | 'commercial_photography_art_and_graphics' - | 'commuter_transport_and_ferries' - | 'computer_network_services' - | 'computer_programming' - | 'computer_repair' - | 'computer_software_stores' - | 'computers_peripherals_and_software' - | 'concrete_work_services' - | 'construction_materials' - | 'consulting_public_relations' - | 'correspondence_schools' - | 'cosmetic_stores' - | 'counseling_services' - | 'country_clubs' - | 'courier_services' - | 'court_costs' - | 'credit_reporting_agencies' - | 'cruise_lines' - | 'dairy_products_stores' - | 'dance_hall_studios_schools' - | 'dating_escort_services' - | 'dentists_orthodontists' - | 'department_stores' - | 'detective_agencies' - | 'digital_goods_applications' - | 'digital_goods_games' - | 'digital_goods_large_volume' - | 'digital_goods_media' - | 'direct_marketing_catalog_merchant' - | 'direct_marketing_combination_catalog_and_retail_merchant' - | 'direct_marketing_inbound_telemarketing' - | 'direct_marketing_insurance_services' - | 'direct_marketing_other' - | 'direct_marketing_outbound_telemarketing' - | 'direct_marketing_subscription' - | 'direct_marketing_travel' - | 'discount_stores' - | 'doctors' - | 'door_to_door_sales' - | 'drapery_window_covering_and_upholstery_stores' - | 'drinking_places' - | 'drug_stores_and_pharmacies' - | 'drugs_drug_proprietaries_and_druggist_sundries' - | 'dry_cleaners' - | 'durable_goods' - | 'duty_free_stores' - | 'eating_places_restaurants' - | 'educational_services' - | 'electric_razor_stores' - | 'electrical_parts_and_equipment' - | 'electrical_services' - | 'electronics_repair_shops' - | 'electronics_stores' - | 'elementary_secondary_schools' - | 'employment_temp_agencies' - | 'equipment_rental' - | 'exterminating_services' - | 'family_clothing_stores' - | 'fast_food_restaurants' - | 'financial_institutions' - | 'fines_government_administrative_entities' - | 'fireplace_fireplace_screens_and_accessories_stores' - | 'floor_covering_stores' - | 'florists' - | 'florists_supplies_nursery_stock_and_flowers' - | 'freezer_and_locker_meat_provisioners' - | 'fuel_dealers_non_automotive' - | 'funeral_services_crematories' - | 'furniture_home_furnishings_and_equipment_stores_except_appliances' - | 'furniture_repair_refinishing' - | 'furriers_and_fur_shops' - | 'general_services' - | 'gift_card_novelty_and_souvenir_shops' - | 'glass_paint_and_wallpaper_stores' - | 'glassware_crystal_stores' - | 'golf_courses_public' - | 'government_services' - | 'grocery_stores_supermarkets' - | 'hardware_equipment_and_supplies' - | 'hardware_stores' - | 'health_and_beauty_spas' - | 'hearing_aids_sales_and_supplies' - | 'heating_plumbing_a_c' - | 'hobby_toy_and_game_shops' - | 'home_supply_warehouse_stores' - | 'hospitals' - | 'hotels_motels_and_resorts' - | 'household_appliance_stores' - | 'industrial_supplies' - | 'information_retrieval_services' - | 'insurance_default' - | 'insurance_underwriting_premiums' - | 'intra_company_purchases' - | 'jewelry_stores_watches_clocks_and_silverware_stores' - | 'landscaping_services' - | 'laundries' - | 'laundry_cleaning_services' - | 'legal_services_attorneys' - | 'luggage_and_leather_goods_stores' - | 'lumber_building_materials_stores' - | 'manual_cash_disburse' - | 'marinas_service_and_supplies' - | 'masonry_stonework_and_plaster' - | 'massage_parlors' - | 'medical_and_dental_labs' - | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' - | 'medical_services' - | 'membership_organizations' - | 'mens_and_boys_clothing_and_accessories_stores' - | 'mens_womens_clothing_stores' - | 'metal_service_centers' - | 'miscellaneous' - | 'miscellaneous_apparel_and_accessory_shops' - | 'miscellaneous_auto_dealers' - | 'miscellaneous_business_services' - | 'miscellaneous_food_stores' - | 'miscellaneous_general_merchandise' - | 'miscellaneous_general_services' - | 'miscellaneous_home_furnishing_specialty_stores' - | 'miscellaneous_publishing_and_printing' - | 'miscellaneous_recreation_services' - | 'miscellaneous_repair_shops' - | 'miscellaneous_specialty_retail' - | 'mobile_home_dealers' - | 'motion_picture_theaters' - | 'motor_freight_carriers_and_trucking' - | 'motor_homes_dealers' - | 'motor_vehicle_supplies_and_new_parts' - | 'motorcycle_shops_and_dealers' - | 'motorcycle_shops_dealers' - | 'music_stores_musical_instruments_pianos_and_sheet_music' - | 'news_dealers_and_newsstands' - | 'non_fi_money_orders' - | 'non_fi_stored_value_card_purchase_load' - | 'nondurable_goods' - | 'nurseries_lawn_and_garden_supply_stores' - | 'nursing_personal_care' - | 'office_and_commercial_furniture' - | 'opticians_eyeglasses' - | 'optometrists_ophthalmologist' - | 'orthopedic_goods_prosthetic_devices' - | 'osteopaths' - | 'package_stores_beer_wine_and_liquor' - | 'paints_varnishes_and_supplies' - | 'parking_lots_garages' - | 'passenger_railways' - | 'pawn_shops' - | 'pet_shops_pet_food_and_supplies' - | 'petroleum_and_petroleum_products' - | 'photo_developing' - | 'photographic_photocopy_microfilm_equipment_and_supplies' - | 'photographic_studios' - | 'picture_video_production' - | 'piece_goods_notions_and_other_dry_goods' - | 'plumbing_heating_equipment_and_supplies' - | 'political_organizations' - | 'postal_services_government_only' - | 'precious_stones_and_metals_watches_and_jewelry' - | 'professional_services' - | 'public_warehousing_and_storage' - | 'quick_copy_repro_and_blueprint' - | 'railroads' - | 'real_estate_agents_and_managers_rentals' - | 'record_stores' - | 'recreational_vehicle_rentals' - | 'religious_goods_stores' - | 'religious_organizations' - | 'roofing_siding_sheet_metal' - | 'secretarial_support_services' - | 'security_brokers_dealers' - | 'service_stations' - | 'sewing_needlework_fabric_and_piece_goods_stores' - | 'shoe_repair_hat_cleaning' - | 'shoe_stores' - | 'small_appliance_repair' - | 'snowmobile_dealers' - | 'special_trade_services' - | 'specialty_cleaning' - | 'sporting_goods_stores' - | 'sporting_recreation_camps' - | 'sports_and_riding_apparel_stores' - | 'sports_clubs_fields' - | 'stamp_and_coin_stores' - | 'stationary_office_supplies_printing_and_writing_paper' - | 'stationery_stores_office_and_school_supply_stores' - | 'swimming_pools_sales' - | 't_ui_travel_germany' - | 'tailors_alterations' - | 'tax_payments_government_agencies' - | 'tax_preparation_services' - | 'taxicabs_limousines' - | 'telecommunication_equipment_and_telephone_sales' - | 'telecommunication_services' - | 'telegraph_services' - | 'tent_and_awning_shops' - | 'testing_laboratories' - | 'theatrical_ticket_agencies' - | 'timeshares' - | 'tire_retreading_and_repair' - | 'tolls_bridge_fees' - | 'tourist_attractions_and_exhibits' - | 'towing_services' - | 'trailer_parks_campgrounds' - | 'transportation_services' - | 'travel_agencies_tour_operators' - | 'truck_stop_iteration' - | 'truck_utility_trailer_rentals' - | 'typesetting_plate_making_and_related_services' - | 'typewriter_stores' - | 'u_s_federal_government_agencies_or_departments' - | 'uniforms_commercial_clothing' - | 'used_merchandise_and_secondhand_stores' - | 'utilities' - | 'variety_stores' - | 'veterinary_services' - | 'video_amusement_game_supplies' - | 'video_game_arcades' - | 'video_tape_rental_stores' - | 'vocational_trade_schools' - | 'watch_jewelry_repair' - | 'welding_repair' - | 'wholesale_clubs' - | 'wig_and_toupee_stores' - | 'wires_money_orders' - | 'womens_accessory_and_specialty_shops' - | 'womens_ready_to_wear_stores' - | 'wrecking_and_salvage_yards'; - - type Interval = - | 'all_time' - | 'daily' - | 'monthly' - | 'per_authorization' - | 'weekly' - | 'yearly'; - } - } - - type Status = 'active' | 'canceled' | 'inactive'; - } - - interface CardListParams extends PaginationParams { - /** - * Only return cards belonging to the Cardholder with the provided ID. - */ - cardholder?: string; - - /** - * Only return cards that were issued during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return cards that have the given expiration month. - */ - exp_month?: number; - - /** - * Only return cards that have the given expiration year. - */ - exp_year?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return cards that have the given last four digits. - */ - last4?: string; - - /** - * Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. - */ - status?: CardListParams.Status; - - /** - * Only return cards that have the given type. One of `virtual` or `physical`. - */ - type?: CardListParams.Type; - } - - namespace CardListParams { - type Status = 'active' | 'canceled' | 'inactive'; - - type Type = 'physical' | 'virtual'; - } - - class CardsResource { - /** - * Creates an Issuing Card object. - */ - create( - params: CardCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves an Issuing Card object. - */ - retrieve( - id: string, - params?: CardRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: CardUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: CardListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Issuing/CardsResource.d.ts b/types/2022-11-15/Issuing/CardsResource.d.ts new file mode 100644 index 0000000000..9ca0078f4e --- /dev/null +++ b/types/2022-11-15/Issuing/CardsResource.d.ts @@ -0,0 +1,2124 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Issuing { + interface CardCreateParams { + /** + * The currency for the card. + */ + currency: string; + + /** + * The type of card to issue. Possible values are `physical` or `virtual`. + */ + type: CardCreateParams.Type; + + /** + * The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. + */ + cardholder?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + financial_account?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The card this is meant to be a replacement for (if any). + */ + replacement_for?: string; + + /** + * If `replacement_for` is specified, this should indicate why that card is being replaced. + */ + replacement_reason?: CardCreateParams.ReplacementReason; + + /** + * The address where the card will be shipped. + */ + shipping?: CardCreateParams.Shipping; + + /** + * Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + */ + spending_controls?: CardCreateParams.SpendingControls; + + /** + * Whether authorizations can be approved on this card. Defaults to `inactive`. + */ + status?: CardCreateParams.Status; + } + + namespace CardCreateParams { + type ReplacementReason = 'damaged' | 'expired' | 'lost' | 'stolen'; + + interface Shipping { + /** + * The address that the card is shipped to. + */ + address: Shipping.Address; + + /** + * Customs information for the shipment. + */ + customs?: Shipping.Customs; + + /** + * The name printed on the shipping label when shipping the card. + */ + name: string; + + /** + * Phone number of the recipient of the shipment. + */ + phone_number?: string; + + /** + * Whether a signature is required for card delivery. + */ + require_signature?: boolean; + + /** + * Shipment service. + */ + service?: Shipping.Service; + + /** + * Packaging options. + */ + type?: Shipping.Type; + } + + namespace Shipping { + interface Address { + /** + * City, district, suburb, town, or village. + */ + city: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + interface Customs { + /** + * The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. + */ + eori_number?: string; + } + + type Service = 'express' | 'priority' | 'standard'; + + type Type = 'bulk' | 'individual'; + } + + interface SpendingControls { + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + */ + allowed_categories?: Array; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + */ + blocked_categories?: Array; + + /** + * Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + */ + spending_limits?: Array; + } + + namespace SpendingControls { + type AllowedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type BlockedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + interface SpendingLimit { + /** + * Maximum amount allowed to spend per interval. + */ + amount: number; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + */ + categories?: Array; + + /** + * Interval (or event) to which the amount applies. + */ + interval: SpendingLimit.Interval; + } + + namespace SpendingLimit { + type Category = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type Interval = + | 'all_time' + | 'daily' + | 'monthly' + | 'per_authorization' + | 'weekly' + | 'yearly'; + } + } + + type Status = 'active' | 'inactive'; + + type Type = 'physical' | 'virtual'; + } + + interface CardRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CardUpdateParams { + /** + * Reason why the `status` of this card is `canceled`. + */ + cancellation_reason?: CardUpdateParams.CancellationReason; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * The desired new PIN for this card. + */ + pin?: CardUpdateParams.Pin; + + /** + * Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + */ + spending_controls?: CardUpdateParams.SpendingControls; + + /** + * Dictates whether authorizations can be approved on this card. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. + */ + status?: CardUpdateParams.Status; + } + + namespace CardUpdateParams { + type CancellationReason = 'lost' | 'stolen'; + + interface Pin { + /** + * The card's desired new PIN, encrypted under Stripe's public key. + */ + encrypted_number?: string; + } + + interface SpendingControls { + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + */ + allowed_categories?: Array; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + */ + blocked_categories?: Array; + + /** + * Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + */ + spending_limits?: Array; + } + + namespace SpendingControls { + type AllowedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type BlockedCategory = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + interface SpendingLimit { + /** + * Maximum amount allowed to spend per interval. + */ + amount: number; + + /** + * Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + */ + categories?: Array; + + /** + * Interval (or event) to which the amount applies. + */ + interval: SpendingLimit.Interval; + } + + namespace SpendingLimit { + type Category = + | 'ac_refrigeration_repair' + | 'accounting_bookkeeping_services' + | 'advertising_services' + | 'agricultural_cooperative' + | 'airlines_air_carriers' + | 'airports_flying_fields' + | 'ambulance_services' + | 'amusement_parks_carnivals' + | 'antique_reproductions' + | 'antique_shops' + | 'aquariums' + | 'architectural_surveying_services' + | 'art_dealers_and_galleries' + | 'artists_supply_and_craft_shops' + | 'auto_and_home_supply_stores' + | 'auto_body_repair_shops' + | 'auto_paint_shops' + | 'auto_service_shops' + | 'automated_cash_disburse' + | 'automated_fuel_dispensers' + | 'automobile_associations' + | 'automotive_parts_and_accessories_stores' + | 'automotive_tire_stores' + | 'bail_and_bond_payments' + | 'bakeries' + | 'bands_orchestras' + | 'barber_and_beauty_shops' + | 'betting_casino_gambling' + | 'bicycle_shops' + | 'billiard_pool_establishments' + | 'boat_dealers' + | 'boat_rentals_and_leases' + | 'book_stores' + | 'books_periodicals_and_newspapers' + | 'bowling_alleys' + | 'bus_lines' + | 'business_secretarial_schools' + | 'buying_shopping_services' + | 'cable_satellite_and_other_pay_television_and_radio' + | 'camera_and_photographic_supply_stores' + | 'candy_nut_and_confectionery_stores' + | 'car_and_truck_dealers_new_used' + | 'car_and_truck_dealers_used_only' + | 'car_rental_agencies' + | 'car_washes' + | 'carpentry_services' + | 'carpet_upholstery_cleaning' + | 'caterers' + | 'charitable_and_social_service_organizations_fundraising' + | 'chemicals_and_allied_products' + | 'child_care_services' + | 'childrens_and_infants_wear_stores' + | 'chiropodists_podiatrists' + | 'chiropractors' + | 'cigar_stores_and_stands' + | 'civic_social_fraternal_associations' + | 'cleaning_and_maintenance' + | 'clothing_rental' + | 'colleges_universities' + | 'commercial_equipment' + | 'commercial_footwear' + | 'commercial_photography_art_and_graphics' + | 'commuter_transport_and_ferries' + | 'computer_network_services' + | 'computer_programming' + | 'computer_repair' + | 'computer_software_stores' + | 'computers_peripherals_and_software' + | 'concrete_work_services' + | 'construction_materials' + | 'consulting_public_relations' + | 'correspondence_schools' + | 'cosmetic_stores' + | 'counseling_services' + | 'country_clubs' + | 'courier_services' + | 'court_costs' + | 'credit_reporting_agencies' + | 'cruise_lines' + | 'dairy_products_stores' + | 'dance_hall_studios_schools' + | 'dating_escort_services' + | 'dentists_orthodontists' + | 'department_stores' + | 'detective_agencies' + | 'digital_goods_applications' + | 'digital_goods_games' + | 'digital_goods_large_volume' + | 'digital_goods_media' + | 'direct_marketing_catalog_merchant' + | 'direct_marketing_combination_catalog_and_retail_merchant' + | 'direct_marketing_inbound_telemarketing' + | 'direct_marketing_insurance_services' + | 'direct_marketing_other' + | 'direct_marketing_outbound_telemarketing' + | 'direct_marketing_subscription' + | 'direct_marketing_travel' + | 'discount_stores' + | 'doctors' + | 'door_to_door_sales' + | 'drapery_window_covering_and_upholstery_stores' + | 'drinking_places' + | 'drug_stores_and_pharmacies' + | 'drugs_drug_proprietaries_and_druggist_sundries' + | 'dry_cleaners' + | 'durable_goods' + | 'duty_free_stores' + | 'eating_places_restaurants' + | 'educational_services' + | 'electric_razor_stores' + | 'electrical_parts_and_equipment' + | 'electrical_services' + | 'electronics_repair_shops' + | 'electronics_stores' + | 'elementary_secondary_schools' + | 'employment_temp_agencies' + | 'equipment_rental' + | 'exterminating_services' + | 'family_clothing_stores' + | 'fast_food_restaurants' + | 'financial_institutions' + | 'fines_government_administrative_entities' + | 'fireplace_fireplace_screens_and_accessories_stores' + | 'floor_covering_stores' + | 'florists' + | 'florists_supplies_nursery_stock_and_flowers' + | 'freezer_and_locker_meat_provisioners' + | 'fuel_dealers_non_automotive' + | 'funeral_services_crematories' + | 'furniture_home_furnishings_and_equipment_stores_except_appliances' + | 'furniture_repair_refinishing' + | 'furriers_and_fur_shops' + | 'general_services' + | 'gift_card_novelty_and_souvenir_shops' + | 'glass_paint_and_wallpaper_stores' + | 'glassware_crystal_stores' + | 'golf_courses_public' + | 'government_services' + | 'grocery_stores_supermarkets' + | 'hardware_equipment_and_supplies' + | 'hardware_stores' + | 'health_and_beauty_spas' + | 'hearing_aids_sales_and_supplies' + | 'heating_plumbing_a_c' + | 'hobby_toy_and_game_shops' + | 'home_supply_warehouse_stores' + | 'hospitals' + | 'hotels_motels_and_resorts' + | 'household_appliance_stores' + | 'industrial_supplies' + | 'information_retrieval_services' + | 'insurance_default' + | 'insurance_underwriting_premiums' + | 'intra_company_purchases' + | 'jewelry_stores_watches_clocks_and_silverware_stores' + | 'landscaping_services' + | 'laundries' + | 'laundry_cleaning_services' + | 'legal_services_attorneys' + | 'luggage_and_leather_goods_stores' + | 'lumber_building_materials_stores' + | 'manual_cash_disburse' + | 'marinas_service_and_supplies' + | 'masonry_stonework_and_plaster' + | 'massage_parlors' + | 'medical_and_dental_labs' + | 'medical_dental_ophthalmic_and_hospital_equipment_and_supplies' + | 'medical_services' + | 'membership_organizations' + | 'mens_and_boys_clothing_and_accessories_stores' + | 'mens_womens_clothing_stores' + | 'metal_service_centers' + | 'miscellaneous' + | 'miscellaneous_apparel_and_accessory_shops' + | 'miscellaneous_auto_dealers' + | 'miscellaneous_business_services' + | 'miscellaneous_food_stores' + | 'miscellaneous_general_merchandise' + | 'miscellaneous_general_services' + | 'miscellaneous_home_furnishing_specialty_stores' + | 'miscellaneous_publishing_and_printing' + | 'miscellaneous_recreation_services' + | 'miscellaneous_repair_shops' + | 'miscellaneous_specialty_retail' + | 'mobile_home_dealers' + | 'motion_picture_theaters' + | 'motor_freight_carriers_and_trucking' + | 'motor_homes_dealers' + | 'motor_vehicle_supplies_and_new_parts' + | 'motorcycle_shops_and_dealers' + | 'motorcycle_shops_dealers' + | 'music_stores_musical_instruments_pianos_and_sheet_music' + | 'news_dealers_and_newsstands' + | 'non_fi_money_orders' + | 'non_fi_stored_value_card_purchase_load' + | 'nondurable_goods' + | 'nurseries_lawn_and_garden_supply_stores' + | 'nursing_personal_care' + | 'office_and_commercial_furniture' + | 'opticians_eyeglasses' + | 'optometrists_ophthalmologist' + | 'orthopedic_goods_prosthetic_devices' + | 'osteopaths' + | 'package_stores_beer_wine_and_liquor' + | 'paints_varnishes_and_supplies' + | 'parking_lots_garages' + | 'passenger_railways' + | 'pawn_shops' + | 'pet_shops_pet_food_and_supplies' + | 'petroleum_and_petroleum_products' + | 'photo_developing' + | 'photographic_photocopy_microfilm_equipment_and_supplies' + | 'photographic_studios' + | 'picture_video_production' + | 'piece_goods_notions_and_other_dry_goods' + | 'plumbing_heating_equipment_and_supplies' + | 'political_organizations' + | 'postal_services_government_only' + | 'precious_stones_and_metals_watches_and_jewelry' + | 'professional_services' + | 'public_warehousing_and_storage' + | 'quick_copy_repro_and_blueprint' + | 'railroads' + | 'real_estate_agents_and_managers_rentals' + | 'record_stores' + | 'recreational_vehicle_rentals' + | 'religious_goods_stores' + | 'religious_organizations' + | 'roofing_siding_sheet_metal' + | 'secretarial_support_services' + | 'security_brokers_dealers' + | 'service_stations' + | 'sewing_needlework_fabric_and_piece_goods_stores' + | 'shoe_repair_hat_cleaning' + | 'shoe_stores' + | 'small_appliance_repair' + | 'snowmobile_dealers' + | 'special_trade_services' + | 'specialty_cleaning' + | 'sporting_goods_stores' + | 'sporting_recreation_camps' + | 'sports_and_riding_apparel_stores' + | 'sports_clubs_fields' + | 'stamp_and_coin_stores' + | 'stationary_office_supplies_printing_and_writing_paper' + | 'stationery_stores_office_and_school_supply_stores' + | 'swimming_pools_sales' + | 't_ui_travel_germany' + | 'tailors_alterations' + | 'tax_payments_government_agencies' + | 'tax_preparation_services' + | 'taxicabs_limousines' + | 'telecommunication_equipment_and_telephone_sales' + | 'telecommunication_services' + | 'telegraph_services' + | 'tent_and_awning_shops' + | 'testing_laboratories' + | 'theatrical_ticket_agencies' + | 'timeshares' + | 'tire_retreading_and_repair' + | 'tolls_bridge_fees' + | 'tourist_attractions_and_exhibits' + | 'towing_services' + | 'trailer_parks_campgrounds' + | 'transportation_services' + | 'travel_agencies_tour_operators' + | 'truck_stop_iteration' + | 'truck_utility_trailer_rentals' + | 'typesetting_plate_making_and_related_services' + | 'typewriter_stores' + | 'u_s_federal_government_agencies_or_departments' + | 'uniforms_commercial_clothing' + | 'used_merchandise_and_secondhand_stores' + | 'utilities' + | 'variety_stores' + | 'veterinary_services' + | 'video_amusement_game_supplies' + | 'video_game_arcades' + | 'video_tape_rental_stores' + | 'vocational_trade_schools' + | 'watch_jewelry_repair' + | 'welding_repair' + | 'wholesale_clubs' + | 'wig_and_toupee_stores' + | 'wires_money_orders' + | 'womens_accessory_and_specialty_shops' + | 'womens_ready_to_wear_stores' + | 'wrecking_and_salvage_yards'; + + type Interval = + | 'all_time' + | 'daily' + | 'monthly' + | 'per_authorization' + | 'weekly' + | 'yearly'; + } + } + + type Status = 'active' | 'canceled' | 'inactive'; + } + + interface CardListParams extends PaginationParams { + /** + * Only return cards belonging to the Cardholder with the provided ID. + */ + cardholder?: string; + + /** + * Only return cards that were issued during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return cards that have the given expiration month. + */ + exp_month?: number; + + /** + * Only return cards that have the given expiration year. + */ + exp_year?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return cards that have the given last four digits. + */ + last4?: string; + + /** + * Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. + */ + status?: CardListParams.Status; + + /** + * Only return cards that have the given type. One of `virtual` or `physical`. + */ + type?: CardListParams.Type; + } + + namespace CardListParams { + type Status = 'active' | 'canceled' | 'inactive'; + + type Type = 'physical' | 'virtual'; + } + + class CardsResource { + /** + * Creates an Issuing Card object. + */ + create( + params: CardCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves an Issuing Card object. + */ + retrieve( + id: string, + params?: CardRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: CardUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: CardListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Issuing/Disputes.d.ts b/types/2022-11-15/Issuing/Disputes.d.ts index b9c491ef36..753076ba23 100644 --- a/types/2022-11-15/Issuing/Disputes.d.ts +++ b/types/2022-11-15/Issuing/Disputes.d.ts @@ -336,735 +336,6 @@ declare module 'stripe' { received_debit: string; } } - - interface DisputeCreateParams { - /** - * The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. - */ - amount?: number; - - /** - * Evidence provided for the dispute. - */ - evidence?: DisputeCreateParams.Evidence; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. - */ - transaction?: string; - - /** - * Params for disputes related to Treasury FinancialAccounts - */ - treasury?: DisputeCreateParams.Treasury; - } - - namespace DisputeCreateParams { - interface Evidence { - /** - * Evidence provided when `reason` is 'canceled'. - */ - canceled?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'duplicate'. - */ - duplicate?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'fraudulent'. - */ - fraudulent?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'merchandise_not_as_described'. - */ - merchandise_not_as_described?: Stripe.Emptyable< - Evidence.MerchandiseNotAsDescribed - >; - - /** - * Evidence provided when `reason` is 'not_received'. - */ - not_received?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'other'. - */ - other?: Stripe.Emptyable; - - /** - * The reason for filing the dispute. The evidence should be submitted in the field of the same name. - */ - reason?: Evidence.Reason; - - /** - * Evidence provided when `reason` is 'service_not_as_described'. - */ - service_not_as_described?: Stripe.Emptyable< - Evidence.ServiceNotAsDescribed - >; - } - - namespace Evidence { - interface Canceled { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when order was canceled. - */ - canceled_at?: Stripe.Emptyable; - - /** - * Whether the cardholder was provided with a cancellation policy. - */ - cancellation_policy_provided?: Stripe.Emptyable; - - /** - * Reason for canceling the order. - */ - cancellation_reason?: string; - - /** - * Date when the cardholder expected to receive the product. - */ - expected_at?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - - /** - * Result of cardholder's attempt to return the product. - */ - return_status?: Stripe.Emptyable; - - /** - * Date when the product was returned or attempted to be returned. - */ - returned_at?: Stripe.Emptyable; - } - - namespace Canceled { - type ProductType = 'merchandise' | 'service'; - - type ReturnStatus = 'merchant_rejected' | 'successful'; - } - - interface Duplicate { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. - */ - card_statement?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. - */ - cash_receipt?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. - */ - check_image?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. - */ - original_transaction?: string; - } - - interface Fraudulent { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - } - - interface MerchandiseNotAsDescribed { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Date when the product was received. - */ - received_at?: Stripe.Emptyable; - - /** - * Description of the cardholder's attempt to return the product. - */ - return_description?: string; - - /** - * Result of cardholder's attempt to return the product. - */ - return_status?: Stripe.Emptyable< - MerchandiseNotAsDescribed.ReturnStatus - >; - - /** - * Date when the product was returned or attempted to be returned. - */ - returned_at?: Stripe.Emptyable; - } - - namespace MerchandiseNotAsDescribed { - type ReturnStatus = 'merchant_rejected' | 'successful'; - } - - interface NotReceived { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when the cardholder expected to receive the product. - */ - expected_at?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - } - - namespace NotReceived { - type ProductType = 'merchandise' | 'service'; - } - - interface Other { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - } - - namespace Other { - type ProductType = 'merchandise' | 'service'; - } - - type Reason = - | 'canceled' - | 'duplicate' - | 'fraudulent' - | 'merchandise_not_as_described' - | 'not_received' - | 'other' - | 'service_not_as_described'; - - interface ServiceNotAsDescribed { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when order was canceled. - */ - canceled_at?: Stripe.Emptyable; - - /** - * Reason for canceling the order. - */ - cancellation_reason?: string; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Date when the product was received. - */ - received_at?: Stripe.Emptyable; - } - } - - interface Treasury { - /** - * The ID of the ReceivedDebit to initiate an Issuings dispute for. - */ - received_debit: string; - } - } - - interface DisputeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface DisputeUpdateParams { - /** - * The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - */ - amount?: number; - - /** - * Evidence provided for the dispute. - */ - evidence?: DisputeUpdateParams.Evidence; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - namespace DisputeUpdateParams { - interface Evidence { - /** - * Evidence provided when `reason` is 'canceled'. - */ - canceled?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'duplicate'. - */ - duplicate?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'fraudulent'. - */ - fraudulent?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'merchandise_not_as_described'. - */ - merchandise_not_as_described?: Stripe.Emptyable< - Evidence.MerchandiseNotAsDescribed - >; - - /** - * Evidence provided when `reason` is 'not_received'. - */ - not_received?: Stripe.Emptyable; - - /** - * Evidence provided when `reason` is 'other'. - */ - other?: Stripe.Emptyable; - - /** - * The reason for filing the dispute. The evidence should be submitted in the field of the same name. - */ - reason?: Evidence.Reason; - - /** - * Evidence provided when `reason` is 'service_not_as_described'. - */ - service_not_as_described?: Stripe.Emptyable< - Evidence.ServiceNotAsDescribed - >; - } - - namespace Evidence { - interface Canceled { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when order was canceled. - */ - canceled_at?: Stripe.Emptyable; - - /** - * Whether the cardholder was provided with a cancellation policy. - */ - cancellation_policy_provided?: Stripe.Emptyable; - - /** - * Reason for canceling the order. - */ - cancellation_reason?: string; - - /** - * Date when the cardholder expected to receive the product. - */ - expected_at?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - - /** - * Result of cardholder's attempt to return the product. - */ - return_status?: Stripe.Emptyable; - - /** - * Date when the product was returned or attempted to be returned. - */ - returned_at?: Stripe.Emptyable; - } - - namespace Canceled { - type ProductType = 'merchandise' | 'service'; - - type ReturnStatus = 'merchant_rejected' | 'successful'; - } - - interface Duplicate { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. - */ - card_statement?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. - */ - cash_receipt?: Stripe.Emptyable; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. - */ - check_image?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. - */ - original_transaction?: string; - } - - interface Fraudulent { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - } - - interface MerchandiseNotAsDescribed { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Date when the product was received. - */ - received_at?: Stripe.Emptyable; - - /** - * Description of the cardholder's attempt to return the product. - */ - return_description?: string; - - /** - * Result of cardholder's attempt to return the product. - */ - return_status?: Stripe.Emptyable< - MerchandiseNotAsDescribed.ReturnStatus - >; - - /** - * Date when the product was returned or attempted to be returned. - */ - returned_at?: Stripe.Emptyable; - } - - namespace MerchandiseNotAsDescribed { - type ReturnStatus = 'merchant_rejected' | 'successful'; - } - - interface NotReceived { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when the cardholder expected to receive the product. - */ - expected_at?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - } - - namespace NotReceived { - type ProductType = 'merchandise' | 'service'; - } - - interface Other { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Description of the merchandise or service that was purchased. - */ - product_description?: string; - - /** - * Whether the product was a merchandise or service. - */ - product_type?: Stripe.Emptyable; - } - - namespace Other { - type ProductType = 'merchandise' | 'service'; - } - - type Reason = - | 'canceled' - | 'duplicate' - | 'fraudulent' - | 'merchandise_not_as_described' - | 'not_received' - | 'other' - | 'service_not_as_described'; - - interface ServiceNotAsDescribed { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - */ - additional_documentation?: Stripe.Emptyable; - - /** - * Date when order was canceled. - */ - canceled_at?: Stripe.Emptyable; - - /** - * Reason for canceling the order. - */ - cancellation_reason?: string; - - /** - * Explanation of why the cardholder is disputing this transaction. - */ - explanation?: string; - - /** - * Date when the product was received. - */ - received_at?: Stripe.Emptyable; - } - } - } - - interface DisputeListParams extends PaginationParams { - /** - * Select Issuing disputes that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Select Issuing disputes with the given status. - */ - status?: DisputeListParams.Status; - - /** - * Select the Issuing dispute for the given transaction. - */ - transaction?: string; - } - - namespace DisputeListParams { - type Status = 'expired' | 'lost' | 'submitted' | 'unsubmitted' | 'won'; - } - - interface DisputeSubmitParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - class DisputesResource { - /** - * Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. - */ - create( - params?: DisputeCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves an Issuing Dispute object. - */ - retrieve( - id: string, - params?: DisputeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. - */ - update( - id: string, - params?: DisputeUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: DisputeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). - */ - submit( - id: string, - params?: DisputeSubmitParams, - options?: RequestOptions - ): Promise>; - submit( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Issuing/DisputesResource.d.ts b/types/2022-11-15/Issuing/DisputesResource.d.ts new file mode 100644 index 0000000000..91bc308980 --- /dev/null +++ b/types/2022-11-15/Issuing/DisputesResource.d.ts @@ -0,0 +1,736 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Issuing { + interface DisputeCreateParams { + /** + * The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. + */ + amount?: number; + + /** + * Evidence provided for the dispute. + */ + evidence?: DisputeCreateParams.Evidence; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. + */ + transaction?: string; + + /** + * Params for disputes related to Treasury FinancialAccounts + */ + treasury?: DisputeCreateParams.Treasury; + } + + namespace DisputeCreateParams { + interface Evidence { + /** + * Evidence provided when `reason` is 'canceled'. + */ + canceled?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'duplicate'. + */ + duplicate?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'fraudulent'. + */ + fraudulent?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'merchandise_not_as_described'. + */ + merchandise_not_as_described?: Stripe.Emptyable< + Evidence.MerchandiseNotAsDescribed + >; + + /** + * Evidence provided when `reason` is 'not_received'. + */ + not_received?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'other'. + */ + other?: Stripe.Emptyable; + + /** + * The reason for filing the dispute. The evidence should be submitted in the field of the same name. + */ + reason?: Evidence.Reason; + + /** + * Evidence provided when `reason` is 'service_not_as_described'. + */ + service_not_as_described?: Stripe.Emptyable< + Evidence.ServiceNotAsDescribed + >; + } + + namespace Evidence { + interface Canceled { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when order was canceled. + */ + canceled_at?: Stripe.Emptyable; + + /** + * Whether the cardholder was provided with a cancellation policy. + */ + cancellation_policy_provided?: Stripe.Emptyable; + + /** + * Reason for canceling the order. + */ + cancellation_reason?: string; + + /** + * Date when the cardholder expected to receive the product. + */ + expected_at?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + + /** + * Result of cardholder's attempt to return the product. + */ + return_status?: Stripe.Emptyable; + + /** + * Date when the product was returned or attempted to be returned. + */ + returned_at?: Stripe.Emptyable; + } + + namespace Canceled { + type ProductType = 'merchandise' | 'service'; + + type ReturnStatus = 'merchant_rejected' | 'successful'; + } + + interface Duplicate { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + */ + card_statement?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + */ + cash_receipt?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + */ + check_image?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. + */ + original_transaction?: string; + } + + interface Fraudulent { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + } + + interface MerchandiseNotAsDescribed { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Date when the product was received. + */ + received_at?: Stripe.Emptyable; + + /** + * Description of the cardholder's attempt to return the product. + */ + return_description?: string; + + /** + * Result of cardholder's attempt to return the product. + */ + return_status?: Stripe.Emptyable< + MerchandiseNotAsDescribed.ReturnStatus + >; + + /** + * Date when the product was returned or attempted to be returned. + */ + returned_at?: Stripe.Emptyable; + } + + namespace MerchandiseNotAsDescribed { + type ReturnStatus = 'merchant_rejected' | 'successful'; + } + + interface NotReceived { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when the cardholder expected to receive the product. + */ + expected_at?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + } + + namespace NotReceived { + type ProductType = 'merchandise' | 'service'; + } + + interface Other { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + } + + namespace Other { + type ProductType = 'merchandise' | 'service'; + } + + type Reason = + | 'canceled' + | 'duplicate' + | 'fraudulent' + | 'merchandise_not_as_described' + | 'not_received' + | 'other' + | 'service_not_as_described'; + + interface ServiceNotAsDescribed { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when order was canceled. + */ + canceled_at?: Stripe.Emptyable; + + /** + * Reason for canceling the order. + */ + cancellation_reason?: string; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Date when the product was received. + */ + received_at?: Stripe.Emptyable; + } + } + + interface Treasury { + /** + * The ID of the ReceivedDebit to initiate an Issuings dispute for. + */ + received_debit: string; + } + } + + interface DisputeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface DisputeUpdateParams { + /** + * The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + */ + amount?: number; + + /** + * Evidence provided for the dispute. + */ + evidence?: DisputeUpdateParams.Evidence; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + namespace DisputeUpdateParams { + interface Evidence { + /** + * Evidence provided when `reason` is 'canceled'. + */ + canceled?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'duplicate'. + */ + duplicate?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'fraudulent'. + */ + fraudulent?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'merchandise_not_as_described'. + */ + merchandise_not_as_described?: Stripe.Emptyable< + Evidence.MerchandiseNotAsDescribed + >; + + /** + * Evidence provided when `reason` is 'not_received'. + */ + not_received?: Stripe.Emptyable; + + /** + * Evidence provided when `reason` is 'other'. + */ + other?: Stripe.Emptyable; + + /** + * The reason for filing the dispute. The evidence should be submitted in the field of the same name. + */ + reason?: Evidence.Reason; + + /** + * Evidence provided when `reason` is 'service_not_as_described'. + */ + service_not_as_described?: Stripe.Emptyable< + Evidence.ServiceNotAsDescribed + >; + } + + namespace Evidence { + interface Canceled { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when order was canceled. + */ + canceled_at?: Stripe.Emptyable; + + /** + * Whether the cardholder was provided with a cancellation policy. + */ + cancellation_policy_provided?: Stripe.Emptyable; + + /** + * Reason for canceling the order. + */ + cancellation_reason?: string; + + /** + * Date when the cardholder expected to receive the product. + */ + expected_at?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + + /** + * Result of cardholder's attempt to return the product. + */ + return_status?: Stripe.Emptyable; + + /** + * Date when the product was returned or attempted to be returned. + */ + returned_at?: Stripe.Emptyable; + } + + namespace Canceled { + type ProductType = 'merchandise' | 'service'; + + type ReturnStatus = 'merchant_rejected' | 'successful'; + } + + interface Duplicate { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + */ + card_statement?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + */ + cash_receipt?: Stripe.Emptyable; + + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + */ + check_image?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. + */ + original_transaction?: string; + } + + interface Fraudulent { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + } + + interface MerchandiseNotAsDescribed { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Date when the product was received. + */ + received_at?: Stripe.Emptyable; + + /** + * Description of the cardholder's attempt to return the product. + */ + return_description?: string; + + /** + * Result of cardholder's attempt to return the product. + */ + return_status?: Stripe.Emptyable< + MerchandiseNotAsDescribed.ReturnStatus + >; + + /** + * Date when the product was returned or attempted to be returned. + */ + returned_at?: Stripe.Emptyable; + } + + namespace MerchandiseNotAsDescribed { + type ReturnStatus = 'merchant_rejected' | 'successful'; + } + + interface NotReceived { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when the cardholder expected to receive the product. + */ + expected_at?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + } + + namespace NotReceived { + type ProductType = 'merchandise' | 'service'; + } + + interface Other { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Description of the merchandise or service that was purchased. + */ + product_description?: string; + + /** + * Whether the product was a merchandise or service. + */ + product_type?: Stripe.Emptyable; + } + + namespace Other { + type ProductType = 'merchandise' | 'service'; + } + + type Reason = + | 'canceled' + | 'duplicate' + | 'fraudulent' + | 'merchandise_not_as_described' + | 'not_received' + | 'other' + | 'service_not_as_described'; + + interface ServiceNotAsDescribed { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + */ + additional_documentation?: Stripe.Emptyable; + + /** + * Date when order was canceled. + */ + canceled_at?: Stripe.Emptyable; + + /** + * Reason for canceling the order. + */ + cancellation_reason?: string; + + /** + * Explanation of why the cardholder is disputing this transaction. + */ + explanation?: string; + + /** + * Date when the product was received. + */ + received_at?: Stripe.Emptyable; + } + } + } + + interface DisputeListParams extends PaginationParams { + /** + * Select Issuing disputes that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Select Issuing disputes with the given status. + */ + status?: DisputeListParams.Status; + + /** + * Select the Issuing dispute for the given transaction. + */ + transaction?: string; + } + + namespace DisputeListParams { + type Status = 'expired' | 'lost' | 'submitted' | 'unsubmitted' | 'won'; + } + + interface DisputeSubmitParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + class DisputesResource { + /** + * Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. + */ + create( + params?: DisputeCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves an Issuing Dispute object. + */ + retrieve( + id: string, + params?: DisputeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. + */ + update( + id: string, + params?: DisputeUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: DisputeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + */ + submit( + id: string, + params?: DisputeSubmitParams, + options?: RequestOptions + ): Promise>; + submit( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Issuing/Transactions.d.ts b/types/2022-11-15/Issuing/Transactions.d.ts index 5ae4f3de17..a891943e44 100644 --- a/types/2022-11-15/Issuing/Transactions.d.ts +++ b/types/2022-11-15/Issuing/Transactions.d.ts @@ -321,91 +321,6 @@ declare module 'stripe' { type Wallet = 'apple_pay' | 'google_pay' | 'samsung_pay'; } - - interface TransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransactionUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TransactionListParams extends PaginationParams { - /** - * Only return transactions that belong to the given card. - */ - card?: string; - - /** - * Only return transactions that belong to the given cardholder. - */ - cardholder?: string; - - /** - * Only return transactions that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return transactions that have the given type. One of `capture` or `refund`. - */ - type?: TransactionListParams.Type; - } - - namespace TransactionListParams { - type Type = 'capture' | 'refund'; - } - - class TransactionsResource { - /** - * Retrieves an Issuing Transaction object. - */ - retrieve( - id: string, - params?: TransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: TransactionUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: TransactionListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Issuing/TransactionsResource.d.ts b/types/2022-11-15/Issuing/TransactionsResource.d.ts new file mode 100644 index 0000000000..81096a9098 --- /dev/null +++ b/types/2022-11-15/Issuing/TransactionsResource.d.ts @@ -0,0 +1,92 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Issuing { + interface TransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TransactionListParams extends PaginationParams { + /** + * Only return transactions that belong to the given card. + */ + card?: string; + + /** + * Only return transactions that belong to the given cardholder. + */ + cardholder?: string; + + /** + * Only return transactions that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return transactions that have the given type. One of `capture` or `refund`. + */ + type?: TransactionListParams.Type; + } + + namespace TransactionListParams { + type Type = 'capture' | 'refund'; + } + + class TransactionsResource { + /** + * Retrieves an Issuing Transaction object. + */ + retrieve( + id: string, + params?: TransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: TransactionUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: TransactionListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/LoginLinks.d.ts b/types/2022-11-15/LoginLinks.d.ts index 18dc53e370..7314518eb1 100644 --- a/types/2022-11-15/LoginLinks.d.ts +++ b/types/2022-11-15/LoginLinks.d.ts @@ -21,12 +21,5 @@ declare module 'stripe' { */ url: string; } - - interface LoginLinkCreateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/LoginLinksResource.d.ts b/types/2022-11-15/LoginLinksResource.d.ts new file mode 100644 index 0000000000..3d676d3f02 --- /dev/null +++ b/types/2022-11-15/LoginLinksResource.d.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface LoginLinkCreateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/Mandates.d.ts b/types/2022-11-15/Mandates.d.ts index b130576b95..35857a315e 100644 --- a/types/2022-11-15/Mandates.d.ts +++ b/types/2022-11-15/Mandates.d.ts @@ -243,27 +243,5 @@ declare module 'stripe' { type Type = 'multi_use' | 'single_use'; } - - interface MandateRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class MandatesResource { - /** - * Retrieves a Mandate object. - */ - retrieve( - id: string, - params?: MandateRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/MandatesResource.d.ts b/types/2022-11-15/MandatesResource.d.ts new file mode 100644 index 0000000000..934482b66c --- /dev/null +++ b/types/2022-11-15/MandatesResource.d.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface MandateRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class MandatesResource { + /** + * Retrieves a Mandate object. + */ + retrieve( + id: string, + params?: MandateRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/PaymentIntents.d.ts b/types/2022-11-15/PaymentIntents.d.ts index 5e3cef4340..079bac0a14 100644 --- a/types/2022-11-15/PaymentIntents.d.ts +++ b/types/2022-11-15/PaymentIntents.d.ts @@ -1811,5775 +1811,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - interface PaymentIntentCreateParams { - /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount: 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; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount?: number; - - /** - * When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters. - */ - automatic_payment_methods?: PaymentIntentCreateParams.AutomaticPaymentMethods; - - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: PaymentIntentCreateParams.CaptureMethod; - - /** - * Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided. - */ - confirm?: boolean; - - confirmation_method?: PaymentIntentCreateParams.ConfirmationMethod; - - /** - * ID of the Customer this PaymentIntent belongs to, if one exists. - * - * Payment methods attached to other Customers cannot be used with this PaymentIntent. - * - * If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - */ - error_on_requires_action?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * ID of the mandate to be used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - */ - mandate?: string; - - /** - * This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - */ - mandate_data?: PaymentIntentCreateParams.MandateData; - - /** - * 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.MetadataParam; - - /** - * Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - */ - off_session?: boolean | PaymentIntentCreateParams.OffSession; - - /** - * The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - on_behalf_of?: string; - - /** - * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. - * - * If neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward. - */ - payment_method?: string; - - /** - * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - * property on the PaymentIntent. - */ - payment_method_data?: PaymentIntentCreateParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this PaymentIntent. - */ - payment_method_options?: PaymentIntentCreateParams.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"]. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentIntentCreateParams.RadarOptions; - - /** - * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email?: string; - - /** - * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - */ - return_url?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: PaymentIntentCreateParams.SetupFutureUsage; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: PaymentIntentCreateParams.Shipping; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * The parameters used to automatically create a Transfer when the payment succeeds. - * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - transfer_data?: PaymentIntentCreateParams.TransferData; - - /** - * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - transfer_group?: string; - - /** - * Set to `true` only when using manual confirmation and the iOS or Android SDKs to handle additional authentication steps. - */ - use_stripe_sdk?: boolean; - } - - namespace PaymentIntentCreateParams { - interface AutomaticPaymentMethods { - /** - * Whether this feature is enabled. - */ - enabled: boolean; - } - - type CaptureMethod = 'automatic' | 'manual'; - - type ConfirmationMethod = 'automatic' | 'manual'; - - interface MandateData { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData.CustomerAcceptance; - } - - namespace MandateData { - interface CustomerAcceptance { - /** - * The time at which the customer accepted the Mandate. - */ - accepted_at?: number; - - /** - * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - */ - offline?: CustomerAcceptance.Offline; - - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online?: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. - */ - type: CustomerAcceptance.Type; - } - - namespace CustomerAcceptance { - interface Offline {} - - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent: string; - } - - type Type = 'offline' | 'online'; - } - } - - type OffSession = 'one_off' | 'recurring'; - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - */ - affirm?: Stripe.Emptyable; - - /** - * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - */ - afterpay_clearpay?: Stripe.Emptyable< - PaymentMethodOptions.AfterpayClearpay - >; - - /** - * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - */ - alipay?: Stripe.Emptyable; - - /** - * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - */ - au_becs_debit?: Stripe.Emptyable; - - /** - * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - */ - bacs_debit?: Stripe.Emptyable; - - /** - * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - */ - bancontact?: Stripe.Emptyable; - - /** - * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - */ - blik?: Stripe.Emptyable; - - /** - * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - */ - boleto?: Stripe.Emptyable; - - /** - * Configuration for any card payments attempted on this PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - card_present?: Stripe.Emptyable; - - /** - * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - */ - eps?: Stripe.Emptyable; - - /** - * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - */ - fpx?: Stripe.Emptyable; - - /** - * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - */ - giropay?: Stripe.Emptyable; - - /** - * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - */ - grabpay?: Stripe.Emptyable; - - /** - * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - */ - ideal?: Stripe.Emptyable; - - /** - * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - interac_present?: Stripe.Emptyable; - - /** - * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - */ - klarna?: Stripe.Emptyable; - - /** - * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - */ - konbini?: Stripe.Emptyable; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: Stripe.Emptyable; - - /** - * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - */ - oxxo?: Stripe.Emptyable; - - /** - * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - */ - p24?: Stripe.Emptyable; - - /** - * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - */ - paynow?: Stripe.Emptyable; - - /** - * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - */ - pix?: Stripe.Emptyable; - - /** - * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - */ - promptpay?: Stripe.Emptyable; - - /** - * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: Stripe.Emptyable; - - /** - * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - */ - sofort?: Stripe.Emptyable; - - /** - * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: Stripe.Emptyable; - - /** - * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - */ - wechat_pay?: Stripe.Emptyable; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Affirm { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface AuBecsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace AuBecsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface BacsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace BacsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Boleto { - /** - * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Boleto { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. - */ - cvc_token?: string; - - /** - * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments?: Card.Installments; - - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter indicates that a transaction will be marked - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - */ - statement_descriptor_suffix_kana?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - */ - statement_descriptor_suffix_kanji?: Stripe.Emptyable; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this PaymentIntent. - * This will cause the response to contain a list of available installment plans. - * Setting to false will prevent any selected plan from applying to a charge. - */ - enabled?: boolean; - - /** - * The selected installment plan to use for this payment attempt. - * This parameter can only be provided during confirmation. - */ - plan?: Stripe.Emptyable; - } - - namespace Installments { - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month'; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CardPresent { - /** - * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) - */ - request_extended_authorization?: boolean; - - /** - * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - */ - request_incremental_authorization_support?: boolean; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Eps { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Fpx { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Giropay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Grabpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Konbini { - /** - * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. - */ - confirmation_number?: string; - - /** - * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. - */ - expires_after_days?: Stripe.Emptyable; - - /** - * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. - */ - expires_at?: Stripe.Emptyable; - - /** - * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - */ - product_description?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface Paynow { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Pix { - /** - * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. - */ - expires_after_seconds?: number; - - /** - * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. - */ - expires_at?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Promptpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - type SetupFutureUsage = 'off_session' | 'on_session'; - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.AddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - * The amount is capped at the total transaction amount and if no amount is set, - * the full amount is transferred. - * - * If you intend to collect a fee and you need a more robust reporting experience, using - * [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) - * might be a better fit for your integration. - */ - amount?: number; - - /** - * If specified, successful charges will be attributed to the destination - * account for tax reporting, and the funds from charges will be transferred - * to the destination account. The ID of the resulting transfer will be - * returned on the successful charge's `transfer` field. - */ - destination: string; - } - } - - interface PaymentIntentRetrieveParams { - /** - * The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source. - */ - client_secret?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentIntentUpdateParams { - /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount?: number; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount?: Stripe.Emptyable; - - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: PaymentIntentUpdateParams.CaptureMethod; - - /** - * 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 Customer this PaymentIntent belongs to, if one exists. - * - * Payment methods attached to other Customers cannot be used with this PaymentIntent. - * - * If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - */ - payment_method?: string; - - /** - * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - * property on the PaymentIntent. - */ - payment_method_data?: PaymentIntentUpdateParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this PaymentIntent. - */ - payment_method_options?: PaymentIntentUpdateParams.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - PaymentIntentUpdateParams.SetupFutureUsage - >; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: Stripe.Emptyable; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - transfer_data?: PaymentIntentUpdateParams.TransferData; - - /** - * A string that identifies the resulting payment as part of a group. `transfer_group` may only be provided if it has not been set. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - transfer_group?: string; - } - - namespace PaymentIntentUpdateParams { - type CaptureMethod = 'automatic' | 'manual'; - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - */ - affirm?: Stripe.Emptyable; - - /** - * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - */ - afterpay_clearpay?: Stripe.Emptyable< - PaymentMethodOptions.AfterpayClearpay - >; - - /** - * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - */ - alipay?: Stripe.Emptyable; - - /** - * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - */ - au_becs_debit?: Stripe.Emptyable; - - /** - * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - */ - bacs_debit?: Stripe.Emptyable; - - /** - * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - */ - bancontact?: Stripe.Emptyable; - - /** - * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - */ - blik?: Stripe.Emptyable; - - /** - * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - */ - boleto?: Stripe.Emptyable; - - /** - * Configuration for any card payments attempted on this PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - card_present?: Stripe.Emptyable; - - /** - * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - */ - eps?: Stripe.Emptyable; - - /** - * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - */ - fpx?: Stripe.Emptyable; - - /** - * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - */ - giropay?: Stripe.Emptyable; - - /** - * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - */ - grabpay?: Stripe.Emptyable; - - /** - * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - */ - ideal?: Stripe.Emptyable; - - /** - * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - interac_present?: Stripe.Emptyable; - - /** - * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - */ - klarna?: Stripe.Emptyable; - - /** - * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - */ - konbini?: Stripe.Emptyable; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: Stripe.Emptyable; - - /** - * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - */ - oxxo?: Stripe.Emptyable; - - /** - * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - */ - p24?: Stripe.Emptyable; - - /** - * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - */ - paynow?: Stripe.Emptyable; - - /** - * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - */ - pix?: Stripe.Emptyable; - - /** - * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - */ - promptpay?: Stripe.Emptyable; - - /** - * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: Stripe.Emptyable; - - /** - * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - */ - sofort?: Stripe.Emptyable; - - /** - * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: Stripe.Emptyable; - - /** - * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - */ - wechat_pay?: Stripe.Emptyable; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Affirm { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface AuBecsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace AuBecsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface BacsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace BacsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Boleto { - /** - * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Boleto { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. - */ - cvc_token?: string; - - /** - * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments?: Card.Installments; - - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter indicates that a transaction will be marked - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - */ - statement_descriptor_suffix_kana?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - */ - statement_descriptor_suffix_kanji?: Stripe.Emptyable; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this PaymentIntent. - * This will cause the response to contain a list of available installment plans. - * Setting to false will prevent any selected plan from applying to a charge. - */ - enabled?: boolean; - - /** - * The selected installment plan to use for this payment attempt. - * This parameter can only be provided during confirmation. - */ - plan?: Stripe.Emptyable; - } - - namespace Installments { - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month'; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CardPresent { - /** - * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) - */ - request_extended_authorization?: boolean; - - /** - * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - */ - request_incremental_authorization_support?: boolean; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Eps { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Fpx { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Giropay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Grabpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Konbini { - /** - * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. - */ - confirmation_number?: string; - - /** - * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. - */ - expires_after_days?: Stripe.Emptyable; - - /** - * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. - */ - expires_at?: Stripe.Emptyable; - - /** - * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - */ - product_description?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface Paynow { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Pix { - /** - * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. - */ - expires_after_seconds?: number; - - /** - * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. - */ - expires_at?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Promptpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type SetupFutureUsage = 'off_session' | 'on_session'; - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.AddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - */ - amount?: number; - } - } - - interface PaymentIntentListParams 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return PaymentIntents for the customer specified by this customer ID. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentIntentApplyCustomerBalanceParams { - /** - * Amount intended to be applied to this PaymentIntent from the customer's cash balance. - * - * A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - * - * The maximum amount is the amount of the PaymentIntent. - * - * When omitted, the amount defaults to the remaining amount requested on the PaymentIntent. - */ - amount?: 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; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentIntentCancelParams { - /** - * Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` - */ - cancellation_reason?: PaymentIntentCancelParams.CancellationReason; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace PaymentIntentCancelParams { - type CancellationReason = - | 'abandoned' - | 'duplicate' - | 'fraudulent' - | 'requested_by_customer'; - } - - interface PaymentIntentCaptureParams { - /** - * The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. - */ - amount_to_capture?: number; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * The parameters used to automatically create a Transfer when the payment - * is captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - transfer_data?: PaymentIntentCaptureParams.TransferData; - } - - namespace PaymentIntentCaptureParams { - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - */ - amount?: number; - } - } - - interface PaymentIntentConfirmParams { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: PaymentIntentConfirmParams.CaptureMethod; - - /** - * Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). - */ - error_on_requires_action?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * ID of the mandate to be used for this payment. - */ - mandate?: string; - - /** - * This hash contains details about the Mandate to create - */ - mandate_data?: - | PaymentIntentConfirmParams.MandateData1 - | PaymentIntentConfirmParams.MandateData2; - - /** - * Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). - */ - off_session?: boolean | PaymentIntentConfirmParams.OffSession; - - /** - * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - */ - payment_method?: string; - - /** - * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear - * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) - * property on the PaymentIntent. - */ - payment_method_data?: PaymentIntentConfirmParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this PaymentIntent. - */ - payment_method_options?: PaymentIntentConfirmParams.PaymentMethodOptions; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentIntentConfirmParams.RadarOptions; - - /** - * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email?: Stripe.Emptyable; - - /** - * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - * This parameter is only used for cards and other redirect-based payment methods. - */ - return_url?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - PaymentIntentConfirmParams.SetupFutureUsage - >; - - /** - * Shipping information for this PaymentIntent. - */ - shipping?: Stripe.Emptyable; - - /** - * Set to `true` only when using manual confirmation and the iOS or Android SDKs to handle additional authentication steps. - */ - use_stripe_sdk?: boolean; - } - - namespace PaymentIntentConfirmParams { - type CaptureMethod = 'automatic' | 'manual'; - - interface MandateData1 { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData1.CustomerAcceptance; - } - - namespace MandateData1 { - interface CustomerAcceptance { - /** - * The time at which the customer accepted the Mandate. - */ - accepted_at?: number; - - /** - * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - */ - offline?: CustomerAcceptance.Offline; - - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online?: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. - */ - type: CustomerAcceptance.Type; - } - - namespace CustomerAcceptance { - interface Offline {} - - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent: string; - } - - type Type = 'offline' | 'online'; - } - } - - interface MandateData2 { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData2.CustomerAcceptance; - } - - namespace MandateData2 { - interface CustomerAcceptance { - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. - */ - type: 'online'; - } - - namespace CustomerAcceptance { - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address?: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent?: string; - } - } - } - - type OffSession = 'one_off' | 'recurring'; - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - */ - affirm?: Stripe.Emptyable; - - /** - * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - */ - afterpay_clearpay?: Stripe.Emptyable< - PaymentMethodOptions.AfterpayClearpay - >; - - /** - * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - */ - alipay?: Stripe.Emptyable; - - /** - * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - */ - au_becs_debit?: Stripe.Emptyable; - - /** - * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - */ - bacs_debit?: Stripe.Emptyable; - - /** - * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - */ - bancontact?: Stripe.Emptyable; - - /** - * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - */ - blik?: Stripe.Emptyable; - - /** - * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - */ - boleto?: Stripe.Emptyable; - - /** - * Configuration for any card payments attempted on this PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - card_present?: Stripe.Emptyable; - - /** - * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - */ - eps?: Stripe.Emptyable; - - /** - * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - */ - fpx?: Stripe.Emptyable; - - /** - * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - */ - giropay?: Stripe.Emptyable; - - /** - * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - */ - grabpay?: Stripe.Emptyable; - - /** - * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - */ - ideal?: Stripe.Emptyable; - - /** - * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - */ - interac_present?: Stripe.Emptyable; - - /** - * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - */ - klarna?: Stripe.Emptyable; - - /** - * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - */ - konbini?: Stripe.Emptyable; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: Stripe.Emptyable; - - /** - * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - */ - oxxo?: Stripe.Emptyable; - - /** - * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - */ - p24?: Stripe.Emptyable; - - /** - * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - */ - paynow?: Stripe.Emptyable; - - /** - * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - */ - pix?: Stripe.Emptyable; - - /** - * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - */ - promptpay?: Stripe.Emptyable; - - /** - * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: Stripe.Emptyable; - - /** - * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - */ - sofort?: Stripe.Emptyable; - - /** - * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: Stripe.Emptyable; - - /** - * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - */ - wechat_pay?: Stripe.Emptyable; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Affirm { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface AuBecsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace AuBecsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface BacsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace BacsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Boleto { - /** - * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Boleto { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. - */ - cvc_token?: string; - - /** - * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments?: Card.Installments; - - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter indicates that a transaction will be marked - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - */ - statement_descriptor_suffix_kana?: Stripe.Emptyable; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - */ - statement_descriptor_suffix_kanji?: Stripe.Emptyable; - } - - namespace Card { - interface Installments { - /** - * Setting to true enables installments for this PaymentIntent. - * This will cause the response to contain a list of available installment plans. - * Setting to false will prevent any selected plan from applying to a charge. - */ - enabled?: boolean; - - /** - * The selected installment plan to use for this payment attempt. - * This parameter can only be provided during confirmation. - */ - plan?: Stripe.Emptyable; - } - - namespace Installments { - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month'; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CardPresent { - /** - * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) - */ - request_extended_authorization?: boolean; - - /** - * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - */ - request_incremental_authorization_support?: boolean; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Eps { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Fpx { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Giropay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Grabpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Konbini { - /** - * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. - */ - confirmation_number?: string; - - /** - * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. - */ - expires_after_days?: Stripe.Emptyable; - - /** - * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. - */ - expires_at?: Stripe.Emptyable; - - /** - * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - */ - product_description?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface Paynow { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Pix { - /** - * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. - */ - expires_after_seconds?: number; - - /** - * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. - */ - expires_at?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface Promptpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - type SetupFutureUsage = 'off_session' | 'on_session'; - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.AddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - } - - interface PaymentIntentIncrementAuthorizationParams { - /** - * The updated total amount you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. - */ - amount: number; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount?: number; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * The parameters used to automatically create a Transfer when the payment is captured. - * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - transfer_data?: PaymentIntentIncrementAuthorizationParams.TransferData; - } - - namespace PaymentIntentIncrementAuthorizationParams { - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - */ - amount?: number; - } - } - - interface PaymentIntentSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - interface PaymentIntentVerifyMicrodepositsParams { - /** - * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. - */ - amounts?: Array; - - /** - * A six-character code starting with SM present in the microdeposit sent to the bank account. - */ - descriptor_code?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class PaymentIntentsResource { - /** - * Creates a PaymentIntent object. - * - * After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) - * to continue the payment. You can read more about the different payment flows - * available via the Payment Intents API [here](https://stripe.com/docs/payments/payment-intents). - * - * When confirm=true is used during creation, it is equivalent to creating - * and confirming the PaymentIntent in the same call. You may use any parameters - * available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when confirm=true - * is supplied. - */ - create( - params: PaymentIntentCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a PaymentIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. - */ - retrieve( - id: string, - params?: PaymentIntentRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates properties on a PaymentIntent object without confirming. - * - * Depending on which properties you update, you may need to confirm the - * PaymentIntent again. For example, updating the payment_method will - * always require you to confirm the PaymentIntent again. If you prefer to - * update and confirm at the same time, we recommend updating properties via - * the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. - */ - update( - id: string, - params?: PaymentIntentUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of PaymentIntents. - */ - list( - params?: PaymentIntentListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Manually reconcile the remaining amount for a customer_balance PaymentIntent. - */ - applyCustomerBalance( - id: string, - params?: PaymentIntentApplyCustomerBalanceParams, - options?: RequestOptions - ): Promise>; - applyCustomerBalance( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or processing. - * - * Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status='requires_capture', the remaining amount_capturable will automatically be refunded. - * - * You cannot cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead - */ - cancel( - id: string, - params?: PaymentIntentCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. - * - * Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by default). - * - * Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). - */ - capture( - id: string, - params?: PaymentIntentCaptureParams, - options?: RequestOptions - ): Promise>; - capture( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Confirm that your customer intends to pay with current or provided - * payment method. Upon confirmation, the PaymentIntent will attempt to initiate - * a payment. - * If the selected payment method requires additional authentication steps, the - * PaymentIntent will transition to the requires_action status and - * suggest additional actions via next_action. If payment fails, - * the PaymentIntent will transition to the requires_payment_method status. If - * payment succeeds, the PaymentIntent will transition to the succeeded - * status (or requires_capture, if capture_method is set to manual). - * If the confirmation_method is automatic, payment may be attempted - * using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) - * and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). - * After next_actions are handled by the client, no additional - * confirmation is required to complete the payment. - * If the confirmation_method is manual, all payment attempts must be - * initiated using a secret key. - * If any actions are required for the payment, the PaymentIntent will - * return to the requires_confirmation state - * after those actions are completed. Your server needs to then - * explicitly re-confirm the PaymentIntent to initiate the next payment - * attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) - * to learn more about manual confirmation. - */ - confirm( - id: string, - params?: PaymentIntentConfirmParams, - options?: RequestOptions - ): Promise>; - confirm( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Perform an incremental authorization on an eligible - * [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the - * PaymentIntent's status must be requires_capture and - * [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) - * must be true. - * - * Incremental authorizations attempt to increase the authorized amount on - * your customer's card to the new, higher amount provided. As with the - * initial authorization, incremental authorizations may be declined. A - * single PaymentIntent can call this endpoint multiple times to further - * increase the authorized amount. - * - * If the incremental authorization succeeds, the PaymentIntent object is - * returned with the updated - * [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). - * If the incremental authorization fails, a - * [card_declined](https://stripe.com/docs/error-codes#card-declined) error is returned, and no - * fields on the PaymentIntent or Charge are updated. The PaymentIntent - * object remains capturable for the previously authorized amount. - * - * Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. - * Once captured, a PaymentIntent can no longer be incremented. - * - * Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). - */ - incrementAuthorization( - id: string, - params: PaymentIntentIncrementAuthorizationParams, - options?: RequestOptions - ): Promise>; - - /** - * Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: PaymentIntentSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - - /** - * Verifies microdeposits on a PaymentIntent object. - */ - verifyMicrodeposits( - id: string, - params?: PaymentIntentVerifyMicrodepositsParams, - options?: RequestOptions - ): Promise>; - verifyMicrodeposits( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/PaymentIntentsResource.d.ts b/types/2022-11-15/PaymentIntentsResource.d.ts new file mode 100644 index 0000000000..42e94216f5 --- /dev/null +++ b/types/2022-11-15/PaymentIntentsResource.d.ts @@ -0,0 +1,5775 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PaymentIntentCreateParams { + /** + * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount: 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; + + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: number; + + /** + * When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters. + */ + automatic_payment_methods?: PaymentIntentCreateParams.AutomaticPaymentMethods; + + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentCreateParams.CaptureMethod; + + /** + * Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided. + */ + confirm?: boolean; + + confirmation_method?: PaymentIntentCreateParams.ConfirmationMethod; + + /** + * ID of the Customer this PaymentIntent belongs to, if one exists. + * + * Payment methods attached to other Customers cannot be used with this PaymentIntent. + * + * If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + */ + error_on_requires_action?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * ID of the mandate to be used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + */ + mandate?: string; + + /** + * This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + */ + mandate_data?: PaymentIntentCreateParams.MandateData; + + /** + * 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.MetadataParam; + + /** + * Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + */ + off_session?: boolean | PaymentIntentCreateParams.OffSession; + + /** + * The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + on_behalf_of?: string; + + /** + * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. + * + * If neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward. + */ + payment_method?: string; + + /** + * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + * property on the PaymentIntent. + */ + payment_method_data?: PaymentIntentCreateParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this PaymentIntent. + */ + payment_method_options?: PaymentIntentCreateParams.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"]. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types?: Array; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentIntentCreateParams.RadarOptions; + + /** + * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + */ + receipt_email?: string; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + */ + return_url?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: PaymentIntentCreateParams.SetupFutureUsage; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: PaymentIntentCreateParams.Shipping; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * The parameters used to automatically create a Transfer when the payment succeeds. + * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + transfer_data?: PaymentIntentCreateParams.TransferData; + + /** + * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + */ + transfer_group?: string; + + /** + * Set to `true` only when using manual confirmation and the iOS or Android SDKs to handle additional authentication steps. + */ + use_stripe_sdk?: boolean; + } + + namespace PaymentIntentCreateParams { + interface AutomaticPaymentMethods { + /** + * Whether this feature is enabled. + */ + enabled: boolean; + } + + type CaptureMethod = 'automatic' | 'manual'; + + type ConfirmationMethod = 'automatic' | 'manual'; + + interface MandateData { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData.CustomerAcceptance; + } + + namespace MandateData { + interface CustomerAcceptance { + /** + * The time at which the customer accepted the Mandate. + */ + accepted_at?: number; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + */ + offline?: CustomerAcceptance.Offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online?: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + */ + type: CustomerAcceptance.Type; + } + + namespace CustomerAcceptance { + interface Offline {} + + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + } + + type Type = 'offline' | 'online'; + } + } + + type OffSession = 'one_off' | 'recurring'; + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + + /** + * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + */ + afterpay_clearpay?: Stripe.Emptyable< + PaymentMethodOptions.AfterpayClearpay + >; + + /** + * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + */ + alipay?: Stripe.Emptyable; + + /** + * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + */ + au_becs_debit?: Stripe.Emptyable; + + /** + * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + */ + bacs_debit?: Stripe.Emptyable; + + /** + * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + */ + bancontact?: Stripe.Emptyable; + + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + + /** + * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + */ + boleto?: Stripe.Emptyable; + + /** + * Configuration for any card payments attempted on this PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + card_present?: Stripe.Emptyable; + + /** + * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + */ + eps?: Stripe.Emptyable; + + /** + * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + */ + fpx?: Stripe.Emptyable; + + /** + * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + */ + giropay?: Stripe.Emptyable; + + /** + * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + */ + grabpay?: Stripe.Emptyable; + + /** + * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + */ + ideal?: Stripe.Emptyable; + + /** + * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + interac_present?: Stripe.Emptyable; + + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + + /** + * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + */ + konbini?: Stripe.Emptyable; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + + /** + * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + */ + oxxo?: Stripe.Emptyable; + + /** + * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + */ + p24?: Stripe.Emptyable; + + /** + * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + */ + paynow?: Stripe.Emptyable; + + /** + * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + */ + pix?: Stripe.Emptyable; + + /** + * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + */ + promptpay?: Stripe.Emptyable; + + /** + * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: Stripe.Emptyable; + + /** + * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + */ + sofort?: Stripe.Emptyable; + + /** + * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: Stripe.Emptyable; + + /** + * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + */ + wechat_pay?: Stripe.Emptyable; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace AuBecsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Boleto { + /** + * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + */ + cvc_token?: string; + + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter indicates that a transaction will be marked + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + */ + statement_descriptor_suffix_kana?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + */ + statement_descriptor_suffix_kanji?: Stripe.Emptyable; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this PaymentIntent. + * This will cause the response to contain a list of available installment plans. + * Setting to false will prevent any selected plan from applying to a charge. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this payment attempt. + * This parameter can only be provided during confirmation. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CardPresent { + /** + * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + */ + request_extended_authorization?: boolean; + + /** + * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + */ + request_incremental_authorization_support?: boolean; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-CH' + | 'de-DE' + | 'en-AT' + | 'en-AU' + | 'en-BE' + | 'en-CA' + | 'en-CH' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-NZ' + | 'en-PL' + | 'en-PT' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-CA' + | 'fr-CH' + | 'fr-FR' + | 'it-CH' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'pl-PL' + | 'pt-PT' + | 'sv-FI' + | 'sv-SE'; + } + + interface Konbini { + /** + * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + */ + confirmation_number?: string; + + /** + * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + */ + expires_after_days?: Stripe.Emptyable; + + /** + * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + */ + expires_at?: Stripe.Emptyable; + + /** + * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + */ + product_description?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + */ + expires_after_seconds?: number; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + */ + expires_at?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Promptpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + type SetupFutureUsage = 'off_session' | 'on_session'; + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + * The amount is capped at the total transaction amount and if no amount is set, + * the full amount is transferred. + * + * If you intend to collect a fee and you need a more robust reporting experience, using + * [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) + * might be a better fit for your integration. + */ + amount?: number; + + /** + * If specified, successful charges will be attributed to the destination + * account for tax reporting, and the funds from charges will be transferred + * to the destination account. The ID of the resulting transfer will be + * returned on the successful charge's `transfer` field. + */ + destination: string; + } + } + + interface PaymentIntentRetrieveParams { + /** + * The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source. + */ + client_secret?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentIntentUpdateParams { + /** + * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount?: number; + + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: Stripe.Emptyable; + + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentUpdateParams.CaptureMethod; + + /** + * 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 Customer this PaymentIntent belongs to, if one exists. + * + * Payment methods attached to other Customers cannot be used with this PaymentIntent. + * + * If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + */ + payment_method?: string; + + /** + * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + * property on the PaymentIntent. + */ + payment_method_data?: PaymentIntentUpdateParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this PaymentIntent. + */ + payment_method_options?: PaymentIntentUpdateParams.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types?: Array; + + /** + * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + */ + receipt_email?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + PaymentIntentUpdateParams.SetupFutureUsage + >; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: Stripe.Emptyable; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + transfer_data?: PaymentIntentUpdateParams.TransferData; + + /** + * A string that identifies the resulting payment as part of a group. `transfer_group` may only be provided if it has not been set. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + */ + transfer_group?: string; + } + + namespace PaymentIntentUpdateParams { + type CaptureMethod = 'automatic' | 'manual'; + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + + /** + * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + */ + afterpay_clearpay?: Stripe.Emptyable< + PaymentMethodOptions.AfterpayClearpay + >; + + /** + * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + */ + alipay?: Stripe.Emptyable; + + /** + * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + */ + au_becs_debit?: Stripe.Emptyable; + + /** + * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + */ + bacs_debit?: Stripe.Emptyable; + + /** + * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + */ + bancontact?: Stripe.Emptyable; + + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + + /** + * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + */ + boleto?: Stripe.Emptyable; + + /** + * Configuration for any card payments attempted on this PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + card_present?: Stripe.Emptyable; + + /** + * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + */ + eps?: Stripe.Emptyable; + + /** + * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + */ + fpx?: Stripe.Emptyable; + + /** + * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + */ + giropay?: Stripe.Emptyable; + + /** + * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + */ + grabpay?: Stripe.Emptyable; + + /** + * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + */ + ideal?: Stripe.Emptyable; + + /** + * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + interac_present?: Stripe.Emptyable; + + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + + /** + * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + */ + konbini?: Stripe.Emptyable; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + + /** + * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + */ + oxxo?: Stripe.Emptyable; + + /** + * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + */ + p24?: Stripe.Emptyable; + + /** + * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + */ + paynow?: Stripe.Emptyable; + + /** + * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + */ + pix?: Stripe.Emptyable; + + /** + * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + */ + promptpay?: Stripe.Emptyable; + + /** + * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: Stripe.Emptyable; + + /** + * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + */ + sofort?: Stripe.Emptyable; + + /** + * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: Stripe.Emptyable; + + /** + * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + */ + wechat_pay?: Stripe.Emptyable; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace AuBecsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Boleto { + /** + * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + */ + cvc_token?: string; + + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter indicates that a transaction will be marked + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + */ + statement_descriptor_suffix_kana?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + */ + statement_descriptor_suffix_kanji?: Stripe.Emptyable; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this PaymentIntent. + * This will cause the response to contain a list of available installment plans. + * Setting to false will prevent any selected plan from applying to a charge. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this payment attempt. + * This parameter can only be provided during confirmation. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CardPresent { + /** + * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + */ + request_extended_authorization?: boolean; + + /** + * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + */ + request_incremental_authorization_support?: boolean; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-CH' + | 'de-DE' + | 'en-AT' + | 'en-AU' + | 'en-BE' + | 'en-CA' + | 'en-CH' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-NZ' + | 'en-PL' + | 'en-PT' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-CA' + | 'fr-CH' + | 'fr-FR' + | 'it-CH' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'pl-PL' + | 'pt-PT' + | 'sv-FI' + | 'sv-SE'; + } + + interface Konbini { + /** + * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + */ + confirmation_number?: string; + + /** + * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + */ + expires_after_days?: Stripe.Emptyable; + + /** + * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + */ + expires_at?: Stripe.Emptyable; + + /** + * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + */ + product_description?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + */ + expires_after_seconds?: number; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + */ + expires_at?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Promptpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type SetupFutureUsage = 'off_session' | 'on_session'; + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + */ + amount?: number; + } + } + + interface PaymentIntentListParams 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return PaymentIntents for the customer specified by this customer ID. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentIntentApplyCustomerBalanceParams { + /** + * Amount intended to be applied to this PaymentIntent from the customer's cash balance. + * + * A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + * + * The maximum amount is the amount of the PaymentIntent. + * + * When omitted, the amount defaults to the remaining amount requested on the PaymentIntent. + */ + amount?: 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; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentIntentCancelParams { + /** + * Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` + */ + cancellation_reason?: PaymentIntentCancelParams.CancellationReason; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace PaymentIntentCancelParams { + type CancellationReason = + | 'abandoned' + | 'duplicate' + | 'fraudulent' + | 'requested_by_customer'; + } + + interface PaymentIntentCaptureParams { + /** + * The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. + */ + amount_to_capture?: number; + + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * The parameters used to automatically create a Transfer when the payment + * is captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + transfer_data?: PaymentIntentCaptureParams.TransferData; + } + + namespace PaymentIntentCaptureParams { + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + */ + amount?: number; + } + } + + interface PaymentIntentConfirmParams { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentConfirmParams.CaptureMethod; + + /** + * Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + */ + error_on_requires_action?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * ID of the mandate to be used for this payment. + */ + mandate?: string; + + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: + | PaymentIntentConfirmParams.MandateData1 + | PaymentIntentConfirmParams.MandateData2; + + /** + * Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + */ + off_session?: boolean | PaymentIntentConfirmParams.OffSession; + + /** + * ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + */ + payment_method?: string; + + /** + * If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + * in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) + * property on the PaymentIntent. + */ + payment_method_data?: PaymentIntentConfirmParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this PaymentIntent. + */ + payment_method_options?: PaymentIntentConfirmParams.PaymentMethodOptions; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentIntentConfirmParams.RadarOptions; + + /** + * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + */ + receipt_email?: Stripe.Emptyable; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + PaymentIntentConfirmParams.SetupFutureUsage + >; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: Stripe.Emptyable; + + /** + * Set to `true` only when using manual confirmation and the iOS or Android SDKs to handle additional authentication steps. + */ + use_stripe_sdk?: boolean; + } + + namespace PaymentIntentConfirmParams { + type CaptureMethod = 'automatic' | 'manual'; + + interface MandateData1 { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData1.CustomerAcceptance; + } + + namespace MandateData1 { + interface CustomerAcceptance { + /** + * The time at which the customer accepted the Mandate. + */ + accepted_at?: number; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + */ + offline?: CustomerAcceptance.Offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online?: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + */ + type: CustomerAcceptance.Type; + } + + namespace CustomerAcceptance { + interface Offline {} + + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + } + + type Type = 'offline' | 'online'; + } + } + + interface MandateData2 { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData2.CustomerAcceptance; + } + + namespace MandateData2 { + interface CustomerAcceptance { + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. + */ + type: 'online'; + } + + namespace CustomerAcceptance { + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address?: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent?: string; + } + } + } + + type OffSession = 'one_off' | 'recurring'; + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + */ + affirm?: Stripe.Emptyable; + + /** + * If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + */ + afterpay_clearpay?: Stripe.Emptyable< + PaymentMethodOptions.AfterpayClearpay + >; + + /** + * If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + */ + alipay?: Stripe.Emptyable; + + /** + * If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + */ + au_becs_debit?: Stripe.Emptyable; + + /** + * If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + */ + bacs_debit?: Stripe.Emptyable; + + /** + * If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + */ + bancontact?: Stripe.Emptyable; + + /** + * If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + */ + blik?: Stripe.Emptyable; + + /** + * If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + */ + boleto?: Stripe.Emptyable; + + /** + * Configuration for any card payments attempted on this PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + card_present?: Stripe.Emptyable; + + /** + * If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + */ + eps?: Stripe.Emptyable; + + /** + * If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + */ + fpx?: Stripe.Emptyable; + + /** + * If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + */ + giropay?: Stripe.Emptyable; + + /** + * If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + */ + grabpay?: Stripe.Emptyable; + + /** + * If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + */ + ideal?: Stripe.Emptyable; + + /** + * If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + */ + interac_present?: Stripe.Emptyable; + + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + + /** + * If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + */ + konbini?: Stripe.Emptyable; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: Stripe.Emptyable; + + /** + * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + */ + oxxo?: Stripe.Emptyable; + + /** + * If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + */ + p24?: Stripe.Emptyable; + + /** + * If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + */ + paynow?: Stripe.Emptyable; + + /** + * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + */ + pix?: Stripe.Emptyable; + + /** + * If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + */ + promptpay?: Stripe.Emptyable; + + /** + * If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: Stripe.Emptyable; + + /** + * If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + */ + sofort?: Stripe.Emptyable; + + /** + * If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: Stripe.Emptyable; + + /** + * If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + */ + wechat_pay?: Stripe.Emptyable; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Affirm { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface AuBecsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace AuBecsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface BacsDebit { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace BacsDebit { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Boleto { + /** + * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Boleto { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. + */ + cvc_token?: string; + + /** + * Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + * + * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + */ + installments?: Card.Installments; + + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter indicates that a transaction will be marked + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + */ + statement_descriptor_suffix_kana?: Stripe.Emptyable; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + */ + statement_descriptor_suffix_kanji?: Stripe.Emptyable; + } + + namespace Card { + interface Installments { + /** + * Setting to true enables installments for this PaymentIntent. + * This will cause the response to contain a list of available installment plans. + * Setting to false will prevent any selected plan from applying to a charge. + */ + enabled?: boolean; + + /** + * The selected installment plan to use for this payment attempt. + * This parameter can only be provided during confirmation. + */ + plan?: Stripe.Emptyable; + } + + namespace Installments { + interface Plan { + /** + * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + */ + count: number; + + /** + * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + * One of `month`. + */ + interval: 'month'; + + /** + * Type of installment plan, one of `fixed_count`. + */ + type: 'fixed_count'; + } + } + + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CardPresent { + /** + * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + */ + request_extended_authorization?: boolean; + + /** + * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + */ + request_incremental_authorization_support?: boolean; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Eps { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Fpx { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Giropay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Grabpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-CH' + | 'de-DE' + | 'en-AT' + | 'en-AU' + | 'en-BE' + | 'en-CA' + | 'en-CH' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-NZ' + | 'en-PL' + | 'en-PT' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-CA' + | 'fr-CH' + | 'fr-FR' + | 'it-CH' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'pl-PL' + | 'pt-PT' + | 'sv-FI' + | 'sv-SE'; + } + + interface Konbini { + /** + * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. + */ + confirmation_number?: string; + + /** + * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. + */ + expires_after_days?: Stripe.Emptyable; + + /** + * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + */ + expires_at?: Stripe.Emptyable; + + /** + * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + */ + product_description?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paynow { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Pix { + /** + * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + */ + expires_after_seconds?: number; + + /** + * The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. + */ + expires_at?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface Promptpay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + type SetupFutureUsage = 'off_session' | 'on_session'; + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + + interface PaymentIntentIncrementAuthorizationParams { + /** + * The updated total amount you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. + */ + amount: number; + + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + application_fee_amount?: number; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * The parameters used to automatically create a Transfer when the payment is captured. + * For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + */ + transfer_data?: PaymentIntentIncrementAuthorizationParams.TransferData; + } + + namespace PaymentIntentIncrementAuthorizationParams { + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + */ + amount?: number; + } + } + + interface PaymentIntentSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + interface PaymentIntentVerifyMicrodepositsParams { + /** + * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array; + + /** + * A six-character code starting with SM present in the microdeposit sent to the bank account. + */ + descriptor_code?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class PaymentIntentsResource { + /** + * Creates a PaymentIntent object. + * + * After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) + * to continue the payment. You can read more about the different payment flows + * available via the Payment Intents API [here](https://stripe.com/docs/payments/payment-intents). + * + * When confirm=true is used during creation, it is equivalent to creating + * and confirming the PaymentIntent in the same call. You may use any parameters + * available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when confirm=true + * is supplied. + */ + create( + params: PaymentIntentCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + */ + retrieve( + id: string, + params?: PaymentIntentRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates properties on a PaymentIntent object without confirming. + * + * Depending on which properties you update, you may need to confirm the + * PaymentIntent again. For example, updating the payment_method will + * always require you to confirm the PaymentIntent again. If you prefer to + * update and confirm at the same time, we recommend updating properties via + * the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. + */ + update( + id: string, + params?: PaymentIntentUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of PaymentIntents. + */ + list( + params?: PaymentIntentListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Manually reconcile the remaining amount for a customer_balance PaymentIntent. + */ + applyCustomerBalance( + id: string, + params?: PaymentIntentApplyCustomerBalanceParams, + options?: RequestOptions + ): Promise>; + applyCustomerBalance( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or processing. + * + * Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status='requires_capture', the remaining amount_capturable will automatically be refunded. + * + * You cannot cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead + */ + cancel( + id: string, + params?: PaymentIntentCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. + * + * Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by default). + * + * Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + */ + capture( + id: string, + params?: PaymentIntentCaptureParams, + options?: RequestOptions + ): Promise>; + capture( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Confirm that your customer intends to pay with current or provided + * payment method. Upon confirmation, the PaymentIntent will attempt to initiate + * a payment. + * If the selected payment method requires additional authentication steps, the + * PaymentIntent will transition to the requires_action status and + * suggest additional actions via next_action. If payment fails, + * the PaymentIntent will transition to the requires_payment_method status. If + * payment succeeds, the PaymentIntent will transition to the succeeded + * status (or requires_capture, if capture_method is set to manual). + * If the confirmation_method is automatic, payment may be attempted + * using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + * and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + * After next_actions are handled by the client, no additional + * confirmation is required to complete the payment. + * If the confirmation_method is manual, all payment attempts must be + * initiated using a secret key. + * If any actions are required for the payment, the PaymentIntent will + * return to the requires_confirmation state + * after those actions are completed. Your server needs to then + * explicitly re-confirm the PaymentIntent to initiate the next payment + * attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual) + * to learn more about manual confirmation. + */ + confirm( + id: string, + params?: PaymentIntentConfirmParams, + options?: RequestOptions + ): Promise>; + confirm( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Perform an incremental authorization on an eligible + * [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + * PaymentIntent's status must be requires_capture and + * [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) + * must be true. + * + * Incremental authorizations attempt to increase the authorized amount on + * your customer's card to the new, higher amount provided. As with the + * initial authorization, incremental authorizations may be declined. A + * single PaymentIntent can call this endpoint multiple times to further + * increase the authorized amount. + * + * If the incremental authorization succeeds, the PaymentIntent object is + * returned with the updated + * [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + * If the incremental authorization fails, a + * [card_declined](https://stripe.com/docs/error-codes#card-declined) error is returned, and no + * fields on the PaymentIntent or Charge are updated. The PaymentIntent + * object remains capturable for the previously authorized amount. + * + * Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + * Once captured, a PaymentIntent can no longer be incremented. + * + * Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + */ + incrementAuthorization( + id: string, + params: PaymentIntentIncrementAuthorizationParams, + options?: RequestOptions + ): Promise>; + + /** + * Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: PaymentIntentSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + + /** + * Verifies microdeposits on a PaymentIntent object. + */ + verifyMicrodeposits( + id: string, + params?: PaymentIntentVerifyMicrodepositsParams, + options?: RequestOptions + ): Promise>; + verifyMicrodeposits( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/PaymentLinks.d.ts b/types/2022-11-15/PaymentLinks.d.ts index 074b5c706f..0553b3bea2 100644 --- a/types/2022-11-15/PaymentLinks.d.ts +++ b/types/2022-11-15/PaymentLinks.d.ts @@ -570,1167 +570,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - interface PaymentLinkCreateParams { - /** - * The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. - */ - line_items: Array; - - /** - * Behavior after the purchase is complete. - */ - after_completion?: PaymentLinkCreateParams.AfterCompletion; - - /** - * Enables user redeemable promotion codes. - */ - allow_promotion_codes?: boolean; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. - */ - application_fee_amount?: number; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. - */ - application_fee_percent?: number; - - /** - * Configuration for automatic tax collection. - */ - automatic_tax?: PaymentLinkCreateParams.AutomaticTax; - - /** - * Configuration for collecting the customer's billing address. - */ - billing_address_collection?: PaymentLinkCreateParams.BillingAddressCollection; - - /** - * Configure fields to gather active consent from customers. - */ - 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; - - /** - * Display additional text for your customers using custom text. - */ - custom_text?: PaymentLinkCreateParams.CustomText; - - /** - * 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). - */ - customer_creation?: PaymentLinkCreateParams.CustomerCreation; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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 associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - */ - metadata?: Stripe.MetadataParam; - - /** - * The account on behalf of which to charge. - */ - on_behalf_of?: string; - - /** - * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - */ - payment_intent_data?: PaymentLinkCreateParams.PaymentIntentData; - - /** - * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - * - * Can only be set in `subscription` mode. - * - * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - */ - payment_method_collection?: PaymentLinkCreateParams.PaymentMethodCollection; - - /** - * The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). - */ - payment_method_types?: Array; - - /** - * Controls phone number collection settings during checkout. - * - * We recommend that you review your privacy policy and check with your legal contacts. - */ - phone_number_collection?: PaymentLinkCreateParams.PhoneNumberCollection; - - /** - * Configuration for collecting the customer's shipping address. - */ - shipping_address_collection?: PaymentLinkCreateParams.ShippingAddressCollection; - - /** - * The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - */ - shipping_options?: Array; - - /** - * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). - */ - submit_type?: PaymentLinkCreateParams.SubmitType; - - /** - * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. - */ - subscription_data?: PaymentLinkCreateParams.SubscriptionData; - - /** - * Controls tax ID collection during checkout. - */ - tax_id_collection?: PaymentLinkCreateParams.TaxIdCollection; - - /** - * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - */ - transfer_data?: PaymentLinkCreateParams.TransferData; - } - - namespace PaymentLinkCreateParams { - interface AfterCompletion { - /** - * Configuration when `type=hosted_confirmation`. - */ - hosted_confirmation?: AfterCompletion.HostedConfirmation; - - /** - * Configuration when `type=redirect`. - */ - redirect?: AfterCompletion.Redirect; - - /** - * The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. - */ - type: AfterCompletion.Type; - } - - namespace AfterCompletion { - interface HostedConfirmation { - /** - * A custom message to display to the customer after the purchase is complete. - */ - custom_message?: string; - } - - interface Redirect { - /** - * The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - */ - url: string; - } - - type Type = 'hosted_confirmation' | 'redirect'; - } - - interface AutomaticTax { - /** - * If `true`, tax will be calculated automatically using the customer's location. - */ - enabled: boolean; - } - - type BillingAddressCollection = 'auto' | 'required'; - - interface ConsentCollection { - /** - * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout - * Session will determine whether to display an option to opt into promotional communication - * from the merchant depending on the customer's locale. Only available to US merchants. - */ - promotions?: ConsentCollection.Promotions; - - /** - * If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - * There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - */ - terms_of_service?: ConsentCollection.TermsOfService; - } - - namespace ConsentCollection { - type Promotions = 'auto' | 'none'; - - type TermsOfService = 'none' | 'required'; - } - - type CustomerCreation = 'always' | 'if_required'; - - interface CustomText { - /** - * Custom text that should be displayed alongside shipping address collection. - */ - shipping_address?: Stripe.Emptyable; - - /** - * Custom text that should be displayed alongside the payment confirmation button. - */ - submit?: Stripe.Emptyable; - } - - namespace CustomText { - interface ShippingAddress { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - - interface Submit { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - } - - interface LineItem { - /** - * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. - */ - adjustable_quantity?: LineItem.AdjustableQuantity; - - /** - * The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. - */ - price: string; - - /** - * The quantity of the line item being purchased. - */ - quantity: number; - } - - namespace LineItem { - interface AdjustableQuantity { - /** - * Set to true if the quantity can be adjusted to any non-negative Integer. - */ - enabled: boolean; - - /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. - */ - maximum?: number; - - /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. - */ - minimum?: number; - } - } - - interface PaymentIntentData { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: PaymentIntentData.CaptureMethod; - - /** - * Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. - * - * When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. - * - * When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. - * - * If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. - * - * If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. - * - * When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. - */ - setup_future_usage?: PaymentIntentData.SetupFutureUsage; - } - - namespace PaymentIntentData { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'off_session' | 'on_session'; - } - - type PaymentMethodCollection = 'always' | 'if_required'; - - type PaymentMethodType = - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface PhoneNumberCollection { - /** - * Set to `true` to enable phone number collection. - */ - enabled: boolean; - } - - interface ShippingAddressCollection { - /** - * An array of two-letter ISO country codes representing which countries Checkout should provide as options for - * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - */ - allowed_countries: Array; - } - - namespace ShippingAddressCollection { - type AllowedCountry = - | 'AC' - | 'AD' - | 'AE' - | 'AF' - | 'AG' - | 'AI' - | 'AL' - | 'AM' - | 'AO' - | 'AQ' - | 'AR' - | 'AT' - | 'AU' - | 'AW' - | 'AX' - | 'AZ' - | 'BA' - | 'BB' - | 'BD' - | 'BE' - | 'BF' - | 'BG' - | 'BH' - | 'BI' - | 'BJ' - | 'BL' - | 'BM' - | 'BN' - | 'BO' - | 'BQ' - | 'BR' - | 'BS' - | 'BT' - | 'BV' - | 'BW' - | 'BY' - | 'BZ' - | 'CA' - | 'CD' - | 'CF' - | 'CG' - | 'CH' - | 'CI' - | 'CK' - | 'CL' - | 'CM' - | 'CN' - | 'CO' - | 'CR' - | 'CV' - | 'CW' - | 'CY' - | 'CZ' - | 'DE' - | 'DJ' - | 'DK' - | 'DM' - | 'DO' - | 'DZ' - | 'EC' - | 'EE' - | 'EG' - | 'EH' - | 'ER' - | 'ES' - | 'ET' - | 'FI' - | 'FJ' - | 'FK' - | 'FO' - | 'FR' - | 'GA' - | 'GB' - | 'GD' - | 'GE' - | 'GF' - | 'GG' - | 'GH' - | 'GI' - | 'GL' - | 'GM' - | 'GN' - | 'GP' - | 'GQ' - | 'GR' - | 'GS' - | 'GT' - | 'GU' - | 'GW' - | 'GY' - | 'HK' - | 'HN' - | 'HR' - | 'HT' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IM' - | 'IN' - | 'IO' - | 'IQ' - | 'IS' - | 'IT' - | 'JE' - | 'JM' - | 'JO' - | 'JP' - | 'KE' - | 'KG' - | 'KH' - | 'KI' - | 'KM' - | 'KN' - | 'KR' - | 'KW' - | 'KY' - | 'KZ' - | 'LA' - | 'LB' - | 'LC' - | 'LI' - | 'LK' - | 'LR' - | 'LS' - | 'LT' - | 'LU' - | 'LV' - | 'LY' - | 'MA' - | 'MC' - | 'MD' - | 'ME' - | 'MF' - | 'MG' - | 'MK' - | 'ML' - | 'MM' - | 'MN' - | 'MO' - | 'MQ' - | 'MR' - | 'MS' - | 'MT' - | 'MU' - | 'MV' - | 'MW' - | 'MX' - | 'MY' - | 'MZ' - | 'NA' - | 'NC' - | 'NE' - | 'NG' - | 'NI' - | 'NL' - | 'NO' - | 'NP' - | 'NR' - | 'NU' - | 'NZ' - | 'OM' - | 'PA' - | 'PE' - | 'PF' - | 'PG' - | 'PH' - | 'PK' - | 'PL' - | 'PM' - | 'PN' - | 'PR' - | 'PS' - | 'PT' - | 'PY' - | 'QA' - | 'RE' - | 'RO' - | 'RS' - | 'RU' - | 'RW' - | 'SA' - | 'SB' - | 'SC' - | 'SE' - | 'SG' - | 'SH' - | 'SI' - | 'SJ' - | 'SK' - | 'SL' - | 'SM' - | 'SN' - | 'SO' - | 'SR' - | 'SS' - | 'ST' - | 'SV' - | 'SX' - | 'SZ' - | 'TA' - | 'TC' - | 'TD' - | 'TF' - | 'TG' - | 'TH' - | 'TJ' - | 'TK' - | 'TL' - | 'TM' - | 'TN' - | 'TO' - | 'TR' - | 'TT' - | 'TV' - | 'TW' - | 'TZ' - | 'UA' - | 'UG' - | 'US' - | 'UY' - | 'UZ' - | 'VA' - | 'VC' - | 'VE' - | 'VG' - | 'VN' - | 'VU' - | 'WF' - | 'WS' - | 'XK' - | 'YE' - | 'YT' - | 'ZA' - | 'ZM' - | 'ZW' - | 'ZZ'; - } - - interface ShippingOption { - /** - * The ID of the Shipping Rate to use for this shipping option. - */ - shipping_rate?: string; - } - - type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; - - interface SubscriptionData { - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * 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; - } - - interface TaxIdCollection { - /** - * Set to `true` to enable tax ID collection. - */ - enabled: boolean; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when a charge succeeds. - */ - amount?: number; - - /** - * If specified, successful charges will be attributed to the destination - * account for tax reporting, and the funds from charges will be transferred - * to the destination account. The ID of the resulting transfer will be - * returned on the successful charge's `transfer` field. - */ - destination: string; - } - } - - interface PaymentLinkRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentLinkUpdateParams { - /** - * Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - */ - active?: boolean; - - /** - * Behavior after the purchase is complete. - */ - after_completion?: PaymentLinkUpdateParams.AfterCompletion; - - /** - * Enables user redeemable promotion codes. - */ - allow_promotion_codes?: boolean; - - /** - * Configuration for automatic tax collection. - */ - automatic_tax?: PaymentLinkUpdateParams.AutomaticTax; - - /** - * Configuration for collecting the customer's billing address. - */ - billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection; - - /** - * Display additional text for your customers using custom text. - */ - custom_text?: PaymentLinkUpdateParams.CustomText; - - /** - * 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). - */ - customer_creation?: PaymentLinkUpdateParams.CustomerCreation; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. - */ - line_items?: Array; - - /** - * 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 associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - */ - metadata?: Stripe.MetadataParam; - - /** - * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. - * - * Can only be set in `subscription` mode. - * - * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - */ - payment_method_collection?: PaymentLinkUpdateParams.PaymentMethodCollection; - - /** - * The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Stripe.Emptyable< - Array - >; - - /** - * Configuration for collecting the customer's shipping address. - */ - shipping_address_collection?: Stripe.Emptyable< - PaymentLinkUpdateParams.ShippingAddressCollection - >; - } - - namespace PaymentLinkUpdateParams { - interface AfterCompletion { - /** - * Configuration when `type=hosted_confirmation`. - */ - hosted_confirmation?: AfterCompletion.HostedConfirmation; - - /** - * Configuration when `type=redirect`. - */ - redirect?: AfterCompletion.Redirect; - - /** - * The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. - */ - type: AfterCompletion.Type; - } - - namespace AfterCompletion { - interface HostedConfirmation { - /** - * A custom message to display to the customer after the purchase is complete. - */ - custom_message?: string; - } - - interface Redirect { - /** - * The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - */ - url: string; - } - - type Type = 'hosted_confirmation' | 'redirect'; - } - - interface AutomaticTax { - /** - * If `true`, tax will be calculated automatically using the customer's location. - */ - enabled: boolean; - } - - type BillingAddressCollection = 'auto' | 'required'; - - type CustomerCreation = 'always' | 'if_required'; - - interface CustomText { - /** - * Custom text that should be displayed alongside shipping address collection. - */ - shipping_address?: Stripe.Emptyable; - - /** - * Custom text that should be displayed alongside the payment confirmation button. - */ - submit?: Stripe.Emptyable; - } - - namespace CustomText { - interface ShippingAddress { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - - interface Submit { - /** - * Text may be up to 500 characters in length. - */ - message: string; - } - } - - interface LineItem { - /** - * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. - */ - adjustable_quantity?: LineItem.AdjustableQuantity; - - /** - * The ID of an existing line item on the payment link. - */ - id: string; - - /** - * The quantity of the line item being purchased. - */ - quantity?: number; - } - - namespace LineItem { - interface AdjustableQuantity { - /** - * Set to true if the quantity can be adjusted to any non-negative Integer. - */ - enabled: boolean; - - /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. - */ - maximum?: number; - - /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. - */ - minimum?: number; - } - } - - type PaymentMethodCollection = 'always' | 'if_required'; - - type PaymentMethodType = - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface ShippingAddressCollection { - /** - * An array of two-letter ISO country codes representing which countries Checkout should provide as options for - * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - */ - allowed_countries: Array; - } - - namespace ShippingAddressCollection { - type AllowedCountry = - | 'AC' - | 'AD' - | 'AE' - | 'AF' - | 'AG' - | 'AI' - | 'AL' - | 'AM' - | 'AO' - | 'AQ' - | 'AR' - | 'AT' - | 'AU' - | 'AW' - | 'AX' - | 'AZ' - | 'BA' - | 'BB' - | 'BD' - | 'BE' - | 'BF' - | 'BG' - | 'BH' - | 'BI' - | 'BJ' - | 'BL' - | 'BM' - | 'BN' - | 'BO' - | 'BQ' - | 'BR' - | 'BS' - | 'BT' - | 'BV' - | 'BW' - | 'BY' - | 'BZ' - | 'CA' - | 'CD' - | 'CF' - | 'CG' - | 'CH' - | 'CI' - | 'CK' - | 'CL' - | 'CM' - | 'CN' - | 'CO' - | 'CR' - | 'CV' - | 'CW' - | 'CY' - | 'CZ' - | 'DE' - | 'DJ' - | 'DK' - | 'DM' - | 'DO' - | 'DZ' - | 'EC' - | 'EE' - | 'EG' - | 'EH' - | 'ER' - | 'ES' - | 'ET' - | 'FI' - | 'FJ' - | 'FK' - | 'FO' - | 'FR' - | 'GA' - | 'GB' - | 'GD' - | 'GE' - | 'GF' - | 'GG' - | 'GH' - | 'GI' - | 'GL' - | 'GM' - | 'GN' - | 'GP' - | 'GQ' - | 'GR' - | 'GS' - | 'GT' - | 'GU' - | 'GW' - | 'GY' - | 'HK' - | 'HN' - | 'HR' - | 'HT' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IM' - | 'IN' - | 'IO' - | 'IQ' - | 'IS' - | 'IT' - | 'JE' - | 'JM' - | 'JO' - | 'JP' - | 'KE' - | 'KG' - | 'KH' - | 'KI' - | 'KM' - | 'KN' - | 'KR' - | 'KW' - | 'KY' - | 'KZ' - | 'LA' - | 'LB' - | 'LC' - | 'LI' - | 'LK' - | 'LR' - | 'LS' - | 'LT' - | 'LU' - | 'LV' - | 'LY' - | 'MA' - | 'MC' - | 'MD' - | 'ME' - | 'MF' - | 'MG' - | 'MK' - | 'ML' - | 'MM' - | 'MN' - | 'MO' - | 'MQ' - | 'MR' - | 'MS' - | 'MT' - | 'MU' - | 'MV' - | 'MW' - | 'MX' - | 'MY' - | 'MZ' - | 'NA' - | 'NC' - | 'NE' - | 'NG' - | 'NI' - | 'NL' - | 'NO' - | 'NP' - | 'NR' - | 'NU' - | 'NZ' - | 'OM' - | 'PA' - | 'PE' - | 'PF' - | 'PG' - | 'PH' - | 'PK' - | 'PL' - | 'PM' - | 'PN' - | 'PR' - | 'PS' - | 'PT' - | 'PY' - | 'QA' - | 'RE' - | 'RO' - | 'RS' - | 'RU' - | 'RW' - | 'SA' - | 'SB' - | 'SC' - | 'SE' - | 'SG' - | 'SH' - | 'SI' - | 'SJ' - | 'SK' - | 'SL' - | 'SM' - | 'SN' - | 'SO' - | 'SR' - | 'SS' - | 'ST' - | 'SV' - | 'SX' - | 'SZ' - | 'TA' - | 'TC' - | 'TD' - | 'TF' - | 'TG' - | 'TH' - | 'TJ' - | 'TK' - | 'TL' - | 'TM' - | 'TN' - | 'TO' - | 'TR' - | 'TT' - | 'TV' - | 'TW' - | 'TZ' - | 'UA' - | 'UG' - | 'US' - | 'UY' - | 'UZ' - | 'VA' - | 'VC' - | 'VE' - | 'VG' - | 'VN' - | 'VU' - | 'WF' - | 'WS' - | 'XK' - | 'YE' - | 'YT' - | 'ZA' - | 'ZM' - | 'ZW' - | 'ZZ'; - } - } - - interface PaymentLinkListParams extends PaginationParams { - /** - * Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentLinkListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class PaymentLinksResource { - /** - * Creates a payment link. - */ - create( - params: PaymentLinkCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve a payment link. - */ - retrieve( - id: string, - params?: PaymentLinkRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a payment link. - */ - update( - id: string, - params?: PaymentLinkUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your payment links. - */ - list( - params?: PaymentLinkListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: PaymentLinkListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/PaymentLinksResource.d.ts b/types/2022-11-15/PaymentLinksResource.d.ts new file mode 100644 index 0000000000..846c8d7a6d --- /dev/null +++ b/types/2022-11-15/PaymentLinksResource.d.ts @@ -0,0 +1,1167 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PaymentLinkCreateParams { + /** + * The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. + */ + line_items: Array; + + /** + * Behavior after the purchase is complete. + */ + after_completion?: PaymentLinkCreateParams.AfterCompletion; + + /** + * Enables user redeemable promotion codes. + */ + allow_promotion_codes?: boolean; + + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. + */ + application_fee_amount?: number; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + */ + application_fee_percent?: number; + + /** + * Configuration for automatic tax collection. + */ + automatic_tax?: PaymentLinkCreateParams.AutomaticTax; + + /** + * Configuration for collecting the customer's billing address. + */ + billing_address_collection?: PaymentLinkCreateParams.BillingAddressCollection; + + /** + * Configure fields to gather active consent from customers. + */ + 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; + + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkCreateParams.CustomText; + + /** + * 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). + */ + customer_creation?: PaymentLinkCreateParams.CustomerCreation; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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 associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge. + */ + on_behalf_of?: string; + + /** + * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + */ + payment_intent_data?: PaymentLinkCreateParams.PaymentIntentData; + + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: PaymentLinkCreateParams.PaymentMethodCollection; + + /** + * The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). + */ + payment_method_types?: Array; + + /** + * Controls phone number collection settings during checkout. + * + * We recommend that you review your privacy policy and check with your legal contacts. + */ + phone_number_collection?: PaymentLinkCreateParams.PhoneNumberCollection; + + /** + * Configuration for collecting the customer's shipping address. + */ + shipping_address_collection?: PaymentLinkCreateParams.ShippingAddressCollection; + + /** + * The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + */ + shipping_options?: Array; + + /** + * Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). + */ + submit_type?: PaymentLinkCreateParams.SubmitType; + + /** + * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. + */ + subscription_data?: PaymentLinkCreateParams.SubscriptionData; + + /** + * Controls tax ID collection during checkout. + */ + tax_id_collection?: PaymentLinkCreateParams.TaxIdCollection; + + /** + * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + */ + transfer_data?: PaymentLinkCreateParams.TransferData; + } + + namespace PaymentLinkCreateParams { + interface AfterCompletion { + /** + * Configuration when `type=hosted_confirmation`. + */ + hosted_confirmation?: AfterCompletion.HostedConfirmation; + + /** + * Configuration when `type=redirect`. + */ + redirect?: AfterCompletion.Redirect; + + /** + * The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. + */ + type: AfterCompletion.Type; + } + + namespace AfterCompletion { + interface HostedConfirmation { + /** + * A custom message to display to the customer after the purchase is complete. + */ + custom_message?: string; + } + + interface Redirect { + /** + * The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. + */ + url: string; + } + + type Type = 'hosted_confirmation' | 'redirect'; + } + + interface AutomaticTax { + /** + * If `true`, tax will be calculated automatically using the customer's location. + */ + enabled: boolean; + } + + type BillingAddressCollection = 'auto' | 'required'; + + interface ConsentCollection { + /** + * If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + * Session will determine whether to display an option to opt into promotional communication + * from the merchant depending on the customer's locale. Only available to US merchants. + */ + promotions?: ConsentCollection.Promotions; + + /** + * If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + * There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + */ + terms_of_service?: ConsentCollection.TermsOfService; + } + + namespace ConsentCollection { + type Promotions = 'auto' | 'none'; + + type TermsOfService = 'none' | 'required'; + } + + type CustomerCreation = 'always' | 'if_required'; + + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + + interface LineItem { + /** + * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. + */ + adjustable_quantity?: LineItem.AdjustableQuantity; + + /** + * The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + */ + price: string; + + /** + * The quantity of the line item being purchased. + */ + quantity: number; + } + + namespace LineItem { + interface AdjustableQuantity { + /** + * Set to true if the quantity can be adjusted to any non-negative Integer. + */ + enabled: boolean; + + /** + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + */ + maximum?: number; + + /** + * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + */ + minimum?: number; + } + } + + interface PaymentIntentData { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: PaymentIntentData.CaptureMethod; + + /** + * Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + * + * When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + * + * When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + * + * If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + * + * If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + * + * When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + */ + setup_future_usage?: PaymentIntentData.SetupFutureUsage; + } + + namespace PaymentIntentData { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'off_session' | 'on_session'; + } + + type PaymentMethodCollection = 'always' | 'if_required'; + + type PaymentMethodType = + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface PhoneNumberCollection { + /** + * Set to `true` to enable phone number collection. + */ + enabled: boolean; + } + + interface ShippingAddressCollection { + /** + * An array of two-letter ISO country codes representing which countries Checkout should provide as options for + * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + */ + allowed_countries: Array; + } + + namespace ShippingAddressCollection { + type AllowedCountry = + | 'AC' + | 'AD' + | 'AE' + | 'AF' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AQ' + | 'AR' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BY' + | 'BZ' + | 'CA' + | 'CD' + | 'CF' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CV' + | 'CW' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HN' + | 'HR' + | 'HT' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'LY' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MK' + | 'ML' + | 'MM' + | 'MN' + | 'MO' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NG' + | 'NI' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RU' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SO' + | 'SR' + | 'SS' + | 'ST' + | 'SV' + | 'SX' + | 'SZ' + | 'TA' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VE' + | 'VG' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'XK' + | 'YE' + | 'YT' + | 'ZA' + | 'ZM' + | 'ZW' + | 'ZZ'; + } + + interface ShippingOption { + /** + * The ID of the Shipping Rate to use for this shipping option. + */ + shipping_rate?: string; + } + + type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; + + interface SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * 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; + } + + interface TaxIdCollection { + /** + * Set to `true` to enable tax ID collection. + */ + enabled: boolean; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when a charge succeeds. + */ + amount?: number; + + /** + * If specified, successful charges will be attributed to the destination + * account for tax reporting, and the funds from charges will be transferred + * to the destination account. The ID of the resulting transfer will be + * returned on the successful charge's `transfer` field. + */ + destination: string; + } + } + + interface PaymentLinkRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentLinkUpdateParams { + /** + * Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + */ + active?: boolean; + + /** + * Behavior after the purchase is complete. + */ + after_completion?: PaymentLinkUpdateParams.AfterCompletion; + + /** + * Enables user redeemable promotion codes. + */ + allow_promotion_codes?: boolean; + + /** + * Configuration for automatic tax collection. + */ + automatic_tax?: PaymentLinkUpdateParams.AutomaticTax; + + /** + * Configuration for collecting the customer's billing address. + */ + billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection; + + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkUpdateParams.CustomText; + + /** + * 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). + */ + customer_creation?: PaymentLinkUpdateParams.CustomerCreation; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. + */ + line_items?: Array; + + /** + * 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 associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + */ + metadata?: Stripe.MetadataParam; + + /** + * Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + * + * Can only be set in `subscription` mode. + * + * If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + */ + payment_method_collection?: PaymentLinkUpdateParams.PaymentMethodCollection; + + /** + * The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types?: Stripe.Emptyable< + Array + >; + + /** + * Configuration for collecting the customer's shipping address. + */ + shipping_address_collection?: Stripe.Emptyable< + PaymentLinkUpdateParams.ShippingAddressCollection + >; + } + + namespace PaymentLinkUpdateParams { + interface AfterCompletion { + /** + * Configuration when `type=hosted_confirmation`. + */ + hosted_confirmation?: AfterCompletion.HostedConfirmation; + + /** + * Configuration when `type=redirect`. + */ + redirect?: AfterCompletion.Redirect; + + /** + * The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. + */ + type: AfterCompletion.Type; + } + + namespace AfterCompletion { + interface HostedConfirmation { + /** + * A custom message to display to the customer after the purchase is complete. + */ + custom_message?: string; + } + + interface Redirect { + /** + * The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. + */ + url: string; + } + + type Type = 'hosted_confirmation' | 'redirect'; + } + + interface AutomaticTax { + /** + * If `true`, tax will be calculated automatically using the customer's location. + */ + enabled: boolean; + } + + type BillingAddressCollection = 'auto' | 'required'; + + type CustomerCreation = 'always' | 'if_required'; + + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + + interface LineItem { + /** + * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. + */ + adjustable_quantity?: LineItem.AdjustableQuantity; + + /** + * The ID of an existing line item on the payment link. + */ + id: string; + + /** + * The quantity of the line item being purchased. + */ + quantity?: number; + } + + namespace LineItem { + interface AdjustableQuantity { + /** + * Set to true if the quantity can be adjusted to any non-negative Integer. + */ + enabled: boolean; + + /** + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + */ + maximum?: number; + + /** + * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + */ + minimum?: number; + } + } + + type PaymentMethodCollection = 'always' | 'if_required'; + + type PaymentMethodType = + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface ShippingAddressCollection { + /** + * An array of two-letter ISO country codes representing which countries Checkout should provide as options for + * shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + */ + allowed_countries: Array; + } + + namespace ShippingAddressCollection { + type AllowedCountry = + | 'AC' + | 'AD' + | 'AE' + | 'AF' + | 'AG' + | 'AI' + | 'AL' + | 'AM' + | 'AO' + | 'AQ' + | 'AR' + | 'AT' + | 'AU' + | 'AW' + | 'AX' + | 'AZ' + | 'BA' + | 'BB' + | 'BD' + | 'BE' + | 'BF' + | 'BG' + | 'BH' + | 'BI' + | 'BJ' + | 'BL' + | 'BM' + | 'BN' + | 'BO' + | 'BQ' + | 'BR' + | 'BS' + | 'BT' + | 'BV' + | 'BW' + | 'BY' + | 'BZ' + | 'CA' + | 'CD' + | 'CF' + | 'CG' + | 'CH' + | 'CI' + | 'CK' + | 'CL' + | 'CM' + | 'CN' + | 'CO' + | 'CR' + | 'CV' + | 'CW' + | 'CY' + | 'CZ' + | 'DE' + | 'DJ' + | 'DK' + | 'DM' + | 'DO' + | 'DZ' + | 'EC' + | 'EE' + | 'EG' + | 'EH' + | 'ER' + | 'ES' + | 'ET' + | 'FI' + | 'FJ' + | 'FK' + | 'FO' + | 'FR' + | 'GA' + | 'GB' + | 'GD' + | 'GE' + | 'GF' + | 'GG' + | 'GH' + | 'GI' + | 'GL' + | 'GM' + | 'GN' + | 'GP' + | 'GQ' + | 'GR' + | 'GS' + | 'GT' + | 'GU' + | 'GW' + | 'GY' + | 'HK' + | 'HN' + | 'HR' + | 'HT' + | 'HU' + | 'ID' + | 'IE' + | 'IL' + | 'IM' + | 'IN' + | 'IO' + | 'IQ' + | 'IS' + | 'IT' + | 'JE' + | 'JM' + | 'JO' + | 'JP' + | 'KE' + | 'KG' + | 'KH' + | 'KI' + | 'KM' + | 'KN' + | 'KR' + | 'KW' + | 'KY' + | 'KZ' + | 'LA' + | 'LB' + | 'LC' + | 'LI' + | 'LK' + | 'LR' + | 'LS' + | 'LT' + | 'LU' + | 'LV' + | 'LY' + | 'MA' + | 'MC' + | 'MD' + | 'ME' + | 'MF' + | 'MG' + | 'MK' + | 'ML' + | 'MM' + | 'MN' + | 'MO' + | 'MQ' + | 'MR' + | 'MS' + | 'MT' + | 'MU' + | 'MV' + | 'MW' + | 'MX' + | 'MY' + | 'MZ' + | 'NA' + | 'NC' + | 'NE' + | 'NG' + | 'NI' + | 'NL' + | 'NO' + | 'NP' + | 'NR' + | 'NU' + | 'NZ' + | 'OM' + | 'PA' + | 'PE' + | 'PF' + | 'PG' + | 'PH' + | 'PK' + | 'PL' + | 'PM' + | 'PN' + | 'PR' + | 'PS' + | 'PT' + | 'PY' + | 'QA' + | 'RE' + | 'RO' + | 'RS' + | 'RU' + | 'RW' + | 'SA' + | 'SB' + | 'SC' + | 'SE' + | 'SG' + | 'SH' + | 'SI' + | 'SJ' + | 'SK' + | 'SL' + | 'SM' + | 'SN' + | 'SO' + | 'SR' + | 'SS' + | 'ST' + | 'SV' + | 'SX' + | 'SZ' + | 'TA' + | 'TC' + | 'TD' + | 'TF' + | 'TG' + | 'TH' + | 'TJ' + | 'TK' + | 'TL' + | 'TM' + | 'TN' + | 'TO' + | 'TR' + | 'TT' + | 'TV' + | 'TW' + | 'TZ' + | 'UA' + | 'UG' + | 'US' + | 'UY' + | 'UZ' + | 'VA' + | 'VC' + | 'VE' + | 'VG' + | 'VN' + | 'VU' + | 'WF' + | 'WS' + | 'XK' + | 'YE' + | 'YT' + | 'ZA' + | 'ZM' + | 'ZW' + | 'ZZ'; + } + } + + interface PaymentLinkListParams extends PaginationParams { + /** + * Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentLinkListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class PaymentLinksResource { + /** + * Creates a payment link. + */ + create( + params: PaymentLinkCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve a payment link. + */ + retrieve( + id: string, + params?: PaymentLinkRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a payment link. + */ + update( + id: string, + params?: PaymentLinkUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your payment links. + */ + list( + params?: PaymentLinkListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: PaymentLinkListLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/PaymentMethods.d.ts b/types/2022-11-15/PaymentMethods.d.ts index f6b76fe80c..580ca2de9d 100644 --- a/types/2022-11-15/PaymentMethods.d.ts +++ b/types/2022-11-15/PaymentMethods.d.ts @@ -787,848 +787,5 @@ declare module 'stripe' { interface WechatPay {} } - - interface PaymentMethodCreateParams { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodCreateParams.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodCreateParams.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodCreateParams.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodCreateParams.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodCreateParams.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodCreateParams.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodCreateParams.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodCreateParams.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodCreateParams.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodCreateParams.Boleto; - - /** - * If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly. - */ - card?: PaymentMethodCreateParams.Card1 | PaymentMethodCreateParams.Card2; - - /** - * The `Customer` to whom the original PaymentMethod is attached. - */ - customer?: string; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodCreateParams.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodCreateParams.Eps; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodCreateParams.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodCreateParams.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodCreateParams.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodCreateParams.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodCreateParams.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodCreateParams.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodCreateParams.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodCreateParams.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodCreateParams.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodCreateParams.P24; - - /** - * The PaymentMethod to share. - */ - payment_method?: string; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodCreateParams.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodCreateParams.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodCreateParams.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodCreateParams.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodCreateParams.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodCreateParams.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type?: PaymentMethodCreateParams.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodCreateParams.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodCreateParams.WechatPay; - } - - namespace PaymentMethodCreateParams { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface Card1 { - /** - * The card's CVC. It is highly recommended to always include this value. - */ - cvc?: string; - - /** - * Two-digit number representing the card's expiration month. - */ - exp_month: number; - - /** - * Four-digit number representing the card's expiration year. - */ - exp_year: number; - - /** - * The card number, as a string without any separators. - */ - number: string; - } - - interface Card2 { - token: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentMethodUpdateParams { - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - acss_debit?: PaymentMethodUpdateParams.AcssDebit; - - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - affirm?: PaymentMethodUpdateParams.Affirm; - - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - au_becs_debit?: PaymentMethodUpdateParams.AuBecsDebit; - - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - bacs_debit?: PaymentMethodUpdateParams.BacsDebit; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodUpdateParams.BillingDetails; - - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - blik?: PaymentMethodUpdateParams.Blik; - - /** - * If this is a `card` PaymentMethod, this hash contains the user's card details. - */ - card?: PaymentMethodUpdateParams.Card; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodUpdateParams.Link; - - /** - * 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; - - /** - * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. - */ - sepa_debit?: PaymentMethodUpdateParams.SepaDebit; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodUpdateParams.UsBankAccount; - } - - namespace PaymentMethodUpdateParams { - interface AcssDebit {} - - interface Affirm {} - - interface AuBecsDebit {} - - interface BacsDebit {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Card { - /** - * Two-digit number representing the card's expiration month. - */ - exp_month?: number; - - /** - * Four-digit number representing the card's expiration year. - */ - exp_year?: number; - } - - interface Link {} - - interface SepaDebit {} - - interface UsBankAccount { - /** - * Bank account type. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - } - } - - interface PaymentMethodListParams extends PaginationParams { - /** - * A required filter on the list, based on the object `type` field. - */ - type: PaymentMethodListParams.Type; - - /** - * The ID of the customer whose PaymentMethods will be retrieved. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace PaymentMethodListParams { - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'card_present' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - } - - interface PaymentMethodAttachParams { - /** - * The ID of the customer to which to attach the PaymentMethod. - */ - customer: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PaymentMethodDetachParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class PaymentMethodsResource { - /** - * Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. - * - * Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. - */ - create( - params?: PaymentMethodCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) - */ - retrieve( - id: string, - params?: PaymentMethodRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. - */ - update( - id: string, - params?: PaymentMethodUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. - */ - list( - params: PaymentMethodListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Attaches a PaymentMethod object to a Customer. - * - * To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) - * or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). - * These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach - * endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for - * future use, which makes later declines and payment friction more likely. - * See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up - * future payments. - * - * To use this PaymentMethod as the default for invoice or subscription payments, - * set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), - * on the Customer to the PaymentMethod's ID. - */ - attach( - id: string, - params: PaymentMethodAttachParams, - options?: RequestOptions - ): Promise>; - - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. - */ - detach( - id: string, - params?: PaymentMethodDetachParams, - options?: RequestOptions - ): Promise>; - detach( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/PaymentMethodsResource.d.ts b/types/2022-11-15/PaymentMethodsResource.d.ts new file mode 100644 index 0000000000..f52f5ec6cd --- /dev/null +++ b/types/2022-11-15/PaymentMethodsResource.d.ts @@ -0,0 +1,848 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PaymentMethodCreateParams { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodCreateParams.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodCreateParams.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodCreateParams.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodCreateParams.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodCreateParams.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodCreateParams.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodCreateParams.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodCreateParams.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodCreateParams.Boleto; + + /** + * If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly. + */ + card?: PaymentMethodCreateParams.Card1 | PaymentMethodCreateParams.Card2; + + /** + * The `Customer` to whom the original PaymentMethod is attached. + */ + customer?: string; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodCreateParams.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodCreateParams.Eps; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodCreateParams.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodCreateParams.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodCreateParams.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodCreateParams.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodCreateParams.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodCreateParams.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodCreateParams.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodCreateParams.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodCreateParams.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodCreateParams.P24; + + /** + * The PaymentMethod to share. + */ + payment_method?: string; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodCreateParams.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodCreateParams.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodCreateParams.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodCreateParams.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodCreateParams.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodCreateParams.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type?: PaymentMethodCreateParams.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodCreateParams.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodCreateParams.WechatPay; + } + + namespace PaymentMethodCreateParams { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface Card1 { + /** + * The card's CVC. It is highly recommended to always include this value. + */ + cvc?: string; + + /** + * Two-digit number representing the card's expiration month. + */ + exp_month: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year: number; + + /** + * The card number, as a string without any separators. + */ + number: string; + } + + interface Card2 { + token: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentMethodUpdateParams { + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + acss_debit?: PaymentMethodUpdateParams.AcssDebit; + + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + affirm?: PaymentMethodUpdateParams.Affirm; + + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + au_becs_debit?: PaymentMethodUpdateParams.AuBecsDebit; + + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + bacs_debit?: PaymentMethodUpdateParams.BacsDebit; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodUpdateParams.BillingDetails; + + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + blik?: PaymentMethodUpdateParams.Blik; + + /** + * If this is a `card` PaymentMethod, this hash contains the user's card details. + */ + card?: PaymentMethodUpdateParams.Card; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodUpdateParams.Link; + + /** + * 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; + + /** + * This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. + */ + sepa_debit?: PaymentMethodUpdateParams.SepaDebit; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodUpdateParams.UsBankAccount; + } + + namespace PaymentMethodUpdateParams { + interface AcssDebit {} + + interface Affirm {} + + interface AuBecsDebit {} + + interface BacsDebit {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Card { + /** + * Two-digit number representing the card's expiration month. + */ + exp_month?: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year?: number; + } + + interface Link {} + + interface SepaDebit {} + + interface UsBankAccount { + /** + * Bank account type. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + } + } + + interface PaymentMethodListParams extends PaginationParams { + /** + * A required filter on the list, based on the object `type` field. + */ + type: PaymentMethodListParams.Type; + + /** + * The ID of the customer whose PaymentMethods will be retrieved. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace PaymentMethodListParams { + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'card' + | 'card_present' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + } + + interface PaymentMethodAttachParams { + /** + * The ID of the customer to which to attach the PaymentMethod. + */ + customer: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PaymentMethodDetachParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class PaymentMethodsResource { + /** + * Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. + * + * Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. + */ + create( + params?: PaymentMethodCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) + */ + retrieve( + id: string, + params?: PaymentMethodRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. + */ + update( + id: string, + params?: PaymentMethodUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. + */ + list( + params: PaymentMethodListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Attaches a PaymentMethod object to a Customer. + * + * To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) + * or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + * These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + * endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + * future use, which makes later declines and payment friction more likely. + * See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + * future payments. + * + * To use this PaymentMethod as the default for invoice or subscription payments, + * set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), + * on the Customer to the PaymentMethod's ID. + */ + attach( + id: string, + params: PaymentMethodAttachParams, + options?: RequestOptions + ): Promise>; + + /** + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + */ + detach( + id: string, + params?: PaymentMethodDetachParams, + options?: RequestOptions + ): Promise>; + detach( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Payouts.d.ts b/types/2022-11-15/Payouts.d.ts index 440e20de4c..e0a79e81b0 100644 --- a/types/2022-11-15/Payouts.d.ts +++ b/types/2022-11-15/Payouts.d.ts @@ -133,190 +133,5 @@ declare module 'stripe' { namespace Payout { type Type = 'bank_account' | 'card'; } - - interface PayoutCreateParams { - /** - * A positive integer in cents representing how much to payout. - */ - amount: 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; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The ID of a bank account or a card to send the payout to. If no destination is supplied, the default external account for the specified currency will be used. - */ - destination?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * The method used to send this payout, which can be `standard` or `instant`. `instant` is only supported for payouts to debit cards. (See [Instant payouts for marketplaces for more information](https://stripe.com/blog/instant-payouts-for-marketplaces).) - */ - method?: PayoutCreateParams.Method; - - /** - * The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the balances API. One of `bank_account`, `card`, or `fpx`. - */ - source_type?: PayoutCreateParams.SourceType; - - /** - * A string to be displayed on the recipient's bank or card statement. This may be at most 22 characters. Attempting to use a `statement_descriptor` longer than 22 characters will return an error. Note: Most banks will truncate this information and/or display it inconsistently. Some may not display it at all. - */ - statement_descriptor?: string; - } - - namespace PayoutCreateParams { - type Method = 'instant' | 'standard'; - - type SourceType = 'bank_account' | 'card' | 'fpx'; - } - - interface PayoutRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PayoutUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface PayoutListParams extends PaginationParams { - arrival_date?: Stripe.RangeQueryParam | number; - - created?: Stripe.RangeQueryParam | number; - - /** - * The ID of an external account - only return payouts sent to this external account. - */ - destination?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. - */ - status?: string; - } - - interface PayoutCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PayoutReverseParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - class PayoutsResource { - /** - * To send funds to your own bank account, you create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the payout amount, or you'll receive an “Insufficient Funds” error. - * - * If your API key is in test mode, money won't actually be sent, though everything else will occur as if in live mode. - * - * If you are creating a manual payout on a Stripe account that uses multiple payment source types, you'll need to specify the source type balance that the payout should draw from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. - */ - create( - params: PayoutCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information. - */ - retrieve( - id: string, - params?: PayoutRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified payout by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only the metadata as arguments. - */ - update( - id: string, - params?: PayoutUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. The payouts are returned in sorted order, with the most recently created payouts appearing first. - */ - list( - params?: PayoutListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * A previously created payout can be canceled if it has not yet been paid out. Funds will be refunded to your available balance. You may not cancel automatic Stripe payouts. - */ - cancel( - id: string, - params?: PayoutCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Reverses a payout by debiting the destination bank account. Only payouts for connected accounts to US bank accounts may be reversed at this time. If the payout is in the pending status, /v1/payouts/:id/cancel should be used instead. - * - * By requesting a reversal via /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account has authorized the debit on the bank account and that no other authorization is required. - */ - reverse( - id: string, - params?: PayoutReverseParams, - options?: RequestOptions - ): Promise>; - reverse( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/PayoutsResource.d.ts b/types/2022-11-15/PayoutsResource.d.ts new file mode 100644 index 0000000000..8604d25acf --- /dev/null +++ b/types/2022-11-15/PayoutsResource.d.ts @@ -0,0 +1,190 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PayoutCreateParams { + /** + * A positive integer in cents representing how much to payout. + */ + amount: 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; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The ID of a bank account or a card to send the payout to. If no destination is supplied, the default external account for the specified currency will be used. + */ + destination?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * The method used to send this payout, which can be `standard` or `instant`. `instant` is only supported for payouts to debit cards. (See [Instant payouts for marketplaces for more information](https://stripe.com/blog/instant-payouts-for-marketplaces).) + */ + method?: PayoutCreateParams.Method; + + /** + * The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the balances API. One of `bank_account`, `card`, or `fpx`. + */ + source_type?: PayoutCreateParams.SourceType; + + /** + * A string to be displayed on the recipient's bank or card statement. This may be at most 22 characters. Attempting to use a `statement_descriptor` longer than 22 characters will return an error. Note: Most banks will truncate this information and/or display it inconsistently. Some may not display it at all. + */ + statement_descriptor?: string; + } + + namespace PayoutCreateParams { + type Method = 'instant' | 'standard'; + + type SourceType = 'bank_account' | 'card' | 'fpx'; + } + + interface PayoutRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PayoutUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface PayoutListParams extends PaginationParams { + arrival_date?: Stripe.RangeQueryParam | number; + + created?: Stripe.RangeQueryParam | number; + + /** + * The ID of an external account - only return payouts sent to this external account. + */ + destination?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. + */ + status?: string; + } + + interface PayoutCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PayoutReverseParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + class PayoutsResource { + /** + * To send funds to your own bank account, you create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the payout amount, or you'll receive an “Insufficient Funds” error. + * + * If your API key is in test mode, money won't actually be sent, though everything else will occur as if in live mode. + * + * If you are creating a manual payout on a Stripe account that uses multiple payment source types, you'll need to specify the source type balance that the payout should draw from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. + */ + create( + params: PayoutCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information. + */ + retrieve( + id: string, + params?: PayoutRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified payout by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only the metadata as arguments. + */ + update( + id: string, + params?: PayoutUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. The payouts are returned in sorted order, with the most recently created payouts appearing first. + */ + list( + params?: PayoutListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * A previously created payout can be canceled if it has not yet been paid out. Funds will be refunded to your available balance. You may not cancel automatic Stripe payouts. + */ + cancel( + id: string, + params?: PayoutCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Reverses a payout by debiting the destination bank account. Only payouts for connected accounts to US bank accounts may be reversed at this time. If the payout is in the pending status, /v1/payouts/:id/cancel should be used instead. + * + * By requesting a reversal via /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account has authorized the debit on the bank account and that no other authorization is required. + */ + reverse( + id: string, + params?: PayoutReverseParams, + options?: RequestOptions + ): Promise>; + reverse( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Persons.d.ts b/types/2022-11-15/Persons.d.ts index 13bf6ec673..c29021e252 100644 --- a/types/2022-11-15/Persons.d.ts +++ b/types/2022-11-15/Persons.d.ts @@ -597,582 +597,5 @@ declare module 'stripe' { */ deleted: true; } - - interface PersonCreateParams { - /** - * The person's address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the person's address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the person's address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The person's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: PersonCreateParams.Documents; - - /** - * The person's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The person's first name. - */ - first_name?: string; - - /** - * The Kana variation of the person's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the person's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the person is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The person's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The person's last name. - */ - last_name?: string; - - /** - * The Kana variation of the person's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the person's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The person's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - */ - nationality?: string; - - /** - * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. - */ - person_token?: string; - - /** - * The person's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: string; - - /** - * The person's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The relationship that this person has with the account's legal entity. - */ - relationship?: PersonCreateParams.Relationship; - - /** - * The last four digits of the person's Social Security number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The person's verification status. - */ - verification?: PersonCreateParams.Verification; - } - - namespace PersonCreateParams { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Documents { - /** - * One or more documents that demonstrate proof that this person is authorized to represent the company. - */ - company_authorization?: Documents.CompanyAuthorization; - - /** - * One or more documents showing the person's passport page with photo and personal data. - */ - passport?: Documents.Passport; - - /** - * One or more documents showing the person's visa required for living in the country where they are residing. - */ - visa?: Documents.Visa; - } - - namespace Documents { - interface CompanyAuthorization { - /** - * 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; - } - - interface Passport { - /** - * 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; - } - - interface Visa { - /** - * 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; - } - } - - interface Relationship { - /** - * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - */ - director?: boolean; - - /** - * Whether the person has significant responsibility to control, manage, or direct the organization. - */ - executive?: boolean; - - /** - * Whether the person is an owner of the account's legal entity. - */ - owner?: boolean; - - /** - * The percent owned by the person of the account's legal entity. - */ - percent_ownership?: Stripe.Emptyable; - - /** - * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. - */ - representative?: boolean; - - /** - * The person's title (e.g., CEO, Support Engineer). - */ - title?: string; - } - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface PersonRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PersonUpdateParams { - /** - * The person's address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the person's address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the person's address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The person's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: PersonUpdateParams.Documents; - - /** - * The person's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The person's first name. - */ - first_name?: string; - - /** - * The Kana variation of the person's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the person's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the person is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The person's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The person's last name. - */ - last_name?: string; - - /** - * The Kana variation of the person's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the person's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The person's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - */ - nationality?: string; - - /** - * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. - */ - person_token?: string; - - /** - * The person's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: string; - - /** - * The person's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The relationship that this person has with the account's legal entity. - */ - relationship?: PersonUpdateParams.Relationship; - - /** - * The last four digits of the person's Social Security number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The person's verification status. - */ - verification?: PersonUpdateParams.Verification; - } - - namespace PersonUpdateParams { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Documents { - /** - * One or more documents that demonstrate proof that this person is authorized to represent the company. - */ - company_authorization?: Documents.CompanyAuthorization; - - /** - * One or more documents showing the person's passport page with photo and personal data. - */ - passport?: Documents.Passport; - - /** - * One or more documents showing the person's visa required for living in the country where they are residing. - */ - visa?: Documents.Visa; - } - - namespace Documents { - interface CompanyAuthorization { - /** - * 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; - } - - interface Passport { - /** - * 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; - } - - interface Visa { - /** - * 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; - } - } - - interface Relationship { - /** - * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - */ - director?: boolean; - - /** - * Whether the person has significant responsibility to control, manage, or direct the organization. - */ - executive?: boolean; - - /** - * Whether the person is an owner of the account's legal entity. - */ - owner?: boolean; - - /** - * The percent owned by the person of the account's legal entity. - */ - percent_ownership?: Stripe.Emptyable; - - /** - * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. - */ - representative?: boolean; - - /** - * The person's title (e.g., CEO, Support Engineer). - */ - title?: string; - } - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface PersonListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Filters on the list of people returned based on the person's relationship to the account's company. - */ - relationship?: PersonListParams.Relationship; - } - - namespace PersonListParams { - interface Relationship { - /** - * A filter on the list of people returned based on whether these people are directors of the account's company. - */ - director?: boolean; - - /** - * A filter on the list of people returned based on whether these people are executives of the account's company. - */ - executive?: boolean; - - /** - * A filter on the list of people returned based on whether these people are owners of the account's company. - */ - owner?: boolean; - - /** - * A filter on the list of people returned based on whether these people are the representative of the account's company. - */ - representative?: boolean; - } - } - - interface PersonDeleteParams {} } } diff --git a/types/2022-11-15/PersonsResource.d.ts b/types/2022-11-15/PersonsResource.d.ts new file mode 100644 index 0000000000..244afa0fa2 --- /dev/null +++ b/types/2022-11-15/PersonsResource.d.ts @@ -0,0 +1,582 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PersonCreateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonCreateParams.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonCreateParams.Relationship; + + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: PersonCreateParams.Verification; + } + + namespace PersonCreateParams { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Documents { + /** + * One or more documents that demonstrate proof that this person is authorized to represent the company. + */ + company_authorization?: Documents.CompanyAuthorization; + + /** + * One or more documents showing the person's passport page with photo and personal data. + */ + passport?: Documents.Passport; + + /** + * One or more documents showing the person's visa required for living in the country where they are residing. + */ + visa?: Documents.Visa; + } + + namespace Documents { + interface CompanyAuthorization { + /** + * 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; + } + + interface Passport { + /** + * 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; + } + + interface Visa { + /** + * 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; + } + } + + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface PersonRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PersonUpdateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonUpdateParams.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonUpdateParams.Relationship; + + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: PersonUpdateParams.Verification; + } + + namespace PersonUpdateParams { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Documents { + /** + * One or more documents that demonstrate proof that this person is authorized to represent the company. + */ + company_authorization?: Documents.CompanyAuthorization; + + /** + * One or more documents showing the person's passport page with photo and personal data. + */ + passport?: Documents.Passport; + + /** + * One or more documents showing the person's visa required for living in the country where they are residing. + */ + visa?: Documents.Visa; + } + + namespace Documents { + interface CompanyAuthorization { + /** + * 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; + } + + interface Passport { + /** + * 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; + } + + interface Visa { + /** + * 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; + } + } + + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface PersonListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filters on the list of people returned based on the person's relationship to the account's company. + */ + relationship?: PersonListParams.Relationship; + } + + namespace PersonListParams { + interface Relationship { + /** + * A filter on the list of people returned based on whether these people are directors of the account's company. + */ + director?: boolean; + + /** + * A filter on the list of people returned based on whether these people are executives of the account's company. + */ + executive?: boolean; + + /** + * A filter on the list of people returned based on whether these people are owners of the account's company. + */ + owner?: boolean; + + /** + * A filter on the list of people returned based on whether these people are the representative of the account's company. + */ + representative?: boolean; + } + } + + interface PersonDeleteParams {} + } +} diff --git a/types/2022-11-15/Plans.d.ts b/types/2022-11-15/Plans.d.ts index b5a34f597b..81ebb5ac7e 100644 --- a/types/2022-11-15/Plans.d.ts +++ b/types/2022-11-15/Plans.d.ts @@ -190,305 +190,5 @@ declare module 'stripe' { */ deleted: true; } - - interface PlanCreateParams { - /** - * 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; - - /** - * Specifies billing frequency. Either `day`, `week`, `month` or `year`. - */ - interval: PlanCreateParams.Interval; - - /** - * Whether the plan is currently available for new subscriptions. Defaults to `true`. - */ - active?: boolean; - - /** - * Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - */ - aggregate_usage?: PlanCreateParams.AggregateUsage; - - /** - * A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. - */ - amount?: number; - - /** - * Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. - */ - amount_decimal?: string; - - /** - * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - */ - billing_scheme?: PlanCreateParams.BillingScheme; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. - */ - id?: string; - - /** - * 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; - - /** - * 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; - - /** - * A brief description of the plan, hidden from customers. - */ - nickname?: string; - - product?: PlanCreateParams.Product | string; - - /** - * 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; - - /** - * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. - */ - tiers_mode?: PlanCreateParams.TiersMode; - - /** - * Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. - */ - transform_usage?: PlanCreateParams.TransformUsage; - - /** - * 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). - */ - trial_period_days?: number; - - /** - * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. - */ - usage_type?: PlanCreateParams.UsageType; - } - - namespace PlanCreateParams { - type AggregateUsage = 'last_during_period' | 'last_ever' | 'max' | 'sum'; - - type BillingScheme = 'per_unit' | 'tiered'; - - type Interval = 'day' | 'month' | 'week' | 'year'; - - interface Product { - /** - * Whether the product is currently available for purchase. Defaults to `true`. - */ - active?: boolean; - - /** - * The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. - */ - id?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. - * - * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - */ - statement_descriptor?: string; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. - */ - unit_label?: string; - } - - 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; - } - - type TiersMode = 'graduated' | 'volume'; - - interface TransformUsage { - /** - * Divide usage by this number. - */ - divide_by: number; - - /** - * After division, either round the result `up` or `down`. - */ - round: TransformUsage.Round; - } - - namespace TransformUsage { - type Round = 'down' | 'up'; - } - - type UsageType = 'licensed' | 'metered'; - } - - interface PlanRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PlanUpdateParams { - /** - * Whether the plan is currently available for new subscriptions. - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * A brief description of the plan, hidden from customers. - */ - nickname?: string; - - /** - * The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. - */ - product?: string; - - /** - * 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). - */ - trial_period_days?: number; - } - - interface PlanListParams extends PaginationParams { - /** - * Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). - */ - active?: boolean; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return plans for the given product. - */ - product?: string; - } - - interface PlanDeleteParams {} - - class PlansResource { - /** - * 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. - */ - create( - params: PlanCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the plan with the given ID. - */ - retrieve( - id: string, - params?: PlanRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. - */ - update( - id: string, - params?: PlanUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your plans. - */ - list( - params?: PlanListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. - */ - del( - id: string, - params?: PlanDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/PlansResource.d.ts b/types/2022-11-15/PlansResource.d.ts new file mode 100644 index 0000000000..8d516ac22b --- /dev/null +++ b/types/2022-11-15/PlansResource.d.ts @@ -0,0 +1,305 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PlanCreateParams { + /** + * 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; + + /** + * Specifies billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: PlanCreateParams.Interval; + + /** + * Whether the plan is currently available for new subscriptions. Defaults to `true`. + */ + active?: boolean; + + /** + * Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + */ + aggregate_usage?: PlanCreateParams.AggregateUsage; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. + */ + amount?: number; + + /** + * Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. + */ + amount_decimal?: string; + + /** + * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + */ + billing_scheme?: PlanCreateParams.BillingScheme; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. + */ + id?: string; + + /** + * 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; + + /** + * 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; + + /** + * A brief description of the plan, hidden from customers. + */ + nickname?: string; + + product?: PlanCreateParams.Product | string; + + /** + * 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; + + /** + * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + */ + tiers_mode?: PlanCreateParams.TiersMode; + + /** + * Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. + */ + transform_usage?: PlanCreateParams.TransformUsage; + + /** + * 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). + */ + trial_period_days?: number; + + /** + * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + */ + usage_type?: PlanCreateParams.UsageType; + } + + namespace PlanCreateParams { + type AggregateUsage = 'last_during_period' | 'last_ever' | 'max' | 'sum'; + + type BillingScheme = 'per_unit' | 'tiered'; + + type Interval = 'day' | 'month' | 'week' | 'year'; + + interface Product { + /** + * Whether the product is currently available for purchase. Defaults to `true`. + */ + active?: boolean; + + /** + * The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. + */ + id?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. + * + * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. + */ + statement_descriptor?: string; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. + */ + unit_label?: string; + } + + 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; + } + + type TiersMode = 'graduated' | 'volume'; + + interface TransformUsage { + /** + * Divide usage by this number. + */ + divide_by: number; + + /** + * After division, either round the result `up` or `down`. + */ + round: TransformUsage.Round; + } + + namespace TransformUsage { + type Round = 'down' | 'up'; + } + + type UsageType = 'licensed' | 'metered'; + } + + interface PlanRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PlanUpdateParams { + /** + * Whether the plan is currently available for new subscriptions. + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * A brief description of the plan, hidden from customers. + */ + nickname?: string; + + /** + * The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. + */ + product?: string; + + /** + * 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). + */ + trial_period_days?: number; + } + + interface PlanListParams extends PaginationParams { + /** + * Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). + */ + active?: boolean; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return plans for the given product. + */ + product?: string; + } + + interface PlanDeleteParams {} + + class PlansResource { + /** + * 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. + */ + create( + params: PlanCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the plan with the given ID. + */ + retrieve( + id: string, + params?: PlanRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. + */ + update( + id: string, + params?: PlanUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your plans. + */ + list( + params?: PlanListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. + */ + del( + id: string, + params?: PlanDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Prices.d.ts b/types/2022-11-15/Prices.d.ts index b4fb46baef..62b1b36c36 100644 --- a/types/2022-11-15/Prices.d.ts +++ b/types/2022-11-15/Prices.d.ts @@ -324,620 +324,5 @@ declare module 'stripe' { */ deleted: true; } - - interface PriceCreateParams { - /** - * 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; - - /** - * Whether the price can be used for new purchases. Defaults to `true`. - */ - active?: boolean; - - /** - * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - */ - 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. - */ - custom_unit_amount?: PriceCreateParams.CustomUnitAmount; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. - */ - lookup_key?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * A brief description of the price, hidden from customers. - */ - nickname?: string; - - /** - * The ID of the product that this price will belong to. - */ - product?: string; - - /** - * These fields can be used to create a new product that this price will belong to. - */ - product_data?: PriceCreateParams.ProductData; - - /** - * The recurring components of a price such as `interval` and `usage_type`. - */ - recurring?: PriceCreateParams.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?: PriceCreateParams.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; - - /** - * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. - */ - tiers_mode?: PriceCreateParams.TiersMode; - - /** - * If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - */ - transfer_lookup_key?: boolean; - - /** - * Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. - */ - transform_quantity?: PriceCreateParams.TransformQuantity; - - /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. - */ - 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 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`. - */ - 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; - } - - interface ProductData { - /** - * Whether the product is currently available for purchase. Defaults to `true`. - */ - active?: boolean; - - /** - * The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. - */ - id?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. - * - * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - */ - statement_descriptor?: string; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. - */ - unit_label?: string; - } - - interface Recurring { - /** - * Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - */ - aggregate_usage?: Recurring.AggregateUsage; - - /** - * 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; - - /** - * Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - */ - trial_period_days?: number; - - /** - * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. - */ - usage_type?: Recurring.UsageType; - } - - namespace Recurring { - type AggregateUsage = - | 'last_during_period' - | 'last_ever' - | 'max' - | 'sum'; - - type Interval = 'day' | 'month' | 'week' | 'year'; - - type UsageType = 'licensed' | 'metered'; - } - - 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; - } - - type TiersMode = 'graduated' | 'volume'; - - interface TransformQuantity { - /** - * Divide usage by this number. - */ - divide_by: number; - - /** - * After division, either round the result `up` or `down`. - */ - round: TransformQuantity.Round; - } - - namespace TransformQuantity { - type Round = 'down' | 'up'; - } - } - - interface PriceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PriceUpdateParams { - /** - * Whether the price can be used for new purchases. Defaults to `true`. - */ - 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. - */ - expand?: Array; - - /** - * A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. - */ - lookup_key?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * A brief description of the price, hidden from customers. - */ - nickname?: string; - - /** - * The recurring components of a price such as `interval` and `usage_type`. - */ - recurring?: Stripe.Emptyable; - - /** - * 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?: PriceUpdateParams.TaxBehavior; - - /** - * If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - */ - transfer_lookup_key?: boolean; - } - - 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). - */ - trial_period_days?: number; - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface PriceListParams extends PaginationParams { - /** - * Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). - */ - active?: boolean; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return prices for the given currency. - */ - currency?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return the price with these lookup_keys, if any exist. - */ - lookup_keys?: Array; - - /** - * Only return prices for the given product. - */ - product?: string; - - /** - * Only return prices with these recurring fields. - */ - recurring?: PriceListParams.Recurring; - - /** - * Only return prices of type `recurring` or `one_time`. - */ - type?: PriceListParams.Type; - } - - namespace PriceListParams { - interface Recurring { - /** - * Filter by billing frequency. Either `day`, `week`, `month` or `year`. - */ - interval?: Recurring.Interval; - - /** - * Filter by the usage type for this price. Can be either `metered` or `licensed`. - */ - usage_type?: Recurring.UsageType; - } - - namespace Recurring { - type Interval = 'day' | 'month' | 'week' | 'year'; - - type UsageType = 'licensed' | 'metered'; - } - - type Type = 'one_time' | 'recurring'; - } - - interface PriceSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - class PricesResource { - /** - * Creates a new price for an existing product. The price can be recurring or one-time. - */ - create( - params: PriceCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the price with the given ID. - */ - retrieve( - id: string, - params?: PriceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. - */ - update( - id: string, - params?: PriceUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your prices. - */ - list( - params?: PriceListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: PriceSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - } } } diff --git a/types/2022-11-15/PricesResource.d.ts b/types/2022-11-15/PricesResource.d.ts new file mode 100644 index 0000000000..83dbca4875 --- /dev/null +++ b/types/2022-11-15/PricesResource.d.ts @@ -0,0 +1,620 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PriceCreateParams { + /** + * 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; + + /** + * Whether the price can be used for new purchases. Defaults to `true`. + */ + active?: boolean; + + /** + * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + */ + 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. + */ + custom_unit_amount?: PriceCreateParams.CustomUnitAmount; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. + */ + lookup_key?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * A brief description of the price, hidden from customers. + */ + nickname?: string; + + /** + * The ID of the product that this price will belong to. + */ + product?: string; + + /** + * These fields can be used to create a new product that this price will belong to. + */ + product_data?: PriceCreateParams.ProductData; + + /** + * The recurring components of a price such as `interval` and `usage_type`. + */ + recurring?: PriceCreateParams.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?: PriceCreateParams.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; + + /** + * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + */ + tiers_mode?: PriceCreateParams.TiersMode; + + /** + * If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + */ + transfer_lookup_key?: boolean; + + /** + * Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. + */ + transform_quantity?: PriceCreateParams.TransformQuantity; + + /** + * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + */ + 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 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`. + */ + 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; + } + + interface ProductData { + /** + * Whether the product is currently available for purchase. Defaults to `true`. + */ + active?: boolean; + + /** + * The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. + */ + id?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. + * + * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. + */ + statement_descriptor?: string; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. + */ + unit_label?: string; + } + + interface Recurring { + /** + * Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + */ + aggregate_usage?: Recurring.AggregateUsage; + + /** + * 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; + + /** + * Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + */ + trial_period_days?: number; + + /** + * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + */ + usage_type?: Recurring.UsageType; + } + + namespace Recurring { + type AggregateUsage = + | 'last_during_period' + | 'last_ever' + | 'max' + | 'sum'; + + type Interval = 'day' | 'month' | 'week' | 'year'; + + type UsageType = 'licensed' | 'metered'; + } + + 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; + } + + type TiersMode = 'graduated' | 'volume'; + + interface TransformQuantity { + /** + * Divide usage by this number. + */ + divide_by: number; + + /** + * After division, either round the result `up` or `down`. + */ + round: TransformQuantity.Round; + } + + namespace TransformQuantity { + type Round = 'down' | 'up'; + } + } + + interface PriceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PriceUpdateParams { + /** + * Whether the price can be used for new purchases. Defaults to `true`. + */ + 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. + */ + expand?: Array; + + /** + * A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. + */ + lookup_key?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * A brief description of the price, hidden from customers. + */ + nickname?: string; + + /** + * The recurring components of a price such as `interval` and `usage_type`. + */ + recurring?: Stripe.Emptyable; + + /** + * 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?: PriceUpdateParams.TaxBehavior; + + /** + * If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + */ + transfer_lookup_key?: boolean; + } + + 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). + */ + trial_period_days?: number; + } + + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface PriceListParams extends PaginationParams { + /** + * Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). + */ + active?: boolean; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return prices for the given currency. + */ + currency?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return the price with these lookup_keys, if any exist. + */ + lookup_keys?: Array; + + /** + * Only return prices for the given product. + */ + product?: string; + + /** + * Only return prices with these recurring fields. + */ + recurring?: PriceListParams.Recurring; + + /** + * Only return prices of type `recurring` or `one_time`. + */ + type?: PriceListParams.Type; + } + + namespace PriceListParams { + interface Recurring { + /** + * Filter by billing frequency. Either `day`, `week`, `month` or `year`. + */ + interval?: Recurring.Interval; + + /** + * Filter by the usage type for this price. Can be either `metered` or `licensed`. + */ + usage_type?: Recurring.UsageType; + } + + namespace Recurring { + type Interval = 'day' | 'month' | 'week' | 'year'; + + type UsageType = 'licensed' | 'metered'; + } + + type Type = 'one_time' | 'recurring'; + } + + interface PriceSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + class PricesResource { + /** + * Creates a new price for an existing product. The price can be recurring or one-time. + */ + create( + params: PriceCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the price with the given ID. + */ + retrieve( + id: string, + params?: PriceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. + */ + update( + id: string, + params?: PriceUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your prices. + */ + list( + params?: PriceListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: PriceSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + } + } +} diff --git a/types/2022-11-15/Products.d.ts b/types/2022-11-15/Products.d.ts index f782fa3920..8cd59db0ec 100644 --- a/types/2022-11-15/Products.d.ts +++ b/types/2022-11-15/Products.d.ts @@ -166,508 +166,5 @@ declare module 'stripe' { */ deleted: true; } - - interface ProductCreateParams { - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * Whether the product is currently available for purchase. Defaults to `true`. - */ - active?: boolean; - - /** - * A list of up to 5 alphanumeric attributes. Should only be set if type=`good`. - */ - attributes?: Array; - - /** - * A short one-line description of the product, meant to be displayable to the customer. May only be set if type=`good`. - */ - caption?: string; - - /** - * An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if type=`good`. - */ - deactivate_on?: Array; - - /** - * 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. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. - */ - id?: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Array; - - /** - * 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.MetadataParam; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: ProductCreateParams.PackageDimensions; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. - * - * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - * It must contain at least one letter. - */ - statement_descriptor?: string; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. - */ - type?: ProductCreateParams.Type; - - /** - * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. - */ - unit_label?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: string; - } - - 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; - - /** - * 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`. - */ - 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 cents (or local equivalent) (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 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 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`. - */ - 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. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - - type Type = 'good' | 'service'; - } - - interface ProductRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ProductUpdateParams { - /** - * Whether the product is available for purchase. - */ - active?: boolean; - - /** - * A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g., `["color", "size"]`). If a value for `attributes` is specified, the list specified will replace the existing attributes list on this product. Any attributes not present after the update will be deleted from the SKUs for this product. - */ - attributes?: Stripe.Emptyable>; - - /** - * A short one-line description of the product, meant to be displayable to the customer. May only be set if `type=good`. - */ - caption?: string; - - /** - * An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if `type=good`. - */ - deactivate_on?: Array; - - /** - * 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. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Stripe.Emptyable>; - - /** - * 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; - - /** - * The product's name, meant to be displayable to the customer. - */ - name?: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable< - ProductUpdateParams.PackageDimensions - >; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. - * - * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. - * It must contain at least one letter. May only be set if `type=service`. - */ - statement_descriptor?: string; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: Stripe.Emptyable; - - /** - * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. May only be set if `type=service`. - */ - unit_label?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: Stripe.Emptyable; - } - - namespace ProductUpdateParams { - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - - interface ProductListParams extends PaginationParams { - /** - * Only return products that are active or inactive (e.g., pass `false` to list all inactive products). - */ - active?: boolean; - - /** - * Only return products that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). - */ - ids?: Array; - - /** - * Only return products that can be shipped (i.e., physical, not digital products). - */ - shippable?: boolean; - - /** - * Only return products of this type. - */ - type?: ProductListParams.Type; - - /** - * Only return products with the given url. - */ - url?: string; - } - - namespace ProductListParams { - type Type = 'good' | 'service'; - } - - interface ProductDeleteParams {} - - interface ProductSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - class ProductsResource { - /** - * Creates a new product object. - */ - create( - params: ProductCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. - */ - retrieve( - id: string, - params?: ProductRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: ProductUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. - */ - list( - params?: ProductListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. - */ - del( - id: string, - params?: ProductDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: ProductSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - } } } diff --git a/types/2022-11-15/ProductsResource.d.ts b/types/2022-11-15/ProductsResource.d.ts new file mode 100644 index 0000000000..a14195fbf0 --- /dev/null +++ b/types/2022-11-15/ProductsResource.d.ts @@ -0,0 +1,508 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ProductCreateParams { + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * Whether the product is currently available for purchase. Defaults to `true`. + */ + active?: boolean; + + /** + * A list of up to 5 alphanumeric attributes. Should only be set if type=`good`. + */ + attributes?: Array; + + /** + * A short one-line description of the product, meant to be displayable to the customer. May only be set if type=`good`. + */ + caption?: string; + + /** + * An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if type=`good`. + */ + deactivate_on?: Array; + + /** + * 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. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. + */ + id?: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Array; + + /** + * 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.MetadataParam; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: ProductCreateParams.PackageDimensions; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. + * + * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. + * It must contain at least one letter. + */ + statement_descriptor?: string; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. + */ + type?: ProductCreateParams.Type; + + /** + * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. + */ + unit_label?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: string; + } + + 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; + + /** + * 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`. + */ + 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 cents (or local equivalent) (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 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 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`. + */ + 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. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + + type Type = 'good' | 'service'; + } + + interface ProductRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ProductUpdateParams { + /** + * Whether the product is available for purchase. + */ + active?: boolean; + + /** + * A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g., `["color", "size"]`). If a value for `attributes` is specified, the list specified will replace the existing attributes list on this product. Any attributes not present after the update will be deleted from the SKUs for this product. + */ + attributes?: Stripe.Emptyable>; + + /** + * A short one-line description of the product, meant to be displayable to the customer. May only be set if `type=good`. + */ + caption?: string; + + /** + * An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if `type=good`. + */ + deactivate_on?: Array; + + /** + * 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. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Stripe.Emptyable>; + + /** + * 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; + + /** + * The product's name, meant to be displayable to the customer. + */ + name?: string; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: Stripe.Emptyable< + ProductUpdateParams.PackageDimensions + >; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. + * + * This may be up to 22 characters. The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. + * It must contain at least one letter. May only be set if `type=service`. + */ + statement_descriptor?: string; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: Stripe.Emptyable; + + /** + * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. May only be set if `type=service`. + */ + unit_label?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: Stripe.Emptyable; + } + + namespace ProductUpdateParams { + interface PackageDimensions { + /** + * Height, in inches. Maximum precision is 2 decimal places. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + } + + interface ProductListParams extends PaginationParams { + /** + * Only return products that are active or inactive (e.g., pass `false` to list all inactive products). + */ + active?: boolean; + + /** + * Only return products that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). + */ + ids?: Array; + + /** + * Only return products that can be shipped (i.e., physical, not digital products). + */ + shippable?: boolean; + + /** + * Only return products of this type. + */ + type?: ProductListParams.Type; + + /** + * Only return products with the given url. + */ + url?: string; + } + + namespace ProductListParams { + type Type = 'good' | 'service'; + } + + interface ProductDeleteParams {} + + interface ProductSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + class ProductsResource { + /** + * Creates a new product object. + */ + create( + params: ProductCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. + */ + retrieve( + id: string, + params?: ProductRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: ProductUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. + */ + list( + params?: ProductListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. + */ + del( + id: string, + params?: ProductDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: ProductSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + } + } +} diff --git a/types/2022-11-15/PromotionCodes.d.ts b/types/2022-11-15/PromotionCodes.d.ts index 1b6458c845..a89780e7fa 100644 --- a/types/2022-11-15/PromotionCodes.d.ts +++ b/types/2022-11-15/PromotionCodes.d.ts @@ -106,209 +106,5 @@ declare module 'stripe' { } } } - - interface PromotionCodeCreateParams { - /** - * The coupon for this promotion code. - */ - coupon: string; - - /** - * Whether the promotion code is currently active. - */ - active?: boolean; - - /** - * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. - */ - code?: string; - - /** - * The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. - */ - expires_at?: number; - - /** - * A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. - */ - max_redemptions?: number; - - /** - * 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.MetadataParam; - - /** - * Settings that restrict the redemption of the promotion code. - */ - restrictions?: PromotionCodeCreateParams.Restrictions; - } - - 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 - */ - first_time_transaction?: boolean; - - /** - * 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; - - /** - * Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount - */ - 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 { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PromotionCodeUpdateParams { - /** - * Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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 { - /** - * Filter promotion codes by whether they are active. - */ - active?: boolean; - - /** - * Only return promotion codes that have this case-insensitive code. - */ - code?: string; - - /** - * Only return promotion codes for this coupon. - */ - coupon?: string; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return promotion codes that are restricted to this customer. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class PromotionCodesResource { - /** - * A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. - */ - create( - params: PromotionCodeCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. - */ - retrieve( - id: string, - params?: PromotionCodeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. - */ - update( - id: string, - params?: PromotionCodeUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your promotion codes. - */ - list( - params?: PromotionCodeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/PromotionCodesResource.d.ts b/types/2022-11-15/PromotionCodesResource.d.ts new file mode 100644 index 0000000000..620838bb23 --- /dev/null +++ b/types/2022-11-15/PromotionCodesResource.d.ts @@ -0,0 +1,209 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface PromotionCodeCreateParams { + /** + * The coupon for this promotion code. + */ + coupon: string; + + /** + * Whether the promotion code is currently active. + */ + active?: boolean; + + /** + * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. + */ + code?: string; + + /** + * The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. + */ + expires_at?: number; + + /** + * A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. + */ + max_redemptions?: number; + + /** + * 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.MetadataParam; + + /** + * Settings that restrict the redemption of the promotion code. + */ + restrictions?: PromotionCodeCreateParams.Restrictions; + } + + 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 + */ + first_time_transaction?: boolean; + + /** + * 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; + + /** + * Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount + */ + 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 { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PromotionCodeUpdateParams { + /** + * Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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 { + /** + * Filter promotion codes by whether they are active. + */ + active?: boolean; + + /** + * Only return promotion codes that have this case-insensitive code. + */ + code?: string; + + /** + * Only return promotion codes for this coupon. + */ + coupon?: string; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return promotion codes that are restricted to this customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class PromotionCodesResource { + /** + * A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. + */ + create( + params: PromotionCodeCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. + */ + retrieve( + id: string, + params?: PromotionCodeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. + */ + update( + id: string, + params?: PromotionCodeUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your promotion codes. + */ + list( + params?: PromotionCodeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Quotes.d.ts b/types/2022-11-15/Quotes.d.ts index 9810469ee2..68a659a110 100644 --- a/types/2022-11-15/Quotes.d.ts +++ b/types/2022-11-15/Quotes.d.ts @@ -515,693 +515,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - interface QuoteCreateParams { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. - */ - application_fee_amount?: Stripe.Emptyable; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. - */ - application_fee_percent?: Stripe.Emptyable; - - /** - * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. - */ - automatic_tax?: QuoteCreateParams.AutomaticTax; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - */ - collection_method?: QuoteCreateParams.CollectionMethod; - - /** - * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - */ - customer?: string; - - /** - * The tax rates that will apply to any line item that does not have `tax_rates` set. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. - */ - description?: string; - - /** - * The discounts applied to the quote. You can only set up to one discount. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. - */ - expires_at?: number; - - /** - * A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. - */ - footer?: string; - - /** - * Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`. - */ - from_quote?: QuoteCreateParams.FromQuote; - - /** - * A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. - */ - header?: string; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: QuoteCreateParams.InvoiceSettings; - - /** - * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items?: Array; - - /** - * 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.MetadataParam; - - /** - * The account on behalf of which to charge. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. - */ - subscription_data?: QuoteCreateParams.SubscriptionData; - - /** - * ID of the test clock to attach to the quote. - */ - test_clock?: string; - - /** - * The data with which to automatically create a Transfer for each of the invoices. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace QuoteCreateParams { - interface AutomaticTax { - /** - * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. - */ - enabled: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface FromQuote { - /** - * Whether this quote is a revision of the previous quote. - */ - is_revision?: boolean; - - /** - * The `id` of the quote that will be cloned. - */ - quote: string; - } - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. - */ - days_until_due?: number; - } - - interface LineItem { - /** - * The ID of the price object. One of `price` or `price_data` is required. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - */ - price_data?: LineItem.PriceData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring?: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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 SubscriptionData { - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. - */ - effective_date?: Stripe.Emptyable<'current_period_end' | number>; - - /** - * Integer representing the number of trial period days before the customer is charged for the first time. - */ - trial_period_days?: Stripe.Emptyable; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface QuoteRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuoteUpdateParams { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. - */ - application_fee_amount?: Stripe.Emptyable; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. - */ - application_fee_percent?: Stripe.Emptyable; - - /** - * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. - */ - automatic_tax?: QuoteUpdateParams.AutomaticTax; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - */ - collection_method?: QuoteUpdateParams.CollectionMethod; - - /** - * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - */ - customer?: string; - - /** - * The tax rates that will apply to any line item that does not have `tax_rates` set. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * A description that will be displayed on the quote PDF. - */ - description?: string; - - /** - * The discounts applied to the quote. You can only set up to one discount. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. - */ - expires_at?: number; - - /** - * A footer that will be displayed on the quote PDF. - */ - footer?: string; - - /** - * A header that will be displayed on the quote PDF. - */ - header?: string; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: QuoteUpdateParams.InvoiceSettings; - - /** - * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items?: Array; - - /** - * 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.MetadataParam; - - /** - * The account on behalf of which to charge. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. - */ - subscription_data?: QuoteUpdateParams.SubscriptionData; - - /** - * The data with which to automatically create a Transfer for each of the invoices. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace QuoteUpdateParams { - interface AutomaticTax { - /** - * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. - */ - enabled: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. - */ - days_until_due?: number; - } - - interface LineItem { - /** - * The ID of an existing line item on the quote. - */ - id?: string; - - /** - * The ID of the price object. One of `price` or `price_data` is required. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. - */ - price_data?: LineItem.PriceData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring?: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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 SubscriptionData { - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. - */ - effective_date?: Stripe.Emptyable<'current_period_end' | number>; - - /** - * Integer representing the number of trial period days before the customer is charged for the first time. - */ - trial_period_days?: Stripe.Emptyable; - } - - interface TransferData { - /** - * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface QuoteListParams extends PaginationParams { - /** - * The ID of the customer whose quotes will be retrieved. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The status of the quote. - */ - status?: QuoteListParams.Status; - - /** - * Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. - */ - test_clock?: string; - } - - namespace QuoteListParams { - type Status = 'accepted' | 'canceled' | 'draft' | 'open'; - } - - interface QuoteAcceptParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuoteCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuoteFinalizeQuoteParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. - */ - expires_at?: number; - } - - interface QuoteListComputedUpfrontLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuoteListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuotePdfParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class QuotesResource { - /** - * A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). - */ - create( - params?: QuoteCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the quote with the given ID. - */ - retrieve( - id: string, - params?: QuoteRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * A quote models prices and services for a customer. - */ - update( - id: string, - params?: QuoteUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your quotes. - */ - list( - params?: QuoteListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Accepts the specified quote. - */ - accept( - id: string, - params?: QuoteAcceptParams, - options?: RequestOptions - ): Promise>; - accept( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Cancels the quote. - */ - cancel( - id: string, - params?: QuoteCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Finalizes the quote. - */ - finalizeQuote( - id: string, - params?: QuoteFinalizeQuoteParams, - options?: RequestOptions - ): Promise>; - finalizeQuote( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. - */ - listComputedUpfrontLineItems( - id: string, - params?: QuoteListComputedUpfrontLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listComputedUpfrontLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: QuoteListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Download the PDF for a finalized quote - */ - pdf( - id: string, - params?: QuotePdfParams, - options?: RequestOptions - ): Promise; - pdf(id: string, options?: RequestOptions): Promise; - } } } diff --git a/types/2022-11-15/QuotesResource.d.ts b/types/2022-11-15/QuotesResource.d.ts new file mode 100644 index 0000000000..59b23b1c5b --- /dev/null +++ b/types/2022-11-15/QuotesResource.d.ts @@ -0,0 +1,693 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface QuoteCreateParams { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + */ + application_fee_amount?: Stripe.Emptyable; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + */ + application_fee_percent?: Stripe.Emptyable; + + /** + * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + */ + automatic_tax?: QuoteCreateParams.AutomaticTax; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + */ + collection_method?: QuoteCreateParams.CollectionMethod; + + /** + * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + */ + customer?: string; + + /** + * The tax rates that will apply to any line item that does not have `tax_rates` set. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + */ + description?: string; + + /** + * The discounts applied to the quote. You can only set up to one discount. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + */ + expires_at?: number; + + /** + * A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + */ + footer?: string; + + /** + * Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`. + */ + from_quote?: QuoteCreateParams.FromQuote; + + /** + * A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + */ + header?: string; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: QuoteCreateParams.InvoiceSettings; + + /** + * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + */ + line_items?: Array; + + /** + * 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.MetadataParam; + + /** + * The account on behalf of which to charge. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + */ + subscription_data?: QuoteCreateParams.SubscriptionData; + + /** + * ID of the test clock to attach to the quote. + */ + test_clock?: string; + + /** + * The data with which to automatically create a Transfer for each of the invoices. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace QuoteCreateParams { + interface AutomaticTax { + /** + * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + */ + enabled: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface FromQuote { + /** + * Whether this quote is a revision of the previous quote. + */ + is_revision?: boolean; + + /** + * The `id` of the quote that will be cloned. + */ + quote: string; + } + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + */ + days_until_due?: number; + } + + interface LineItem { + /** + * The ID of the price object. One of `price` or `price_data` is required. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + */ + price_data?: LineItem.PriceData; + + /** + * The quantity of the line item. + */ + quantity?: number; + + /** + * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace LineItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring?: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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 SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + */ + effective_date?: Stripe.Emptyable<'current_period_end' | number>; + + /** + * Integer representing the number of trial period days before the customer is charged for the first time. + */ + trial_period_days?: Stripe.Emptyable; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface QuoteRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuoteUpdateParams { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. + */ + application_fee_amount?: Stripe.Emptyable; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + */ + application_fee_percent?: Stripe.Emptyable; + + /** + * Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + */ + automatic_tax?: QuoteUpdateParams.AutomaticTax; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + */ + collection_method?: QuoteUpdateParams.CollectionMethod; + + /** + * The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + */ + customer?: string; + + /** + * The tax rates that will apply to any line item that does not have `tax_rates` set. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * A description that will be displayed on the quote PDF. + */ + description?: string; + + /** + * The discounts applied to the quote. You can only set up to one discount. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + */ + expires_at?: number; + + /** + * A footer that will be displayed on the quote PDF. + */ + footer?: string; + + /** + * A header that will be displayed on the quote PDF. + */ + header?: string; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: QuoteUpdateParams.InvoiceSettings; + + /** + * A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. + */ + line_items?: Array; + + /** + * 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.MetadataParam; + + /** + * The account on behalf of which to charge. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + */ + subscription_data?: QuoteUpdateParams.SubscriptionData; + + /** + * The data with which to automatically create a Transfer for each of the invoices. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace QuoteUpdateParams { + interface AutomaticTax { + /** + * Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + */ + enabled: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + */ + days_until_due?: number; + } + + interface LineItem { + /** + * The ID of an existing line item on the quote. + */ + id?: string; + + /** + * The ID of the price object. One of `price` or `price_data` is required. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. + */ + price_data?: LineItem.PriceData; + + /** + * The quantity of the line item. + */ + quantity?: number; + + /** + * The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace LineItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring?: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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 SubscriptionData { + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + */ + effective_date?: Stripe.Emptyable<'current_period_end' | number>; + + /** + * Integer representing the number of trial period days before the customer is charged for the first time. + */ + trial_period_days?: Stripe.Emptyable; + } + + interface TransferData { + /** + * The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface QuoteListParams extends PaginationParams { + /** + * The ID of the customer whose quotes will be retrieved. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The status of the quote. + */ + status?: QuoteListParams.Status; + + /** + * Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. + */ + test_clock?: string; + } + + namespace QuoteListParams { + type Status = 'accepted' | 'canceled' | 'draft' | 'open'; + } + + interface QuoteAcceptParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuoteCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuoteFinalizeQuoteParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + */ + expires_at?: number; + } + + interface QuoteListComputedUpfrontLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuoteListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuotePdfParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class QuotesResource { + /** + * A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + */ + create( + params?: QuoteCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the quote with the given ID. + */ + retrieve( + id: string, + params?: QuoteRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * A quote models prices and services for a customer. + */ + update( + id: string, + params?: QuoteUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your quotes. + */ + list( + params?: QuoteListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Accepts the specified quote. + */ + accept( + id: string, + params?: QuoteAcceptParams, + options?: RequestOptions + ): Promise>; + accept( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Cancels the quote. + */ + cancel( + id: string, + params?: QuoteCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Finalizes the quote. + */ + finalizeQuote( + id: string, + params?: QuoteFinalizeQuoteParams, + options?: RequestOptions + ): Promise>; + finalizeQuote( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. + */ + listComputedUpfrontLineItems( + id: string, + params?: QuoteListComputedUpfrontLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listComputedUpfrontLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: QuoteListLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Download the PDF for a finalized quote + */ + pdf( + id: string, + params?: QuotePdfParams, + options?: RequestOptions + ): Promise; + pdf(id: string, options?: RequestOptions): Promise; + } + } +} diff --git a/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts b/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts index e9f0ebe968..7f674250ac 100644 --- a/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts +++ b/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts @@ -50,58 +50,6 @@ declare module 'stripe' { */ payment_intent?: string | Stripe.PaymentIntent; } - - interface EarlyFraudWarningRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface EarlyFraudWarningListParams extends PaginationParams { - /** - * Only return early fraud warnings for the charge specified by this charge ID. - */ - charge?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. - */ - payment_intent?: string; - } - - class EarlyFraudWarningsResource { - /** - * Retrieves the details of an early fraud warning that has previously been created. - * - * Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. - */ - retrieve( - id: string, - params?: EarlyFraudWarningRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of early fraud warnings. - */ - list( - params?: EarlyFraudWarningListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts b/types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts new file mode 100644 index 0000000000..e1e381a8b4 --- /dev/null +++ b/types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Radar { + interface EarlyFraudWarningRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface EarlyFraudWarningListParams extends PaginationParams { + /** + * Only return early fraud warnings for the charge specified by this charge ID. + */ + charge?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. + */ + payment_intent?: string; + } + + class EarlyFraudWarningsResource { + /** + * Retrieves the details of an early fraud warning that has previously been created. + * + * Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. + */ + retrieve( + id: string, + params?: EarlyFraudWarningRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of early fraud warnings. + */ + list( + params?: EarlyFraudWarningListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Radar/ValueListItems.d.ts b/types/2022-11-15/Radar/ValueListItems.d.ts index d7efde51b6..93b7eaff7a 100644 --- a/types/2022-11-15/Radar/ValueListItems.d.ts +++ b/types/2022-11-15/Radar/ValueListItems.d.ts @@ -66,95 +66,6 @@ declare module 'stripe' { */ deleted: true; } - - interface ValueListItemCreateParams { - /** - * The value of the item (whose type must match the type of the parent value list). - */ - value: string; - - /** - * The identifier of the value list which the created item will be added to. - */ - value_list: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ValueListItemRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ValueListItemListParams extends PaginationParams { - /** - * Identifier for the parent value list this item belongs to. - */ - value_list: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Return items belonging to the parent list whose value matches the specified value (using an "is like" match). - */ - value?: string; - } - - interface ValueListItemDeleteParams {} - - class ValueListItemsResource { - /** - * Creates a new ValueListItem object, which is added to the specified parent value list. - */ - create( - params: ValueListItemCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a ValueListItem object. - */ - retrieve( - id: string, - params?: ValueListItemRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params: ValueListItemListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes a ValueListItem object, removing it from its parent value list. - */ - del( - id: string, - params?: ValueListItemDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Radar/ValueListItemsResource.d.ts b/types/2022-11-15/Radar/ValueListItemsResource.d.ts new file mode 100644 index 0000000000..b685349e19 --- /dev/null +++ b/types/2022-11-15/Radar/ValueListItemsResource.d.ts @@ -0,0 +1,96 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Radar { + interface ValueListItemCreateParams { + /** + * The value of the item (whose type must match the type of the parent value list). + */ + value: string; + + /** + * The identifier of the value list which the created item will be added to. + */ + value_list: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ValueListItemRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ValueListItemListParams extends PaginationParams { + /** + * Identifier for the parent value list this item belongs to. + */ + value_list: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Return items belonging to the parent list whose value matches the specified value (using an "is like" match). + */ + value?: string; + } + + interface ValueListItemDeleteParams {} + + class ValueListItemsResource { + /** + * Creates a new ValueListItem object, which is added to the specified parent value list. + */ + create( + params: ValueListItemCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a ValueListItem object. + */ + retrieve( + id: string, + params?: ValueListItemRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params: ValueListItemListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a ValueListItem object, removing it from its parent value list. + */ + del( + id: string, + params?: ValueListItemDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Radar/ValueLists.d.ts b/types/2022-11-15/Radar/ValueLists.d.ts index d85f1b0eae..ee29f9c027 100644 --- a/types/2022-11-15/Radar/ValueLists.d.ts +++ b/types/2022-11-15/Radar/ValueLists.d.ts @@ -93,149 +93,6 @@ declare module 'stripe' { */ deleted: true; } - - interface ValueListCreateParams { - /** - * The name of the value list for use in rules. - */ - alias: string; - - /** - * The human-readable name of the value list. - */ - name: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. - */ - item_type?: ValueListCreateParams.ItemType; - - /** - * 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.MetadataParam; - } - - namespace ValueListCreateParams { - type ItemType = - | 'card_bin' - | 'card_fingerprint' - | 'case_sensitive_string' - | 'country' - | 'customer_id' - | 'email' - | 'ip_address' - | 'string'; - } - - interface ValueListRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ValueListUpdateParams { - /** - * The name of the value list for use in rules. - */ - alias?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * The human-readable name of the value list. - */ - name?: string; - } - - interface ValueListListParams extends PaginationParams { - /** - * The alias used to reference the value list when writing rules. - */ - alias?: string; - - /** - * A value contained within a value list - returns all value lists containing this value. - */ - contains?: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ValueListDeleteParams {} - - class ValueListsResource { - /** - * Creates a new ValueList object, which can then be referenced in rules. - */ - create( - params: ValueListCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a ValueList object. - */ - retrieve( - id: string, - params?: ValueListRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. - */ - update( - id: string, - params?: ValueListUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: ValueListListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. - */ - del( - id: string, - params?: ValueListDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Radar/ValueListsResource.d.ts b/types/2022-11-15/Radar/ValueListsResource.d.ts new file mode 100644 index 0000000000..ed7a799ff8 --- /dev/null +++ b/types/2022-11-15/Radar/ValueListsResource.d.ts @@ -0,0 +1,150 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Radar { + interface ValueListCreateParams { + /** + * The name of the value list for use in rules. + */ + alias: string; + + /** + * The human-readable name of the value list. + */ + name: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. + */ + item_type?: ValueListCreateParams.ItemType; + + /** + * 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.MetadataParam; + } + + namespace ValueListCreateParams { + type ItemType = + | 'card_bin' + | 'card_fingerprint' + | 'case_sensitive_string' + | 'country' + | 'customer_id' + | 'email' + | 'ip_address' + | 'string'; + } + + interface ValueListRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ValueListUpdateParams { + /** + * The name of the value list for use in rules. + */ + alias?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * The human-readable name of the value list. + */ + name?: string; + } + + interface ValueListListParams extends PaginationParams { + /** + * The alias used to reference the value list when writing rules. + */ + alias?: string; + + /** + * A value contained within a value list - returns all value lists containing this value. + */ + contains?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ValueListDeleteParams {} + + class ValueListsResource { + /** + * Creates a new ValueList object, which can then be referenced in rules. + */ + create( + params: ValueListCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a ValueList object. + */ + retrieve( + id: string, + params?: ValueListRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. + */ + update( + id: string, + params?: ValueListUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: ValueListListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. + */ + del( + id: string, + params?: ValueListDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Refunds.d.ts b/types/2022-11-15/Refunds.d.ts index f620ad25da..7ddc7f095c 100644 --- a/types/2022-11-15/Refunds.d.ts +++ b/types/2022-11-15/Refunds.d.ts @@ -147,160 +147,5 @@ declare module 'stripe' { | 'fraudulent' | 'requested_by_customer'; } - - interface RefundCreateParams { - /** - * A positive integer representing how much to refund. - */ - amount?: number; - - charge?: 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; - - /** - * Customer whose customer balance to refund from. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Address to send refund email, use customer email if not specified - */ - 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * Origin of the refund - */ - origin?: 'customer_balance'; - - payment_intent?: string; - - reason?: RefundCreateParams.Reason; - - refund_application_fee?: boolean; - - reverse_transfer?: boolean; - } - - namespace RefundCreateParams { - type Reason = 'duplicate' | 'fraudulent' | 'requested_by_customer'; - } - - interface RefundRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface RefundUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface RefundListParams extends PaginationParams { - /** - * Only return refunds for the charge specified by this charge ID. - */ - charge?: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return refunds for the PaymentIntent specified by this ID. - */ - payment_intent?: string; - } - - interface RefundCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class RefundsResource { - /** - * Create a refund. - */ - create( - params?: RefundCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the details of an existing refund. - */ - retrieve( - id: string, - params?: RefundRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - */ - update( - id: string, - params?: RefundUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of all refunds you've previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object. - */ - list( - params?: RefundListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Cancels a refund with a status of requires_action. - * - * Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action state. - */ - cancel( - id: string, - params?: RefundCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/RefundsResource.d.ts b/types/2022-11-15/RefundsResource.d.ts new file mode 100644 index 0000000000..4d4af738f0 --- /dev/null +++ b/types/2022-11-15/RefundsResource.d.ts @@ -0,0 +1,160 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface RefundCreateParams { + /** + * A positive integer representing how much to refund. + */ + amount?: number; + + charge?: 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; + + /** + * Customer whose customer balance to refund from. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Address to send refund email, use customer email if not specified + */ + 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * Origin of the refund + */ + origin?: 'customer_balance'; + + payment_intent?: string; + + reason?: RefundCreateParams.Reason; + + refund_application_fee?: boolean; + + reverse_transfer?: boolean; + } + + namespace RefundCreateParams { + type Reason = 'duplicate' | 'fraudulent' | 'requested_by_customer'; + } + + interface RefundRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface RefundUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface RefundListParams extends PaginationParams { + /** + * Only return refunds for the charge specified by this charge ID. + */ + charge?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return refunds for the PaymentIntent specified by this ID. + */ + payment_intent?: string; + } + + interface RefundCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class RefundsResource { + /** + * Create a refund. + */ + create( + params?: RefundCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the details of an existing refund. + */ + retrieve( + id: string, + params?: RefundRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + */ + update( + id: string, + params?: RefundUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of all refunds you've previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object. + */ + list( + params?: RefundListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Cancels a refund with a status of requires_action. + * + * Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action state. + */ + cancel( + id: string, + params?: RefundCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Reporting/ReportRuns.d.ts b/types/2022-11-15/Reporting/ReportRuns.d.ts index 47e9dfe777..8b9fd2d4a9 100644 --- a/types/2022-11-15/Reporting/ReportRuns.d.ts +++ b/types/2022-11-15/Reporting/ReportRuns.d.ts @@ -110,754 +110,6 @@ declare module 'stripe' { timezone?: string; } } - - interface ReportRunCreateParams { - /** - * The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. - */ - report_type: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. - */ - parameters?: ReportRunCreateParams.Parameters; - } - - namespace ReportRunCreateParams { - interface Parameters { - /** - * The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. - */ - columns?: Array; - - /** - * Connected account ID to filter for in the report run. - */ - connected_account?: string; - - /** - * Currency of objects to be included in the report run. - */ - currency?: string; - - /** - * Ending timestamp of data to be included in the report run (exclusive). - */ - interval_end?: number; - - /** - * Starting timestamp of data to be included in the report run. - */ - interval_start?: number; - - /** - * Payout ID by which to filter the report run. - */ - payout?: string; - - /** - * Category of balance transactions to be included in the report run. - */ - reporting_category?: Parameters.ReportingCategory; - - /** - * Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. - */ - timezone?: Parameters.Timezone; - } - - namespace Parameters { - type ReportingCategory = - | 'advance' - | 'advance_funding' - | 'anticipation_repayment' - | 'charge' - | 'charge_failure' - | 'connect_collection_transfer' - | 'connect_reserved_funds' - | 'contribution' - | 'dispute' - | 'dispute_reversal' - | 'fee' - | 'financing_paydown' - | 'financing_paydown_reversal' - | 'financing_payout' - | 'financing_payout_reversal' - | 'issuing_authorization_hold' - | 'issuing_authorization_release' - | 'issuing_dispute' - | 'issuing_transaction' - | 'network_cost' - | 'other_adjustment' - | 'partial_capture_reversal' - | 'payout' - | 'payout_reversal' - | 'platform_earning' - | 'platform_earning_refund' - | 'refund' - | 'refund_failure' - | 'risk_reserved_funds' - | 'tax' - | 'topup' - | 'topup_reversal' - | 'transfer' - | 'transfer_reversal'; - - type Timezone = - | 'Africa/Abidjan' - | 'Africa/Accra' - | 'Africa/Addis_Ababa' - | 'Africa/Algiers' - | 'Africa/Asmara' - | 'Africa/Asmera' - | 'Africa/Bamako' - | 'Africa/Bangui' - | 'Africa/Banjul' - | 'Africa/Bissau' - | 'Africa/Blantyre' - | 'Africa/Brazzaville' - | 'Africa/Bujumbura' - | 'Africa/Cairo' - | 'Africa/Casablanca' - | 'Africa/Ceuta' - | 'Africa/Conakry' - | 'Africa/Dakar' - | 'Africa/Dar_es_Salaam' - | 'Africa/Djibouti' - | 'Africa/Douala' - | 'Africa/El_Aaiun' - | 'Africa/Freetown' - | 'Africa/Gaborone' - | 'Africa/Harare' - | 'Africa/Johannesburg' - | 'Africa/Juba' - | 'Africa/Kampala' - | 'Africa/Khartoum' - | 'Africa/Kigali' - | 'Africa/Kinshasa' - | 'Africa/Lagos' - | 'Africa/Libreville' - | 'Africa/Lome' - | 'Africa/Luanda' - | 'Africa/Lubumbashi' - | 'Africa/Lusaka' - | 'Africa/Malabo' - | 'Africa/Maputo' - | 'Africa/Maseru' - | 'Africa/Mbabane' - | 'Africa/Mogadishu' - | 'Africa/Monrovia' - | 'Africa/Nairobi' - | 'Africa/Ndjamena' - | 'Africa/Niamey' - | 'Africa/Nouakchott' - | 'Africa/Ouagadougou' - | 'Africa/Porto-Novo' - | 'Africa/Sao_Tome' - | 'Africa/Timbuktu' - | 'Africa/Tripoli' - | 'Africa/Tunis' - | 'Africa/Windhoek' - | 'America/Adak' - | 'America/Anchorage' - | 'America/Anguilla' - | 'America/Antigua' - | 'America/Araguaina' - | 'America/Argentina/Buenos_Aires' - | 'America/Argentina/Catamarca' - | 'America/Argentina/ComodRivadavia' - | 'America/Argentina/Cordoba' - | 'America/Argentina/Jujuy' - | 'America/Argentina/La_Rioja' - | 'America/Argentina/Mendoza' - | 'America/Argentina/Rio_Gallegos' - | 'America/Argentina/Salta' - | 'America/Argentina/San_Juan' - | 'America/Argentina/San_Luis' - | 'America/Argentina/Tucuman' - | 'America/Argentina/Ushuaia' - | 'America/Aruba' - | 'America/Asuncion' - | 'America/Atikokan' - | 'America/Atka' - | 'America/Bahia' - | 'America/Bahia_Banderas' - | 'America/Barbados' - | 'America/Belem' - | 'America/Belize' - | 'America/Blanc-Sablon' - | 'America/Boa_Vista' - | 'America/Bogota' - | 'America/Boise' - | 'America/Buenos_Aires' - | 'America/Cambridge_Bay' - | 'America/Campo_Grande' - | 'America/Cancun' - | 'America/Caracas' - | 'America/Catamarca' - | 'America/Cayenne' - | 'America/Cayman' - | 'America/Chicago' - | 'America/Chihuahua' - | 'America/Coral_Harbour' - | 'America/Cordoba' - | 'America/Costa_Rica' - | 'America/Creston' - | 'America/Cuiaba' - | 'America/Curacao' - | 'America/Danmarkshavn' - | 'America/Dawson' - | 'America/Dawson_Creek' - | 'America/Denver' - | 'America/Detroit' - | 'America/Dominica' - | 'America/Edmonton' - | 'America/Eirunepe' - | 'America/El_Salvador' - | 'America/Ensenada' - | 'America/Fort_Nelson' - | 'America/Fort_Wayne' - | 'America/Fortaleza' - | 'America/Glace_Bay' - | 'America/Godthab' - | 'America/Goose_Bay' - | 'America/Grand_Turk' - | 'America/Grenada' - | 'America/Guadeloupe' - | 'America/Guatemala' - | 'America/Guayaquil' - | 'America/Guyana' - | 'America/Halifax' - | 'America/Havana' - | 'America/Hermosillo' - | 'America/Indiana/Indianapolis' - | 'America/Indiana/Knox' - | 'America/Indiana/Marengo' - | 'America/Indiana/Petersburg' - | 'America/Indiana/Tell_City' - | 'America/Indiana/Vevay' - | 'America/Indiana/Vincennes' - | 'America/Indiana/Winamac' - | 'America/Indianapolis' - | 'America/Inuvik' - | 'America/Iqaluit' - | 'America/Jamaica' - | 'America/Jujuy' - | 'America/Juneau' - | 'America/Kentucky/Louisville' - | 'America/Kentucky/Monticello' - | 'America/Knox_IN' - | 'America/Kralendijk' - | 'America/La_Paz' - | 'America/Lima' - | 'America/Los_Angeles' - | 'America/Louisville' - | 'America/Lower_Princes' - | 'America/Maceio' - | 'America/Managua' - | 'America/Manaus' - | 'America/Marigot' - | 'America/Martinique' - | 'America/Matamoros' - | 'America/Mazatlan' - | 'America/Mendoza' - | 'America/Menominee' - | 'America/Merida' - | 'America/Metlakatla' - | 'America/Mexico_City' - | 'America/Miquelon' - | 'America/Moncton' - | 'America/Monterrey' - | 'America/Montevideo' - | 'America/Montreal' - | 'America/Montserrat' - | 'America/Nassau' - | 'America/New_York' - | 'America/Nipigon' - | 'America/Nome' - | 'America/Noronha' - | 'America/North_Dakota/Beulah' - | 'America/North_Dakota/Center' - | 'America/North_Dakota/New_Salem' - | 'America/Nuuk' - | 'America/Ojinaga' - | 'America/Panama' - | 'America/Pangnirtung' - | 'America/Paramaribo' - | 'America/Phoenix' - | 'America/Port-au-Prince' - | 'America/Port_of_Spain' - | 'America/Porto_Acre' - | 'America/Porto_Velho' - | 'America/Puerto_Rico' - | 'America/Punta_Arenas' - | 'America/Rainy_River' - | 'America/Rankin_Inlet' - | 'America/Recife' - | 'America/Regina' - | 'America/Resolute' - | 'America/Rio_Branco' - | 'America/Rosario' - | 'America/Santa_Isabel' - | 'America/Santarem' - | 'America/Santiago' - | 'America/Santo_Domingo' - | 'America/Sao_Paulo' - | 'America/Scoresbysund' - | 'America/Shiprock' - | 'America/Sitka' - | 'America/St_Barthelemy' - | 'America/St_Johns' - | 'America/St_Kitts' - | 'America/St_Lucia' - | 'America/St_Thomas' - | 'America/St_Vincent' - | 'America/Swift_Current' - | 'America/Tegucigalpa' - | 'America/Thule' - | 'America/Thunder_Bay' - | 'America/Tijuana' - | 'America/Toronto' - | 'America/Tortola' - | 'America/Vancouver' - | 'America/Virgin' - | 'America/Whitehorse' - | 'America/Winnipeg' - | 'America/Yakutat' - | 'America/Yellowknife' - | 'Antarctica/Casey' - | 'Antarctica/Davis' - | 'Antarctica/DumontDUrville' - | 'Antarctica/Macquarie' - | 'Antarctica/Mawson' - | 'Antarctica/McMurdo' - | 'Antarctica/Palmer' - | 'Antarctica/Rothera' - | 'Antarctica/South_Pole' - | 'Antarctica/Syowa' - | 'Antarctica/Troll' - | 'Antarctica/Vostok' - | 'Arctic/Longyearbyen' - | 'Asia/Aden' - | 'Asia/Almaty' - | 'Asia/Amman' - | 'Asia/Anadyr' - | 'Asia/Aqtau' - | 'Asia/Aqtobe' - | 'Asia/Ashgabat' - | 'Asia/Ashkhabad' - | 'Asia/Atyrau' - | 'Asia/Baghdad' - | 'Asia/Bahrain' - | 'Asia/Baku' - | 'Asia/Bangkok' - | 'Asia/Barnaul' - | 'Asia/Beirut' - | 'Asia/Bishkek' - | 'Asia/Brunei' - | 'Asia/Calcutta' - | 'Asia/Chita' - | 'Asia/Choibalsan' - | 'Asia/Chongqing' - | 'Asia/Chungking' - | 'Asia/Colombo' - | 'Asia/Dacca' - | 'Asia/Damascus' - | 'Asia/Dhaka' - | 'Asia/Dili' - | 'Asia/Dubai' - | 'Asia/Dushanbe' - | 'Asia/Famagusta' - | 'Asia/Gaza' - | 'Asia/Harbin' - | 'Asia/Hebron' - | 'Asia/Ho_Chi_Minh' - | 'Asia/Hong_Kong' - | 'Asia/Hovd' - | 'Asia/Irkutsk' - | 'Asia/Istanbul' - | 'Asia/Jakarta' - | 'Asia/Jayapura' - | 'Asia/Jerusalem' - | 'Asia/Kabul' - | 'Asia/Kamchatka' - | 'Asia/Karachi' - | 'Asia/Kashgar' - | 'Asia/Kathmandu' - | 'Asia/Katmandu' - | 'Asia/Khandyga' - | 'Asia/Kolkata' - | 'Asia/Krasnoyarsk' - | 'Asia/Kuala_Lumpur' - | 'Asia/Kuching' - | 'Asia/Kuwait' - | 'Asia/Macao' - | 'Asia/Macau' - | 'Asia/Magadan' - | 'Asia/Makassar' - | 'Asia/Manila' - | 'Asia/Muscat' - | 'Asia/Nicosia' - | 'Asia/Novokuznetsk' - | 'Asia/Novosibirsk' - | 'Asia/Omsk' - | 'Asia/Oral' - | 'Asia/Phnom_Penh' - | 'Asia/Pontianak' - | 'Asia/Pyongyang' - | 'Asia/Qatar' - | 'Asia/Qostanay' - | 'Asia/Qyzylorda' - | 'Asia/Rangoon' - | 'Asia/Riyadh' - | 'Asia/Saigon' - | 'Asia/Sakhalin' - | 'Asia/Samarkand' - | 'Asia/Seoul' - | 'Asia/Shanghai' - | 'Asia/Singapore' - | 'Asia/Srednekolymsk' - | 'Asia/Taipei' - | 'Asia/Tashkent' - | 'Asia/Tbilisi' - | 'Asia/Tehran' - | 'Asia/Tel_Aviv' - | 'Asia/Thimbu' - | 'Asia/Thimphu' - | 'Asia/Tokyo' - | 'Asia/Tomsk' - | 'Asia/Ujung_Pandang' - | 'Asia/Ulaanbaatar' - | 'Asia/Ulan_Bator' - | 'Asia/Urumqi' - | 'Asia/Ust-Nera' - | 'Asia/Vientiane' - | 'Asia/Vladivostok' - | 'Asia/Yakutsk' - | 'Asia/Yangon' - | 'Asia/Yekaterinburg' - | 'Asia/Yerevan' - | 'Atlantic/Azores' - | 'Atlantic/Bermuda' - | 'Atlantic/Canary' - | 'Atlantic/Cape_Verde' - | 'Atlantic/Faeroe' - | 'Atlantic/Faroe' - | 'Atlantic/Jan_Mayen' - | 'Atlantic/Madeira' - | 'Atlantic/Reykjavik' - | 'Atlantic/South_Georgia' - | 'Atlantic/St_Helena' - | 'Atlantic/Stanley' - | 'Australia/ACT' - | 'Australia/Adelaide' - | 'Australia/Brisbane' - | 'Australia/Broken_Hill' - | 'Australia/Canberra' - | 'Australia/Currie' - | 'Australia/Darwin' - | 'Australia/Eucla' - | 'Australia/Hobart' - | 'Australia/LHI' - | 'Australia/Lindeman' - | 'Australia/Lord_Howe' - | 'Australia/Melbourne' - | 'Australia/NSW' - | 'Australia/North' - | 'Australia/Perth' - | 'Australia/Queensland' - | 'Australia/South' - | 'Australia/Sydney' - | 'Australia/Tasmania' - | 'Australia/Victoria' - | 'Australia/West' - | 'Australia/Yancowinna' - | 'Brazil/Acre' - | 'Brazil/DeNoronha' - | 'Brazil/East' - | 'Brazil/West' - | 'CET' - | 'CST6CDT' - | 'Canada/Atlantic' - | 'Canada/Central' - | 'Canada/Eastern' - | 'Canada/Mountain' - | 'Canada/Newfoundland' - | 'Canada/Pacific' - | 'Canada/Saskatchewan' - | 'Canada/Yukon' - | 'Chile/Continental' - | 'Chile/EasterIsland' - | 'Cuba' - | 'EET' - | 'EST' - | 'EST5EDT' - | 'Egypt' - | 'Eire' - | 'Etc/GMT' - | 'Etc/GMT+0' - | 'Etc/GMT+1' - | 'Etc/GMT+10' - | 'Etc/GMT+11' - | 'Etc/GMT+12' - | 'Etc/GMT+2' - | 'Etc/GMT+3' - | 'Etc/GMT+4' - | 'Etc/GMT+5' - | 'Etc/GMT+6' - | 'Etc/GMT+7' - | 'Etc/GMT+8' - | 'Etc/GMT+9' - | 'Etc/GMT-0' - | 'Etc/GMT-1' - | 'Etc/GMT-10' - | 'Etc/GMT-11' - | 'Etc/GMT-12' - | 'Etc/GMT-13' - | 'Etc/GMT-14' - | 'Etc/GMT-2' - | 'Etc/GMT-3' - | 'Etc/GMT-4' - | 'Etc/GMT-5' - | 'Etc/GMT-6' - | 'Etc/GMT-7' - | 'Etc/GMT-8' - | 'Etc/GMT-9' - | 'Etc/GMT0' - | 'Etc/Greenwich' - | 'Etc/UCT' - | 'Etc/UTC' - | 'Etc/Universal' - | 'Etc/Zulu' - | 'Europe/Amsterdam' - | 'Europe/Andorra' - | 'Europe/Astrakhan' - | 'Europe/Athens' - | 'Europe/Belfast' - | 'Europe/Belgrade' - | 'Europe/Berlin' - | 'Europe/Bratislava' - | 'Europe/Brussels' - | 'Europe/Bucharest' - | 'Europe/Budapest' - | 'Europe/Busingen' - | 'Europe/Chisinau' - | 'Europe/Copenhagen' - | 'Europe/Dublin' - | 'Europe/Gibraltar' - | 'Europe/Guernsey' - | 'Europe/Helsinki' - | 'Europe/Isle_of_Man' - | 'Europe/Istanbul' - | 'Europe/Jersey' - | 'Europe/Kaliningrad' - | 'Europe/Kiev' - | 'Europe/Kirov' - | 'Europe/Kyiv' - | 'Europe/Lisbon' - | 'Europe/Ljubljana' - | 'Europe/London' - | 'Europe/Luxembourg' - | 'Europe/Madrid' - | 'Europe/Malta' - | 'Europe/Mariehamn' - | 'Europe/Minsk' - | 'Europe/Monaco' - | 'Europe/Moscow' - | 'Europe/Nicosia' - | 'Europe/Oslo' - | 'Europe/Paris' - | 'Europe/Podgorica' - | 'Europe/Prague' - | 'Europe/Riga' - | 'Europe/Rome' - | 'Europe/Samara' - | 'Europe/San_Marino' - | 'Europe/Sarajevo' - | 'Europe/Saratov' - | 'Europe/Simferopol' - | 'Europe/Skopje' - | 'Europe/Sofia' - | 'Europe/Stockholm' - | 'Europe/Tallinn' - | 'Europe/Tirane' - | 'Europe/Tiraspol' - | 'Europe/Ulyanovsk' - | 'Europe/Uzhgorod' - | 'Europe/Vaduz' - | 'Europe/Vatican' - | 'Europe/Vienna' - | 'Europe/Vilnius' - | 'Europe/Volgograd' - | 'Europe/Warsaw' - | 'Europe/Zagreb' - | 'Europe/Zaporozhye' - | 'Europe/Zurich' - | 'Factory' - | 'GB' - | 'GB-Eire' - | 'GMT' - | 'GMT+0' - | 'GMT-0' - | 'GMT0' - | 'Greenwich' - | 'HST' - | 'Hongkong' - | 'Iceland' - | 'Indian/Antananarivo' - | 'Indian/Chagos' - | 'Indian/Christmas' - | 'Indian/Cocos' - | 'Indian/Comoro' - | 'Indian/Kerguelen' - | 'Indian/Mahe' - | 'Indian/Maldives' - | 'Indian/Mauritius' - | 'Indian/Mayotte' - | 'Indian/Reunion' - | 'Iran' - | 'Israel' - | 'Jamaica' - | 'Japan' - | 'Kwajalein' - | 'Libya' - | 'MET' - | 'MST' - | 'MST7MDT' - | 'Mexico/BajaNorte' - | 'Mexico/BajaSur' - | 'Mexico/General' - | 'NZ' - | 'NZ-CHAT' - | 'Navajo' - | 'PRC' - | 'PST8PDT' - | 'Pacific/Apia' - | 'Pacific/Auckland' - | 'Pacific/Bougainville' - | 'Pacific/Chatham' - | 'Pacific/Chuuk' - | 'Pacific/Easter' - | 'Pacific/Efate' - | 'Pacific/Enderbury' - | 'Pacific/Fakaofo' - | 'Pacific/Fiji' - | 'Pacific/Funafuti' - | 'Pacific/Galapagos' - | 'Pacific/Gambier' - | 'Pacific/Guadalcanal' - | 'Pacific/Guam' - | 'Pacific/Honolulu' - | 'Pacific/Johnston' - | 'Pacific/Kanton' - | 'Pacific/Kiritimati' - | 'Pacific/Kosrae' - | 'Pacific/Kwajalein' - | 'Pacific/Majuro' - | 'Pacific/Marquesas' - | 'Pacific/Midway' - | 'Pacific/Nauru' - | 'Pacific/Niue' - | 'Pacific/Norfolk' - | 'Pacific/Noumea' - | 'Pacific/Pago_Pago' - | 'Pacific/Palau' - | 'Pacific/Pitcairn' - | 'Pacific/Pohnpei' - | 'Pacific/Ponape' - | 'Pacific/Port_Moresby' - | 'Pacific/Rarotonga' - | 'Pacific/Saipan' - | 'Pacific/Samoa' - | 'Pacific/Tahiti' - | 'Pacific/Tarawa' - | 'Pacific/Tongatapu' - | 'Pacific/Truk' - | 'Pacific/Wake' - | 'Pacific/Wallis' - | 'Pacific/Yap' - | 'Poland' - | 'Portugal' - | 'ROC' - | 'ROK' - | 'Singapore' - | 'Turkey' - | 'UCT' - | 'US/Alaska' - | 'US/Aleutian' - | 'US/Arizona' - | 'US/Central' - | 'US/East-Indiana' - | 'US/Eastern' - | 'US/Hawaii' - | 'US/Indiana-Starke' - | 'US/Michigan' - | 'US/Mountain' - | 'US/Pacific' - | 'US/Pacific-New' - | 'US/Samoa' - | 'UTC' - | 'Universal' - | 'W-SU' - | 'WET' - | 'Zulu'; - } - } - - interface ReportRunRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReportRunListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ReportRunsResource { - /** - * Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) - */ - create( - params: ReportRunCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing Report Run. - */ - retrieve( - id: string, - params?: ReportRunRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Report Runs, with the most recent appearing first. - */ - list( - params?: ReportRunListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Reporting/ReportRunsResource.d.ts b/types/2022-11-15/Reporting/ReportRunsResource.d.ts new file mode 100644 index 0000000000..5dd37a7d44 --- /dev/null +++ b/types/2022-11-15/Reporting/ReportRunsResource.d.ts @@ -0,0 +1,755 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Reporting { + interface ReportRunCreateParams { + /** + * The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. + */ + report_type: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. + */ + parameters?: ReportRunCreateParams.Parameters; + } + + namespace ReportRunCreateParams { + interface Parameters { + /** + * The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. + */ + columns?: Array; + + /** + * Connected account ID to filter for in the report run. + */ + connected_account?: string; + + /** + * Currency of objects to be included in the report run. + */ + currency?: string; + + /** + * Ending timestamp of data to be included in the report run (exclusive). + */ + interval_end?: number; + + /** + * Starting timestamp of data to be included in the report run. + */ + interval_start?: number; + + /** + * Payout ID by which to filter the report run. + */ + payout?: string; + + /** + * Category of balance transactions to be included in the report run. + */ + reporting_category?: Parameters.ReportingCategory; + + /** + * Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. + */ + timezone?: Parameters.Timezone; + } + + namespace Parameters { + type ReportingCategory = + | 'advance' + | 'advance_funding' + | 'anticipation_repayment' + | 'charge' + | 'charge_failure' + | 'connect_collection_transfer' + | 'connect_reserved_funds' + | 'contribution' + | 'dispute' + | 'dispute_reversal' + | 'fee' + | 'financing_paydown' + | 'financing_paydown_reversal' + | 'financing_payout' + | 'financing_payout_reversal' + | 'issuing_authorization_hold' + | 'issuing_authorization_release' + | 'issuing_dispute' + | 'issuing_transaction' + | 'network_cost' + | 'other_adjustment' + | 'partial_capture_reversal' + | 'payout' + | 'payout_reversal' + | 'platform_earning' + | 'platform_earning_refund' + | 'refund' + | 'refund_failure' + | 'risk_reserved_funds' + | 'tax' + | 'topup' + | 'topup_reversal' + | 'transfer' + | 'transfer_reversal'; + + type Timezone = + | 'Africa/Abidjan' + | 'Africa/Accra' + | 'Africa/Addis_Ababa' + | 'Africa/Algiers' + | 'Africa/Asmara' + | 'Africa/Asmera' + | 'Africa/Bamako' + | 'Africa/Bangui' + | 'Africa/Banjul' + | 'Africa/Bissau' + | 'Africa/Blantyre' + | 'Africa/Brazzaville' + | 'Africa/Bujumbura' + | 'Africa/Cairo' + | 'Africa/Casablanca' + | 'Africa/Ceuta' + | 'Africa/Conakry' + | 'Africa/Dakar' + | 'Africa/Dar_es_Salaam' + | 'Africa/Djibouti' + | 'Africa/Douala' + | 'Africa/El_Aaiun' + | 'Africa/Freetown' + | 'Africa/Gaborone' + | 'Africa/Harare' + | 'Africa/Johannesburg' + | 'Africa/Juba' + | 'Africa/Kampala' + | 'Africa/Khartoum' + | 'Africa/Kigali' + | 'Africa/Kinshasa' + | 'Africa/Lagos' + | 'Africa/Libreville' + | 'Africa/Lome' + | 'Africa/Luanda' + | 'Africa/Lubumbashi' + | 'Africa/Lusaka' + | 'Africa/Malabo' + | 'Africa/Maputo' + | 'Africa/Maseru' + | 'Africa/Mbabane' + | 'Africa/Mogadishu' + | 'Africa/Monrovia' + | 'Africa/Nairobi' + | 'Africa/Ndjamena' + | 'Africa/Niamey' + | 'Africa/Nouakchott' + | 'Africa/Ouagadougou' + | 'Africa/Porto-Novo' + | 'Africa/Sao_Tome' + | 'Africa/Timbuktu' + | 'Africa/Tripoli' + | 'Africa/Tunis' + | 'Africa/Windhoek' + | 'America/Adak' + | 'America/Anchorage' + | 'America/Anguilla' + | 'America/Antigua' + | 'America/Araguaina' + | 'America/Argentina/Buenos_Aires' + | 'America/Argentina/Catamarca' + | 'America/Argentina/ComodRivadavia' + | 'America/Argentina/Cordoba' + | 'America/Argentina/Jujuy' + | 'America/Argentina/La_Rioja' + | 'America/Argentina/Mendoza' + | 'America/Argentina/Rio_Gallegos' + | 'America/Argentina/Salta' + | 'America/Argentina/San_Juan' + | 'America/Argentina/San_Luis' + | 'America/Argentina/Tucuman' + | 'America/Argentina/Ushuaia' + | 'America/Aruba' + | 'America/Asuncion' + | 'America/Atikokan' + | 'America/Atka' + | 'America/Bahia' + | 'America/Bahia_Banderas' + | 'America/Barbados' + | 'America/Belem' + | 'America/Belize' + | 'America/Blanc-Sablon' + | 'America/Boa_Vista' + | 'America/Bogota' + | 'America/Boise' + | 'America/Buenos_Aires' + | 'America/Cambridge_Bay' + | 'America/Campo_Grande' + | 'America/Cancun' + | 'America/Caracas' + | 'America/Catamarca' + | 'America/Cayenne' + | 'America/Cayman' + | 'America/Chicago' + | 'America/Chihuahua' + | 'America/Coral_Harbour' + | 'America/Cordoba' + | 'America/Costa_Rica' + | 'America/Creston' + | 'America/Cuiaba' + | 'America/Curacao' + | 'America/Danmarkshavn' + | 'America/Dawson' + | 'America/Dawson_Creek' + | 'America/Denver' + | 'America/Detroit' + | 'America/Dominica' + | 'America/Edmonton' + | 'America/Eirunepe' + | 'America/El_Salvador' + | 'America/Ensenada' + | 'America/Fort_Nelson' + | 'America/Fort_Wayne' + | 'America/Fortaleza' + | 'America/Glace_Bay' + | 'America/Godthab' + | 'America/Goose_Bay' + | 'America/Grand_Turk' + | 'America/Grenada' + | 'America/Guadeloupe' + | 'America/Guatemala' + | 'America/Guayaquil' + | 'America/Guyana' + | 'America/Halifax' + | 'America/Havana' + | 'America/Hermosillo' + | 'America/Indiana/Indianapolis' + | 'America/Indiana/Knox' + | 'America/Indiana/Marengo' + | 'America/Indiana/Petersburg' + | 'America/Indiana/Tell_City' + | 'America/Indiana/Vevay' + | 'America/Indiana/Vincennes' + | 'America/Indiana/Winamac' + | 'America/Indianapolis' + | 'America/Inuvik' + | 'America/Iqaluit' + | 'America/Jamaica' + | 'America/Jujuy' + | 'America/Juneau' + | 'America/Kentucky/Louisville' + | 'America/Kentucky/Monticello' + | 'America/Knox_IN' + | 'America/Kralendijk' + | 'America/La_Paz' + | 'America/Lima' + | 'America/Los_Angeles' + | 'America/Louisville' + | 'America/Lower_Princes' + | 'America/Maceio' + | 'America/Managua' + | 'America/Manaus' + | 'America/Marigot' + | 'America/Martinique' + | 'America/Matamoros' + | 'America/Mazatlan' + | 'America/Mendoza' + | 'America/Menominee' + | 'America/Merida' + | 'America/Metlakatla' + | 'America/Mexico_City' + | 'America/Miquelon' + | 'America/Moncton' + | 'America/Monterrey' + | 'America/Montevideo' + | 'America/Montreal' + | 'America/Montserrat' + | 'America/Nassau' + | 'America/New_York' + | 'America/Nipigon' + | 'America/Nome' + | 'America/Noronha' + | 'America/North_Dakota/Beulah' + | 'America/North_Dakota/Center' + | 'America/North_Dakota/New_Salem' + | 'America/Nuuk' + | 'America/Ojinaga' + | 'America/Panama' + | 'America/Pangnirtung' + | 'America/Paramaribo' + | 'America/Phoenix' + | 'America/Port-au-Prince' + | 'America/Port_of_Spain' + | 'America/Porto_Acre' + | 'America/Porto_Velho' + | 'America/Puerto_Rico' + | 'America/Punta_Arenas' + | 'America/Rainy_River' + | 'America/Rankin_Inlet' + | 'America/Recife' + | 'America/Regina' + | 'America/Resolute' + | 'America/Rio_Branco' + | 'America/Rosario' + | 'America/Santa_Isabel' + | 'America/Santarem' + | 'America/Santiago' + | 'America/Santo_Domingo' + | 'America/Sao_Paulo' + | 'America/Scoresbysund' + | 'America/Shiprock' + | 'America/Sitka' + | 'America/St_Barthelemy' + | 'America/St_Johns' + | 'America/St_Kitts' + | 'America/St_Lucia' + | 'America/St_Thomas' + | 'America/St_Vincent' + | 'America/Swift_Current' + | 'America/Tegucigalpa' + | 'America/Thule' + | 'America/Thunder_Bay' + | 'America/Tijuana' + | 'America/Toronto' + | 'America/Tortola' + | 'America/Vancouver' + | 'America/Virgin' + | 'America/Whitehorse' + | 'America/Winnipeg' + | 'America/Yakutat' + | 'America/Yellowknife' + | 'Antarctica/Casey' + | 'Antarctica/Davis' + | 'Antarctica/DumontDUrville' + | 'Antarctica/Macquarie' + | 'Antarctica/Mawson' + | 'Antarctica/McMurdo' + | 'Antarctica/Palmer' + | 'Antarctica/Rothera' + | 'Antarctica/South_Pole' + | 'Antarctica/Syowa' + | 'Antarctica/Troll' + | 'Antarctica/Vostok' + | 'Arctic/Longyearbyen' + | 'Asia/Aden' + | 'Asia/Almaty' + | 'Asia/Amman' + | 'Asia/Anadyr' + | 'Asia/Aqtau' + | 'Asia/Aqtobe' + | 'Asia/Ashgabat' + | 'Asia/Ashkhabad' + | 'Asia/Atyrau' + | 'Asia/Baghdad' + | 'Asia/Bahrain' + | 'Asia/Baku' + | 'Asia/Bangkok' + | 'Asia/Barnaul' + | 'Asia/Beirut' + | 'Asia/Bishkek' + | 'Asia/Brunei' + | 'Asia/Calcutta' + | 'Asia/Chita' + | 'Asia/Choibalsan' + | 'Asia/Chongqing' + | 'Asia/Chungking' + | 'Asia/Colombo' + | 'Asia/Dacca' + | 'Asia/Damascus' + | 'Asia/Dhaka' + | 'Asia/Dili' + | 'Asia/Dubai' + | 'Asia/Dushanbe' + | 'Asia/Famagusta' + | 'Asia/Gaza' + | 'Asia/Harbin' + | 'Asia/Hebron' + | 'Asia/Ho_Chi_Minh' + | 'Asia/Hong_Kong' + | 'Asia/Hovd' + | 'Asia/Irkutsk' + | 'Asia/Istanbul' + | 'Asia/Jakarta' + | 'Asia/Jayapura' + | 'Asia/Jerusalem' + | 'Asia/Kabul' + | 'Asia/Kamchatka' + | 'Asia/Karachi' + | 'Asia/Kashgar' + | 'Asia/Kathmandu' + | 'Asia/Katmandu' + | 'Asia/Khandyga' + | 'Asia/Kolkata' + | 'Asia/Krasnoyarsk' + | 'Asia/Kuala_Lumpur' + | 'Asia/Kuching' + | 'Asia/Kuwait' + | 'Asia/Macao' + | 'Asia/Macau' + | 'Asia/Magadan' + | 'Asia/Makassar' + | 'Asia/Manila' + | 'Asia/Muscat' + | 'Asia/Nicosia' + | 'Asia/Novokuznetsk' + | 'Asia/Novosibirsk' + | 'Asia/Omsk' + | 'Asia/Oral' + | 'Asia/Phnom_Penh' + | 'Asia/Pontianak' + | 'Asia/Pyongyang' + | 'Asia/Qatar' + | 'Asia/Qostanay' + | 'Asia/Qyzylorda' + | 'Asia/Rangoon' + | 'Asia/Riyadh' + | 'Asia/Saigon' + | 'Asia/Sakhalin' + | 'Asia/Samarkand' + | 'Asia/Seoul' + | 'Asia/Shanghai' + | 'Asia/Singapore' + | 'Asia/Srednekolymsk' + | 'Asia/Taipei' + | 'Asia/Tashkent' + | 'Asia/Tbilisi' + | 'Asia/Tehran' + | 'Asia/Tel_Aviv' + | 'Asia/Thimbu' + | 'Asia/Thimphu' + | 'Asia/Tokyo' + | 'Asia/Tomsk' + | 'Asia/Ujung_Pandang' + | 'Asia/Ulaanbaatar' + | 'Asia/Ulan_Bator' + | 'Asia/Urumqi' + | 'Asia/Ust-Nera' + | 'Asia/Vientiane' + | 'Asia/Vladivostok' + | 'Asia/Yakutsk' + | 'Asia/Yangon' + | 'Asia/Yekaterinburg' + | 'Asia/Yerevan' + | 'Atlantic/Azores' + | 'Atlantic/Bermuda' + | 'Atlantic/Canary' + | 'Atlantic/Cape_Verde' + | 'Atlantic/Faeroe' + | 'Atlantic/Faroe' + | 'Atlantic/Jan_Mayen' + | 'Atlantic/Madeira' + | 'Atlantic/Reykjavik' + | 'Atlantic/South_Georgia' + | 'Atlantic/St_Helena' + | 'Atlantic/Stanley' + | 'Australia/ACT' + | 'Australia/Adelaide' + | 'Australia/Brisbane' + | 'Australia/Broken_Hill' + | 'Australia/Canberra' + | 'Australia/Currie' + | 'Australia/Darwin' + | 'Australia/Eucla' + | 'Australia/Hobart' + | 'Australia/LHI' + | 'Australia/Lindeman' + | 'Australia/Lord_Howe' + | 'Australia/Melbourne' + | 'Australia/NSW' + | 'Australia/North' + | 'Australia/Perth' + | 'Australia/Queensland' + | 'Australia/South' + | 'Australia/Sydney' + | 'Australia/Tasmania' + | 'Australia/Victoria' + | 'Australia/West' + | 'Australia/Yancowinna' + | 'Brazil/Acre' + | 'Brazil/DeNoronha' + | 'Brazil/East' + | 'Brazil/West' + | 'CET' + | 'CST6CDT' + | 'Canada/Atlantic' + | 'Canada/Central' + | 'Canada/Eastern' + | 'Canada/Mountain' + | 'Canada/Newfoundland' + | 'Canada/Pacific' + | 'Canada/Saskatchewan' + | 'Canada/Yukon' + | 'Chile/Continental' + | 'Chile/EasterIsland' + | 'Cuba' + | 'EET' + | 'EST' + | 'EST5EDT' + | 'Egypt' + | 'Eire' + | 'Etc/GMT' + | 'Etc/GMT+0' + | 'Etc/GMT+1' + | 'Etc/GMT+10' + | 'Etc/GMT+11' + | 'Etc/GMT+12' + | 'Etc/GMT+2' + | 'Etc/GMT+3' + | 'Etc/GMT+4' + | 'Etc/GMT+5' + | 'Etc/GMT+6' + | 'Etc/GMT+7' + | 'Etc/GMT+8' + | 'Etc/GMT+9' + | 'Etc/GMT-0' + | 'Etc/GMT-1' + | 'Etc/GMT-10' + | 'Etc/GMT-11' + | 'Etc/GMT-12' + | 'Etc/GMT-13' + | 'Etc/GMT-14' + | 'Etc/GMT-2' + | 'Etc/GMT-3' + | 'Etc/GMT-4' + | 'Etc/GMT-5' + | 'Etc/GMT-6' + | 'Etc/GMT-7' + | 'Etc/GMT-8' + | 'Etc/GMT-9' + | 'Etc/GMT0' + | 'Etc/Greenwich' + | 'Etc/UCT' + | 'Etc/UTC' + | 'Etc/Universal' + | 'Etc/Zulu' + | 'Europe/Amsterdam' + | 'Europe/Andorra' + | 'Europe/Astrakhan' + | 'Europe/Athens' + | 'Europe/Belfast' + | 'Europe/Belgrade' + | 'Europe/Berlin' + | 'Europe/Bratislava' + | 'Europe/Brussels' + | 'Europe/Bucharest' + | 'Europe/Budapest' + | 'Europe/Busingen' + | 'Europe/Chisinau' + | 'Europe/Copenhagen' + | 'Europe/Dublin' + | 'Europe/Gibraltar' + | 'Europe/Guernsey' + | 'Europe/Helsinki' + | 'Europe/Isle_of_Man' + | 'Europe/Istanbul' + | 'Europe/Jersey' + | 'Europe/Kaliningrad' + | 'Europe/Kiev' + | 'Europe/Kirov' + | 'Europe/Kyiv' + | 'Europe/Lisbon' + | 'Europe/Ljubljana' + | 'Europe/London' + | 'Europe/Luxembourg' + | 'Europe/Madrid' + | 'Europe/Malta' + | 'Europe/Mariehamn' + | 'Europe/Minsk' + | 'Europe/Monaco' + | 'Europe/Moscow' + | 'Europe/Nicosia' + | 'Europe/Oslo' + | 'Europe/Paris' + | 'Europe/Podgorica' + | 'Europe/Prague' + | 'Europe/Riga' + | 'Europe/Rome' + | 'Europe/Samara' + | 'Europe/San_Marino' + | 'Europe/Sarajevo' + | 'Europe/Saratov' + | 'Europe/Simferopol' + | 'Europe/Skopje' + | 'Europe/Sofia' + | 'Europe/Stockholm' + | 'Europe/Tallinn' + | 'Europe/Tirane' + | 'Europe/Tiraspol' + | 'Europe/Ulyanovsk' + | 'Europe/Uzhgorod' + | 'Europe/Vaduz' + | 'Europe/Vatican' + | 'Europe/Vienna' + | 'Europe/Vilnius' + | 'Europe/Volgograd' + | 'Europe/Warsaw' + | 'Europe/Zagreb' + | 'Europe/Zaporozhye' + | 'Europe/Zurich' + | 'Factory' + | 'GB' + | 'GB-Eire' + | 'GMT' + | 'GMT+0' + | 'GMT-0' + | 'GMT0' + | 'Greenwich' + | 'HST' + | 'Hongkong' + | 'Iceland' + | 'Indian/Antananarivo' + | 'Indian/Chagos' + | 'Indian/Christmas' + | 'Indian/Cocos' + | 'Indian/Comoro' + | 'Indian/Kerguelen' + | 'Indian/Mahe' + | 'Indian/Maldives' + | 'Indian/Mauritius' + | 'Indian/Mayotte' + | 'Indian/Reunion' + | 'Iran' + | 'Israel' + | 'Jamaica' + | 'Japan' + | 'Kwajalein' + | 'Libya' + | 'MET' + | 'MST' + | 'MST7MDT' + | 'Mexico/BajaNorte' + | 'Mexico/BajaSur' + | 'Mexico/General' + | 'NZ' + | 'NZ-CHAT' + | 'Navajo' + | 'PRC' + | 'PST8PDT' + | 'Pacific/Apia' + | 'Pacific/Auckland' + | 'Pacific/Bougainville' + | 'Pacific/Chatham' + | 'Pacific/Chuuk' + | 'Pacific/Easter' + | 'Pacific/Efate' + | 'Pacific/Enderbury' + | 'Pacific/Fakaofo' + | 'Pacific/Fiji' + | 'Pacific/Funafuti' + | 'Pacific/Galapagos' + | 'Pacific/Gambier' + | 'Pacific/Guadalcanal' + | 'Pacific/Guam' + | 'Pacific/Honolulu' + | 'Pacific/Johnston' + | 'Pacific/Kanton' + | 'Pacific/Kiritimati' + | 'Pacific/Kosrae' + | 'Pacific/Kwajalein' + | 'Pacific/Majuro' + | 'Pacific/Marquesas' + | 'Pacific/Midway' + | 'Pacific/Nauru' + | 'Pacific/Niue' + | 'Pacific/Norfolk' + | 'Pacific/Noumea' + | 'Pacific/Pago_Pago' + | 'Pacific/Palau' + | 'Pacific/Pitcairn' + | 'Pacific/Pohnpei' + | 'Pacific/Ponape' + | 'Pacific/Port_Moresby' + | 'Pacific/Rarotonga' + | 'Pacific/Saipan' + | 'Pacific/Samoa' + | 'Pacific/Tahiti' + | 'Pacific/Tarawa' + | 'Pacific/Tongatapu' + | 'Pacific/Truk' + | 'Pacific/Wake' + | 'Pacific/Wallis' + | 'Pacific/Yap' + | 'Poland' + | 'Portugal' + | 'ROC' + | 'ROK' + | 'Singapore' + | 'Turkey' + | 'UCT' + | 'US/Alaska' + | 'US/Aleutian' + | 'US/Arizona' + | 'US/Central' + | 'US/East-Indiana' + | 'US/Eastern' + | 'US/Hawaii' + | 'US/Indiana-Starke' + | 'US/Michigan' + | 'US/Mountain' + | 'US/Pacific' + | 'US/Pacific-New' + | 'US/Samoa' + | 'UTC' + | 'Universal' + | 'W-SU' + | 'WET' + | 'Zulu'; + } + } + + interface ReportRunRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReportRunListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ReportRunsResource { + /** + * Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + */ + create( + params: ReportRunCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing Report Run. + */ + retrieve( + id: string, + params?: ReportRunRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Report Runs, with the most recent appearing first. + */ + list( + params?: ReportRunListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Reporting/ReportTypes.d.ts b/types/2022-11-15/Reporting/ReportTypes.d.ts index 559e3a03f9..ee6ceaf40d 100644 --- a/types/2022-11-15/Reporting/ReportTypes.d.ts +++ b/types/2022-11-15/Reporting/ReportTypes.d.ts @@ -59,46 +59,6 @@ declare module 'stripe' { */ version: number; } - - interface ReportTypeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReportTypeListParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ReportTypesResource { - /** - * Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) - */ - retrieve( - id: string, - params?: ReportTypeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a full list of Report Types. - */ - list( - params?: ReportTypeListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Reporting/ReportTypesResource.d.ts b/types/2022-11-15/Reporting/ReportTypesResource.d.ts new file mode 100644 index 0000000000..a7eed5b340 --- /dev/null +++ b/types/2022-11-15/Reporting/ReportTypesResource.d.ts @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Reporting { + interface ReportTypeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReportTypeListParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ReportTypesResource { + /** + * Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) + */ + retrieve( + id: string, + params?: ReportTypeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a full list of Report Types. + */ + list( + params?: ReportTypeListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Reviews.d.ts b/types/2022-11-15/Reviews.d.ts index c956afa82f..68eae3652f 100644 --- a/types/2022-11-15/Reviews.d.ts +++ b/types/2022-11-15/Reviews.d.ts @@ -139,65 +139,5 @@ declare module 'stripe' { version: string | null; } } - - interface ReviewRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReviewListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReviewApproveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ReviewsResource { - /** - * Retrieves a Review object. - */ - retrieve( - id: string, - params?: ReviewRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. - */ - list( - params?: ReviewListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Approves a Review object, closing it and removing it from the list of reviews. - */ - approve( - id: string, - params?: ReviewApproveParams, - options?: RequestOptions - ): Promise>; - approve( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/ReviewsResource.d.ts b/types/2022-11-15/ReviewsResource.d.ts new file mode 100644 index 0000000000..370d588b19 --- /dev/null +++ b/types/2022-11-15/ReviewsResource.d.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ReviewRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReviewListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReviewApproveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ReviewsResource { + /** + * Retrieves a Review object. + */ + retrieve( + id: string, + params?: ReviewRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + */ + list( + params?: ReviewListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Approves a Review object, closing it and removing it from the list of reviews. + */ + approve( + id: string, + params?: ReviewApproveParams, + options?: RequestOptions + ): Promise>; + approve( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/SetupAttempts.d.ts b/types/2022-11-15/SetupAttempts.d.ts index 1f0572c855..a95bcf0dfb 100644 --- a/types/2022-11-15/SetupAttempts.d.ts +++ b/types/2022-11-15/SetupAttempts.d.ts @@ -475,35 +475,5 @@ declare module 'stripe' { | 'invalid_request_error'; } } - - interface SetupAttemptListParams extends PaginationParams { - /** - * Only return SetupAttempts created by the SetupIntent specified by - * this ID. - */ - setup_intent: string; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class SetupAttemptsResource { - /** - * Returns a list of SetupAttempts associated with a provided SetupIntent. - */ - list( - params: SetupAttemptListParams, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/SetupAttemptsResource.d.ts b/types/2022-11-15/SetupAttemptsResource.d.ts new file mode 100644 index 0000000000..806feb7066 --- /dev/null +++ b/types/2022-11-15/SetupAttemptsResource.d.ts @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SetupAttemptListParams extends PaginationParams { + /** + * Only return SetupAttempts created by the SetupIntent specified by + * this ID. + */ + setup_intent: string; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SetupAttemptsResource { + /** + * Returns a list of SetupAttempts associated with a provided SetupIntent. + */ + list( + params: SetupAttemptListParams, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/SetupIntents.d.ts b/types/2022-11-15/SetupIntents.d.ts index 72132f0240..c4795c1881 100644 --- a/types/2022-11-15/SetupIntents.d.ts +++ b/types/2022-11-15/SetupIntents.d.ts @@ -589,2889 +589,5 @@ declare module 'stripe' { | 'requires_payment_method' | 'succeeded'; } - - interface SetupIntentCreateParams { - /** - * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - * - * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - */ - attach_to_self?: boolean; - - /** - * Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required. - */ - confirm?: boolean; - - /** - * ID of the Customer this SetupIntent belongs to, if one exists. - * - * If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Indicates the directions of money movement for which this payment method is intended to be used. - * - * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. - */ - flow_directions?: Array; - - /** - * This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - */ - mandate_data?: SetupIntentCreateParams.MandateData; - - /** - * 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.MetadataParam; - - /** - * The Stripe account ID for which this SetupIntent is created. - */ - on_behalf_of?: string; - - /** - * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - */ - payment_method?: string; - - /** - * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - * value in the SetupIntent. - */ - payment_method_data?: SetupIntentCreateParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this SetupIntent. - */ - payment_method_options?: SetupIntentCreateParams.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) that this SetupIntent is allowed to use. If this is not provided, defaults to ["card"]. - */ - payment_method_types?: Array; - - /** - * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - */ - return_url?: string; - - /** - * If this hash is populated, this SetupIntent will generate a single_use Mandate on success. - */ - single_use?: SetupIntentCreateParams.SingleUse; - - /** - * Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. - */ - usage?: SetupIntentCreateParams.Usage; - } - - namespace SetupIntentCreateParams { - type FlowDirection = 'inbound' | 'outbound'; - - interface MandateData { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData.CustomerAcceptance; - } - - namespace MandateData { - interface CustomerAcceptance { - /** - * The time at which the customer accepted the Mandate. - */ - accepted_at?: number; - - /** - * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - */ - offline?: CustomerAcceptance.Offline; - - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online?: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. - */ - type: CustomerAcceptance.Type; - } - - namespace CustomerAcceptance { - interface Offline {} - - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent: string; - } - - type Type = 'offline' | 'online'; - } - } - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodOptions.Blik; - - /** - * Configuration for any card setup attempted on this SetupIntent. - */ - card?: PaymentMethodOptions.Card; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: PaymentMethodOptions.Link; - - /** - * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: PaymentMethodOptions.UsBankAccount; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * 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?: AcssDebit.Currency; - - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - type Currency = 'cad' | 'usd'; - - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * List of Stripe products where this mandate can be selected automatically. - */ - default_for?: Array; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type DefaultFor = 'invoice' | 'subscription'; - - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter signals that a card has been collected - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * Currency in which future payments will be charged. 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; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface Link { - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - } - - namespace SepaDebit { - interface MandateOptions {} - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - interface SingleUse { - /** - * Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount: 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; - } - - type Usage = 'off_session' | 'on_session'; - } - - interface SetupIntentRetrieveParams { - /** - * The client secret of the SetupIntent. Required if a publishable key is used to retrieve the SetupIntent. - */ - client_secret?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SetupIntentUpdateParams { - /** - * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - * - * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - */ - attach_to_self?: boolean; - - /** - * ID of the Customer this SetupIntent belongs to, if one exists. - * - * If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Indicates the directions of money movement for which this payment method is intended to be used. - * - * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. - */ - flow_directions?: Array; - - /** - * 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; - - /** - * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - */ - payment_method?: string; - - /** - * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - * value in the SetupIntent. - */ - payment_method_data?: SetupIntentUpdateParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this SetupIntent. - */ - payment_method_options?: SetupIntentUpdateParams.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. If this is not provided, defaults to ["card"]. - */ - payment_method_types?: Array; - } - - namespace SetupIntentUpdateParams { - type FlowDirection = 'inbound' | 'outbound'; - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodOptions.Blik; - - /** - * Configuration for any card setup attempted on this SetupIntent. - */ - card?: PaymentMethodOptions.Card; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: PaymentMethodOptions.Link; - - /** - * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: PaymentMethodOptions.UsBankAccount; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * 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?: AcssDebit.Currency; - - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - type Currency = 'cad' | 'usd'; - - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * List of Stripe products where this mandate can be selected automatically. - */ - default_for?: Array; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type DefaultFor = 'invoice' | 'subscription'; - - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter signals that a card has been collected - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * Currency in which future payments will be charged. 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; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface Link { - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - } - - namespace SepaDebit { - interface MandateOptions {} - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - } - - interface SetupIntentListParams extends PaginationParams { - /** - * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - * - * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - */ - attach_to_self?: boolean; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return SetupIntents for the customer specified by this customer ID. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return SetupIntents associated with the specified payment method. - */ - payment_method?: string; - } - - interface SetupIntentCancelParams { - /** - * Reason for canceling this SetupIntent. Possible values are `abandoned`, `requested_by_customer`, or `duplicate` - */ - cancellation_reason?: SetupIntentCancelParams.CancellationReason; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace SetupIntentCancelParams { - type CancellationReason = - | 'abandoned' - | 'duplicate' - | 'requested_by_customer'; - } - - interface SetupIntentConfirmParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * This hash contains details about the Mandate to create - */ - mandate_data?: - | SetupIntentConfirmParams.MandateData1 - | SetupIntentConfirmParams.MandateData2; - - /** - * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - */ - payment_method?: string; - - /** - * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - * value in the SetupIntent. - */ - payment_method_data?: SetupIntentConfirmParams.PaymentMethodData; - - /** - * Payment-method-specific configuration for this SetupIntent. - */ - payment_method_options?: SetupIntentConfirmParams.PaymentMethodOptions; - - /** - * The URL to redirect your customer back to after they authenticate on the payment method's app or site. - * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - * This parameter is only used for cards and other redirect-based payment methods. - */ - return_url?: string; - } - - namespace SetupIntentConfirmParams { - interface MandateData1 { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData1.CustomerAcceptance; - } - - namespace MandateData1 { - interface CustomerAcceptance { - /** - * The time at which the customer accepted the Mandate. - */ - accepted_at?: number; - - /** - * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - */ - offline?: CustomerAcceptance.Offline; - - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online?: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. - */ - type: CustomerAcceptance.Type; - } - - namespace CustomerAcceptance { - interface Offline {} - - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent: string; - } - - type Type = 'offline' | 'online'; - } - } - - interface MandateData2 { - /** - * This hash contains details about the customer acceptance of the Mandate. - */ - customer_acceptance: MandateData2.CustomerAcceptance; - } - - namespace MandateData2 { - interface CustomerAcceptance { - /** - * If this is a Mandate accepted online, this hash contains details about the online acceptance. - */ - online: CustomerAcceptance.Online; - - /** - * The type of customer acceptance information included with the Mandate. - */ - type: 'online'; - } - - namespace CustomerAcceptance { - interface Online { - /** - * The IP address from which the Mandate was accepted by the customer. - */ - ip_address?: string; - - /** - * The user agent of the browser from which the Mandate was accepted by the customer. - */ - user_agent?: string; - } - } - } - - interface PaymentMethodData { - /** - * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - */ - acss_debit?: PaymentMethodData.AcssDebit; - - /** - * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - */ - affirm?: PaymentMethodData.Affirm; - - /** - * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - */ - afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; - - /** - * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - */ - alipay?: PaymentMethodData.Alipay; - - /** - * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - */ - au_becs_debit?: PaymentMethodData.AuBecsDebit; - - /** - * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - */ - bacs_debit?: PaymentMethodData.BacsDebit; - - /** - * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - */ - bancontact?: PaymentMethodData.Bancontact; - - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: PaymentMethodData.BillingDetails; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodData.Blik; - - /** - * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - */ - boleto?: PaymentMethodData.Boleto; - - /** - * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - */ - customer_balance?: PaymentMethodData.CustomerBalance; - - /** - * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - */ - eps?: PaymentMethodData.Eps; - - /** - * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - */ - fpx?: PaymentMethodData.Fpx; - - /** - * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - */ - giropay?: PaymentMethodData.Giropay; - - /** - * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - */ - grabpay?: PaymentMethodData.Grabpay; - - /** - * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - */ - ideal?: PaymentMethodData.Ideal; - - /** - * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - */ - interac_present?: PaymentMethodData.InteracPresent; - - /** - * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - */ - klarna?: PaymentMethodData.Klarna; - - /** - * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - */ - konbini?: PaymentMethodData.Konbini; - - /** - * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - */ - link?: PaymentMethodData.Link; - - /** - * 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.MetadataParam; - - /** - * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - */ - oxxo?: PaymentMethodData.Oxxo; - - /** - * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - */ - p24?: PaymentMethodData.P24; - - /** - * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - */ - paynow?: PaymentMethodData.Paynow; - - /** - * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - */ - pix?: PaymentMethodData.Pix; - - /** - * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - */ - promptpay?: PaymentMethodData.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethodData.RadarOptions; - - /** - * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - */ - sepa_debit?: PaymentMethodData.SepaDebit; - - /** - * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - */ - sofort?: PaymentMethodData.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethodData.Type; - - /** - * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - */ - us_bank_account?: PaymentMethodData.UsBankAccount; - - /** - * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - */ - wechat_pay?: PaymentMethodData.WechatPay; - } - - namespace PaymentMethodData { - interface AcssDebit { - /** - * Customer's bank account number. - */ - account_number: string; - - /** - * Institution number of the customer's bank. - */ - institution_number: string; - - /** - * Transit number of the customer's bank. - */ - transit_number: string; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * The account number for the bank account. - */ - account_number: string; - - /** - * Bank-State-Branch number of the bank account. - */ - bsb_number: string; - } - - interface BacsDebit { - /** - * Account number of the bank account that the funds will be debited from. - */ - account_number?: string; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code?: string; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - interface Blik {} - - interface Boleto { - /** - * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) - */ - tax_id: string; - } - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. - */ - bank?: Eps.Bank; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type for FPX transaction - */ - account_holder_type?: Fpx.AccountHolderType; - - /** - * The customer's bank. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank. - */ - bank?: Ideal.Bank; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Customer's date of birth - */ - dob?: Klarna.Dob; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - } - - interface Konbini {} - - interface Link {} - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank. - */ - bank?: P24.Bank; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * IBAN of the bank account. - */ - iban: string; - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: Sofort.Country; - } - - namespace Sofort { - type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - - interface WechatPay {} - } - - interface PaymentMethodOptions { - /** - * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - */ - blik?: PaymentMethodOptions.Blik; - - /** - * Configuration for any card setup attempted on this SetupIntent. - */ - card?: PaymentMethodOptions.Card; - - /** - * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - */ - link?: PaymentMethodOptions.Link; - - /** - * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - */ - us_bank_account?: PaymentMethodOptions.UsBankAccount; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * 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?: AcssDebit.Currency; - - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - type Currency = 'cad' | 'usd'; - - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * List of Stripe products where this mandate can be selected automatically. - */ - default_for?: Array; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type DefaultFor = 'invoice' | 'subscription'; - - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Blik { - /** - * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. - */ - code?: string; - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * When specified, this parameter signals that a card has been collected - * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This - * parameter can only be provided during confirmation. - */ - moto?: boolean; - - /** - * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * Currency in which future payments will be charged. 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; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date?: number; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count?: number; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types?: Array<'india'>; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface Link { - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - } - - namespace SepaDebit { - interface MandateOptions {} - } - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Additional fields for network related functions - */ - networks?: UsBankAccount.Networks; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - interface Networks { - /** - * Triggers validations to run across the selected networks - */ - requested?: Array; - } - - namespace Networks { - type Requested = 'ach' | 'us_domestic_wire'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - } - - interface SetupIntentVerifyMicrodepositsParams { - /** - * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. - */ - amounts?: Array; - - /** - * A six-character code starting with SM present in the microdeposit sent to the bank account. - */ - descriptor_code?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class SetupIntentsResource { - /** - * Creates a SetupIntent object. - * - * After the SetupIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) - * to collect any required permissions to charge the payment method later. - */ - create( - params?: SetupIntentCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. - */ - retrieve( - id: string, - params?: SetupIntentRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates a SetupIntent object. - */ - update( - id: string, - params?: SetupIntentUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of SetupIntents. - */ - list( - params?: SetupIntentListParams, - options?: RequestOptions - ): ApiListPromise; - 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. - * - * Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error. - */ - cancel( - id: string, - params?: SetupIntentCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Confirm that your customer intends to set up the current or - * provided payment method. For example, you would confirm a SetupIntent - * when a customer hits the “Save” button on a payment method management - * page on your website. - * - * If the selected payment method does not require any additional - * steps from the customer, the SetupIntent will transition to the - * succeeded status. - * - * Otherwise, it will transition to the requires_action status and - * suggest additional actions via next_action. If setup fails, - * the SetupIntent will transition to the - * requires_payment_method status. - */ - confirm( - id: string, - params?: SetupIntentConfirmParams, - options?: RequestOptions - ): Promise>; - confirm( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Verifies microdeposits on a SetupIntent object. - */ - verifyMicrodeposits( - id: string, - params?: SetupIntentVerifyMicrodepositsParams, - options?: RequestOptions - ): Promise>; - verifyMicrodeposits( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/SetupIntentsResource.d.ts b/types/2022-11-15/SetupIntentsResource.d.ts new file mode 100644 index 0000000000..77d20c05cb --- /dev/null +++ b/types/2022-11-15/SetupIntentsResource.d.ts @@ -0,0 +1,2889 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SetupIntentCreateParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + + /** + * Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required. + */ + confirm?: boolean; + + /** + * ID of the Customer this SetupIntent belongs to, if one exists. + * + * If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions?: Array; + + /** + * This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + */ + mandate_data?: SetupIntentCreateParams.MandateData; + + /** + * 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.MetadataParam; + + /** + * The Stripe account ID for which this SetupIntent is created. + */ + on_behalf_of?: string; + + /** + * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + */ + payment_method?: string; + + /** + * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + * value in the SetupIntent. + */ + payment_method_data?: SetupIntentCreateParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this SetupIntent. + */ + payment_method_options?: SetupIntentCreateParams.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) that this SetupIntent is allowed to use. If this is not provided, defaults to ["card"]. + */ + payment_method_types?: Array; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + */ + return_url?: string; + + /** + * If this hash is populated, this SetupIntent will generate a single_use Mandate on success. + */ + single_use?: SetupIntentCreateParams.SingleUse; + + /** + * Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. + */ + usage?: SetupIntentCreateParams.Usage; + } + + namespace SetupIntentCreateParams { + type FlowDirection = 'inbound' | 'outbound'; + + interface MandateData { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData.CustomerAcceptance; + } + + namespace MandateData { + interface CustomerAcceptance { + /** + * The time at which the customer accepted the Mandate. + */ + accepted_at?: number; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + */ + offline?: CustomerAcceptance.Offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online?: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + */ + type: CustomerAcceptance.Type; + } + + namespace CustomerAcceptance { + interface Offline {} + + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + } + + type Type = 'offline' | 'online'; + } + } + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + + /** + * Configuration for any card setup attempted on this SetupIntent. + */ + card?: PaymentMethodOptions.Card; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + + /** + * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: PaymentMethodOptions.UsBankAccount; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * 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?: AcssDebit.Currency; + + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + type Currency = 'cad' | 'usd'; + + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * List of Stripe products where this mandate can be selected automatically. + */ + default_for?: Array; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type DefaultFor = 'invoice' | 'subscription'; + + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Card { + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter signals that a card has been collected + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * Currency in which future payments will be charged. 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; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + } + + namespace SepaDebit { + interface MandateOptions {} + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + + interface SingleUse { + /** + * Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount: 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; + } + + type Usage = 'off_session' | 'on_session'; + } + + interface SetupIntentRetrieveParams { + /** + * The client secret of the SetupIntent. Required if a publishable key is used to retrieve the SetupIntent. + */ + client_secret?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SetupIntentUpdateParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + + /** + * ID of the Customer this SetupIntent belongs to, if one exists. + * + * If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Indicates the directions of money movement for which this payment method is intended to be used. + * + * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + */ + flow_directions?: Array; + + /** + * 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; + + /** + * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + */ + payment_method?: string; + + /** + * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + * value in the SetupIntent. + */ + payment_method_data?: SetupIntentUpdateParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this SetupIntent. + */ + payment_method_options?: SetupIntentUpdateParams.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. If this is not provided, defaults to ["card"]. + */ + payment_method_types?: Array; + } + + namespace SetupIntentUpdateParams { + type FlowDirection = 'inbound' | 'outbound'; + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + + /** + * Configuration for any card setup attempted on this SetupIntent. + */ + card?: PaymentMethodOptions.Card; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + + /** + * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: PaymentMethodOptions.UsBankAccount; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * 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?: AcssDebit.Currency; + + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + type Currency = 'cad' | 'usd'; + + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * List of Stripe products where this mandate can be selected automatically. + */ + default_for?: Array; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type DefaultFor = 'invoice' | 'subscription'; + + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Card { + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter signals that a card has been collected + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * Currency in which future payments will be charged. 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; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + } + + namespace SepaDebit { + interface MandateOptions {} + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + } + + interface SetupIntentListParams extends PaginationParams { + /** + * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + * + * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + */ + attach_to_self?: boolean; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return SetupIntents for the customer specified by this customer ID. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return SetupIntents associated with the specified payment method. + */ + payment_method?: string; + } + + interface SetupIntentCancelParams { + /** + * Reason for canceling this SetupIntent. Possible values are `abandoned`, `requested_by_customer`, or `duplicate` + */ + cancellation_reason?: SetupIntentCancelParams.CancellationReason; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace SetupIntentCancelParams { + type CancellationReason = + | 'abandoned' + | 'duplicate' + | 'requested_by_customer'; + } + + interface SetupIntentConfirmParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: + | SetupIntentConfirmParams.MandateData1 + | SetupIntentConfirmParams.MandateData2; + + /** + * ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + */ + payment_method?: string; + + /** + * When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) + * value in the SetupIntent. + */ + payment_method_data?: SetupIntentConfirmParams.PaymentMethodData; + + /** + * Payment-method-specific configuration for this SetupIntent. + */ + payment_method_options?: SetupIntentConfirmParams.PaymentMethodOptions; + + /** + * The URL to redirect your customer back to after they authenticate on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + } + + namespace SetupIntentConfirmParams { + interface MandateData1 { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData1.CustomerAcceptance; + } + + namespace MandateData1 { + interface CustomerAcceptance { + /** + * The time at which the customer accepted the Mandate. + */ + accepted_at?: number; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + */ + offline?: CustomerAcceptance.Offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online?: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + */ + type: CustomerAcceptance.Type; + } + + namespace CustomerAcceptance { + interface Offline {} + + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + } + + type Type = 'offline' | 'online'; + } + } + + interface MandateData2 { + /** + * This hash contains details about the customer acceptance of the Mandate. + */ + customer_acceptance: MandateData2.CustomerAcceptance; + } + + namespace MandateData2 { + interface CustomerAcceptance { + /** + * If this is a Mandate accepted online, this hash contains details about the online acceptance. + */ + online: CustomerAcceptance.Online; + + /** + * The type of customer acceptance information included with the Mandate. + */ + type: 'online'; + } + + namespace CustomerAcceptance { + interface Online { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address?: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent?: string; + } + } + } + + interface PaymentMethodData { + /** + * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + */ + acss_debit?: PaymentMethodData.AcssDebit; + + /** + * If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + */ + affirm?: PaymentMethodData.Affirm; + + /** + * If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + */ + afterpay_clearpay?: PaymentMethodData.AfterpayClearpay; + + /** + * If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + */ + alipay?: PaymentMethodData.Alipay; + + /** + * If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + */ + au_becs_debit?: PaymentMethodData.AuBecsDebit; + + /** + * If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + */ + bacs_debit?: PaymentMethodData.BacsDebit; + + /** + * If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + */ + bancontact?: PaymentMethodData.Bancontact; + + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodData.BillingDetails; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodData.Blik; + + /** + * If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + */ + boleto?: PaymentMethodData.Boleto; + + /** + * If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + */ + customer_balance?: PaymentMethodData.CustomerBalance; + + /** + * If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + */ + eps?: PaymentMethodData.Eps; + + /** + * If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + */ + fpx?: PaymentMethodData.Fpx; + + /** + * If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + */ + giropay?: PaymentMethodData.Giropay; + + /** + * If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + */ + grabpay?: PaymentMethodData.Grabpay; + + /** + * If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + */ + ideal?: PaymentMethodData.Ideal; + + /** + * If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + */ + interac_present?: PaymentMethodData.InteracPresent; + + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodData.Klarna; + + /** + * If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + */ + konbini?: PaymentMethodData.Konbini; + + /** + * If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + */ + link?: PaymentMethodData.Link; + + /** + * 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.MetadataParam; + + /** + * If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + */ + oxxo?: PaymentMethodData.Oxxo; + + /** + * If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + */ + p24?: PaymentMethodData.P24; + + /** + * If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + */ + paynow?: PaymentMethodData.Paynow; + + /** + * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + */ + pix?: PaymentMethodData.Pix; + + /** + * If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + */ + promptpay?: PaymentMethodData.Promptpay; + + /** + * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + */ + radar_options?: PaymentMethodData.RadarOptions; + + /** + * If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + */ + sepa_debit?: PaymentMethodData.SepaDebit; + + /** + * If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + */ + sofort?: PaymentMethodData.Sofort; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: PaymentMethodData.Type; + + /** + * If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + */ + us_bank_account?: PaymentMethodData.UsBankAccount; + + /** + * If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + */ + wechat_pay?: PaymentMethodData.WechatPay; + } + + namespace PaymentMethodData { + interface AcssDebit { + /** + * Customer's bank account number. + */ + account_number: string; + + /** + * Institution number of the customer's bank. + */ + institution_number: string; + + /** + * Transit number of the customer's bank. + */ + transit_number: string; + } + + interface Affirm {} + + interface AfterpayClearpay {} + + interface Alipay {} + + interface AuBecsDebit { + /** + * The account number for the bank account. + */ + account_number: string; + + /** + * Bank-State-Branch number of the bank account. + */ + bsb_number: string; + } + + interface BacsDebit { + /** + * Account number of the bank account that the funds will be debited from. + */ + account_number?: string; + + /** + * Sort code of the bank account. (e.g., `10-20-30`) + */ + sort_code?: string; + } + + interface Bancontact {} + + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + interface Blik {} + + interface Boleto { + /** + * The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + */ + tax_id: string; + } + + interface CustomerBalance {} + + interface Eps { + /** + * The customer's bank. + */ + bank?: Eps.Bank; + } + + namespace Eps { + type Bank = + | 'arzte_und_apotheker_bank' + | 'austrian_anadi_bank_ag' + | 'bank_austria' + | 'bankhaus_carl_spangler' + | 'bankhaus_schelhammer_und_schattera_ag' + | 'bawag_psk_ag' + | 'bks_bank_ag' + | 'brull_kallmus_bank_ag' + | 'btv_vier_lander_bank' + | 'capital_bank_grawe_gruppe_ag' + | 'deutsche_bank_ag' + | 'dolomitenbank' + | 'easybank_ag' + | 'erste_bank_und_sparkassen' + | 'hypo_alpeadriabank_international_ag' + | 'hypo_bank_burgenland_aktiengesellschaft' + | 'hypo_noe_lb_fur_niederosterreich_u_wien' + | 'hypo_oberosterreich_salzburg_steiermark' + | 'hypo_tirol_bank_ag' + | 'hypo_vorarlberg_bank_ag' + | 'marchfelder_bank' + | 'oberbank_ag' + | 'raiffeisen_bankengruppe_osterreich' + | 'schoellerbank_ag' + | 'sparda_bank_wien' + | 'volksbank_gruppe' + | 'volkskreditbank_ag' + | 'vr_bank_braunau'; + } + + interface Fpx { + /** + * Account holder type for FPX transaction + */ + account_holder_type?: Fpx.AccountHolderType; + + /** + * The customer's bank. + */ + bank: Fpx.Bank; + } + + namespace Fpx { + type AccountHolderType = 'company' | 'individual'; + + type Bank = + | 'affin_bank' + | 'agrobank' + | 'alliance_bank' + | 'ambank' + | 'bank_islam' + | 'bank_muamalat' + | 'bank_of_china' + | 'bank_rakyat' + | 'bsn' + | 'cimb' + | 'deutsche_bank' + | 'hong_leong_bank' + | 'hsbc' + | 'kfh' + | 'maybank2e' + | 'maybank2u' + | 'ocbc' + | 'pb_enterprise' + | 'public_bank' + | 'rhb' + | 'standard_chartered' + | 'uob'; + } + + interface Giropay {} + + interface Grabpay {} + + interface Ideal { + /** + * The customer's bank. + */ + bank?: Ideal.Bank; + } + + namespace Ideal { + type Bank = + | 'abn_amro' + | 'asn_bank' + | 'bunq' + | 'handelsbanken' + | 'ing' + | 'knab' + | 'moneyou' + | 'rabobank' + | 'regiobank' + | 'revolut' + | 'sns_bank' + | 'triodos_bank' + | 'van_lanschot'; + } + + interface InteracPresent {} + + interface Klarna { + /** + * Customer's date of birth + */ + dob?: Klarna.Dob; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + } + + interface Konbini {} + + interface Link {} + + interface Oxxo {} + + interface P24 { + /** + * The customer's bank. + */ + bank?: P24.Bank; + } + + namespace P24 { + type Bank = + | 'alior_bank' + | 'bank_millennium' + | 'bank_nowy_bfg_sa' + | 'bank_pekao_sa' + | 'banki_spbdzielcze' + | 'blik' + | 'bnp_paribas' + | 'boz' + | 'citi_handlowy' + | 'credit_agricole' + | 'envelobank' + | 'etransfer_pocztowy24' + | 'getin_bank' + | 'ideabank' + | 'ing' + | 'inteligo' + | 'mbank_mtransfer' + | 'nest_przelew' + | 'noble_pay' + | 'pbac_z_ipko' + | 'plus_bank' + | 'santander_przelew24' + | 'tmobile_usbugi_bankowe' + | 'toyota_bank' + | 'volkswagen_bank'; + } + + interface Paynow {} + + interface Pix {} + + interface Promptpay {} + + interface RadarOptions { + /** + * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + */ + session?: string; + } + + interface SepaDebit { + /** + * IBAN of the bank account. + */ + iban: string; + } + + interface Sofort { + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: Sofort.Country; + } + + namespace Sofort { + type Country = 'AT' | 'BE' | 'DE' | 'ES' | 'IT' | 'NL'; + } + + type Type = + | 'acss_debit' + | 'affirm' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'blik' + | 'boleto' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'konbini' + | 'link' + | 'oxxo' + | 'p24' + | 'paynow' + | 'pix' + | 'promptpay' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + + interface WechatPay {} + } + + interface PaymentMethodOptions { + /** + * If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + */ + blik?: PaymentMethodOptions.Blik; + + /** + * Configuration for any card setup attempted on this SetupIntent. + */ + card?: PaymentMethodOptions.Card; + + /** + * If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + */ + link?: PaymentMethodOptions.Link; + + /** + * If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + */ + us_bank_account?: PaymentMethodOptions.UsBankAccount; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * 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?: AcssDebit.Currency; + + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + type Currency = 'cad' | 'usd'; + + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * List of Stripe products where this mandate can be selected automatically. + */ + default_for?: Array; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type DefaultFor = 'invoice' | 'subscription'; + + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Blik { + /** + * The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + */ + code?: string; + } + + interface Card { + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * When specified, this parameter signals that a card has been collected + * as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + * parameter can only be provided during confirmation. + */ + moto?: boolean; + + /** + * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type: MandateOptions.AmountType; + + /** + * Currency in which future payments will be charged. 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; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + + /** + * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + */ + end_date?: number; + + /** + * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + */ + interval: MandateOptions.Interval; + + /** + * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + */ + interval_count?: number; + + /** + * Unique identifier for the mandate or subscription. + */ + reference: string; + + /** + * Start date of the mandate or subscription. Start date should not be lesser than yesterday. + */ + start_date: number; + + /** + * Specifies the type of mandates supported. Possible values are `india`. + */ + supported_types?: Array<'india'>; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + + type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface Link { + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + } + + namespace SepaDebit { + interface MandateOptions {} + } + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Additional fields for network related functions + */ + networks?: UsBankAccount.Networks; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + + /** + * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ + return_url?: string; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + interface Networks { + /** + * Triggers validations to run across the selected networks + */ + requested?: Array; + } + + namespace Networks { + type Requested = 'ach' | 'us_domestic_wire'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + } + + interface SetupIntentVerifyMicrodepositsParams { + /** + * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array; + + /** + * A six-character code starting with SM present in the microdeposit sent to the bank account. + */ + descriptor_code?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SetupIntentsResource { + /** + * Creates a SetupIntent object. + * + * After the SetupIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) + * to collect any required permissions to charge the payment method later. + */ + create( + params?: SetupIntentCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. + */ + retrieve( + id: string, + params?: SetupIntentRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates a SetupIntent object. + */ + update( + id: string, + params?: SetupIntentUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of SetupIntents. + */ + list( + params?: SetupIntentListParams, + options?: RequestOptions + ): ApiListPromise; + 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. + * + * Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error. + */ + cancel( + id: string, + params?: SetupIntentCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Confirm that your customer intends to set up the current or + * provided payment method. For example, you would confirm a SetupIntent + * when a customer hits the “Save” button on a payment method management + * page on your website. + * + * If the selected payment method does not require any additional + * steps from the customer, the SetupIntent will transition to the + * succeeded status. + * + * Otherwise, it will transition to the requires_action status and + * suggest additional actions via next_action. If setup fails, + * the SetupIntent will transition to the + * requires_payment_method status. + */ + confirm( + id: string, + params?: SetupIntentConfirmParams, + options?: RequestOptions + ): Promise>; + confirm( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Verifies microdeposits on a SetupIntent object. + */ + verifyMicrodeposits( + id: string, + params?: SetupIntentVerifyMicrodepositsParams, + options?: RequestOptions + ): Promise>; + verifyMicrodeposits( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/ShippingRates.d.ts b/types/2022-11-15/ShippingRates.d.ts index 36c0ef9f16..7ce5481b78 100644 --- a/types/2022-11-15/ShippingRates.d.ts +++ b/types/2022-11-15/ShippingRates.d.ts @@ -152,262 +152,5 @@ declare module 'stripe' { type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; } - - interface ShippingRateCreateParams { - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateCreateParams.DeliveryEstimate; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateCreateParams.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.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateCreateParams.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateCreateParams { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: 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; - - /** - * 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 ShippingRateRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ShippingRateUpdateParams { - /** - * Whether the shipping rate can be used for new purchases. Defaults to `true`. - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - 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 { - /** - * Only return shipping rates that are active or inactive. - */ - active?: boolean; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return shipping rates for the given currency. - */ - currency?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ShippingRatesResource { - /** - * Creates a new shipping rate object. - */ - create( - params: ShippingRateCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns the shipping rate object with the given ID. - */ - retrieve( - id: string, - params?: ShippingRateRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing shipping rate object. - */ - update( - id: string, - params?: ShippingRateUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your shipping rates. - */ - list( - params?: ShippingRateListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/ShippingRatesResource.d.ts b/types/2022-11-15/ShippingRatesResource.d.ts new file mode 100644 index 0000000000..c4c39c4c13 --- /dev/null +++ b/types/2022-11-15/ShippingRatesResource.d.ts @@ -0,0 +1,262 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface ShippingRateCreateParams { + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateCreateParams.DeliveryEstimate; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateCreateParams.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.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateCreateParams.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateCreateParams { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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; + + /** + * 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 ShippingRateRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ShippingRateUpdateParams { + /** + * Whether the shipping rate can be used for new purchases. Defaults to `true`. + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + 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 { + /** + * Only return shipping rates that are active or inactive. + */ + active?: boolean; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return shipping rates for the given currency. + */ + currency?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ShippingRatesResource { + /** + * Creates a new shipping rate object. + */ + create( + params: ShippingRateCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns the shipping rate object with the given ID. + */ + retrieve( + id: string, + params?: ShippingRateRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing shipping rate object. + */ + update( + id: string, + params?: ShippingRateUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your shipping rates. + */ + list( + params?: ShippingRateListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts b/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts index f825264258..4e906e2437 100644 --- a/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts +++ b/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts @@ -71,46 +71,6 @@ declare module 'stripe' { message: string; } } - - interface ScheduledQueryRunRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ScheduledQueryRunListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class ScheduledQueryRunsResource { - /** - * Retrieves the details of an scheduled query run. - */ - retrieve( - id: string, - params?: ScheduledQueryRunRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of scheduled query runs. - */ - list( - params?: ScheduledQueryRunListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts b/types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts new file mode 100644 index 0000000000..ba24140083 --- /dev/null +++ b/types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Sigma { + interface ScheduledQueryRunRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ScheduledQueryRunListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class ScheduledQueryRunsResource { + /** + * Retrieves the details of an scheduled query run. + */ + retrieve( + id: string, + params?: ScheduledQueryRunRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of scheduled query runs. + */ + list( + params?: ScheduledQueryRunListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Sources.d.ts b/types/2022-11-15/Sources.d.ts index 48c197f4b2..8371931599 100644 --- a/types/2022-11-15/Sources.d.ts +++ b/types/2022-11-15/Sources.d.ts @@ -735,611 +735,5 @@ declare module 'stripe' { statement_descriptor?: string; } } - - interface SourceCreateParams { - /** - * Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. - */ - amount?: number; - - /** - * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. - */ - currency?: string; - - /** - * The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. - */ - flow?: SourceCreateParams.Flow; - - /** - * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - */ - mandate?: SourceCreateParams.Mandate; - - metadata?: Stripe.MetadataParam; - - /** - * The source to share. - */ - original_source?: string; - - /** - * Information about the owner of the payment instrument that may be used or required by particular source types. - */ - owner?: SourceCreateParams.Owner; - - /** - * Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). - */ - receiver?: SourceCreateParams.Receiver; - - /** - * Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). - */ - redirect?: SourceCreateParams.Redirect; - - /** - * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. - */ - source_order?: SourceCreateParams.SourceOrder; - - /** - * An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. - */ - statement_descriptor?: string; - - /** - * An optional token used to create the source. When passed, token properties will override source parameters. - */ - token?: string; - - /** - * The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) - */ - type?: string; - - usage?: SourceCreateParams.Usage; - } - - namespace SourceCreateParams { - type Flow = 'code_verification' | 'none' | 'receiver' | 'redirect'; - - interface Mandate { - /** - * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. - */ - acceptance?: Mandate.Acceptance; - - /** - * The amount specified by the mandate. (Leave null for a mandate covering all amounts) - */ - amount?: Stripe.Emptyable; - - /** - * The currency specified by the mandate. (Must match `currency` of the source) - */ - currency?: string; - - /** - * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) - */ - interval?: Mandate.Interval; - - /** - * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). - */ - notification_method?: Mandate.NotificationMethod; - } - - namespace Mandate { - interface Acceptance { - /** - * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - */ - date?: number; - - /** - * The IP address from which the mandate was accepted or refused by the customer. - */ - ip?: string; - - /** - * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` - */ - offline?: Acceptance.Offline; - - /** - * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` - */ - online?: Acceptance.Online; - - /** - * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). - */ - status: Acceptance.Status; - - /** - * The type of acceptance information included with the mandate. Either `online` or `offline` - */ - type?: Acceptance.Type; - - /** - * The user agent of the browser from which the mandate was accepted or refused by the customer. - */ - user_agent?: string; - } - - namespace Acceptance { - interface Offline { - /** - * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. - */ - contact_email: string; - } - - interface Online { - /** - * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - */ - date?: number; - - /** - * The IP address from which the mandate was accepted or refused by the customer. - */ - ip?: string; - - /** - * The user agent of the browser from which the mandate was accepted or refused by the customer. - */ - user_agent?: string; - } - - type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; - - type Type = 'offline' | 'online'; - } - - type Interval = 'one_time' | 'scheduled' | 'variable'; - - type NotificationMethod = - | 'deprecated_none' - | 'email' - | 'manual' - | 'none' - | 'stripe_email'; - } - - interface Owner { - /** - * Owner's address. - */ - address?: Stripe.AddressParam; - - /** - * Owner's email address. - */ - email?: string; - - /** - * Owner's full name. - */ - name?: string; - - /** - * Owner's phone number. - */ - phone?: string; - } - - interface Receiver { - /** - * The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. - */ - refund_attributes_method?: Receiver.RefundAttributesMethod; - } - - namespace Receiver { - type RefundAttributesMethod = 'email' | 'manual' | 'none'; - } - - interface Redirect { - /** - * The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. - */ - return_url: string; - } - - interface SourceOrder { - /** - * List of items constituting the order. - */ - items?: Array; - - /** - * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. - */ - shipping?: SourceOrder.Shipping; - } - - namespace SourceOrder { - interface Item { - amount?: number; - - currency?: string; - - description?: string; - - /** - * The ID of the SKU being ordered. - */ - parent?: string; - - /** - * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. - */ - quantity?: number; - - type?: Item.Type; - } - - namespace Item { - type Type = 'discount' | 'shipping' | 'sku' | 'tax'; - } - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.ShippingAddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name?: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - } - - type Usage = 'reusable' | 'single_use'; - } - - interface SourceRetrieveParams { - /** - * The client secret of the source. Required if a publishable key is used to retrieve the source. - */ - client_secret?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SourceUpdateParams { - /** - * Amount associated with the source. - */ - amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - */ - mandate?: SourceUpdateParams.Mandate; - - /** - * 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; - - /** - * Information about the owner of the payment instrument that may be used or required by particular source types. - */ - owner?: SourceUpdateParams.Owner; - - /** - * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. - */ - source_order?: SourceUpdateParams.SourceOrder; - } - - namespace SourceUpdateParams { - interface Mandate { - /** - * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. - */ - acceptance?: Mandate.Acceptance; - - /** - * The amount specified by the mandate. (Leave null for a mandate covering all amounts) - */ - amount?: Stripe.Emptyable; - - /** - * The currency specified by the mandate. (Must match `currency` of the source) - */ - currency?: string; - - /** - * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) - */ - interval?: Mandate.Interval; - - /** - * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). - */ - notification_method?: Mandate.NotificationMethod; - } - - namespace Mandate { - interface Acceptance { - /** - * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - */ - date?: number; - - /** - * The IP address from which the mandate was accepted or refused by the customer. - */ - ip?: string; - - /** - * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` - */ - offline?: Acceptance.Offline; - - /** - * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` - */ - online?: Acceptance.Online; - - /** - * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). - */ - status: Acceptance.Status; - - /** - * The type of acceptance information included with the mandate. Either `online` or `offline` - */ - type?: Acceptance.Type; - - /** - * The user agent of the browser from which the mandate was accepted or refused by the customer. - */ - user_agent?: string; - } - - namespace Acceptance { - interface Offline { - /** - * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. - */ - contact_email: string; - } - - interface Online { - /** - * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - */ - date?: number; - - /** - * The IP address from which the mandate was accepted or refused by the customer. - */ - ip?: string; - - /** - * The user agent of the browser from which the mandate was accepted or refused by the customer. - */ - user_agent?: string; - } - - type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; - - type Type = 'offline' | 'online'; - } - - type Interval = 'one_time' | 'scheduled' | 'variable'; - - type NotificationMethod = - | 'deprecated_none' - | 'email' - | 'manual' - | 'none' - | 'stripe_email'; - } - - interface Owner { - /** - * Owner's address. - */ - address?: Stripe.AddressParam; - - /** - * Owner's email address. - */ - email?: string; - - /** - * Owner's full name. - */ - name?: string; - - /** - * Owner's phone number. - */ - phone?: string; - } - - interface SourceOrder { - /** - * List of items constituting the order. - */ - items?: Array; - - /** - * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. - */ - shipping?: SourceOrder.Shipping; - } - - namespace SourceOrder { - interface Item { - amount?: number; - - currency?: string; - - description?: string; - - /** - * The ID of the SKU being ordered. - */ - parent?: string; - - /** - * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. - */ - quantity?: number; - - type?: Item.Type; - } - - namespace Item { - type Type = 'discount' | 'shipping' | 'sku' | 'tax'; - } - - interface Shipping { - /** - * Shipping address. - */ - address: Stripe.ShippingAddressParam; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string; - - /** - * Recipient name. - */ - name?: string; - - /** - * Recipient phone (including extension). - */ - phone?: string; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string; - } - } - } - - interface SourceListSourceTransactionsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SourceVerifyParams { - /** - * The values needed to verify the source. - */ - values: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class SourcesResource { - /** - * Creates a new source object. - */ - create( - params?: SourceCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. - */ - retrieve( - id: string, - params?: SourceRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. - */ - update( - id: string, - params?: SourceUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * List source transactions for a given source. - */ - listSourceTransactions( - id: string, - params?: SourceListSourceTransactionsParams, - options?: RequestOptions - ): ApiListPromise; - listSourceTransactions( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Verify a given source. - */ - verify( - id: string, - params: SourceVerifyParams, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/SourcesResource.d.ts b/types/2022-11-15/SourcesResource.d.ts new file mode 100644 index 0000000000..fc20fe9dbb --- /dev/null +++ b/types/2022-11-15/SourcesResource.d.ts @@ -0,0 +1,611 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SourceCreateParams { + /** + * Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. + */ + amount?: number; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. + */ + currency?: string; + + /** + * The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. + */ + flow?: SourceCreateParams.Flow; + + /** + * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + */ + mandate?: SourceCreateParams.Mandate; + + metadata?: Stripe.MetadataParam; + + /** + * The source to share. + */ + original_source?: string; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner?: SourceCreateParams.Owner; + + /** + * Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). + */ + receiver?: SourceCreateParams.Receiver; + + /** + * Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). + */ + redirect?: SourceCreateParams.Redirect; + + /** + * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. + */ + source_order?: SourceCreateParams.SourceOrder; + + /** + * An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. + */ + statement_descriptor?: string; + + /** + * An optional token used to create the source. When passed, token properties will override source parameters. + */ + token?: string; + + /** + * The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) + */ + type?: string; + + usage?: SourceCreateParams.Usage; + } + + namespace SourceCreateParams { + type Flow = 'code_verification' | 'none' | 'receiver' | 'redirect'; + + interface Mandate { + /** + * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + */ + acceptance?: Mandate.Acceptance; + + /** + * The amount specified by the mandate. (Leave null for a mandate covering all amounts) + */ + amount?: Stripe.Emptyable; + + /** + * The currency specified by the mandate. (Must match `currency` of the source) + */ + currency?: string; + + /** + * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) + */ + interval?: Mandate.Interval; + + /** + * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + */ + notification_method?: Mandate.NotificationMethod; + } + + namespace Mandate { + interface Acceptance { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` + */ + offline?: Acceptance.Offline; + + /** + * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` + */ + online?: Acceptance.Online; + + /** + * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + */ + status: Acceptance.Status; + + /** + * The type of acceptance information included with the mandate. Either `online` or `offline` + */ + type?: Acceptance.Type; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + namespace Acceptance { + interface Offline { + /** + * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + */ + contact_email: string; + } + + interface Online { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; + + type Type = 'offline' | 'online'; + } + + type Interval = 'one_time' | 'scheduled' | 'variable'; + + type NotificationMethod = + | 'deprecated_none' + | 'email' + | 'manual' + | 'none' + | 'stripe_email'; + } + + interface Owner { + /** + * Owner's address. + */ + address?: Stripe.AddressParam; + + /** + * Owner's email address. + */ + email?: string; + + /** + * Owner's full name. + */ + name?: string; + + /** + * Owner's phone number. + */ + phone?: string; + } + + interface Receiver { + /** + * The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. + */ + refund_attributes_method?: Receiver.RefundAttributesMethod; + } + + namespace Receiver { + type RefundAttributesMethod = 'email' | 'manual' | 'none'; + } + + interface Redirect { + /** + * The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. + */ + return_url: string; + } + + interface SourceOrder { + /** + * List of items constituting the order. + */ + items?: Array; + + /** + * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. + */ + shipping?: SourceOrder.Shipping; + } + + namespace SourceOrder { + interface Item { + amount?: number; + + currency?: string; + + description?: string; + + /** + * The ID of the SKU being ordered. + */ + parent?: string; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + type?: Item.Type; + } + + namespace Item { + type Type = 'discount' | 'shipping' | 'sku' | 'tax'; + } + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.ShippingAddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name?: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + + type Usage = 'reusable' | 'single_use'; + } + + interface SourceRetrieveParams { + /** + * The client secret of the source. Required if a publishable key is used to retrieve the source. + */ + client_secret?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SourceUpdateParams { + /** + * Amount associated with the source. + */ + amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + */ + mandate?: SourceUpdateParams.Mandate; + + /** + * 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; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner?: SourceUpdateParams.Owner; + + /** + * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. + */ + source_order?: SourceUpdateParams.SourceOrder; + } + + namespace SourceUpdateParams { + interface Mandate { + /** + * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + */ + acceptance?: Mandate.Acceptance; + + /** + * The amount specified by the mandate. (Leave null for a mandate covering all amounts) + */ + amount?: Stripe.Emptyable; + + /** + * The currency specified by the mandate. (Must match `currency` of the source) + */ + currency?: string; + + /** + * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) + */ + interval?: Mandate.Interval; + + /** + * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + */ + notification_method?: Mandate.NotificationMethod; + } + + namespace Mandate { + interface Acceptance { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` + */ + offline?: Acceptance.Offline; + + /** + * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` + */ + online?: Acceptance.Online; + + /** + * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + */ + status: Acceptance.Status; + + /** + * The type of acceptance information included with the mandate. Either `online` or `offline` + */ + type?: Acceptance.Type; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + namespace Acceptance { + interface Offline { + /** + * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + */ + contact_email: string; + } + + interface Online { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; + + type Type = 'offline' | 'online'; + } + + type Interval = 'one_time' | 'scheduled' | 'variable'; + + type NotificationMethod = + | 'deprecated_none' + | 'email' + | 'manual' + | 'none' + | 'stripe_email'; + } + + interface Owner { + /** + * Owner's address. + */ + address?: Stripe.AddressParam; + + /** + * Owner's email address. + */ + email?: string; + + /** + * Owner's full name. + */ + name?: string; + + /** + * Owner's phone number. + */ + phone?: string; + } + + interface SourceOrder { + /** + * List of items constituting the order. + */ + items?: Array; + + /** + * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. + */ + shipping?: SourceOrder.Shipping; + } + + namespace SourceOrder { + interface Item { + amount?: number; + + currency?: string; + + description?: string; + + /** + * The ID of the SKU being ordered. + */ + parent?: string; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + type?: Item.Type; + } + + namespace Item { + type Type = 'discount' | 'shipping' | 'sku' | 'tax'; + } + + interface Shipping { + /** + * Shipping address. + */ + address: Stripe.ShippingAddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name?: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + } + + interface SourceListSourceTransactionsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SourceVerifyParams { + /** + * The values needed to verify the source. + */ + values: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class SourcesResource { + /** + * Creates a new source object. + */ + create( + params?: SourceCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. + */ + retrieve( + id: string, + params?: SourceRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + * + * This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + */ + update( + id: string, + params?: SourceUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * List source transactions for a given source. + */ + listSourceTransactions( + id: string, + params?: SourceListSourceTransactionsParams, + options?: RequestOptions + ): ApiListPromise; + listSourceTransactions( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Verify a given source. + */ + verify( + id: string, + params: SourceVerifyParams, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/SubscriptionItems.d.ts b/types/2022-11-15/SubscriptionItems.d.ts index 27ebf41824..4142d82946 100644 --- a/types/2022-11-15/SubscriptionItems.d.ts +++ b/types/2022-11-15/SubscriptionItems.d.ts @@ -100,406 +100,5 @@ declare module 'stripe' { */ deleted: true; } - - interface SubscriptionItemCreateParams { - /** - * The identifier of the subscription to modify. - */ - subscription: string; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionItemCreateParams.BillingThresholds - >; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - * - * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. - * - * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). - * - * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - */ - payment_behavior?: SubscriptionItemCreateParams.PaymentBehavior; - - /** - * The identifier of the plan to add to the subscription. - */ - plan?: string; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: SubscriptionItemCreateParams.PriceData; - - /** - * 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. - */ - proration_behavior?: SubscriptionItemCreateParams.ProrationBehavior; - - /** - * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - */ - proration_date?: number; - - /** - * The quantity you'd like to apply to the subscription item you're creating. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace SubscriptionItemCreateParams { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - type PaymentBehavior = - | 'allow_incomplete' - | 'default_incomplete' - | 'error_if_incomplete' - | 'pending_if_incomplete'; - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - } - - interface SubscriptionItemRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SubscriptionItemUpdateParams { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionItemUpdateParams.BillingThresholds - >; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Indicates if a customer is on or off-session while an invoice payment is attempted. - */ - off_session?: boolean; - - /** - * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - * - * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. - * - * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). - * - * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - */ - payment_behavior?: SubscriptionItemUpdateParams.PaymentBehavior; - - /** - * The identifier of the new plan for this subscription item. - */ - plan?: string; - - /** - * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: SubscriptionItemUpdateParams.PriceData; - - /** - * 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. - */ - proration_behavior?: SubscriptionItemUpdateParams.ProrationBehavior; - - /** - * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - */ - proration_date?: number; - - /** - * The quantity you'd like to apply to the subscription item you're creating. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace SubscriptionItemUpdateParams { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - type PaymentBehavior = - | 'allow_incomplete' - | 'default_incomplete' - | 'error_if_incomplete' - | 'pending_if_incomplete'; - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - } - - interface SubscriptionItemListParams extends PaginationParams { - /** - * The ID of the subscription whose items will be retrieved. - */ - subscription: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SubscriptionItemDeleteParams { - /** - * Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. - */ - clear_usage?: boolean; - - /** - * 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. - */ - proration_behavior?: SubscriptionItemDeleteParams.ProrationBehavior; - - /** - * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - */ - proration_date?: number; - } - - namespace SubscriptionItemDeleteParams { - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - } - - class SubscriptionItemsResource { - /** - * Adds a new item to an existing subscription. No existing items will be changed or replaced. - */ - create( - params: SubscriptionItemCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the subscription item with the given ID. - */ - retrieve( - id: string, - params?: SubscriptionItemRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the plan or quantity of an item on a current subscription. - */ - update( - id: string, - params?: SubscriptionItemUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your subscription items for a given subscription. - */ - list( - params: SubscriptionItemListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. - */ - del( - id: string, - params?: SubscriptionItemDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Creates a usage record for a specified subscription item and date, and fills it with a quantity. - * - * Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. - * - * The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. - * - * The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. - */ - createUsageRecord( - id: string, - params: UsageRecordCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). - * - * The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. - */ - listUsageRecordSummaries( - id: string, - params?: UsageRecordSummaryListParams, - options?: RequestOptions - ): ApiListPromise; - listUsageRecordSummaries( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/SubscriptionItemsResource.d.ts b/types/2022-11-15/SubscriptionItemsResource.d.ts new file mode 100644 index 0000000000..1f6e5a8d13 --- /dev/null +++ b/types/2022-11-15/SubscriptionItemsResource.d.ts @@ -0,0 +1,406 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SubscriptionItemCreateParams { + /** + * The identifier of the subscription to modify. + */ + subscription: string; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionItemCreateParams.BillingThresholds + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + * + * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + * + * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + * + * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + */ + payment_behavior?: SubscriptionItemCreateParams.PaymentBehavior; + + /** + * The identifier of the plan to add to the subscription. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: SubscriptionItemCreateParams.PriceData; + + /** + * 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. + */ + proration_behavior?: SubscriptionItemCreateParams.ProrationBehavior; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + */ + proration_date?: number; + + /** + * The quantity you'd like to apply to the subscription item you're creating. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace SubscriptionItemCreateParams { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + type PaymentBehavior = + | 'allow_incomplete' + | 'default_incomplete' + | 'error_if_incomplete' + | 'pending_if_incomplete'; + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + } + + interface SubscriptionItemRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SubscriptionItemUpdateParams { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionItemUpdateParams.BillingThresholds + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Indicates if a customer is on or off-session while an invoice payment is attempted. + */ + off_session?: boolean; + + /** + * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + * + * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + * + * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + * + * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + */ + payment_behavior?: SubscriptionItemUpdateParams.PaymentBehavior; + + /** + * The identifier of the new plan for this subscription item. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: SubscriptionItemUpdateParams.PriceData; + + /** + * 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. + */ + proration_behavior?: SubscriptionItemUpdateParams.ProrationBehavior; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + */ + proration_date?: number; + + /** + * The quantity you'd like to apply to the subscription item you're creating. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace SubscriptionItemUpdateParams { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + type PaymentBehavior = + | 'allow_incomplete' + | 'default_incomplete' + | 'error_if_incomplete' + | 'pending_if_incomplete'; + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + } + + interface SubscriptionItemListParams extends PaginationParams { + /** + * The ID of the subscription whose items will be retrieved. + */ + subscription: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SubscriptionItemDeleteParams { + /** + * Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * 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. + */ + proration_behavior?: SubscriptionItemDeleteParams.ProrationBehavior; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + */ + proration_date?: number; + } + + namespace SubscriptionItemDeleteParams { + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + } + + class SubscriptionItemsResource { + /** + * Adds a new item to an existing subscription. No existing items will be changed or replaced. + */ + create( + params: SubscriptionItemCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the subscription item with the given ID. + */ + retrieve( + id: string, + params?: SubscriptionItemRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the plan or quantity of an item on a current subscription. + */ + update( + id: string, + params?: SubscriptionItemUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your subscription items for a given subscription. + */ + list( + params: SubscriptionItemListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. + */ + del( + id: string, + params?: SubscriptionItemDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Creates a usage record for a specified subscription item and date, and fills it with a quantity. + * + * Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. + * + * The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. + * + * The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. + */ + createUsageRecord( + id: string, + params: UsageRecordCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). + * + * The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. + */ + listUsageRecordSummaries( + id: string, + params?: UsageRecordSummaryListParams, + options?: RequestOptions + ): ApiListPromise; + listUsageRecordSummaries( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/SubscriptionSchedules.d.ts b/types/2022-11-15/SubscriptionSchedules.d.ts index 267c3f6d1f..52dd3cdedc 100644 --- a/types/2022-11-15/SubscriptionSchedules.d.ts +++ b/types/2022-11-15/SubscriptionSchedules.d.ts @@ -416,1043 +416,5 @@ declare module 'stripe' { | 'not_started' | 'released'; } - - interface SubscriptionScheduleCreateParams { - /** - * The identifier of the customer to create the subscription schedule for. - */ - customer?: string; - - /** - * Object representing the subscription schedule's default settings. - */ - default_settings?: SubscriptionScheduleCreateParams.DefaultSettings; - - /** - * Configures how the subscription schedule behaves when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. - */ - end_behavior?: SubscriptionScheduleCreateParams.EndBehavior; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. - */ - from_subscription?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - */ - phases?: Array; - - /** - * When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. - */ - start_date?: number | 'now'; - } - - namespace SubscriptionScheduleCreateParams { - interface DefaultSettings { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Default settings for automatic tax computation. - */ - automatic_tax?: DefaultSettings.AutomaticTax; - - /** - * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - DefaultSettings.BillingThresholds - >; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - */ - collection_method?: DefaultSettings.CollectionMethod; - - /** - * 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. - */ - default_payment_method?: string; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: DefaultSettings.InvoiceSettings; - - /** - * The account on behalf of which to charge, for each of the associated subscription's invoices. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * The data with which to automatically create a Transfer for each of the associated subscription's invoices. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace DefaultSettings { - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due?: number; - } - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - type EndBehavior = 'cancel' | 'none' | 'release' | 'renew'; - - interface Phase { - /** - * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - */ - add_invoice_items?: Array; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Automatic tax settings for this phase. - */ - automatic_tax?: Phase.AutomaticTax; - - /** - * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor?: Phase.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - */ - collection_method?: Phase.CollectionMethod; - - /** - * The identifier of the coupon to apply to this phase of the subscription schedule. - */ - 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. - */ - default_payment_method?: string; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - */ - end_date?: number; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: Phase.InvoiceSettings; - - /** - * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - */ - items: Array; - - /** - * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - */ - iterations?: number; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The account on behalf of which to charge, for each of the associated subscription's invoices. - */ - on_behalf_of?: string; - - /** - * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. - */ - proration_behavior?: Phase.ProrationBehavior; - - /** - * The data with which to automatically create a Transfer for each of the associated subscription's invoices. - */ - transfer_data?: Phase.TransferData; - - /** - * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - */ - trial?: boolean; - - /** - * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - */ - trial_end?: number; - } - - namespace Phase { - interface AddInvoiceItem { - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: AddInvoiceItem.PriceData; - - /** - * Quantity for this item. Defaults to 1. - */ - quantity?: number; - - /** - * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace AddInvoiceItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due?: number; - } - - interface Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - */ - plan?: string; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: Item.PriceData; - - /** - * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace Item { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - } - - interface SubscriptionScheduleRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SubscriptionScheduleUpdateParams { - /** - * Object representing the subscription schedule's default settings. - */ - default_settings?: SubscriptionScheduleUpdateParams.DefaultSettings; - - /** - * Configures how the subscription schedule behaves when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. - */ - end_behavior?: SubscriptionScheduleUpdateParams.EndBehavior; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. - */ - phases?: Array; - - /** - * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. - */ - proration_behavior?: SubscriptionScheduleUpdateParams.ProrationBehavior; - } - - namespace SubscriptionScheduleUpdateParams { - interface DefaultSettings { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Default settings for automatic tax computation. - */ - automatic_tax?: DefaultSettings.AutomaticTax; - - /** - * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - DefaultSettings.BillingThresholds - >; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - */ - collection_method?: DefaultSettings.CollectionMethod; - - /** - * 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. - */ - default_payment_method?: string; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: DefaultSettings.InvoiceSettings; - - /** - * The account on behalf of which to charge, for each of the associated subscription's invoices. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * The data with which to automatically create a Transfer for each of the associated subscription's invoices. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace DefaultSettings { - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due?: number; - } - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - type EndBehavior = 'cancel' | 'none' | 'release' | 'renew'; - - interface Phase { - /** - * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. - */ - add_invoice_items?: Array; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Automatic tax settings for this phase. - */ - automatic_tax?: Phase.AutomaticTax; - - /** - * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor?: Phase.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. - */ - collection_method?: Phase.CollectionMethod; - - /** - * The identifier of the coupon to apply to this phase of the subscription schedule. - */ - 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. - */ - default_payment_method?: string; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description?: string; - - /** - * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. - */ - end_date?: number | 'now'; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings?: Phase.InvoiceSettings; - - /** - * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - */ - items: Array; - - /** - * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. - */ - iterations?: number; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The account on behalf of which to charge, for each of the associated subscription's invoices. - */ - on_behalf_of?: string; - - /** - * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. - */ - proration_behavior?: Phase.ProrationBehavior; - - /** - * The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. - */ - start_date?: number | 'now'; - - /** - * The data with which to automatically create a Transfer for each of the associated subscription's invoices. - */ - transfer_data?: Phase.TransferData; - - /** - * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - */ - trial?: boolean; - - /** - * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` - */ - trial_end?: number | 'now'; - } - - namespace Phase { - interface AddInvoiceItem { - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: AddInvoiceItem.PriceData; - - /** - * Quantity for this item. Defaults to 1. - */ - quantity?: number; - - /** - * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace AddInvoiceItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due?: number; - } - - interface Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. - */ - plan?: string; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: Item.PriceData; - - /** - * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace Item { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - } - - interface SubscriptionScheduleListParams extends PaginationParams { - /** - * Only return subscription schedules that were created canceled the given date interval. - */ - canceled_at?: Stripe.RangeQueryParam | number; - - /** - * Only return subscription schedules that completed during the given date interval. - */ - completed_at?: Stripe.RangeQueryParam | number; - - /** - * Only return subscription schedules that were created during the given date interval. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Only return subscription schedules for the given customer. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return subscription schedules that were released during the given date interval. - */ - released_at?: Stripe.RangeQueryParam | number; - - /** - * Only return subscription schedules that have not started yet. - */ - scheduled?: boolean; - } - - interface SubscriptionScheduleCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. - */ - invoice_now?: boolean; - - /** - * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. - */ - prorate?: boolean; - } - - interface SubscriptionScheduleReleaseParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Keep any cancellation on the subscription that the schedule has set - */ - preserve_cancel_date?: boolean; - } - - class SubscriptionSchedulesResource { - /** - * Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. - */ - create( - params?: SubscriptionScheduleCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. - */ - retrieve( - id: string, - params?: SubscriptionScheduleRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing subscription schedule. - */ - update( - id: string, - params?: SubscriptionScheduleUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the list of your subscription schedules. - */ - list( - params?: SubscriptionScheduleListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. - */ - cancel( - id: string, - params?: SubscriptionScheduleCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. - */ - release( - id: string, - params?: SubscriptionScheduleReleaseParams, - options?: RequestOptions - ): Promise>; - release( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/SubscriptionSchedulesResource.d.ts b/types/2022-11-15/SubscriptionSchedulesResource.d.ts new file mode 100644 index 0000000000..780204360f --- /dev/null +++ b/types/2022-11-15/SubscriptionSchedulesResource.d.ts @@ -0,0 +1,1043 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SubscriptionScheduleCreateParams { + /** + * The identifier of the customer to create the subscription schedule for. + */ + customer?: string; + + /** + * Object representing the subscription schedule's default settings. + */ + default_settings?: SubscriptionScheduleCreateParams.DefaultSettings; + + /** + * Configures how the subscription schedule behaves when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. + */ + end_behavior?: SubscriptionScheduleCreateParams.EndBehavior; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. + */ + from_subscription?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + */ + phases?: Array; + + /** + * When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. + */ + start_date?: number | 'now'; + } + + namespace SubscriptionScheduleCreateParams { + interface DefaultSettings { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Default settings for automatic tax computation. + */ + automatic_tax?: DefaultSettings.AutomaticTax; + + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + DefaultSettings.BillingThresholds + >; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: DefaultSettings.CollectionMethod; + + /** + * 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. + */ + default_payment_method?: string; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: DefaultSettings.InvoiceSettings; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace DefaultSettings { + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + } + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + type EndBehavior = 'cancel' | 'none' | 'release' | 'renew'; + + interface Phase { + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + */ + add_invoice_items?: Array; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Automatic tax settings for this phase. + */ + automatic_tax?: Phase.AutomaticTax; + + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: Phase.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: Phase.CollectionMethod; + + /** + * The identifier of the coupon to apply to this phase of the subscription schedule. + */ + 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. + */ + default_payment_method?: string; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + */ + end_date?: number; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: Phase.InvoiceSettings; + + /** + * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + */ + items: Array; + + /** + * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + */ + iterations?: number; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: string; + + /** + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. + */ + proration_behavior?: Phase.ProrationBehavior; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Phase.TransferData; + + /** + * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + */ + trial?: boolean; + + /** + * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + */ + trial_end?: number; + } + + namespace Phase { + interface AddInvoiceItem { + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + } + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + } + + interface SubscriptionScheduleRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SubscriptionScheduleUpdateParams { + /** + * Object representing the subscription schedule's default settings. + */ + default_settings?: SubscriptionScheduleUpdateParams.DefaultSettings; + + /** + * Configures how the subscription schedule behaves when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. + */ + end_behavior?: SubscriptionScheduleUpdateParams.EndBehavior; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. + */ + phases?: Array; + + /** + * If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. + */ + proration_behavior?: SubscriptionScheduleUpdateParams.ProrationBehavior; + } + + namespace SubscriptionScheduleUpdateParams { + interface DefaultSettings { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Default settings for automatic tax computation. + */ + automatic_tax?: DefaultSettings.AutomaticTax; + + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: DefaultSettings.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + DefaultSettings.BillingThresholds + >; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: DefaultSettings.CollectionMethod; + + /** + * 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. + */ + default_payment_method?: string; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: DefaultSettings.InvoiceSettings; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace DefaultSettings { + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + } + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + type EndBehavior = 'cancel' | 'none' | 'release' | 'renew'; + + interface Phase { + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. + */ + add_invoice_items?: Array; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Automatic tax settings for this phase. + */ + automatic_tax?: Phase.AutomaticTax; + + /** + * Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: Phase.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. + */ + collection_method?: Phase.CollectionMethod; + + /** + * The identifier of the coupon to apply to this phase of the subscription schedule. + */ + 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. + */ + default_payment_method?: string; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + + /** + * The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. + */ + end_date?: number | 'now'; + + /** + * All invoices will be billed using the specified settings. + */ + invoice_settings?: Phase.InvoiceSettings; + + /** + * List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + */ + items: Array; + + /** + * Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. + */ + iterations?: number; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The account on behalf of which to charge, for each of the associated subscription's invoices. + */ + on_behalf_of?: string; + + /** + * Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. + */ + proration_behavior?: Phase.ProrationBehavior; + + /** + * The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + */ + start_date?: number | 'now'; + + /** + * The data with which to automatically create a Transfer for each of the associated subscription's invoices. + */ + transfer_data?: Phase.TransferData; + + /** + * If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + */ + trial?: boolean; + + /** + * Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + */ + trial_end?: number | 'now'; + } + + namespace Phase { + interface AddInvoiceItem { + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + type BillingCycleAnchor = 'automatic' | 'phase_start'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface InvoiceSettings { + /** + * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + */ + days_until_due?: number; + } + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + } + + interface SubscriptionScheduleListParams extends PaginationParams { + /** + * Only return subscription schedules that were created canceled the given date interval. + */ + canceled_at?: Stripe.RangeQueryParam | number; + + /** + * Only return subscription schedules that completed during the given date interval. + */ + completed_at?: Stripe.RangeQueryParam | number; + + /** + * Only return subscription schedules that were created during the given date interval. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Only return subscription schedules for the given customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return subscription schedules that were released during the given date interval. + */ + released_at?: Stripe.RangeQueryParam | number; + + /** + * Only return subscription schedules that have not started yet. + */ + scheduled?: boolean; + } + + interface SubscriptionScheduleCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. + */ + invoice_now?: boolean; + + /** + * If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. + */ + prorate?: boolean; + } + + interface SubscriptionScheduleReleaseParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Keep any cancellation on the subscription that the schedule has set + */ + preserve_cancel_date?: boolean; + } + + class SubscriptionSchedulesResource { + /** + * Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. + */ + create( + params?: SubscriptionScheduleCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. + */ + retrieve( + id: string, + params?: SubscriptionScheduleRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing subscription schedule. + */ + update( + id: string, + params?: SubscriptionScheduleUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the list of your subscription schedules. + */ + list( + params?: SubscriptionScheduleListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. + */ + cancel( + id: string, + params?: SubscriptionScheduleCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. + */ + release( + id: string, + params?: SubscriptionScheduleReleaseParams, + options?: RequestOptions + ): Promise>; + release( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Subscriptions.d.ts b/types/2022-11-15/Subscriptions.d.ts index 92d46aea27..b0644e7d07 100644 --- a/types/2022-11-15/Subscriptions.d.ts +++ b/types/2022-11-15/Subscriptions.d.ts @@ -549,1510 +549,5 @@ declare module 'stripe' { destination: string | Stripe.Account; } } - - interface SubscriptionCreateParams { - /** - * The identifier of the customer to subscribe. - */ - customer: string; - - /** - * A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. - */ - add_invoice_items?: Array; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. - */ - automatic_tax?: SubscriptionCreateParams.AutomaticTax; - - /** - * For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. - */ - backdate_start_date?: number; - - /** - * A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. - */ - billing_cycle_anchor?: number; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionCreateParams.BillingThresholds - >; - - /** - * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - */ - cancel_at?: number; - - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - cancel_at_period_end?: boolean; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - */ - collection_method?: SubscriptionCreateParams.CollectionMethod; - - /** - * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. - */ - 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`. - */ - days_until_due?: number; - - /** - * ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_payment_method?: string; - - /** - * ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_source?: string; - - /** - * The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A list of up to 20 subscription items, each with an attached price. - */ - items?: Array; - - /** - * 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; - - /** - * Indicates if a customer is on or off-session while an invoice payment is attempted. - */ - off_session?: boolean; - - /** - * The account on behalf of which to charge, for each of the subscription's invoices. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * Only applies to subscriptions with `collection_method=charge_automatically`. - * - * Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - * - * Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. - * - * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - * - * `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. - * - * Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. - */ - payment_behavior?: SubscriptionCreateParams.PaymentBehavior; - - /** - * Payment settings to pass to invoices created by the subscription. - */ - payment_settings?: SubscriptionCreateParams.PaymentSettings; - - /** - * Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - */ - pending_invoice_item_interval?: Stripe.Emptyable< - SubscriptionCreateParams.PendingInvoiceItemInterval - >; - - /** - * The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. - */ - promotion_code?: string; - - /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. - */ - proration_behavior?: SubscriptionCreateParams.ProrationBehavior; - - /** - * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - */ - transfer_data?: SubscriptionCreateParams.TransferData; - - /** - * Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - trial_end?: 'now' | number; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - trial_from_plan?: boolean; - - /** - * Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - trial_period_days?: number; - } - - namespace SubscriptionCreateParams { - interface AddInvoiceItem { - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: AddInvoiceItem.PriceData; - - /** - * Quantity for this item. Defaults to 1. - */ - quantity?: number; - - /** - * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace AddInvoiceItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * 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.MetadataParam; - - /** - * Plan ID for this item, as a string. - */ - plan?: string; - - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: Item.PriceData; - - /** - * Quantity for this item. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace Item { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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'; - } - } - - type PaymentBehavior = - | 'allow_incomplete' - | 'default_incomplete' - | 'error_if_incomplete' - | 'pending_if_incomplete'; - - interface PaymentSettings { - /** - * Payment-method-specific configuration to provide to invoices created by the subscription. - */ - payment_method_options?: PaymentSettings.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - */ - payment_method_types?: Stripe.Emptyable< - Array - >; - - /** - * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - */ - save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; - } - - namespace PaymentSettings { - interface PaymentMethodOptions { - /** - * This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. - */ - konbini?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. - */ - us_bank_account?: Stripe.Emptyable< - PaymentMethodOptions.UsBankAccount - >; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount?: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type?: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: string; - } - - namespace CustomerBalance { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type?: string; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - } - } - - interface Konbini {} - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type PaymentMethodType = - | 'ach_credit_transfer' - | 'ach_debit' - | 'acss_debit' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'boleto' - | 'card' - | 'customer_balance' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'konbini' - | 'link' - | 'paynow' - | 'promptpay' - | 'sepa_credit_transfer' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; - } - - interface PendingInvoiceItemInterval { - /** - * Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. - */ - interval: PendingInvoiceItemInterval.Interval; - - /** - * The number of intervals between invoices. 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 PendingInvoiceItemInterval { - type Interval = 'day' | 'month' | 'week' | 'year'; - } - - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface SubscriptionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SubscriptionUpdateParams { - /** - * A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. - */ - add_invoice_items?: Array; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - */ - application_fee_percent?: number; - - /** - * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. - */ - automatic_tax?: SubscriptionUpdateParams.AutomaticTax; - - /** - * Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor?: SubscriptionUpdateParams.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable< - SubscriptionUpdateParams.BillingThresholds - >; - - /** - * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. - */ - cancel_at?: Stripe.Emptyable; - - /** - * Boolean indicating whether this subscription should cancel at the end of the current period. - */ - cancel_at_period_end?: boolean; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - */ - collection_method?: SubscriptionUpdateParams.CollectionMethod; - - /** - * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. - */ - coupon?: 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`. - */ - days_until_due?: number; - - /** - * ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_payment_method?: string; - - /** - * ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_source?: string; - - /** - * The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates. - */ - default_tax_rates?: Stripe.Emptyable>; - - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A list of up to 20 subscription items, each with an attached price. - */ - items?: Array; - - /** - * 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; - - /** - * Indicates if a customer is on or off-session while an invoice payment is attempted. - */ - off_session?: boolean; - - /** - * The account on behalf of which to charge, for each of the subscription's invoices. - */ - on_behalf_of?: Stripe.Emptyable; - - /** - * If specified, payment collection for this subscription will be paused. - */ - pause_collection?: Stripe.Emptyable< - SubscriptionUpdateParams.PauseCollection - >; - - /** - * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. - * - * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. - * - * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). - * - * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - */ - payment_behavior?: SubscriptionUpdateParams.PaymentBehavior; - - /** - * Payment settings to pass to invoices created by the subscription. - */ - payment_settings?: SubscriptionUpdateParams.PaymentSettings; - - /** - * Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - */ - pending_invoice_item_interval?: Stripe.Emptyable< - SubscriptionUpdateParams.PendingInvoiceItemInterval - >; - - /** - * The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. - */ - promotion_code?: string; - - /** - * 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. - */ - proration_behavior?: SubscriptionUpdateParams.ProrationBehavior; - - /** - * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. - */ - proration_date?: number; - - /** - * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value. - */ - transfer_data?: Stripe.Emptyable; - - /** - * Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. - */ - trial_end?: 'now' | number; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - trial_from_plan?: boolean; - } - - namespace SubscriptionUpdateParams { - interface AddInvoiceItem { - /** - * The ID of the price object. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: AddInvoiceItem.PriceData; - - /** - * Quantity for this item. Defaults to 1. - */ - quantity?: number; - - /** - * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace AddInvoiceItem { - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * 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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface AutomaticTax { - /** - * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'now' | 'unchanged'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to advance to a new billing period - */ - amount_gte?: number; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - */ - reset_billing_cycle_anchor?: boolean; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Item { - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. - */ - billing_thresholds?: Stripe.Emptyable; - - /** - * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. - */ - clear_usage?: boolean; - - /** - * A flag that, if set to `true`, will delete the specified item. - */ - deleted?: boolean; - - /** - * Subscription item to update. - */ - id?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * Plan ID for this item, as a string. - */ - plan?: string; - - /** - * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - */ - price?: string; - - /** - * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - */ - price_data?: Item.PriceData; - - /** - * Quantity for this item. - */ - quantity?: number; - - /** - * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace Item { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to advance to a new billing period - */ - usage_gte: number; - } - - interface PriceData { - /** - * 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 ID of the product that this price will belong to. - */ - product: string; - - /** - * The recurring components of a price such as `interval` and `interval_count`. - */ - recurring: PriceData.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?: PriceData.TaxBehavior; - - /** - * 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 PriceData { - 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 PauseCollection { - /** - * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. - */ - behavior: PauseCollection.Behavior; - - /** - * The time after which the subscription will resume collecting payments. - */ - resumes_at?: number; - } - - namespace PauseCollection { - type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void'; - } - - type PaymentBehavior = - | 'allow_incomplete' - | 'default_incomplete' - | 'error_if_incomplete' - | 'pending_if_incomplete'; - - interface PaymentSettings { - /** - * Payment-method-specific configuration to provide to invoices created by the subscription. - */ - payment_method_options?: PaymentSettings.PaymentMethodOptions; - - /** - * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - */ - payment_method_types?: Stripe.Emptyable< - Array - >; - - /** - * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - */ - save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; - } - - namespace PaymentSettings { - interface PaymentMethodOptions { - /** - * This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. - */ - konbini?: Stripe.Emptyable; - - /** - * This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. - */ - us_bank_account?: Stripe.Emptyable< - PaymentMethodOptions.UsBankAccount - >; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options?: Card.MandateOptions; - - /** - * Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. - */ - network?: Card.Network; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure?: Card.RequestThreeDSecure; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount?: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type?: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description?: string; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: string; - } - - namespace CustomerBalance { - interface BankTransfer { - /** - * Configuration for eu_bank_transfer funding type. - */ - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type?: string; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - } - } - - interface Konbini {} - - interface UsBankAccount { - /** - * Additional fields for Financial Connections Session creation - */ - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Verification method for the intent - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type PaymentMethodType = - | 'ach_credit_transfer' - | 'ach_debit' - | 'acss_debit' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'boleto' - | 'card' - | 'customer_balance' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'konbini' - | 'link' - | 'paynow' - | 'promptpay' - | 'sepa_credit_transfer' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; - } - - interface PendingInvoiceItemInterval { - /** - * Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. - */ - interval: PendingInvoiceItemInterval.Interval; - - /** - * The number of intervals between invoices. 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 PendingInvoiceItemInterval { - type Interval = 'day' | 'month' | 'week' | 'year'; - } - - type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent?: number; - - /** - * ID of an existing, connected Stripe account. - */ - destination: string; - } - } - - interface SubscriptionListParams extends PaginationParams { - /** - * The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. - */ - collection_method?: SubscriptionListParams.CollectionMethod; - - created?: Stripe.RangeQueryParam | number; - - current_period_end?: Stripe.RangeQueryParam | number; - - current_period_start?: Stripe.RangeQueryParam | number; - - /** - * The ID of the customer whose subscriptions will be retrieved. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The ID of the plan whose subscriptions will be retrieved. - */ - plan?: string; - - /** - * Filter for subscriptions that contain this recurring price ID. - */ - price?: string; - - /** - * The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. - */ - status?: SubscriptionListParams.Status; - - /** - * Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. - */ - test_clock?: string; - } - - namespace SubscriptionListParams { - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - type Status = - | 'active' - | 'all' - | 'canceled' - | 'ended' - | 'incomplete' - | 'incomplete_expired' - | 'past_due' - | 'trialing' - | 'unpaid'; - } - - interface SubscriptionCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. - */ - invoice_now?: boolean; - - /** - * Will generate a proration invoice item that credits remaining unused time until the subscription period end. - */ - prorate?: boolean; - } - - interface SubscriptionDeleteParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. - */ - invoice_now?: boolean; - - /** - * Will generate a proration invoice item that credits remaining unused time until the subscription period end. - */ - prorate?: boolean; - } - - interface SubscriptionDeleteDiscountParams {} - - interface SubscriptionSearchParams { - /** - * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). - */ - query: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - */ - limit?: number; - - /** - * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. - */ - page?: string; - } - - class SubscriptionsResource { - /** - * Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. - * - * When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. - * The payment_behavior parameter determines the exact behavior of the initial payment. - * - * To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. - * Schedules provide the flexibility to model more complex billing configurations that change over time. - */ - create( - params: SubscriptionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the subscription with the given ID. - */ - retrieve( - id: string, - params?: SubscriptionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): 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. - */ - update( - id: string, - params?: SubscriptionUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. - */ - list( - params?: SubscriptionListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. - * - * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. - * - * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. - */ - cancel( - id: string, - params?: SubscriptionCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. - * - * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. - * - * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. - */ - del( - id: string, - params?: SubscriptionDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Removes the currently applied discount on a subscription. - */ - deleteDiscount( - id: string, - params?: SubscriptionDeleteDiscountParams, - options?: RequestOptions - ): Promise>; - deleteDiscount( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). - * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating - * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up - * to an hour behind during outages. Search functionality is not available to merchants in India. - */ - search( - params: SubscriptionSearchParams, - options?: RequestOptions - ): ApiSearchResultPromise; - } } } diff --git a/types/2022-11-15/SubscriptionsResource.d.ts b/types/2022-11-15/SubscriptionsResource.d.ts new file mode 100644 index 0000000000..d338934756 --- /dev/null +++ b/types/2022-11-15/SubscriptionsResource.d.ts @@ -0,0 +1,1510 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface SubscriptionCreateParams { + /** + * The identifier of the customer to subscribe. + */ + customer: string; + + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. + */ + add_invoice_items?: Array; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + */ + automatic_tax?: SubscriptionCreateParams.AutomaticTax; + + /** + * For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + */ + backdate_start_date?: number; + + /** + * A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. + */ + billing_cycle_anchor?: number; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionCreateParams.BillingThresholds + >; + + /** + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + */ + cancel_at?: number; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + cancel_at_period_end?: boolean; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + */ + collection_method?: SubscriptionCreateParams.CollectionMethod; + + /** + * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + */ + 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`. + */ + days_until_due?: number; + + /** + * ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + */ + default_payment_method?: string; + + /** + * ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + */ + default_source?: string; + + /** + * The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A list of up to 20 subscription items, each with an attached price. + */ + items?: Array; + + /** + * 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; + + /** + * Indicates if a customer is on or off-session while an invoice payment is attempted. + */ + off_session?: boolean; + + /** + * The account on behalf of which to charge, for each of the subscription's invoices. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * Only applies to subscriptions with `collection_method=charge_automatically`. + * + * Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + * + * Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. + * + * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + * + * `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. + * + * Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. + */ + payment_behavior?: SubscriptionCreateParams.PaymentBehavior; + + /** + * Payment settings to pass to invoices created by the subscription. + */ + payment_settings?: SubscriptionCreateParams.PaymentSettings; + + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + */ + pending_invoice_item_interval?: Stripe.Emptyable< + SubscriptionCreateParams.PendingInvoiceItemInterval + >; + + /** + * The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + */ + promotion_code?: string; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. + */ + proration_behavior?: SubscriptionCreateParams.ProrationBehavior; + + /** + * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. + */ + transfer_data?: SubscriptionCreateParams.TransferData; + + /** + * Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + trial_from_plan?: boolean; + + /** + * Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + trial_period_days?: number; + } + + namespace SubscriptionCreateParams { + interface AddInvoiceItem { + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * 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.MetadataParam; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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'; + } + } + + type PaymentBehavior = + | 'allow_incomplete' + | 'default_incomplete' + | 'error_if_incomplete' + | 'pending_if_incomplete'; + + interface PaymentSettings { + /** + * Payment-method-specific configuration to provide to invoices created by the subscription. + */ + payment_method_options?: PaymentSettings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + */ + payment_method_types?: Stripe.Emptyable< + Array + >; + + /** + * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + */ + save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; + } + + namespace PaymentSettings { + interface PaymentMethodOptions { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + */ + konbini?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + */ + us_bank_account?: Stripe.Emptyable< + PaymentMethodOptions.UsBankAccount + >; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + } + + interface Card { + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount?: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type?: MandateOptions.AmountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: string; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type?: string; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + } + } + + interface Konbini {} + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + + type PaymentMethodType = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'boleto' + | 'card' + | 'customer_balance' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'konbini' + | 'link' + | 'paynow' + | 'promptpay' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; + } + + interface PendingInvoiceItemInterval { + /** + * Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: PendingInvoiceItemInterval.Interval; + + /** + * The number of intervals between invoices. 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 PendingInvoiceItemInterval { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface SubscriptionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface SubscriptionUpdateParams { + /** + * A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. + */ + add_invoice_items?: Array; + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + */ + application_fee_percent?: number; + + /** + * Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + */ + automatic_tax?: SubscriptionUpdateParams.AutomaticTax; + + /** + * Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + */ + billing_cycle_anchor?: SubscriptionUpdateParams.BillingCycleAnchor; + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable< + SubscriptionUpdateParams.BillingThresholds + >; + + /** + * A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. + */ + cancel_at?: Stripe.Emptyable; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + cancel_at_period_end?: boolean; + + /** + * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + */ + collection_method?: SubscriptionUpdateParams.CollectionMethod; + + /** + * The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + */ + coupon?: 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`. + */ + days_until_due?: number; + + /** + * ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + */ + default_payment_method?: string; + + /** + * ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + */ + default_source?: string; + + /** + * The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates. + */ + default_tax_rates?: Stripe.Emptyable>; + + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A list of up to 20 subscription items, each with an attached price. + */ + items?: Array; + + /** + * 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; + + /** + * Indicates if a customer is on or off-session while an invoice payment is attempted. + */ + off_session?: boolean; + + /** + * The account on behalf of which to charge, for each of the subscription's invoices. + */ + on_behalf_of?: Stripe.Emptyable; + + /** + * If specified, payment collection for this subscription will be paused. + */ + pause_collection?: Stripe.Emptyable< + SubscriptionUpdateParams.PauseCollection + >; + + /** + * Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. + * + * Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + * + * Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + * + * Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + */ + payment_behavior?: SubscriptionUpdateParams.PaymentBehavior; + + /** + * Payment settings to pass to invoices created by the subscription. + */ + payment_settings?: SubscriptionUpdateParams.PaymentSettings; + + /** + * Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + */ + pending_invoice_item_interval?: Stripe.Emptyable< + SubscriptionUpdateParams.PendingInvoiceItemInterval + >; + + /** + * The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. + */ + promotion_code?: string; + + /** + * 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. + */ + proration_behavior?: SubscriptionUpdateParams.ProrationBehavior; + + /** + * If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. + */ + proration_date?: number; + + /** + * If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value. + */ + transfer_data?: Stripe.Emptyable; + + /** + * Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. + */ + trial_end?: 'now' | number; + + /** + * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + */ + trial_from_plan?: boolean; + } + + namespace SubscriptionUpdateParams { + interface AddInvoiceItem { + /** + * The ID of the price object. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: AddInvoiceItem.PriceData; + + /** + * Quantity for this item. Defaults to 1. + */ + quantity?: number; + + /** + * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace AddInvoiceItem { + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + } + + interface AutomaticTax { + /** + * Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + */ + enabled: boolean; + } + + type BillingCycleAnchor = 'now' | 'unchanged'; + + interface BillingThresholds { + /** + * Monetary threshold that triggers the subscription to advance to a new billing period + */ + amount_gte?: number; + + /** + * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + */ + reset_billing_cycle_anchor?: boolean; + } + + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + interface Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + billing_thresholds?: Stripe.Emptyable; + + /** + * Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + */ + clear_usage?: boolean; + + /** + * A flag that, if set to `true`, will delete the specified item. + */ + deleted?: boolean; + + /** + * Subscription item to update. + */ + id?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * Plan ID for this item, as a string. + */ + plan?: string; + + /** + * The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + */ + price?: string; + + /** + * Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + */ + price_data?: Item.PriceData; + + /** + * Quantity for this item. + */ + quantity?: number; + + /** + * A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace Item { + interface BillingThresholds { + /** + * Usage threshold that triggers the subscription to advance to a new billing period + */ + usage_gte: number; + } + + interface PriceData { + /** + * 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 ID of the product that this price will belong to. + */ + product: string; + + /** + * The recurring components of a price such as `interval` and `interval_count`. + */ + recurring: PriceData.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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + 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 PauseCollection { + /** + * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + */ + behavior: PauseCollection.Behavior; + + /** + * The time after which the subscription will resume collecting payments. + */ + resumes_at?: number; + } + + namespace PauseCollection { + type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void'; + } + + type PaymentBehavior = + | 'allow_incomplete' + | 'default_incomplete' + | 'error_if_incomplete' + | 'pending_if_incomplete'; + + interface PaymentSettings { + /** + * Payment-method-specific configuration to provide to invoices created by the subscription. + */ + payment_method_options?: PaymentSettings.PaymentMethodOptions; + + /** + * The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + */ + payment_method_types?: Stripe.Emptyable< + Array + >; + + /** + * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + */ + save_default_payment_method?: PaymentSettings.SaveDefaultPaymentMethod; + } + + namespace PaymentSettings { + interface PaymentMethodOptions { + /** + * This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. + */ + konbini?: Stripe.Emptyable; + + /** + * This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. + */ + us_bank_account?: Stripe.Emptyable< + PaymentMethodOptions.UsBankAccount + >; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type TransactionType = 'business' | 'personal'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + } + + interface Card { + /** + * Configuration options for setting up an eMandate for cards issued in India. + */ + mandate_options?: Card.MandateOptions; + + /** + * Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. + */ + network?: Card.Network; + + /** + * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + */ + request_three_d_secure?: Card.RequestThreeDSecure; + } + + namespace Card { + interface MandateOptions { + /** + * Amount to be charged for future payments. + */ + amount?: number; + + /** + * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + */ + amount_type?: MandateOptions.AmountType; + + /** + * A description of the mandate or subscription that is meant to be displayed to the customer. + */ + description?: string; + } + + namespace MandateOptions { + type AmountType = 'fixed' | 'maximum'; + } + + type Network = + | 'amex' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'interac' + | 'jcb' + | 'mastercard' + | 'unionpay' + | 'unknown' + | 'visa'; + + type RequestThreeDSecure = 'any' | 'automatic'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: string; + } + + namespace CustomerBalance { + interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type?: string; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + } + } + + interface Konbini {} + + interface UsBankAccount { + /** + * Additional fields for Financial Connections Session creation + */ + financial_connections?: UsBankAccount.FinancialConnections; + + /** + * Verification method for the intent + */ + verification_method?: UsBankAccount.VerificationMethod; + } + + namespace UsBankAccount { + interface FinancialConnections { + /** + * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + */ + permissions?: Array; + } + + namespace FinancialConnections { + type Permission = + | 'balances' + | 'ownership' + | 'payment_method' + | 'transactions'; + } + + type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; + } + } + + type PaymentMethodType = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'boleto' + | 'card' + | 'customer_balance' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'konbini' + | 'link' + | 'paynow' + | 'promptpay' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'us_bank_account' + | 'wechat_pay'; + + type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; + } + + interface PendingInvoiceItemInterval { + /** + * Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + */ + interval: PendingInvoiceItemInterval.Interval; + + /** + * The number of intervals between invoices. 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 PendingInvoiceItemInterval { + type Interval = 'day' | 'month' | 'week' | 'year'; + } + + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + + interface TransferData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + */ + amount_percent?: number; + + /** + * ID of an existing, connected Stripe account. + */ + destination: string; + } + } + + interface SubscriptionListParams extends PaginationParams { + /** + * The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. + */ + collection_method?: SubscriptionListParams.CollectionMethod; + + created?: Stripe.RangeQueryParam | number; + + current_period_end?: Stripe.RangeQueryParam | number; + + current_period_start?: Stripe.RangeQueryParam | number; + + /** + * The ID of the customer whose subscriptions will be retrieved. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The ID of the plan whose subscriptions will be retrieved. + */ + plan?: string; + + /** + * Filter for subscriptions that contain this recurring price ID. + */ + price?: string; + + /** + * The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. + */ + status?: SubscriptionListParams.Status; + + /** + * Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. + */ + test_clock?: string; + } + + namespace SubscriptionListParams { + type CollectionMethod = 'charge_automatically' | 'send_invoice'; + + type Status = + | 'active' + | 'all' + | 'canceled' + | 'ended' + | 'incomplete' + | 'incomplete_expired' + | 'past_due' + | 'trialing' + | 'unpaid'; + } + + interface SubscriptionCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + */ + invoice_now?: boolean; + + /** + * Will generate a proration invoice item that credits remaining unused time until the subscription period end. + */ + prorate?: boolean; + } + + interface SubscriptionDeleteParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + */ + invoice_now?: boolean; + + /** + * Will generate a proration invoice item that credits remaining unused time until the subscription period end. + */ + prorate?: boolean; + } + + interface SubscriptionDeleteDiscountParams {} + + interface SubscriptionSearchParams { + /** + * The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). + */ + query: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + */ + limit?: number; + + /** + * A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. + */ + page?: string; + } + + class SubscriptionsResource { + /** + * Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. + * + * When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. + * The payment_behavior parameter determines the exact behavior of the initial payment. + * + * To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. + * Schedules provide the flexibility to model more complex billing configurations that change over time. + */ + create( + params: SubscriptionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the subscription with the given ID. + */ + retrieve( + id: string, + params?: SubscriptionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): 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. + */ + update( + id: string, + params?: SubscriptionUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. + */ + list( + params?: SubscriptionListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + * + * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. + */ + cancel( + id: string, + params?: SubscriptionCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. + * + * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. + */ + del( + id: string, + params?: SubscriptionDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Removes the currently applied discount on a subscription. + */ + deleteDiscount( + id: string, + params?: SubscriptionDeleteDiscountParams, + options?: RequestOptions + ): Promise>; + deleteDiscount( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). + * Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating + * conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up + * to an hour behind during outages. Search functionality is not available to merchants in India. + */ + search( + params: SubscriptionSearchParams, + options?: RequestOptions + ): ApiSearchResultPromise; + } + } +} diff --git a/types/2022-11-15/TaxCodes.d.ts b/types/2022-11-15/TaxCodes.d.ts index 75a7263440..685af391e8 100644 --- a/types/2022-11-15/TaxCodes.d.ts +++ b/types/2022-11-15/TaxCodes.d.ts @@ -26,43 +26,5 @@ declare module 'stripe' { */ name: string; } - - interface TaxCodeRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxCodeListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class TaxCodesResource { - /** - * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. - */ - retrieve( - id: string, - params?: TaxCodeRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. - */ - list( - params?: TaxCodeListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/TaxCodesResource.d.ts b/types/2022-11-15/TaxCodesResource.d.ts new file mode 100644 index 0000000000..215680b206 --- /dev/null +++ b/types/2022-11-15/TaxCodesResource.d.ts @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TaxCodeRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxCodeListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class TaxCodesResource { + /** + * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. + */ + retrieve( + id: string, + params?: TaxCodeRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. + */ + list( + params?: TaxCodeListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/TaxIds.d.ts b/types/2022-11-15/TaxIds.d.ts index dbaae1a0e2..0e343c938a 100644 --- a/types/2022-11-15/TaxIds.d.ts +++ b/types/2022-11-15/TaxIds.d.ts @@ -153,93 +153,5 @@ declare module 'stripe' { */ deleted: true; } - - interface TaxIdCreateParams { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxIdCreateParams.Type; - - /** - * Value of the tax ID. - */ - value: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace TaxIdCreateParams { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - - interface TaxIdRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxIdListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxIdDeleteParams {} } } diff --git a/types/2022-11-15/TaxIdsResource.d.ts b/types/2022-11-15/TaxIdsResource.d.ts new file mode 100644 index 0000000000..deb825b2c0 --- /dev/null +++ b/types/2022-11-15/TaxIdsResource.d.ts @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TaxIdCreateParams { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxIdCreateParams.Type; + + /** + * Value of the tax ID. + */ + value: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace TaxIdCreateParams { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + + interface TaxIdRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxIdListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxIdDeleteParams {} + } +} diff --git a/types/2022-11-15/TaxRates.d.ts b/types/2022-11-15/TaxRates.d.ts index 23db44b6a1..8f570cf824 100644 --- a/types/2022-11-15/TaxRates.d.ts +++ b/types/2022-11-15/TaxRates.d.ts @@ -90,203 +90,5 @@ declare module 'stripe' { | 'sales_tax' | 'vat'; } - - interface TaxRateCreateParams { - /** - * The display name of the tax rate, which will be shown to users. - */ - display_name: string; - - /** - * This specifies if the tax rate is inclusive or exclusive. - */ - inclusive: boolean; - - /** - * This represents the tax rate percent out of 100. - */ - percentage: number; - - /** - * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - */ - active?: boolean; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country?: string; - - /** - * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. - */ - jurisdiction?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. - */ - state?: string; - - /** - * The high-level tax type, such as `vat` or `sales_tax`. - */ - tax_type?: TaxRateCreateParams.TaxType; - } - - namespace TaxRateCreateParams { - type TaxType = - | 'gst' - | 'hst' - | 'jct' - | 'pst' - | 'qst' - | 'rst' - | 'sales_tax' - | 'vat'; - } - - interface TaxRateRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxRateUpdateParams { - /** - * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - */ - active?: boolean; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country?: string; - - /** - * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - */ - description?: string; - - /** - * The display name of the tax rate, which will be shown to users. - */ - display_name?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. - */ - jurisdiction?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. - */ - state?: string; - - /** - * The high-level tax type, such as `vat` or `sales_tax`. - */ - tax_type?: TaxRateUpdateParams.TaxType; - } - - namespace TaxRateUpdateParams { - type TaxType = - | 'gst' - | 'hst' - | 'jct' - | 'pst' - | 'qst' - | 'rst' - | 'sales_tax' - | 'vat'; - } - - interface TaxRateListParams extends PaginationParams { - /** - * Optional flag to filter by tax rates that are either active or inactive (archived). - */ - active?: boolean; - - /** - * Optional range for filtering created date. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). - */ - inclusive?: boolean; - } - - class TaxRatesResource { - /** - * Creates a new tax rate. - */ - create( - params: TaxRateCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a tax rate with the given ID - */ - retrieve( - id: string, - params?: TaxRateRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates an existing tax rate. - */ - update( - id: string, - params?: TaxRateUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. - */ - list( - params?: TaxRateListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - } } } diff --git a/types/2022-11-15/TaxRatesResource.d.ts b/types/2022-11-15/TaxRatesResource.d.ts new file mode 100644 index 0000000000..773ca4820f --- /dev/null +++ b/types/2022-11-15/TaxRatesResource.d.ts @@ -0,0 +1,203 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TaxRateCreateParams { + /** + * The display name of the tax rate, which will be shown to users. + */ + display_name: string; + + /** + * This specifies if the tax rate is inclusive or exclusive. + */ + inclusive: boolean; + + /** + * This represents the tax rate percent out of 100. + */ + percentage: number; + + /** + * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + */ + active?: boolean; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + */ + jurisdiction?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + */ + state?: string; + + /** + * The high-level tax type, such as `vat` or `sales_tax`. + */ + tax_type?: TaxRateCreateParams.TaxType; + } + + namespace TaxRateCreateParams { + type TaxType = + | 'gst' + | 'hst' + | 'jct' + | 'pst' + | 'qst' + | 'rst' + | 'sales_tax' + | 'vat'; + } + + interface TaxRateRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxRateUpdateParams { + /** + * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + */ + active?: boolean; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + */ + description?: string; + + /** + * The display name of the tax rate, which will be shown to users. + */ + display_name?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. + */ + jurisdiction?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + */ + state?: string; + + /** + * The high-level tax type, such as `vat` or `sales_tax`. + */ + tax_type?: TaxRateUpdateParams.TaxType; + } + + namespace TaxRateUpdateParams { + type TaxType = + | 'gst' + | 'hst' + | 'jct' + | 'pst' + | 'qst' + | 'rst' + | 'sales_tax' + | 'vat'; + } + + interface TaxRateListParams extends PaginationParams { + /** + * Optional flag to filter by tax rates that are either active or inactive (archived). + */ + active?: boolean; + + /** + * Optional range for filtering created date. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). + */ + inclusive?: boolean; + } + + class TaxRatesResource { + /** + * Creates a new tax rate. + */ + create( + params: TaxRateCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a tax rate with the given ID + */ + retrieve( + id: string, + params?: TaxRateRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates an existing tax rate. + */ + update( + id: string, + params?: TaxRateUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. + */ + list( + params?: TaxRateListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Terminal/Configurations.d.ts b/types/2022-11-15/Terminal/Configurations.d.ts index 0042c3fbf1..f9d5650eaa 100644 --- a/types/2022-11-15/Terminal/Configurations.d.ts +++ b/types/2022-11-15/Terminal/Configurations.d.ts @@ -341,802 +341,6 @@ declare module 'stripe' { */ deleted: true; } - - interface ConfigurationCreateParams { - /** - * An object containing device type specific settings for BBPOS WisePOS E readers - */ - bbpos_wisepos_e?: ConfigurationCreateParams.BbposWiseposE; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Tipping configurations for readers supporting on-reader tips - */ - tipping?: Stripe.Emptyable; - - /** - * An object containing device type specific settings for Verifone P400 readers - */ - verifone_p400?: ConfigurationCreateParams.VerifoneP400; - } - - namespace ConfigurationCreateParams { - interface BbposWiseposE { - /** - * A File ID representing an image you would like displayed on the reader. - */ - splashscreen?: Stripe.Emptyable; - } - - interface Tipping { - /** - * Tipping configuration for AUD - */ - aud?: Tipping.Aud; - - /** - * Tipping configuration for CAD - */ - cad?: Tipping.Cad; - - /** - * Tipping configuration for CHF - */ - chf?: Tipping.Chf; - - /** - * Tipping configuration for CZK - */ - czk?: Tipping.Czk; - - /** - * Tipping configuration for DKK - */ - dkk?: Tipping.Dkk; - - /** - * Tipping configuration for EUR - */ - eur?: Tipping.Eur; - - /** - * Tipping configuration for GBP - */ - gbp?: Tipping.Gbp; - - /** - * Tipping configuration for HKD - */ - hkd?: Tipping.Hkd; - - /** - * Tipping configuration for MYR - */ - myr?: Tipping.Myr; - - /** - * Tipping configuration for NOK - */ - nok?: Tipping.Nok; - - /** - * Tipping configuration for NZD - */ - nzd?: Tipping.Nzd; - - /** - * Tipping configuration for SEK - */ - sek?: Tipping.Sek; - - /** - * Tipping configuration for SGD - */ - sgd?: Tipping.Sgd; - - /** - * Tipping configuration for USD - */ - usd?: Tipping.Usd; - } - - namespace Tipping { - interface Aud { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Cad { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Chf { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Czk { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Dkk { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Eur { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Gbp { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Hkd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Myr { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Nok { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Nzd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Sek { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Sgd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Usd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - } - - interface VerifoneP400 { - /** - * A File ID representing an image you would like displayed on the reader. - */ - splashscreen?: Stripe.Emptyable; - } - } - - interface ConfigurationRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ConfigurationUpdateParams { - /** - * An object containing device type specific settings for BBPOS WisePOS E readers - */ - bbpos_wisepos_e?: Stripe.Emptyable< - ConfigurationUpdateParams.BbposWiseposE - >; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Tipping configurations for readers supporting on-reader tips - */ - tipping?: Stripe.Emptyable; - - /** - * An object containing device type specific settings for Verifone P400 readers - */ - verifone_p400?: Stripe.Emptyable< - ConfigurationUpdateParams.VerifoneP400 - >; - } - - namespace ConfigurationUpdateParams { - interface BbposWiseposE { - /** - * A File ID representing an image you would like displayed on the reader. - */ - splashscreen?: Stripe.Emptyable; - } - - interface Tipping { - /** - * Tipping configuration for AUD - */ - aud?: Tipping.Aud; - - /** - * Tipping configuration for CAD - */ - cad?: Tipping.Cad; - - /** - * Tipping configuration for CHF - */ - chf?: Tipping.Chf; - - /** - * Tipping configuration for CZK - */ - czk?: Tipping.Czk; - - /** - * Tipping configuration for DKK - */ - dkk?: Tipping.Dkk; - - /** - * Tipping configuration for EUR - */ - eur?: Tipping.Eur; - - /** - * Tipping configuration for GBP - */ - gbp?: Tipping.Gbp; - - /** - * Tipping configuration for HKD - */ - hkd?: Tipping.Hkd; - - /** - * Tipping configuration for MYR - */ - myr?: Tipping.Myr; - - /** - * Tipping configuration for NOK - */ - nok?: Tipping.Nok; - - /** - * Tipping configuration for NZD - */ - nzd?: Tipping.Nzd; - - /** - * Tipping configuration for SEK - */ - sek?: Tipping.Sek; - - /** - * Tipping configuration for SGD - */ - sgd?: Tipping.Sgd; - - /** - * Tipping configuration for USD - */ - usd?: Tipping.Usd; - } - - namespace Tipping { - interface Aud { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Cad { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Chf { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Czk { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Dkk { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Eur { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Gbp { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Hkd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Myr { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Nok { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Nzd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Sek { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Sgd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - - interface Usd { - /** - * Fixed amounts displayed when collecting a tip - */ - fixed_amounts?: Array; - - /** - * Percentages displayed when collecting a tip - */ - percentages?: Array; - - /** - * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed - */ - smart_tip_threshold?: number; - } - } - - interface VerifoneP400 { - /** - * A File ID representing an image you would like displayed on the reader. - */ - splashscreen?: Stripe.Emptyable; - } - } - - interface ConfigurationListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * if present, only return the account default or non-default configurations. - */ - is_account_default?: boolean; - } - - interface ConfigurationDeleteParams {} - - class ConfigurationsResource { - /** - * Creates a new Configuration object. - */ - create( - params?: ConfigurationCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a Configuration object. - */ - retrieve( - id: string, - params?: ConfigurationRetrieveParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration - > - >; - retrieve( - id: string, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration - > - >; - - /** - * Updates a new Configuration object. - */ - update( - id: string, - params?: ConfigurationUpdateParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration - > - >; - - /** - * Returns a list of Configuration objects. - */ - list( - params?: ConfigurationListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes a Configuration object. - */ - del( - id: string, - params?: ConfigurationDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Terminal/ConfigurationsResource.d.ts b/types/2022-11-15/Terminal/ConfigurationsResource.d.ts new file mode 100644 index 0000000000..e7f589fcb1 --- /dev/null +++ b/types/2022-11-15/Terminal/ConfigurationsResource.d.ts @@ -0,0 +1,803 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Terminal { + interface ConfigurationCreateParams { + /** + * An object containing device type specific settings for BBPOS WisePOS E readers + */ + bbpos_wisepos_e?: ConfigurationCreateParams.BbposWiseposE; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Tipping configurations for readers supporting on-reader tips + */ + tipping?: Stripe.Emptyable; + + /** + * An object containing device type specific settings for Verifone P400 readers + */ + verifone_p400?: ConfigurationCreateParams.VerifoneP400; + } + + namespace ConfigurationCreateParams { + interface BbposWiseposE { + /** + * A File ID representing an image you would like displayed on the reader. + */ + splashscreen?: Stripe.Emptyable; + } + + interface Tipping { + /** + * Tipping configuration for AUD + */ + aud?: Tipping.Aud; + + /** + * Tipping configuration for CAD + */ + cad?: Tipping.Cad; + + /** + * Tipping configuration for CHF + */ + chf?: Tipping.Chf; + + /** + * Tipping configuration for CZK + */ + czk?: Tipping.Czk; + + /** + * Tipping configuration for DKK + */ + dkk?: Tipping.Dkk; + + /** + * Tipping configuration for EUR + */ + eur?: Tipping.Eur; + + /** + * Tipping configuration for GBP + */ + gbp?: Tipping.Gbp; + + /** + * Tipping configuration for HKD + */ + hkd?: Tipping.Hkd; + + /** + * Tipping configuration for MYR + */ + myr?: Tipping.Myr; + + /** + * Tipping configuration for NOK + */ + nok?: Tipping.Nok; + + /** + * Tipping configuration for NZD + */ + nzd?: Tipping.Nzd; + + /** + * Tipping configuration for SEK + */ + sek?: Tipping.Sek; + + /** + * Tipping configuration for SGD + */ + sgd?: Tipping.Sgd; + + /** + * Tipping configuration for USD + */ + usd?: Tipping.Usd; + } + + namespace Tipping { + interface Aud { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Cad { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Chf { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Czk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Dkk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Eur { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Gbp { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Hkd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Myr { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Nok { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Nzd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Sek { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Sgd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Usd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + } + + interface VerifoneP400 { + /** + * A File ID representing an image you would like displayed on the reader. + */ + splashscreen?: Stripe.Emptyable; + } + } + + interface ConfigurationRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ConfigurationUpdateParams { + /** + * An object containing device type specific settings for BBPOS WisePOS E readers + */ + bbpos_wisepos_e?: Stripe.Emptyable< + ConfigurationUpdateParams.BbposWiseposE + >; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Tipping configurations for readers supporting on-reader tips + */ + tipping?: Stripe.Emptyable; + + /** + * An object containing device type specific settings for Verifone P400 readers + */ + verifone_p400?: Stripe.Emptyable< + ConfigurationUpdateParams.VerifoneP400 + >; + } + + namespace ConfigurationUpdateParams { + interface BbposWiseposE { + /** + * A File ID representing an image you would like displayed on the reader. + */ + splashscreen?: Stripe.Emptyable; + } + + interface Tipping { + /** + * Tipping configuration for AUD + */ + aud?: Tipping.Aud; + + /** + * Tipping configuration for CAD + */ + cad?: Tipping.Cad; + + /** + * Tipping configuration for CHF + */ + chf?: Tipping.Chf; + + /** + * Tipping configuration for CZK + */ + czk?: Tipping.Czk; + + /** + * Tipping configuration for DKK + */ + dkk?: Tipping.Dkk; + + /** + * Tipping configuration for EUR + */ + eur?: Tipping.Eur; + + /** + * Tipping configuration for GBP + */ + gbp?: Tipping.Gbp; + + /** + * Tipping configuration for HKD + */ + hkd?: Tipping.Hkd; + + /** + * Tipping configuration for MYR + */ + myr?: Tipping.Myr; + + /** + * Tipping configuration for NOK + */ + nok?: Tipping.Nok; + + /** + * Tipping configuration for NZD + */ + nzd?: Tipping.Nzd; + + /** + * Tipping configuration for SEK + */ + sek?: Tipping.Sek; + + /** + * Tipping configuration for SGD + */ + sgd?: Tipping.Sgd; + + /** + * Tipping configuration for USD + */ + usd?: Tipping.Usd; + } + + namespace Tipping { + interface Aud { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Cad { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Chf { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Czk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Dkk { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Eur { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Gbp { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Hkd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Myr { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Nok { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Nzd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Sek { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Sgd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + + interface Usd { + /** + * Fixed amounts displayed when collecting a tip + */ + fixed_amounts?: Array; + + /** + * Percentages displayed when collecting a tip + */ + percentages?: Array; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + */ + smart_tip_threshold?: number; + } + } + + interface VerifoneP400 { + /** + * A File ID representing an image you would like displayed on the reader. + */ + splashscreen?: Stripe.Emptyable; + } + } + + interface ConfigurationListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * if present, only return the account default or non-default configurations. + */ + is_account_default?: boolean; + } + + interface ConfigurationDeleteParams {} + + class ConfigurationsResource { + /** + * Creates a new Configuration object. + */ + create( + params?: ConfigurationCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a Configuration object. + */ + retrieve( + id: string, + params?: ConfigurationRetrieveParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration + > + >; + retrieve( + id: string, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration + > + >; + + /** + * Updates a new Configuration object. + */ + update( + id: string, + params?: ConfigurationUpdateParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Configuration | Stripe.Terminal.DeletedConfiguration + > + >; + + /** + * Returns a list of Configuration objects. + */ + list( + params?: ConfigurationListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a Configuration object. + */ + del( + id: string, + params?: ConfigurationDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Terminal/ConnectionTokens.d.ts b/types/2022-11-15/Terminal/ConnectionTokens.d.ts index 4891db2207..b6a8502e7c 100644 --- a/types/2022-11-15/Terminal/ConnectionTokens.d.ts +++ b/types/2022-11-15/Terminal/ConnectionTokens.d.ts @@ -24,31 +24,6 @@ declare module 'stripe' { */ secret: string; } - - interface ConnectionTokenCreateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). - */ - location?: string; - } - - class ConnectionTokensResource { - /** - * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. - */ - create( - params?: ConnectionTokenCreateParams, - options?: RequestOptions - ): Promise>; - create( - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Terminal/ConnectionTokensResource.d.ts b/types/2022-11-15/Terminal/ConnectionTokensResource.d.ts new file mode 100644 index 0000000000..e2b2f1597d --- /dev/null +++ b/types/2022-11-15/Terminal/ConnectionTokensResource.d.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Terminal { + interface ConnectionTokenCreateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + */ + location?: string; + } + + class ConnectionTokensResource { + /** + * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. + */ + create( + params?: ConnectionTokenCreateParams, + options?: RequestOptions + ): Promise>; + create( + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Terminal/Locations.d.ts b/types/2022-11-15/Terminal/Locations.d.ts index 787d36926c..ee3b87f439 100644 --- a/types/2022-11-15/Terminal/Locations.d.ts +++ b/types/2022-11-15/Terminal/Locations.d.ts @@ -63,179 +63,6 @@ declare module 'stripe' { */ deleted: true; } - - interface LocationCreateParams { - /** - * The full address of the location. - */ - address: LocationCreateParams.Address; - - /** - * A name for the location. - */ - display_name: string; - - /** - * The ID of a configuration that will be used to customize all readers in this location. - */ - configuration_overrides?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - namespace LocationCreateParams { - interface Address { - /** - * City, district, suburb, town, or village. - */ - city?: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country: string; - - /** - * Address line 1 (e.g., street, PO Box, or company name). - */ - line1?: string; - - /** - * Address line 2 (e.g., apartment, suite, unit, or building). - */ - line2?: string; - - /** - * ZIP or postal code. - */ - postal_code?: string; - - /** - * State, county, province, or region. - */ - state?: string; - } - } - - interface LocationRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface LocationUpdateParams { - /** - * The full address of the location. - */ - address?: Stripe.AddressParam; - - /** - * The ID of a configuration that will be used to customize all readers in this location. - */ - configuration_overrides?: string; - - /** - * A name for the location. - */ - display_name?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface LocationListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface LocationDeleteParams {} - - class LocationsResource { - /** - * Creates a new Location object. - * For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. - */ - create( - params: LocationCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a Location object. - */ - retrieve( - id: string, - params?: LocationRetrieveParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation - > - >; - retrieve( - id: string, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation - > - >; - - /** - * Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: LocationUpdateParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation - > - >; - - /** - * Returns a list of Location objects. - */ - list( - params?: LocationListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes a Location object. - */ - del( - id: string, - params?: LocationDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Terminal/LocationsResource.d.ts b/types/2022-11-15/Terminal/LocationsResource.d.ts new file mode 100644 index 0000000000..f47f7c3cde --- /dev/null +++ b/types/2022-11-15/Terminal/LocationsResource.d.ts @@ -0,0 +1,180 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Terminal { + interface LocationCreateParams { + /** + * The full address of the location. + */ + address: LocationCreateParams.Address; + + /** + * A name for the location. + */ + display_name: string; + + /** + * The ID of a configuration that will be used to customize all readers in this location. + */ + configuration_overrides?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + namespace LocationCreateParams { + interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } + + interface LocationRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface LocationUpdateParams { + /** + * The full address of the location. + */ + address?: Stripe.AddressParam; + + /** + * The ID of a configuration that will be used to customize all readers in this location. + */ + configuration_overrides?: string; + + /** + * A name for the location. + */ + display_name?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface LocationListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface LocationDeleteParams {} + + class LocationsResource { + /** + * Creates a new Location object. + * For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. + */ + create( + params: LocationCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a Location object. + */ + retrieve( + id: string, + params?: LocationRetrieveParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation + > + >; + retrieve( + id: string, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation + > + >; + + /** + * Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: LocationUpdateParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Location | Stripe.Terminal.DeletedLocation + > + >; + + /** + * Returns a list of Location objects. + */ + list( + params?: LocationListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a Location object. + */ + del( + id: string, + params?: LocationDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Terminal/Readers.d.ts b/types/2022-11-15/Terminal/Readers.d.ts index b543b7847e..a6924eedd9 100644 --- a/types/2022-11-15/Terminal/Readers.d.ts +++ b/types/2022-11-15/Terminal/Readers.d.ts @@ -249,323 +249,6 @@ declare module 'stripe' { */ deleted: true; } - - interface ReaderCreateParams { - /** - * A code generated by the reader used for registering to an account. - */ - registration_code: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. - */ - label?: string; - - /** - * The location to assign the reader to. - */ - location?: 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`. - */ - metadata?: Stripe.Emptyable; - } - - interface ReaderRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReaderUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The new label of the reader. - */ - label?: 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`. - */ - metadata?: Stripe.Emptyable; - } - - interface ReaderListParams extends PaginationParams { - /** - * Filters readers by device type - */ - device_type?: ReaderListParams.DeviceType; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A location ID to filter the response list to only readers at the specific location - */ - location?: string; - - /** - * A status filter to filter readers to only offline or online readers - */ - status?: ReaderListParams.Status; - } - - namespace ReaderListParams { - type DeviceType = - | 'bbpos_chipper2x' - | 'bbpos_wisepad3' - | 'bbpos_wisepos_e' - | 'simulated_wisepos_e' - | 'stripe_m2' - | 'verifone_P400'; - - type Status = 'offline' | 'online'; - } - - interface ReaderDeleteParams {} - - interface ReaderCancelActionParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReaderProcessPaymentIntentParams { - /** - * PaymentIntent ID - */ - payment_intent: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Configuration overrides - */ - process_config?: ReaderProcessPaymentIntentParams.ProcessConfig; - } - - namespace ReaderProcessPaymentIntentParams { - interface ProcessConfig { - /** - * Override showing a tipping selection screen on this transaction. - */ - skip_tipping?: boolean; - - /** - * Tipping configuration for this transaction. - */ - tipping?: ProcessConfig.Tipping; - } - - namespace ProcessConfig { - interface Tipping { - /** - * Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). - */ - amount_eligible?: number; - } - } - } - - interface ReaderProcessSetupIntentParams { - /** - * Customer Consent Collected - */ - customer_consent_collected: boolean; - - /** - * SetupIntent ID - */ - setup_intent: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReaderSetReaderDisplayParams { - /** - * Type - */ - type: 'cart'; - - /** - * Cart - */ - cart?: ReaderSetReaderDisplayParams.Cart; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace ReaderSetReaderDisplayParams { - interface Cart { - /** - * 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; - - /** - * Array of line items that were purchased. - */ - line_items: Array; - - /** - * The amount of tax in cents. - */ - tax?: number; - - /** - * Total balance of cart due in cents. - */ - total: number; - } - - namespace Cart { - interface LineItem { - /** - * The price of the item in cents. - */ - amount: number; - - /** - * The description or name of the item. - */ - description: string; - - /** - * The quantity of the line item being purchased. - */ - quantity: number; - } - } - } - - class ReadersResource { - /** - * Creates a new Reader object. - */ - create( - params: ReaderCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a Reader object. - */ - retrieve( - id: string, - params?: ReaderRetrieveParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader - > - >; - retrieve( - id: string, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader - > - >; - - /** - * Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: ReaderUpdateParams, - options?: RequestOptions - ): Promise< - Stripe.Response< - Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader - > - >; - - /** - * Returns a list of Reader objects. - */ - list( - params?: ReaderListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Deletes a Reader object. - */ - del( - id: string, - params?: ReaderDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Cancels the current reader action. - */ - cancelAction( - id: string, - params?: ReaderCancelActionParams, - options?: RequestOptions - ): Promise>; - cancelAction( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Initiates a payment flow on a Reader. - */ - processPaymentIntent( - id: string, - params: ReaderProcessPaymentIntentParams, - options?: RequestOptions - ): Promise>; - - /** - * Initiates a setup intent flow on a Reader. - */ - processSetupIntent( - id: string, - params: ReaderProcessSetupIntentParams, - options?: RequestOptions - ): Promise>; - - /** - * Sets reader display to show cart details. - */ - setReaderDisplay( - id: string, - params: ReaderSetReaderDisplayParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Terminal/ReadersResource.d.ts b/types/2022-11-15/Terminal/ReadersResource.d.ts new file mode 100644 index 0000000000..426a56f7c0 --- /dev/null +++ b/types/2022-11-15/Terminal/ReadersResource.d.ts @@ -0,0 +1,324 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Terminal { + interface ReaderCreateParams { + /** + * A code generated by the reader used for registering to an account. + */ + registration_code: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. + */ + label?: string; + + /** + * The location to assign the reader to. + */ + location?: 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`. + */ + metadata?: Stripe.Emptyable; + } + + interface ReaderRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReaderUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The new label of the reader. + */ + label?: 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`. + */ + metadata?: Stripe.Emptyable; + } + + interface ReaderListParams extends PaginationParams { + /** + * Filters readers by device type + */ + device_type?: ReaderListParams.DeviceType; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A location ID to filter the response list to only readers at the specific location + */ + location?: string; + + /** + * A status filter to filter readers to only offline or online readers + */ + status?: ReaderListParams.Status; + } + + namespace ReaderListParams { + type DeviceType = + | 'bbpos_chipper2x' + | 'bbpos_wisepad3' + | 'bbpos_wisepos_e' + | 'simulated_wisepos_e' + | 'stripe_m2' + | 'verifone_P400'; + + type Status = 'offline' | 'online'; + } + + interface ReaderDeleteParams {} + + interface ReaderCancelActionParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReaderProcessPaymentIntentParams { + /** + * PaymentIntent ID + */ + payment_intent: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Configuration overrides + */ + process_config?: ReaderProcessPaymentIntentParams.ProcessConfig; + } + + namespace ReaderProcessPaymentIntentParams { + interface ProcessConfig { + /** + * Override showing a tipping selection screen on this transaction. + */ + skip_tipping?: boolean; + + /** + * Tipping configuration for this transaction. + */ + tipping?: ProcessConfig.Tipping; + } + + namespace ProcessConfig { + interface Tipping { + /** + * Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + */ + amount_eligible?: number; + } + } + } + + interface ReaderProcessSetupIntentParams { + /** + * Customer Consent Collected + */ + customer_consent_collected: boolean; + + /** + * SetupIntent ID + */ + setup_intent: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReaderSetReaderDisplayParams { + /** + * Type + */ + type: 'cart'; + + /** + * Cart + */ + cart?: ReaderSetReaderDisplayParams.Cart; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace ReaderSetReaderDisplayParams { + interface Cart { + /** + * 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; + + /** + * Array of line items that were purchased. + */ + line_items: Array; + + /** + * The amount of tax in cents. + */ + tax?: number; + + /** + * Total balance of cart due in cents. + */ + total: number; + } + + namespace Cart { + interface LineItem { + /** + * The price of the item in cents. + */ + amount: number; + + /** + * The description or name of the item. + */ + description: string; + + /** + * The quantity of the line item being purchased. + */ + quantity: number; + } + } + } + + class ReadersResource { + /** + * Creates a new Reader object. + */ + create( + params: ReaderCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a Reader object. + */ + retrieve( + id: string, + params?: ReaderRetrieveParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader + > + >; + retrieve( + id: string, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader + > + >; + + /** + * Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: ReaderUpdateParams, + options?: RequestOptions + ): Promise< + Stripe.Response< + Stripe.Terminal.Reader | Stripe.Terminal.DeletedReader + > + >; + + /** + * Returns a list of Reader objects. + */ + list( + params?: ReaderListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Deletes a Reader object. + */ + del( + id: string, + params?: ReaderDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Cancels the current reader action. + */ + cancelAction( + id: string, + params?: ReaderCancelActionParams, + options?: RequestOptions + ): Promise>; + cancelAction( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Initiates a payment flow on a Reader. + */ + processPaymentIntent( + id: string, + params: ReaderProcessPaymentIntentParams, + options?: RequestOptions + ): Promise>; + + /** + * Initiates a setup intent flow on a Reader. + */ + processSetupIntent( + id: string, + params: ReaderProcessSetupIntentParams, + options?: RequestOptions + ): Promise>; + + /** + * Sets reader display to show cart details. + */ + setReaderDisplay( + id: string, + params: ReaderSetReaderDisplayParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/TestHelpers/Customers.d.ts b/types/2022-11-15/TestHelpers/CustomersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Customers.d.ts rename to types/2022-11-15/TestHelpers/CustomersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Issuing/Cards.d.ts b/types/2022-11-15/TestHelpers/Issuing/CardsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Issuing/Cards.d.ts rename to types/2022-11-15/TestHelpers/Issuing/CardsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Refunds.d.ts b/types/2022-11-15/TestHelpers/RefundsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Refunds.d.ts rename to types/2022-11-15/TestHelpers/RefundsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Terminal/Readers.d.ts b/types/2022-11-15/TestHelpers/Terminal/ReadersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Terminal/Readers.d.ts rename to types/2022-11-15/TestHelpers/Terminal/ReadersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/TestClocks.d.ts b/types/2022-11-15/TestHelpers/TestClocks.d.ts index 39a9c5c667..73f9a1e33a 100644 --- a/types/2022-11-15/TestHelpers/TestClocks.d.ts +++ b/types/2022-11-15/TestHelpers/TestClocks.d.ts @@ -75,107 +75,6 @@ declare module 'stripe' { */ deleted: true; } - - interface TestClockCreateParams { - /** - * The initial frozen time for this test clock. - */ - frozen_time: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The name for this test clock. - */ - name?: string; - } - - interface TestClockRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TestClockListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TestClockDeleteParams {} - - interface TestClockAdvanceParams { - /** - * The time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future. - */ - frozen_time: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class TestClocksResource { - /** - * Creates a new test clock that can be attached to new customers and quotes. - */ - create( - params: TestClockCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a test clock. - */ - retrieve( - id: string, - params?: TestClockRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your test clocks. - */ - list( - params?: TestClockListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Deletes a test clock. - */ - del( - id: string, - params?: TestClockDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. - */ - advance( - id: string, - params: TestClockAdvanceParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/TestHelpers/TestClocksResource.d.ts b/types/2022-11-15/TestHelpers/TestClocksResource.d.ts new file mode 100644 index 0000000000..5b7437ce16 --- /dev/null +++ b/types/2022-11-15/TestHelpers/TestClocksResource.d.ts @@ -0,0 +1,108 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace TestHelpers { + interface TestClockCreateParams { + /** + * The initial frozen time for this test clock. + */ + frozen_time: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The name for this test clock. + */ + name?: string; + } + + interface TestClockRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TestClockListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TestClockDeleteParams {} + + interface TestClockAdvanceParams { + /** + * The time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future. + */ + frozen_time: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class TestClocksResource { + /** + * Creates a new test clock that can be attached to new customers and quotes. + */ + create( + params: TestClockCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a test clock. + */ + retrieve( + id: string, + params?: TestClockRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your test clocks. + */ + list( + params?: TestClockListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Deletes a test clock. + */ + del( + id: string, + params?: TestClockDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. + */ + advance( + id: string, + params: TestClockAdvanceParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/InboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/InboundTransfersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundPaymentsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundPaymentsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundTransfersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedCreditsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedCreditsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedDebitsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedDebitsResource.d.ts diff --git a/types/2022-11-15/Tokens.d.ts b/types/2022-11-15/Tokens.d.ts index 28d4238dc2..6803a11196 100644 --- a/types/2022-11-15/Tokens.d.ts +++ b/types/2022-11-15/Tokens.d.ts @@ -82,772 +82,5 @@ declare module 'stripe' { */ used: boolean; } - - interface TokenCreateParams { - /** - * Information for the account this token will represent. - */ - account?: TokenCreateParams.Account; - - /** - * The bank account this token will represent. - */ - bank_account?: string | TokenCreateParams.BankAccount; - - card?: TokenCreateParams.Card | string; - - /** - * The customer (owned by the application's account) for which to create a token. This can be used only with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). For more details, see [Cloning Saved Payment Methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). - */ - customer?: string; - - /** - * The updated CVC value this token will represent. - */ - cvc_update?: TokenCreateParams.CvcUpdate; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Information for the person this token will represent. - */ - person?: TokenCreateParams.Person; - - /** - * The PII this token will represent. - */ - pii?: TokenCreateParams.Pii; - } - - namespace TokenCreateParams { - interface Account { - /** - * The business type. - */ - business_type?: Account.BusinessType; - - /** - * Information about the company or business. - */ - company?: Account.Company; - - /** - * Information about the person represented by the account. - */ - individual?: Account.Individual; - - /** - * Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. - */ - tos_shown_and_accepted?: boolean; - } - - namespace Account { - type BusinessType = - | 'company' - | 'government_entity' - | 'individual' - | 'non_profit'; - - interface Company { - /** - * The company's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the company's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the company's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. - */ - directors_provided?: boolean; - - /** - * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - */ - executives_provided?: boolean; - - /** - * The company's legal name. - */ - name?: string; - - /** - * The Kana variation of the company's legal name (Japan only). - */ - name_kana?: string; - - /** - * The Kanji variation of the company's legal name (Japan only). - */ - name_kanji?: string; - - /** - * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - */ - owners_provided?: boolean; - - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - */ - ownership_declaration?: Company.OwnershipDeclaration; - - /** - * Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. - */ - ownership_declaration_shown_and_signed?: boolean; - - /** - * The company's phone number (used for verification). - */ - phone?: string; - - /** - * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - */ - registration_number?: string; - - /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - */ - structure?: Stripe.Emptyable; - - /** - * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) - */ - tax_id?: string; - - /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - */ - tax_id_registrar?: string; - - /** - * The VAT number of the company. - */ - vat_id?: string; - - /** - * Information on the verification state of the company. - */ - verification?: Company.Verification; - } - - namespace Company { - interface OwnershipDeclaration { - /** - * The Unix timestamp marking when the beneficial owner attestation was made. - */ - date?: number; - - /** - * The IP address from which the beneficial owner attestation was made. - */ - ip?: string; - - /** - * The user agent of the browser from which the beneficial owner attestation was made. - */ - user_agent?: string; - } - - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; - - interface Verification { - /** - * A document verifying the business. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Individual { - /** - * The individual's primary address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the the individual's primary address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the the individual's primary address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The individual's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * The individual's email address. - */ - email?: string; - - /** - * The individual's first name. - */ - first_name?: string; - - /** - * The Kana variation of the the individual's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the individual's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the individual is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The individual's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The individual's last name. - */ - last_name?: string; - - /** - * The Kana variation of the individual's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the individual's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The individual's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The individual's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: Individual.PoliticalExposure; - - /** - * The individual's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The last four digits of the individual's Social Security Number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The individual's verification document information. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - type PoliticalExposure = 'existing' | 'none'; - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - } - - interface BankAccount { - /** - * The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. - */ - account_holder_name?: string; - - /** - * The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. - */ - account_holder_type?: BankAccount.AccountHolderType; - - /** - * The account number for the bank account, in string form. Must be a checking account. - */ - account_number: string; - - /** - * The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. - */ - account_type?: BankAccount.AccountType; - - /** - * The country in which the bank account is located. - */ - country: string; - - /** - * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) - */ - currency?: string; - - /** - * The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. - */ - routing_number?: string; - } - - namespace BankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'futsu' | 'savings' | 'toza'; - } - - interface Card { - address_city?: string; - - address_country?: string; - - address_line1?: string; - - address_line2?: string; - - address_state?: string; - - address_zip?: string; - - currency?: string; - - cvc?: string; - - exp_month: string; - - exp_year: string; - - name?: string; - - number: string; - } - - interface CvcUpdate { - /** - * The CVC value, in string form. - */ - cvc: string; - } - - interface Person { - /** - * The person's address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the person's address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the person's address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The person's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: Person.Documents; - - /** - * The person's email address. - */ - email?: string; - - /** - * The person's first name. - */ - first_name?: string; - - /** - * The Kana variation of the person's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the person's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the person is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The person's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The person's last name. - */ - last_name?: string; - - /** - * The Kana variation of the person's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the person's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The person's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - */ - nationality?: string; - - /** - * The person's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: string; - - /** - * The person's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The relationship that this person has with the account's legal entity. - */ - relationship?: Person.Relationship; - - /** - * The last four digits of the person's Social Security number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The person's verification status. - */ - verification?: Person.Verification; - } - - namespace Person { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Documents { - /** - * One or more documents that demonstrate proof that this person is authorized to represent the company. - */ - company_authorization?: Documents.CompanyAuthorization; - - /** - * One or more documents showing the person's passport page with photo and personal data. - */ - passport?: Documents.Passport; - - /** - * One or more documents showing the person's visa required for living in the country where they are residing. - */ - visa?: Documents.Visa; - } - - namespace Documents { - interface CompanyAuthorization { - /** - * 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; - } - - interface Passport { - /** - * 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; - } - - interface Visa { - /** - * 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; - } - } - - interface Relationship { - /** - * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - */ - director?: boolean; - - /** - * Whether the person has significant responsibility to control, manage, or direct the organization. - */ - executive?: boolean; - - /** - * Whether the person is an owner of the account's legal entity. - */ - owner?: boolean; - - /** - * The percent owned by the person of the account's legal entity. - */ - percent_ownership?: Stripe.Emptyable; - - /** - * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. - */ - representative?: boolean; - - /** - * The person's title (e.g., CEO, Support Engineer). - */ - title?: string; - } - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Pii { - /** - * The `id_number` for the PII, in string form. - */ - id_number?: string; - } - } - - interface TokenRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class TokensResource { - /** - * Creates a single-use token that represents a bank account's details. - * This token can be used with any API method in place of a bank account dictionary. This token can be used only once, by attaching it to a [Custom account](https://stripe.com/docs/api#accounts). - */ - create( - params?: TokenCreateParams, - options?: RequestOptions - ): Promise>; - create(options?: RequestOptions): Promise>; - - /** - * Retrieves the token with the given ID. - */ - retrieve( - id: string, - params?: TokenRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/TokensResource.d.ts b/types/2022-11-15/TokensResource.d.ts new file mode 100644 index 0000000000..f460ad940f --- /dev/null +++ b/types/2022-11-15/TokensResource.d.ts @@ -0,0 +1,772 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TokenCreateParams { + /** + * Information for the account this token will represent. + */ + account?: TokenCreateParams.Account; + + /** + * The bank account this token will represent. + */ + bank_account?: string | TokenCreateParams.BankAccount; + + card?: TokenCreateParams.Card | string; + + /** + * The customer (owned by the application's account) for which to create a token. This can be used only with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). For more details, see [Cloning Saved Payment Methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). + */ + customer?: string; + + /** + * The updated CVC value this token will represent. + */ + cvc_update?: TokenCreateParams.CvcUpdate; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Information for the person this token will represent. + */ + person?: TokenCreateParams.Person; + + /** + * The PII this token will represent. + */ + pii?: TokenCreateParams.Pii; + } + + namespace TokenCreateParams { + interface Account { + /** + * The business type. + */ + business_type?: Account.BusinessType; + + /** + * Information about the company or business. + */ + company?: Account.Company; + + /** + * Information about the person represented by the account. + */ + individual?: Account.Individual; + + /** + * Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + */ + tos_shown_and_accepted?: boolean; + } + + namespace Account { + type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + + interface Company { + /** + * The company's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the company's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the company's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + */ + directors_provided?: boolean; + + /** + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + */ + executives_provided?: boolean; + + /** + * The company's legal name. + */ + name?: string; + + /** + * The Kana variation of the company's legal name (Japan only). + */ + name_kana?: string; + + /** + * The Kanji variation of the company's legal name (Japan only). + */ + name_kanji?: string; + + /** + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + */ + owners_provided?: boolean; + + /** + * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + */ + ownership_declaration?: Company.OwnershipDeclaration; + + /** + * Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. + */ + ownership_declaration_shown_and_signed?: boolean; + + /** + * The company's phone number (used for verification). + */ + phone?: string; + + /** + * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + */ + registration_number?: string; + + /** + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ + structure?: Stripe.Emptyable; + + /** + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + */ + tax_id?: string; + + /** + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + */ + tax_id_registrar?: string; + + /** + * The VAT number of the company. + */ + vat_id?: string; + + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; + } + + namespace Company { + interface OwnershipDeclaration { + /** + * The Unix timestamp marking when the beneficial owner attestation was made. + */ + date?: number; + + /** + * The IP address from which the beneficial owner attestation was made. + */ + ip?: string; + + /** + * The user agent of the browser from which the beneficial owner attestation was made. + */ + user_agent?: string; + } + + type Structure = + | 'free_zone_establishment' + | 'free_zone_llc' + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'llc' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'single_member_llc' + | 'sole_establishment' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Individual { + /** + * The individual's primary address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The individual's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * The individual's email address. + */ + email?: string; + + /** + * The individual's first name. + */ + first_name?: string; + + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the individual is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The individual's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The individual's last name. + */ + last_name?: string; + + /** + * The Kana variation of the individual's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the individual's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The individual's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The individual's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: Individual.PoliticalExposure; + + /** + * The individual's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The last four digits of the individual's Social Security Number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The individual's verification document information. + */ + verification?: Individual.Verification; + } + + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + type PoliticalExposure = 'existing' | 'none'; + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + } + + interface BankAccount { + /** + * The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + */ + account_holder_name?: string; + + /** + * The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. + */ + account_holder_type?: BankAccount.AccountHolderType; + + /** + * The account number for the bank account, in string form. Must be a checking account. + */ + account_number: string; + + /** + * The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + */ + account_type?: BankAccount.AccountType; + + /** + * The country in which the bank account is located. + */ + country: string; + + /** + * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) + */ + currency?: string; + + /** + * The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. + */ + routing_number?: string; + } + + namespace BankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'futsu' | 'savings' | 'toza'; + } + + interface Card { + address_city?: string; + + address_country?: string; + + address_line1?: string; + + address_line2?: string; + + address_state?: string; + + address_zip?: string; + + currency?: string; + + cvc?: string; + + exp_month: string; + + exp_year: string; + + name?: string; + + number: string; + } + + interface CvcUpdate { + /** + * The CVC value, in string form. + */ + cvc: string; + } + + interface Person { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: Person.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: Person.Relationship; + + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: Person.Verification; + } + + namespace Person { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Documents { + /** + * One or more documents that demonstrate proof that this person is authorized to represent the company. + */ + company_authorization?: Documents.CompanyAuthorization; + + /** + * One or more documents showing the person's passport page with photo and personal data. + */ + passport?: Documents.Passport; + + /** + * One or more documents showing the person's visa required for living in the country where they are residing. + */ + visa?: Documents.Visa; + } + + namespace Documents { + interface CompanyAuthorization { + /** + * 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; + } + + interface Passport { + /** + * 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; + } + + interface Visa { + /** + * 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; + } + } + + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface Pii { + /** + * The `id_number` for the PII, in string form. + */ + id_number?: string; + } + } + + interface TokenRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class TokensResource { + /** + * Creates a single-use token that represents a bank account's details. + * This token can be used with any API method in place of a bank account dictionary. This token can be used only once, by attaching it to a [Custom account](https://stripe.com/docs/api#accounts). + */ + create( + params?: TokenCreateParams, + options?: RequestOptions + ): Promise>; + create(options?: RequestOptions): Promise>; + + /** + * Retrieves the token with the given ID. + */ + retrieve( + id: string, + params?: TokenRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/Topups.d.ts b/types/2022-11-15/Topups.d.ts index bfe1c64481..e25b0f4bbd 100644 --- a/types/2022-11-15/Topups.d.ts +++ b/types/2022-11-15/Topups.d.ts @@ -99,158 +99,5 @@ declare module 'stripe' { | 'reversed' | 'succeeded'; } - - interface TopupCreateParams { - /** - * A positive integer representing how much to transfer. - */ - amount: 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; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). - */ - source?: string; - - /** - * Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. - */ - statement_descriptor?: string; - - /** - * A string that identifies this top-up as part of a group. - */ - transfer_group?: string; - } - - interface TopupRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TopupUpdateParams { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TopupListParams extends PaginationParams { - /** - * A positive integer representing how much to transfer. - */ - amount?: Stripe.RangeQueryParam | number; - - /** - * 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. - */ - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. - */ - status?: TopupListParams.Status; - } - - namespace TopupListParams { - type Status = 'canceled' | 'failed' | 'pending' | 'succeeded'; - } - - interface TopupCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class TopupsResource { - /** - * Top up the balance of an account - */ - create( - params: TopupCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. - */ - retrieve( - id: string, - params?: TopupRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the metadata of a top-up. Other top-up details are not editable by design. - */ - update( - id: string, - params?: TopupUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of top-ups. - */ - list( - params?: TopupListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Cancels a top-up. Only pending top-ups can be canceled. - */ - cancel( - id: string, - params?: TopupCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/TopupsResource.d.ts b/types/2022-11-15/TopupsResource.d.ts new file mode 100644 index 0000000000..4213fa6895 --- /dev/null +++ b/types/2022-11-15/TopupsResource.d.ts @@ -0,0 +1,158 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TopupCreateParams { + /** + * A positive integer representing how much to transfer. + */ + amount: 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; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). + */ + source?: string; + + /** + * Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. + */ + statement_descriptor?: string; + + /** + * A string that identifies this top-up as part of a group. + */ + transfer_group?: string; + } + + interface TopupRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TopupUpdateParams { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TopupListParams extends PaginationParams { + /** + * A positive integer representing how much to transfer. + */ + amount?: Stripe.RangeQueryParam | number; + + /** + * 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. + */ + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. + */ + status?: TopupListParams.Status; + } + + namespace TopupListParams { + type Status = 'canceled' | 'failed' | 'pending' | 'succeeded'; + } + + interface TopupCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class TopupsResource { + /** + * Top up the balance of an account + */ + create( + params: TopupCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. + */ + retrieve( + id: string, + params?: TopupRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the metadata of a top-up. Other top-up details are not editable by design. + */ + update( + id: string, + params?: TopupUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of top-ups. + */ + list( + params?: TopupListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Cancels a top-up. Only pending top-ups can be canceled. + */ + cancel( + id: string, + params?: TopupCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/TransferReversals.d.ts b/types/2022-11-15/TransferReversals.d.ts index 66f43d67b3..a778bc3c99 100644 --- a/types/2022-11-15/TransferReversals.d.ts +++ b/types/2022-11-15/TransferReversals.d.ts @@ -68,58 +68,5 @@ declare module 'stripe' { */ transfer: string | Stripe.Transfer; } - - interface TransferReversalCreateParams { - /** - * A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. - */ - amount?: number; - - /** - * An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. - */ - refund_application_fee?: boolean; - } - - interface TransferReversalRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransferReversalUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TransferReversalListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/TransferReversalsResource.d.ts b/types/2022-11-15/TransferReversalsResource.d.ts new file mode 100644 index 0000000000..c6e4c9d184 --- /dev/null +++ b/types/2022-11-15/TransferReversalsResource.d.ts @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TransferReversalCreateParams { + /** + * A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. + */ + amount?: number; + + /** + * An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. + */ + refund_application_fee?: boolean; + } + + interface TransferReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransferReversalUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TransferReversalListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/Transfers.d.ts b/types/2022-11-15/Transfers.d.ts index 0bef68541d..59e041e357 100644 --- a/types/2022-11-15/Transfers.d.ts +++ b/types/2022-11-15/Transfers.d.ts @@ -100,199 +100,5 @@ declare module 'stripe' { */ transfer_group: string | null; } - - interface TransferCreateParams { - /** - * 3-letter [ISO code for currency](https://stripe.com/docs/payouts). - */ - currency: string; - - /** - * The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. - */ - destination: string; - - /** - * A positive integer in cents (or local equivalent) representing how much to transfer. - */ - amount?: number; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-availability) for details. - */ - source_transaction?: string; - - /** - * The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. - */ - source_type?: TransferCreateParams.SourceType; - - /** - * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. - */ - transfer_group?: string; - } - - namespace TransferCreateParams { - type SourceType = 'bank_account' | 'card' | 'fpx'; - } - - interface TransferRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransferUpdateParams { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TransferListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Only return transfers for the destination specified by this account ID. - */ - destination?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return transfers with the specified transfer group. - */ - transfer_group?: string; - } - - class TransfersResource { - /** - * To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. - */ - create( - params: TransferCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. - */ - retrieve( - id: string, - params?: TransferRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * This request accepts only metadata as an argument. - */ - update( - id: string, - params?: TransferUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. - */ - list( - params?: TransferListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * When you create a new reversal, you must specify a transfer to create it on. - * - * When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. - * - * Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. - */ - createReversal( - id: string, - params?: TransferReversalCreateParams, - options?: RequestOptions - ): Promise>; - createReversal( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. - */ - retrieveReversal( - transferId: string, - id: string, - params?: TransferReversalRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieveReversal( - transferId: string, - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * This request only accepts metadata and description as arguments. - */ - updateReversal( - transferId: string, - id: string, - params?: TransferReversalUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. - */ - listReversals( - id: string, - params?: TransferReversalListParams, - options?: RequestOptions - ): ApiListPromise; - listReversals( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/2022-11-15/TransfersResource.d.ts b/types/2022-11-15/TransfersResource.d.ts new file mode 100644 index 0000000000..f50c0e646c --- /dev/null +++ b/types/2022-11-15/TransfersResource.d.ts @@ -0,0 +1,199 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface TransferCreateParams { + /** + * 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + */ + currency: string; + + /** + * The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. + */ + destination: string; + + /** + * A positive integer in cents (or local equivalent) representing how much to transfer. + */ + amount?: number; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-availability) for details. + */ + source_transaction?: string; + + /** + * The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. + */ + source_type?: TransferCreateParams.SourceType; + + /** + * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details. + */ + transfer_group?: string; + } + + namespace TransferCreateParams { + type SourceType = 'bank_account' | 'card' | 'fpx'; + } + + interface TransferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransferUpdateParams { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TransferListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Only return transfers for the destination specified by this account ID. + */ + destination?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return transfers with the specified transfer group. + */ + transfer_group?: string; + } + + class TransfersResource { + /** + * To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. + */ + create( + params: TransferCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. + */ + retrieve( + id: string, + params?: TransferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + * + * This request accepts only metadata as an argument. + */ + update( + id: string, + params?: TransferUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. + */ + list( + params?: TransferListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * When you create a new reversal, you must specify a transfer to create it on. + * + * When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. + * + * Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. + */ + createReversal( + id: string, + params?: TransferReversalCreateParams, + options?: RequestOptions + ): Promise>; + createReversal( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. + */ + retrieveReversal( + transferId: string, + id: string, + params?: TransferReversalRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieveReversal( + transferId: string, + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata and description as arguments. + */ + updateReversal( + transferId: string, + id: string, + params?: TransferReversalUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. + */ + listReversals( + id: string, + params?: TransferReversalListParams, + options?: RequestOptions + ): ApiListPromise; + listReversals( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/2022-11-15/Treasury/CreditReversals.d.ts b/types/2022-11-15/Treasury/CreditReversals.d.ts index 8778464071..ee4ae573a2 100644 --- a/types/2022-11-15/Treasury/CreditReversals.d.ts +++ b/types/2022-11-15/Treasury/CreditReversals.d.ts @@ -87,87 +87,6 @@ declare module 'stripe' { posted_at: number | null; } } - - interface CreditReversalCreateParams { - /** - * The ReceivedCredit to reverse. - */ - received_credit: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - interface CreditReversalRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CreditReversalListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return CreditReversals for the ReceivedCredit ID. - */ - received_credit?: string; - - /** - * Only return CreditReversals for a given status. - */ - status?: CreditReversalListParams.Status; - } - - namespace CreditReversalListParams { - type Status = 'canceled' | 'posted' | 'processing'; - } - - class CreditReversalsResource { - /** - * Reverses a ReceivedCredit and creates a CreditReversal object. - */ - create( - params: CreditReversalCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list - */ - retrieve( - id: string, - params?: CreditReversalRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of CreditReversals. - */ - list( - params: CreditReversalListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/CreditReversalsResource.d.ts b/types/2022-11-15/Treasury/CreditReversalsResource.d.ts new file mode 100644 index 0000000000..0f78fd13f0 --- /dev/null +++ b/types/2022-11-15/Treasury/CreditReversalsResource.d.ts @@ -0,0 +1,88 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface CreditReversalCreateParams { + /** + * The ReceivedCredit to reverse. + */ + received_credit: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + interface CreditReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CreditReversalListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return CreditReversals for the ReceivedCredit ID. + */ + received_credit?: string; + + /** + * Only return CreditReversals for a given status. + */ + status?: CreditReversalListParams.Status; + } + + namespace CreditReversalListParams { + type Status = 'canceled' | 'posted' | 'processing'; + } + + class CreditReversalsResource { + /** + * Reverses a ReceivedCredit and creates a CreditReversal object. + */ + create( + params: CreditReversalCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list + */ + retrieve( + id: string, + params?: CreditReversalRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of CreditReversals. + */ + list( + params: CreditReversalListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Treasury/DebitReversals.d.ts b/types/2022-11-15/Treasury/DebitReversals.d.ts index fccd3ca431..a663755861 100644 --- a/types/2022-11-15/Treasury/DebitReversals.d.ts +++ b/types/2022-11-15/Treasury/DebitReversals.d.ts @@ -99,94 +99,6 @@ declare module 'stripe' { completed_at: number | null; } } - - interface DebitReversalCreateParams { - /** - * The ReceivedDebit to reverse. - */ - received_debit: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - interface DebitReversalRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface DebitReversalListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return DebitReversals for the ReceivedDebit ID. - */ - received_debit?: string; - - /** - * Only return DebitReversals for a given resolution. - */ - resolution?: DebitReversalListParams.Resolution; - - /** - * Only return DebitReversals for a given status. - */ - status?: DebitReversalListParams.Status; - } - - namespace DebitReversalListParams { - type Resolution = 'lost' | 'won'; - - type Status = 'canceled' | 'completed' | 'processing'; - } - - class DebitReversalsResource { - /** - * Reverses a ReceivedDebit and creates a DebitReversal object. - */ - create( - params: DebitReversalCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a DebitReversal object. - */ - retrieve( - id: string, - params?: DebitReversalRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of DebitReversals. - */ - list( - params: DebitReversalListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/DebitReversalsResource.d.ts b/types/2022-11-15/Treasury/DebitReversalsResource.d.ts new file mode 100644 index 0000000000..a7bad6c9a1 --- /dev/null +++ b/types/2022-11-15/Treasury/DebitReversalsResource.d.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface DebitReversalCreateParams { + /** + * The ReceivedDebit to reverse. + */ + received_debit: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + interface DebitReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface DebitReversalListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return DebitReversals for the ReceivedDebit ID. + */ + received_debit?: string; + + /** + * Only return DebitReversals for a given resolution. + */ + resolution?: DebitReversalListParams.Resolution; + + /** + * Only return DebitReversals for a given status. + */ + status?: DebitReversalListParams.Status; + } + + namespace DebitReversalListParams { + type Resolution = 'lost' | 'won'; + + type Status = 'canceled' | 'completed' | 'processing'; + } + + class DebitReversalsResource { + /** + * Reverses a ReceivedDebit and creates a DebitReversal object. + */ + create( + params: DebitReversalCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a DebitReversal object. + */ + retrieve( + id: string, + params?: DebitReversalRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of DebitReversals. + */ + list( + params: DebitReversalListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Treasury/FinancialAccounts.d.ts b/types/2022-11-15/Treasury/FinancialAccounts.d.ts index 97b43b4ba3..6ef5b7cef9 100644 --- a/types/2022-11-15/Treasury/FinancialAccounts.d.ts +++ b/types/2022-11-15/Treasury/FinancialAccounts.d.ts @@ -235,636 +235,6 @@ declare module 'stripe' { } } } - - interface FinancialAccountCreateParams { - /** - * The currencies the FinancialAccount can hold a balance in. - */ - supported_currencies: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. - */ - features?: FinancialAccountCreateParams.Features; - - /** - * 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.MetadataParam; - - /** - * The set of functionalities that the platform can restrict on the FinancialAccount. - */ - platform_restrictions?: FinancialAccountCreateParams.PlatformRestrictions; - } - - namespace FinancialAccountCreateParams { - interface Features { - /** - * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. - */ - card_issuing?: Features.CardIssuing; - - /** - * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. - */ - deposit_insurance?: Features.DepositInsurance; - - /** - * Contains Features that add FinancialAddresses to the FinancialAccount. - */ - financial_addresses?: Features.FinancialAddresses; - - /** - * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. - */ - inbound_transfers?: Features.InboundTransfers; - - /** - * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). - */ - intra_stripe_flows?: Features.IntraStripeFlows; - - /** - * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. - */ - outbound_payments?: Features.OutboundPayments; - - /** - * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. - */ - outbound_transfers?: Features.OutboundTransfers; - } - - namespace Features { - interface CardIssuing { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface DepositInsurance { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface FinancialAddresses { - /** - * Adds an ABA FinancialAddress to the FinancialAccount. - */ - aba?: FinancialAddresses.Aba; - } - - namespace FinancialAddresses { - interface Aba { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface InboundTransfers { - /** - * Enables ACH Debits via the InboundTransfers API. - */ - ach?: InboundTransfers.Ach; - } - - namespace InboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface IntraStripeFlows { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface OutboundPayments { - /** - * Enables ACH transfers via the OutboundPayments API. - */ - ach?: OutboundPayments.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundPayments API. - */ - us_domestic_wire?: OutboundPayments.UsDomesticWire; - } - - namespace OutboundPayments { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface OutboundTransfers { - /** - * Enables ACH transfers via the OutboundTransfers API. - */ - ach?: OutboundTransfers.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundTransfers API. - */ - us_domestic_wire?: OutboundTransfers.UsDomesticWire; - } - - namespace OutboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - } - - interface PlatformRestrictions { - /** - * Restricts all inbound money movement. - */ - inbound_flows?: PlatformRestrictions.InboundFlows; - - /** - * Restricts all outbound money movement. - */ - outbound_flows?: PlatformRestrictions.OutboundFlows; - } - - namespace PlatformRestrictions { - type InboundFlows = 'restricted' | 'unrestricted'; - - type OutboundFlows = 'restricted' | 'unrestricted'; - } - } - - interface FinancialAccountRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FinancialAccountUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. - */ - features?: FinancialAccountUpdateParams.Features; - - /** - * 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.MetadataParam; - - /** - * The set of functionalities that the platform can restrict on the FinancialAccount. - */ - platform_restrictions?: FinancialAccountUpdateParams.PlatformRestrictions; - } - - namespace FinancialAccountUpdateParams { - interface Features { - /** - * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. - */ - card_issuing?: Features.CardIssuing; - - /** - * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. - */ - deposit_insurance?: Features.DepositInsurance; - - /** - * Contains Features that add FinancialAddresses to the FinancialAccount. - */ - financial_addresses?: Features.FinancialAddresses; - - /** - * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. - */ - inbound_transfers?: Features.InboundTransfers; - - /** - * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). - */ - intra_stripe_flows?: Features.IntraStripeFlows; - - /** - * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. - */ - outbound_payments?: Features.OutboundPayments; - - /** - * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. - */ - outbound_transfers?: Features.OutboundTransfers; - } - - namespace Features { - interface CardIssuing { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface DepositInsurance { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface FinancialAddresses { - /** - * Adds an ABA FinancialAddress to the FinancialAccount. - */ - aba?: FinancialAddresses.Aba; - } - - namespace FinancialAddresses { - interface Aba { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface InboundTransfers { - /** - * Enables ACH Debits via the InboundTransfers API. - */ - ach?: InboundTransfers.Ach; - } - - namespace InboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface IntraStripeFlows { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface OutboundPayments { - /** - * Enables ACH transfers via the OutboundPayments API. - */ - ach?: OutboundPayments.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundPayments API. - */ - us_domestic_wire?: OutboundPayments.UsDomesticWire; - } - - namespace OutboundPayments { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface OutboundTransfers { - /** - * Enables ACH transfers via the OutboundTransfers API. - */ - ach?: OutboundTransfers.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundTransfers API. - */ - us_domestic_wire?: OutboundTransfers.UsDomesticWire; - } - - namespace OutboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - } - - interface PlatformRestrictions { - /** - * Restricts all inbound money movement. - */ - inbound_flows?: PlatformRestrictions.InboundFlows; - - /** - * Restricts all outbound money movement. - */ - outbound_flows?: PlatformRestrictions.OutboundFlows; - } - - namespace PlatformRestrictions { - type InboundFlows = 'restricted' | 'unrestricted'; - - type OutboundFlows = 'restricted' | 'unrestricted'; - } - } - - interface FinancialAccountListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FinancialAccountRetrieveFeaturesParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FinancialAccountUpdateFeaturesParams { - /** - * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. - */ - card_issuing?: FinancialAccountUpdateFeaturesParams.CardIssuing; - - /** - * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. - */ - deposit_insurance?: FinancialAccountUpdateFeaturesParams.DepositInsurance; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Contains Features that add FinancialAddresses to the FinancialAccount. - */ - financial_addresses?: FinancialAccountUpdateFeaturesParams.FinancialAddresses; - - /** - * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. - */ - inbound_transfers?: FinancialAccountUpdateFeaturesParams.InboundTransfers; - - /** - * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). - */ - intra_stripe_flows?: FinancialAccountUpdateFeaturesParams.IntraStripeFlows; - - /** - * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. - */ - outbound_payments?: FinancialAccountUpdateFeaturesParams.OutboundPayments; - - /** - * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. - */ - outbound_transfers?: FinancialAccountUpdateFeaturesParams.OutboundTransfers; - } - - namespace FinancialAccountUpdateFeaturesParams { - interface CardIssuing { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface DepositInsurance { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface FinancialAddresses { - /** - * Adds an ABA FinancialAddress to the FinancialAccount. - */ - aba?: FinancialAddresses.Aba; - } - - namespace FinancialAddresses { - interface Aba { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface InboundTransfers { - /** - * Enables ACH Debits via the InboundTransfers API. - */ - ach?: InboundTransfers.Ach; - } - - namespace InboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface IntraStripeFlows { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface OutboundPayments { - /** - * Enables ACH transfers via the OutboundPayments API. - */ - ach?: OutboundPayments.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundPayments API. - */ - us_domestic_wire?: OutboundPayments.UsDomesticWire; - } - - namespace OutboundPayments { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - - interface OutboundTransfers { - /** - * Enables ACH transfers via the OutboundTransfers API. - */ - ach?: OutboundTransfers.Ach; - - /** - * Enables US domestic wire tranfers via the OutboundTransfers API. - */ - us_domestic_wire?: OutboundTransfers.UsDomesticWire; - } - - namespace OutboundTransfers { - interface Ach { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - - interface UsDomesticWire { - /** - * Whether the FinancialAccount should have the Feature. - */ - requested: boolean; - } - } - } - - class FinancialAccountsResource { - /** - * Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. - */ - create( - params: FinancialAccountCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of a FinancialAccount. - */ - retrieve( - id: string, - params?: FinancialAccountRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the details of a FinancialAccount. - */ - update( - id: string, - params?: FinancialAccountUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of FinancialAccounts. - */ - list( - params?: FinancialAccountListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Retrieves Features information associated with the FinancialAccount. - */ - retrieveFeatures( - id: string, - params?: FinancialAccountRetrieveFeaturesParams, - options?: RequestOptions - ): Promise>; - retrieveFeatures( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the Features associated with a FinancialAccount. - */ - updateFeatures( - id: string, - params?: FinancialAccountUpdateFeaturesParams, - options?: RequestOptions - ): Promise>; - updateFeatures( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Treasury/FinancialAccountsResource.d.ts b/types/2022-11-15/Treasury/FinancialAccountsResource.d.ts new file mode 100644 index 0000000000..33d4970eba --- /dev/null +++ b/types/2022-11-15/Treasury/FinancialAccountsResource.d.ts @@ -0,0 +1,637 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface FinancialAccountCreateParams { + /** + * The currencies the FinancialAccount can hold a balance in. + */ + supported_currencies: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. + */ + features?: FinancialAccountCreateParams.Features; + + /** + * 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.MetadataParam; + + /** + * The set of functionalities that the platform can restrict on the FinancialAccount. + */ + platform_restrictions?: FinancialAccountCreateParams.PlatformRestrictions; + } + + namespace FinancialAccountCreateParams { + interface Features { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: Features.CardIssuing; + + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: Features.DepositInsurance; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: Features.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: Features.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: Features.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: Features.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: Features.OutboundTransfers; + } + + namespace Features { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + interface PlatformRestrictions { + /** + * Restricts all inbound money movement. + */ + inbound_flows?: PlatformRestrictions.InboundFlows; + + /** + * Restricts all outbound money movement. + */ + outbound_flows?: PlatformRestrictions.OutboundFlows; + } + + namespace PlatformRestrictions { + type InboundFlows = 'restricted' | 'unrestricted'; + + type OutboundFlows = 'restricted' | 'unrestricted'; + } + } + + interface FinancialAccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. + */ + features?: FinancialAccountUpdateParams.Features; + + /** + * 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.MetadataParam; + + /** + * The set of functionalities that the platform can restrict on the FinancialAccount. + */ + platform_restrictions?: FinancialAccountUpdateParams.PlatformRestrictions; + } + + namespace FinancialAccountUpdateParams { + interface Features { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: Features.CardIssuing; + + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: Features.DepositInsurance; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: Features.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: Features.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: Features.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: Features.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: Features.OutboundTransfers; + } + + namespace Features { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + interface PlatformRestrictions { + /** + * Restricts all inbound money movement. + */ + inbound_flows?: PlatformRestrictions.InboundFlows; + + /** + * Restricts all outbound money movement. + */ + outbound_flows?: PlatformRestrictions.OutboundFlows; + } + + namespace PlatformRestrictions { + type InboundFlows = 'restricted' | 'unrestricted'; + + type OutboundFlows = 'restricted' | 'unrestricted'; + } + } + + interface FinancialAccountListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountRetrieveFeaturesParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancialAccountUpdateFeaturesParams { + /** + * Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + */ + card_issuing?: FinancialAccountUpdateFeaturesParams.CardIssuing; + + /** + * Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. + */ + deposit_insurance?: FinancialAccountUpdateFeaturesParams.DepositInsurance; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Contains Features that add FinancialAddresses to the FinancialAccount. + */ + financial_addresses?: FinancialAccountUpdateFeaturesParams.FinancialAddresses; + + /** + * Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + */ + inbound_transfers?: FinancialAccountUpdateFeaturesParams.InboundTransfers; + + /** + * Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + */ + intra_stripe_flows?: FinancialAccountUpdateFeaturesParams.IntraStripeFlows; + + /** + * Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + */ + outbound_payments?: FinancialAccountUpdateFeaturesParams.OutboundPayments; + + /** + * Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + */ + outbound_transfers?: FinancialAccountUpdateFeaturesParams.OutboundTransfers; + } + + namespace FinancialAccountUpdateFeaturesParams { + interface CardIssuing { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface DepositInsurance { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface FinancialAddresses { + /** + * Adds an ABA FinancialAddress to the FinancialAccount. + */ + aba?: FinancialAddresses.Aba; + } + + namespace FinancialAddresses { + interface Aba { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface InboundTransfers { + /** + * Enables ACH Debits via the InboundTransfers API. + */ + ach?: InboundTransfers.Ach; + } + + namespace InboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface IntraStripeFlows { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface OutboundPayments { + /** + * Enables ACH transfers via the OutboundPayments API. + */ + ach?: OutboundPayments.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundPayments API. + */ + us_domestic_wire?: OutboundPayments.UsDomesticWire; + } + + namespace OutboundPayments { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + + interface OutboundTransfers { + /** + * Enables ACH transfers via the OutboundTransfers API. + */ + ach?: OutboundTransfers.Ach; + + /** + * Enables US domestic wire tranfers via the OutboundTransfers API. + */ + us_domestic_wire?: OutboundTransfers.UsDomesticWire; + } + + namespace OutboundTransfers { + interface Ach { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + + interface UsDomesticWire { + /** + * Whether the FinancialAccount should have the Feature. + */ + requested: boolean; + } + } + } + + class FinancialAccountsResource { + /** + * Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + */ + create( + params: FinancialAccountCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of a FinancialAccount. + */ + retrieve( + id: string, + params?: FinancialAccountRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the details of a FinancialAccount. + */ + update( + id: string, + params?: FinancialAccountUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of FinancialAccounts. + */ + list( + params?: FinancialAccountListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Retrieves Features information associated with the FinancialAccount. + */ + retrieveFeatures( + id: string, + params?: FinancialAccountRetrieveFeaturesParams, + options?: RequestOptions + ): Promise>; + retrieveFeatures( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the Features associated with a FinancialAccount. + */ + updateFeatures( + id: string, + params?: FinancialAccountUpdateFeaturesParams, + options?: RequestOptions + ): Promise>; + updateFeatures( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Treasury/InboundTransfers.d.ts b/types/2022-11-15/Treasury/InboundTransfers.d.ts index ae72ccce73..5ea5da85ae 100644 --- a/types/2022-11-15/Treasury/InboundTransfers.d.ts +++ b/types/2022-11-15/Treasury/InboundTransfers.d.ts @@ -223,127 +223,6 @@ declare module 'stripe' { succeeded_at: number | null; } } - - interface InboundTransferCreateParams { - /** - * Amount (in cents) to be transferred. - */ - amount: 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; - - /** - * The FinancialAccount to send funds to. - */ - financial_account: string; - - /** - * The origin payment method to be debited for the InboundTransfer. - */ - origin_payment_method: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * The complete description that appears on your customers' statements. Maximum 10 characters. - */ - statement_descriptor?: string; - } - - interface InboundTransferRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface InboundTransferListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. - */ - status?: InboundTransferListParams.Status; - } - - namespace InboundTransferListParams { - type Status = 'canceled' | 'failed' | 'processing' | 'succeeded'; - } - - interface InboundTransferCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class InboundTransfersResource { - /** - * Creates an InboundTransfer. - */ - create( - params: InboundTransferCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing InboundTransfer. - */ - retrieve( - id: string, - params?: InboundTransferRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of InboundTransfers sent from the specified FinancialAccount. - */ - list( - params: InboundTransferListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Cancels an InboundTransfer. - */ - cancel( - id: string, - params?: InboundTransferCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Treasury/InboundTransfersResource.d.ts b/types/2022-11-15/Treasury/InboundTransfersResource.d.ts new file mode 100644 index 0000000000..0b6b5c1da9 --- /dev/null +++ b/types/2022-11-15/Treasury/InboundTransfersResource.d.ts @@ -0,0 +1,128 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface InboundTransferCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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; + + /** + * The FinancialAccount to send funds to. + */ + financial_account: string; + + /** + * The origin payment method to be debited for the InboundTransfer. + */ + origin_payment_method: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * The complete description that appears on your customers' statements. Maximum 10 characters. + */ + statement_descriptor?: string; + } + + interface InboundTransferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface InboundTransferListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. + */ + status?: InboundTransferListParams.Status; + } + + namespace InboundTransferListParams { + type Status = 'canceled' | 'failed' | 'processing' | 'succeeded'; + } + + interface InboundTransferCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class InboundTransfersResource { + /** + * Creates an InboundTransfer. + */ + create( + params: InboundTransferCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing InboundTransfer. + */ + retrieve( + id: string, + params?: InboundTransferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of InboundTransfers sent from the specified FinancialAccount. + */ + list( + params: InboundTransferListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancels an InboundTransfer. + */ + cancel( + id: string, + params?: InboundTransferCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Treasury/OutboundPayments.d.ts b/types/2022-11-15/Treasury/OutboundPayments.d.ts index 8a536803fb..2325096948 100644 --- a/types/2022-11-15/Treasury/OutboundPayments.d.ts +++ b/types/2022-11-15/Treasury/OutboundPayments.d.ts @@ -268,279 +268,6 @@ declare module 'stripe' { returned_at: number | null; } } - - interface OutboundPaymentCreateParams { - /** - * Amount (in cents) to be transferred. - */ - amount: 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; - - /** - * The FinancialAccount to pull funds from. - */ - financial_account: string; - - /** - * ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. - */ - destination_payment_method?: string; - - /** - * Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`. - */ - destination_payment_method_data?: OutboundPaymentCreateParams.DestinationPaymentMethodData; - - /** - * Payment method-specific configuration for this OutboundPayment. - */ - destination_payment_method_options?: OutboundPaymentCreateParams.DestinationPaymentMethodOptions; - - /** - * End user details. - */ - end_user_details?: OutboundPaymentCreateParams.EndUserDetails; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`. - */ - statement_descriptor?: string; - } - - namespace OutboundPaymentCreateParams { - interface DestinationPaymentMethodData { - /** - * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - */ - billing_details?: DestinationPaymentMethodData.BillingDetails; - - /** - * Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. - */ - financial_account?: 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`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: DestinationPaymentMethodData.Type; - - /** - * Required hash if type is set to `us_bank_account`. - */ - us_bank_account?: DestinationPaymentMethodData.UsBankAccount; - } - - namespace DestinationPaymentMethodData { - interface BillingDetails { - /** - * Billing address. - */ - address?: Stripe.Emptyable; - - /** - * Email address. - */ - email?: Stripe.Emptyable; - - /** - * Full name. - */ - name?: string; - - /** - * Billing phone number (including extension). - */ - phone?: string; - } - - type Type = 'financial_account' | 'us_bank_account'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type?: UsBankAccount.AccountHolderType; - - /** - * Account number of the bank account. - */ - account_number?: string; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type?: UsBankAccount.AccountType; - - /** - * The ID of a Financial Connections Account to use as a payment method. - */ - financial_connections_account?: string; - - /** - * Routing number of the bank account. - */ - routing_number?: string; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - } - } - - interface DestinationPaymentMethodOptions { - /** - * Optional fields for `us_bank_account`. - */ - us_bank_account?: Stripe.Emptyable< - DestinationPaymentMethodOptions.UsBankAccount - >; - } - - namespace DestinationPaymentMethodOptions { - interface UsBankAccount { - /** - * The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network. - */ - network?: UsBankAccount.Network; - } - - namespace UsBankAccount { - type Network = 'ach' | 'us_domestic_wire'; - } - } - - interface EndUserDetails { - /** - * IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. - */ - ip_address?: string; - - /** - * `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. - */ - present: boolean; - } - } - - interface OutboundPaymentRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OutboundPaymentListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Only return OutboundPayments sent to this customer. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. - */ - status?: OutboundPaymentListParams.Status; - } - - namespace OutboundPaymentListParams { - type Status = - | 'canceled' - | 'failed' - | 'posted' - | 'processing' - | 'returned'; - } - - interface OutboundPaymentCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class OutboundPaymentsResource { - /** - * Creates an OutboundPayment. - */ - create( - params: OutboundPaymentCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. - */ - retrieve( - id: string, - params?: OutboundPaymentRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of OutboundPayments sent from the specified FinancialAccount. - */ - list( - params: OutboundPaymentListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * Cancel an OutboundPayment. - */ - cancel( - id: string, - params?: OutboundPaymentCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts b/types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts new file mode 100644 index 0000000000..52071e77b2 --- /dev/null +++ b/types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts @@ -0,0 +1,280 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface OutboundPaymentCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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; + + /** + * The FinancialAccount to pull funds from. + */ + financial_account: string; + + /** + * ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. + */ + destination_payment_method?: string; + + /** + * Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`. + */ + destination_payment_method_data?: OutboundPaymentCreateParams.DestinationPaymentMethodData; + + /** + * Payment method-specific configuration for this OutboundPayment. + */ + destination_payment_method_options?: OutboundPaymentCreateParams.DestinationPaymentMethodOptions; + + /** + * End user details. + */ + end_user_details?: OutboundPaymentCreateParams.EndUserDetails; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`. + */ + statement_descriptor?: string; + } + + namespace OutboundPaymentCreateParams { + interface DestinationPaymentMethodData { + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: DestinationPaymentMethodData.BillingDetails; + + /** + * Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + */ + financial_account?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: DestinationPaymentMethodData.Type; + + /** + * Required hash if type is set to `us_bank_account`. + */ + us_bank_account?: DestinationPaymentMethodData.UsBankAccount; + } + + namespace DestinationPaymentMethodData { + interface BillingDetails { + /** + * Billing address. + */ + address?: Stripe.Emptyable; + + /** + * Email address. + */ + email?: Stripe.Emptyable; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + type Type = 'financial_account' | 'us_bank_account'; + + interface UsBankAccount { + /** + * Account holder type: individual or company. + */ + account_holder_type?: UsBankAccount.AccountHolderType; + + /** + * Account number of the bank account. + */ + account_number?: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: UsBankAccount.AccountType; + + /** + * The ID of a Financial Connections Account to use as a payment method. + */ + financial_connections_account?: string; + + /** + * Routing number of the bank account. + */ + routing_number?: string; + } + + namespace UsBankAccount { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'savings'; + } + } + + interface DestinationPaymentMethodOptions { + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: Stripe.Emptyable< + DestinationPaymentMethodOptions.UsBankAccount + >; + } + + namespace DestinationPaymentMethodOptions { + interface UsBankAccount { + /** + * The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network. + */ + network?: UsBankAccount.Network; + } + + namespace UsBankAccount { + type Network = 'ach' | 'us_domestic_wire'; + } + } + + interface EndUserDetails { + /** + * IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. + */ + ip_address?: string; + + /** + * `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. + */ + present: boolean; + } + } + + interface OutboundPaymentRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OutboundPaymentListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Only return OutboundPayments sent to this customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. + */ + status?: OutboundPaymentListParams.Status; + } + + namespace OutboundPaymentListParams { + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + } + + interface OutboundPaymentCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OutboundPaymentsResource { + /** + * Creates an OutboundPayment. + */ + create( + params: OutboundPaymentCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + */ + retrieve( + id: string, + params?: OutboundPaymentRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of OutboundPayments sent from the specified FinancialAccount. + */ + list( + params: OutboundPaymentListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancel an OutboundPayment. + */ + cancel( + id: string, + params?: OutboundPaymentCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/Treasury/OutboundTransfers.d.ts index 98c6e1143d..2c5765b85c 100644 --- a/types/2022-11-15/Treasury/OutboundTransfers.d.ts +++ b/types/2022-11-15/Treasury/OutboundTransfers.d.ts @@ -227,161 +227,6 @@ declare module 'stripe' { returned_at: number | null; } } - - interface OutboundTransferCreateParams { - /** - * Amount (in cents) to be transferred. - */ - amount: 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; - - /** - * The FinancialAccount to pull funds from. - */ - financial_account: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The PaymentMethod to use as the payment instrument for the OutboundTransfer. - */ - destination_payment_method?: string; - - /** - * Hash describing payment method configuration details. - */ - destination_payment_method_options?: OutboundTransferCreateParams.DestinationPaymentMethodOptions; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. - */ - statement_descriptor?: string; - } - - namespace OutboundTransferCreateParams { - interface DestinationPaymentMethodOptions { - /** - * Optional fields for `us_bank_account`. - */ - us_bank_account?: Stripe.Emptyable< - DestinationPaymentMethodOptions.UsBankAccount - >; - } - - namespace DestinationPaymentMethodOptions { - interface UsBankAccount { - /** - * Designate the OutboundTransfer as using a US bank account network configuration. - */ - network?: UsBankAccount.Network; - } - - namespace UsBankAccount { - type Network = 'ach' | 'us_domestic_wire'; - } - } - } - - interface OutboundTransferRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OutboundTransferListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. - */ - status?: OutboundTransferListParams.Status; - } - - namespace OutboundTransferListParams { - type Status = - | 'canceled' - | 'failed' - | 'posted' - | 'processing' - | 'returned'; - } - - interface OutboundTransferCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class OutboundTransfersResource { - /** - * Creates an OutboundTransfer. - */ - create( - params: OutboundTransferCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. - */ - retrieve( - id: string, - params?: OutboundTransferRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of OutboundTransfers sent from the specified FinancialAccount. - */ - list( - params: OutboundTransferListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * An OutboundTransfer can be canceled if the funds have not yet been paid out. - */ - cancel( - id: string, - params?: OutboundTransferCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/2022-11-15/Treasury/OutboundTransfersResource.d.ts b/types/2022-11-15/Treasury/OutboundTransfersResource.d.ts new file mode 100644 index 0000000000..d0e9ce36b6 --- /dev/null +++ b/types/2022-11-15/Treasury/OutboundTransfersResource.d.ts @@ -0,0 +1,162 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface OutboundTransferCreateParams { + /** + * Amount (in cents) to be transferred. + */ + amount: 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; + + /** + * The FinancialAccount to pull funds from. + */ + financial_account: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The PaymentMethod to use as the payment instrument for the OutboundTransfer. + */ + destination_payment_method?: string; + + /** + * Hash describing payment method configuration details. + */ + destination_payment_method_options?: OutboundTransferCreateParams.DestinationPaymentMethodOptions; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. + */ + statement_descriptor?: string; + } + + namespace OutboundTransferCreateParams { + interface DestinationPaymentMethodOptions { + /** + * Optional fields for `us_bank_account`. + */ + us_bank_account?: Stripe.Emptyable< + DestinationPaymentMethodOptions.UsBankAccount + >; + } + + namespace DestinationPaymentMethodOptions { + interface UsBankAccount { + /** + * Designate the OutboundTransfer as using a US bank account network configuration. + */ + network?: UsBankAccount.Network; + } + + namespace UsBankAccount { + type Network = 'ach' | 'us_domestic_wire'; + } + } + } + + interface OutboundTransferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OutboundTransferListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. + */ + status?: OutboundTransferListParams.Status; + } + + namespace OutboundTransferListParams { + type Status = + | 'canceled' + | 'failed' + | 'posted' + | 'processing' + | 'returned'; + } + + interface OutboundTransferCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OutboundTransfersResource { + /** + * Creates an OutboundTransfer. + */ + create( + params: OutboundTransferCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + */ + retrieve( + id: string, + params?: OutboundTransferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of OutboundTransfers sent from the specified FinancialAccount. + */ + list( + params: OutboundTransferListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * An OutboundTransfer can be canceled if the funds have not yet been paid out. + */ + cancel( + id: string, + params?: OutboundTransferCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-11-15/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/Treasury/ReceivedCredits.d.ts index 4736cd5c3d..709e52ede1 100644 --- a/types/2022-11-15/Treasury/ReceivedCredits.d.ts +++ b/types/2022-11-15/Treasury/ReceivedCredits.d.ts @@ -258,77 +258,6 @@ declare module 'stripe' { type Status = 'failed' | 'succeeded'; } - - interface ReceivedCreditRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReceivedCreditListParams extends PaginationParams { - /** - * The FinancialAccount that received the funds. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return ReceivedCredits described by the flow. - */ - linked_flows?: ReceivedCreditListParams.LinkedFlows; - - /** - * Only return ReceivedCredits that have the given status: `succeeded` or `failed`. - */ - status?: ReceivedCreditListParams.Status; - } - - namespace ReceivedCreditListParams { - interface LinkedFlows { - /** - * The source flow type. - */ - source_flow_type: LinkedFlows.SourceFlowType; - } - - namespace LinkedFlows { - type SourceFlowType = - | 'credit_reversal' - | 'other' - | 'outbound_payment' - | 'payout'; - } - - type Status = 'failed' | 'succeeded'; - } - - class ReceivedCreditsResource { - /** - * Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. - */ - retrieve( - id: string, - params?: ReceivedCreditRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of ReceivedCredits. - */ - list( - params: ReceivedCreditListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts b/types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts new file mode 100644 index 0000000000..c44586fd9e --- /dev/null +++ b/types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface ReceivedCreditRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReceivedCreditListParams extends PaginationParams { + /** + * The FinancialAccount that received the funds. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return ReceivedCredits described by the flow. + */ + linked_flows?: ReceivedCreditListParams.LinkedFlows; + + /** + * Only return ReceivedCredits that have the given status: `succeeded` or `failed`. + */ + status?: ReceivedCreditListParams.Status; + } + + namespace ReceivedCreditListParams { + interface LinkedFlows { + /** + * The source flow type. + */ + source_flow_type: LinkedFlows.SourceFlowType; + } + + namespace LinkedFlows { + type SourceFlowType = + | 'credit_reversal' + | 'other' + | 'outbound_payment' + | 'payout'; + } + + type Status = 'failed' | 'succeeded'; + } + + class ReceivedCreditsResource { + /** + * Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + */ + retrieve( + id: string, + params?: ReceivedCreditRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ReceivedCredits. + */ + list( + params: ReceivedCreditListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/Treasury/ReceivedDebits.d.ts index 2e5cdf2b89..2427efb7cd 100644 --- a/types/2022-11-15/Treasury/ReceivedDebits.d.ts +++ b/types/2022-11-15/Treasury/ReceivedDebits.d.ts @@ -211,57 +211,6 @@ declare module 'stripe' { type Status = 'failed' | 'succeeded'; } - - interface ReceivedDebitRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ReceivedDebitListParams extends PaginationParams { - /** - * The FinancialAccount that funds were pulled from. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return ReceivedDebits that have the given status: `succeeded` or `failed`. - */ - status?: ReceivedDebitListParams.Status; - } - - namespace ReceivedDebitListParams { - type Status = 'failed' | 'succeeded'; - } - - class ReceivedDebitsResource { - /** - * Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list - */ - retrieve( - id: string, - params?: ReceivedDebitRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of ReceivedDebits. - */ - list( - params: ReceivedDebitListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts b/types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts new file mode 100644 index 0000000000..0966056ac5 --- /dev/null +++ b/types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface ReceivedDebitRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ReceivedDebitListParams extends PaginationParams { + /** + * The FinancialAccount that funds were pulled from. + */ + financial_account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Only return ReceivedDebits that have the given status: `succeeded` or `failed`. + */ + status?: ReceivedDebitListParams.Status; + } + + namespace ReceivedDebitListParams { + type Status = 'failed' | 'succeeded'; + } + + class ReceivedDebitsResource { + /** + * Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list + */ + retrieve( + id: string, + params?: ReceivedDebitRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of ReceivedDebits. + */ + list( + params: ReceivedDebitListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Treasury/TransactionEntries.d.ts b/types/2022-11-15/Treasury/TransactionEntries.d.ts index 722094995e..593193505a 100644 --- a/types/2022-11-15/Treasury/TransactionEntries.d.ts +++ b/types/2022-11-15/Treasury/TransactionEntries.d.ts @@ -192,66 +192,6 @@ declare module 'stripe' { | 'received_credit' | 'received_debit'; } - - interface TransactionEntryRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransactionEntryListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - created?: Stripe.RangeQueryParam | number; - - effective_at?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. - */ - order_by?: TransactionEntryListParams.OrderBy; - - /** - * Only return TransactionEntries associated with this Transaction. - */ - transaction?: string; - } - - namespace TransactionEntryListParams { - type OrderBy = 'created' | 'effective_at'; - } - - class TransactionEntriesResource { - /** - * Retrieves a TransactionEntry object. - */ - retrieve( - id: string, - params?: TransactionEntryRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a list of TransactionEntry objects. - */ - list( - params: TransactionEntryListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/TransactionEntriesResource.d.ts b/types/2022-11-15/Treasury/TransactionEntriesResource.d.ts new file mode 100644 index 0000000000..f396c30b44 --- /dev/null +++ b/types/2022-11-15/Treasury/TransactionEntriesResource.d.ts @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface TransactionEntryRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionEntryListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + created?: Stripe.RangeQueryParam | number; + + effective_at?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. + */ + order_by?: TransactionEntryListParams.OrderBy; + + /** + * Only return TransactionEntries associated with this Transaction. + */ + transaction?: string; + } + + namespace TransactionEntryListParams { + type OrderBy = 'created' | 'effective_at'; + } + + class TransactionEntriesResource { + /** + * Retrieves a TransactionEntry object. + */ + retrieve( + id: string, + params?: TransactionEntryRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a list of TransactionEntry objects. + */ + list( + params: TransactionEntryListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/Treasury/Transactions.d.ts b/types/2022-11-15/Treasury/Transactions.d.ts index f9df529f4a..d65772f255 100644 --- a/types/2022-11-15/Treasury/Transactions.d.ts +++ b/types/2022-11-15/Treasury/Transactions.d.ts @@ -191,78 +191,6 @@ declare module 'stripe' { void_at: number | null; } } - - interface TransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransactionListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. - */ - order_by?: TransactionListParams.OrderBy; - - /** - * Only return Transactions that have the given status: `open`, `posted`, or `void`. - */ - status?: TransactionListParams.Status; - - /** - * A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified. - */ - status_transitions?: TransactionListParams.StatusTransitions; - } - - namespace TransactionListParams { - type OrderBy = 'created' | 'posted_at'; - - type Status = 'open' | 'posted' | 'void'; - - interface StatusTransitions { - /** - * Returns Transactions with `posted_at` within the specified range. - */ - posted_at?: Stripe.RangeQueryParam | number; - } - } - - class TransactionsResource { - /** - * Retrieves the details of an existing Transaction. - */ - retrieve( - id: string, - params?: TransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves a list of Transaction objects. - */ - list( - params: TransactionListParams, - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/2022-11-15/Treasury/TransactionsResource.d.ts b/types/2022-11-15/Treasury/TransactionsResource.d.ts new file mode 100644 index 0000000000..092f7adf56 --- /dev/null +++ b/types/2022-11-15/Treasury/TransactionsResource.d.ts @@ -0,0 +1,79 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Treasury { + interface TransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionListParams extends PaginationParams { + /** + * Returns objects associated with this FinancialAccount. + */ + financial_account: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. + */ + order_by?: TransactionListParams.OrderBy; + + /** + * Only return Transactions that have the given status: `open`, `posted`, or `void`. + */ + status?: TransactionListParams.Status; + + /** + * A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified. + */ + status_transitions?: TransactionListParams.StatusTransitions; + } + + namespace TransactionListParams { + type OrderBy = 'created' | 'posted_at'; + + type Status = 'open' | 'posted' | 'void'; + + interface StatusTransitions { + /** + * Returns Transactions with `posted_at` within the specified range. + */ + posted_at?: Stripe.RangeQueryParam | number; + } + } + + class TransactionsResource { + /** + * Retrieves the details of an existing Transaction. + */ + retrieve( + id: string, + params?: TransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves a list of Transaction objects. + */ + list( + params: TransactionListParams, + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-11-15/UsageRecordSummaries.d.ts b/types/2022-11-15/UsageRecordSummaries.d.ts index 90d658fe7a..e5d8223d02 100644 --- a/types/2022-11-15/UsageRecordSummaries.d.ts +++ b/types/2022-11-15/UsageRecordSummaries.d.ts @@ -52,12 +52,5 @@ declare module 'stripe' { start: number | null; } } - - interface UsageRecordSummaryListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } } } diff --git a/types/2022-11-15/UsageRecordSummariesResource.d.ts b/types/2022-11-15/UsageRecordSummariesResource.d.ts new file mode 100644 index 0000000000..92c7741a5e --- /dev/null +++ b/types/2022-11-15/UsageRecordSummariesResource.d.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface UsageRecordSummaryListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + } +} diff --git a/types/2022-11-15/UsageRecords.d.ts b/types/2022-11-15/UsageRecords.d.ts index 306118d60d..a6c2597291 100644 --- a/types/2022-11-15/UsageRecords.d.ts +++ b/types/2022-11-15/UsageRecords.d.ts @@ -39,31 +39,5 @@ declare module 'stripe' { */ timestamp: number; } - - interface UsageRecordCreateParams { - /** - * The usage quantity for the specified timestamp. - */ - quantity: number; - - /** - * Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. - */ - action?: UsageRecordCreateParams.Action; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. - */ - timestamp?: 'now' | number; - } - - namespace UsageRecordCreateParams { - type Action = 'increment' | 'set'; - } } } diff --git a/types/2022-11-15/UsageRecordsResource.d.ts b/types/2022-11-15/UsageRecordsResource.d.ts new file mode 100644 index 0000000000..df2a2d4bab --- /dev/null +++ b/types/2022-11-15/UsageRecordsResource.d.ts @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface UsageRecordCreateParams { + /** + * The usage quantity for the specified timestamp. + */ + quantity: number; + + /** + * Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. + */ + action?: UsageRecordCreateParams.Action; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. + */ + timestamp?: 'now' | number; + } + + namespace UsageRecordCreateParams { + type Action = 'increment' | 'set'; + } + } +} diff --git a/types/2022-11-15/WebhookEndpoints.d.ts b/types/2022-11-15/WebhookEndpoints.d.ts index fcdb1516f5..48153c1b58 100644 --- a/types/2022-11-15/WebhookEndpoints.d.ts +++ b/types/2022-11-15/WebhookEndpoints.d.ts @@ -94,688 +94,5 @@ declare module 'stripe' { */ deleted: true; } - - interface WebhookEndpointCreateParams { - /** - * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. - */ - enabled_events: Array; - - /** - * The URL of the webhook endpoint. - */ - url: string; - - /** - * Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. - */ - api_version?: WebhookEndpointCreateParams.ApiVersion; - - /** - * Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. - */ - connect?: boolean; - - /** - * An optional description of what the webhook is used for. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - namespace WebhookEndpointCreateParams { - type ApiVersion = - | '2011-01-01' - | '2011-06-21' - | '2011-06-28' - | '2011-08-01' - | '2011-09-15' - | '2011-11-17' - | '2012-02-23' - | '2012-03-25' - | '2012-06-18' - | '2012-06-28' - | '2012-07-09' - | '2012-09-24' - | '2012-10-26' - | '2012-11-07' - | '2013-02-11' - | '2013-02-13' - | '2013-07-05' - | '2013-08-12' - | '2013-08-13' - | '2013-10-29' - | '2013-12-03' - | '2014-01-31' - | '2014-03-13' - | '2014-03-28' - | '2014-05-19' - | '2014-06-13' - | '2014-06-17' - | '2014-07-22' - | '2014-07-26' - | '2014-08-04' - | '2014-08-20' - | '2014-09-08' - | '2014-10-07' - | '2014-11-05' - | '2014-11-20' - | '2014-12-08' - | '2014-12-17' - | '2014-12-22' - | '2015-01-11' - | '2015-01-26' - | '2015-02-10' - | '2015-02-16' - | '2015-02-18' - | '2015-03-24' - | '2015-04-07' - | '2015-06-15' - | '2015-07-07' - | '2015-07-13' - | '2015-07-28' - | '2015-08-07' - | '2015-08-19' - | '2015-09-03' - | '2015-09-08' - | '2015-09-23' - | '2015-10-01' - | '2015-10-12' - | '2015-10-16' - | '2016-02-03' - | '2016-02-19' - | '2016-02-22' - | '2016-02-23' - | '2016-02-29' - | '2016-03-07' - | '2016-06-15' - | '2016-07-06' - | '2016-10-19' - | '2017-01-27' - | '2017-02-14' - | '2017-04-06' - | '2017-05-25' - | '2017-06-05' - | '2017-08-15' - | '2017-12-14' - | '2018-01-23' - | '2018-02-05' - | '2018-02-06' - | '2018-02-28' - | '2018-05-21' - | '2018-07-27' - | '2018-08-23' - | '2018-09-06' - | '2018-09-24' - | '2018-10-31' - | '2018-11-08' - | '2019-02-11' - | '2019-02-19' - | '2019-03-14' - | '2019-05-16' - | '2019-08-14' - | '2019-09-09' - | '2019-10-08' - | '2019-10-17' - | '2019-11-05' - | '2019-12-03' - | '2020-03-02' - | '2020-08-27' - | '2022-08-01' - | '2022-11-15'; - - type EnabledEvent = - | '*' - | 'account.application.authorized' - | 'account.application.deauthorized' - | 'account.external_account.created' - | 'account.external_account.deleted' - | 'account.external_account.updated' - | 'account.updated' - | 'application_fee.created' - | 'application_fee.refund.updated' - | 'application_fee.refunded' - | 'balance.available' - | 'billing_portal.configuration.created' - | 'billing_portal.configuration.updated' - | 'billing_portal.session.created' - | 'capability.updated' - | 'cash_balance.funds_available' - | 'charge.captured' - | 'charge.dispute.closed' - | 'charge.dispute.created' - | 'charge.dispute.funds_reinstated' - | 'charge.dispute.funds_withdrawn' - | 'charge.dispute.updated' - | 'charge.expired' - | 'charge.failed' - | 'charge.pending' - | 'charge.refund.updated' - | 'charge.refunded' - | 'charge.succeeded' - | 'charge.updated' - | 'checkout.session.async_payment_failed' - | 'checkout.session.async_payment_succeeded' - | 'checkout.session.completed' - | 'checkout.session.expired' - | 'coupon.created' - | 'coupon.deleted' - | 'coupon.updated' - | 'credit_note.created' - | 'credit_note.updated' - | 'credit_note.voided' - | 'customer.created' - | 'customer.deleted' - | 'customer.discount.created' - | 'customer.discount.deleted' - | 'customer.discount.updated' - | 'customer.source.created' - | 'customer.source.deleted' - | 'customer.source.expiring' - | 'customer.source.updated' - | 'customer.subscription.created' - | 'customer.subscription.deleted' - | 'customer.subscription.pending_update_applied' - | 'customer.subscription.pending_update_expired' - | 'customer.subscription.trial_will_end' - | 'customer.subscription.updated' - | 'customer.tax_id.created' - | 'customer.tax_id.deleted' - | 'customer.tax_id.updated' - | 'customer.updated' - | 'customer_cash_balance_transaction.created' - | 'file.created' - | 'financial_connections.account.created' - | 'financial_connections.account.deactivated' - | 'financial_connections.account.disconnected' - | 'financial_connections.account.reactivated' - | 'financial_connections.account.refreshed_balance' - | 'identity.verification_session.canceled' - | 'identity.verification_session.created' - | 'identity.verification_session.processing' - | 'identity.verification_session.redacted' - | 'identity.verification_session.requires_input' - | 'identity.verification_session.verified' - | 'invoice.created' - | 'invoice.deleted' - | 'invoice.finalization_failed' - | 'invoice.finalized' - | 'invoice.marked_uncollectible' - | 'invoice.paid' - | 'invoice.payment_action_required' - | 'invoice.payment_failed' - | 'invoice.payment_succeeded' - | 'invoice.sent' - | 'invoice.upcoming' - | 'invoice.updated' - | 'invoice.voided' - | 'invoiceitem.created' - | 'invoiceitem.deleted' - | 'invoiceitem.updated' - | 'issuing_authorization.created' - | 'issuing_authorization.request' - | 'issuing_authorization.updated' - | 'issuing_card.created' - | 'issuing_card.updated' - | 'issuing_cardholder.created' - | 'issuing_cardholder.updated' - | 'issuing_dispute.closed' - | 'issuing_dispute.created' - | 'issuing_dispute.funds_reinstated' - | 'issuing_dispute.submitted' - | 'issuing_dispute.updated' - | 'issuing_transaction.created' - | 'issuing_transaction.updated' - | 'mandate.updated' - | 'order.created' - | 'payment_intent.amount_capturable_updated' - | 'payment_intent.canceled' - | 'payment_intent.created' - | 'payment_intent.partially_funded' - | 'payment_intent.payment_failed' - | 'payment_intent.processing' - | 'payment_intent.requires_action' - | 'payment_intent.succeeded' - | 'payment_link.created' - | 'payment_link.updated' - | 'payment_method.attached' - | 'payment_method.automatically_updated' - | 'payment_method.detached' - | 'payment_method.updated' - | 'payout.canceled' - | 'payout.created' - | 'payout.failed' - | 'payout.paid' - | 'payout.updated' - | 'person.created' - | 'person.deleted' - | 'person.updated' - | 'plan.created' - | 'plan.deleted' - | 'plan.updated' - | 'price.created' - | 'price.deleted' - | 'price.updated' - | 'product.created' - | 'product.deleted' - | 'product.updated' - | 'promotion_code.created' - | 'promotion_code.updated' - | 'quote.accepted' - | 'quote.canceled' - | 'quote.created' - | 'quote.finalized' - | 'radar.early_fraud_warning.created' - | 'radar.early_fraud_warning.updated' - | 'recipient.created' - | 'recipient.deleted' - | 'recipient.updated' - | 'reporting.report_run.failed' - | 'reporting.report_run.succeeded' - | 'reporting.report_type.updated' - | 'review.closed' - | 'review.opened' - | 'setup_intent.canceled' - | 'setup_intent.created' - | 'setup_intent.requires_action' - | 'setup_intent.setup_failed' - | 'setup_intent.succeeded' - | 'sigma.scheduled_query_run.created' - | 'sku.created' - | 'sku.deleted' - | 'sku.updated' - | 'source.canceled' - | 'source.chargeable' - | 'source.failed' - | 'source.mandate_notification' - | 'source.refund_attributes_required' - | 'source.transaction.created' - | 'source.transaction.updated' - | 'subscription_schedule.aborted' - | 'subscription_schedule.canceled' - | 'subscription_schedule.completed' - | 'subscription_schedule.created' - | 'subscription_schedule.expiring' - | 'subscription_schedule.released' - | 'subscription_schedule.updated' - | 'tax_rate.created' - | 'tax_rate.updated' - | 'terminal.reader.action_failed' - | 'terminal.reader.action_succeeded' - | 'test_helpers.test_clock.advancing' - | 'test_helpers.test_clock.created' - | 'test_helpers.test_clock.deleted' - | 'test_helpers.test_clock.internal_failure' - | 'test_helpers.test_clock.ready' - | 'topup.canceled' - | 'topup.created' - | 'topup.failed' - | 'topup.reversed' - | 'topup.succeeded' - | 'transfer.created' - | 'transfer.reversed' - | 'transfer.updated' - | 'treasury.credit_reversal.created' - | 'treasury.credit_reversal.posted' - | 'treasury.debit_reversal.completed' - | 'treasury.debit_reversal.created' - | 'treasury.debit_reversal.initial_credit_granted' - | 'treasury.financial_account.closed' - | 'treasury.financial_account.created' - | 'treasury.financial_account.features_status_updated' - | 'treasury.inbound_transfer.canceled' - | 'treasury.inbound_transfer.created' - | 'treasury.inbound_transfer.failed' - | 'treasury.inbound_transfer.succeeded' - | 'treasury.outbound_payment.canceled' - | 'treasury.outbound_payment.created' - | 'treasury.outbound_payment.expected_arrival_date_updated' - | 'treasury.outbound_payment.failed' - | 'treasury.outbound_payment.posted' - | 'treasury.outbound_payment.returned' - | 'treasury.outbound_transfer.canceled' - | 'treasury.outbound_transfer.created' - | 'treasury.outbound_transfer.expected_arrival_date_updated' - | 'treasury.outbound_transfer.failed' - | 'treasury.outbound_transfer.posted' - | 'treasury.outbound_transfer.returned' - | 'treasury.received_credit.created' - | 'treasury.received_credit.failed' - | 'treasury.received_credit.succeeded' - | 'treasury.received_debit.created'; - } - - interface WebhookEndpointRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface WebhookEndpointUpdateParams { - /** - * An optional description of what the webhook is used for. - */ - description?: string; - - /** - * Disable the webhook endpoint if set to true. - */ - disabled?: boolean; - - /** - * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. - */ - enabled_events?: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * The URL of the webhook endpoint. - */ - url?: string; - } - - namespace WebhookEndpointUpdateParams { - type EnabledEvent = - | '*' - | 'account.application.authorized' - | 'account.application.deauthorized' - | 'account.external_account.created' - | 'account.external_account.deleted' - | 'account.external_account.updated' - | 'account.updated' - | 'application_fee.created' - | 'application_fee.refund.updated' - | 'application_fee.refunded' - | 'balance.available' - | 'billing_portal.configuration.created' - | 'billing_portal.configuration.updated' - | 'billing_portal.session.created' - | 'capability.updated' - | 'cash_balance.funds_available' - | 'charge.captured' - | 'charge.dispute.closed' - | 'charge.dispute.created' - | 'charge.dispute.funds_reinstated' - | 'charge.dispute.funds_withdrawn' - | 'charge.dispute.updated' - | 'charge.expired' - | 'charge.failed' - | 'charge.pending' - | 'charge.refund.updated' - | 'charge.refunded' - | 'charge.succeeded' - | 'charge.updated' - | 'checkout.session.async_payment_failed' - | 'checkout.session.async_payment_succeeded' - | 'checkout.session.completed' - | 'checkout.session.expired' - | 'coupon.created' - | 'coupon.deleted' - | 'coupon.updated' - | 'credit_note.created' - | 'credit_note.updated' - | 'credit_note.voided' - | 'customer.created' - | 'customer.deleted' - | 'customer.discount.created' - | 'customer.discount.deleted' - | 'customer.discount.updated' - | 'customer.source.created' - | 'customer.source.deleted' - | 'customer.source.expiring' - | 'customer.source.updated' - | 'customer.subscription.created' - | 'customer.subscription.deleted' - | 'customer.subscription.pending_update_applied' - | 'customer.subscription.pending_update_expired' - | 'customer.subscription.trial_will_end' - | 'customer.subscription.updated' - | 'customer.tax_id.created' - | 'customer.tax_id.deleted' - | 'customer.tax_id.updated' - | 'customer.updated' - | 'customer_cash_balance_transaction.created' - | 'file.created' - | 'financial_connections.account.created' - | 'financial_connections.account.deactivated' - | 'financial_connections.account.disconnected' - | 'financial_connections.account.reactivated' - | 'financial_connections.account.refreshed_balance' - | 'identity.verification_session.canceled' - | 'identity.verification_session.created' - | 'identity.verification_session.processing' - | 'identity.verification_session.redacted' - | 'identity.verification_session.requires_input' - | 'identity.verification_session.verified' - | 'invoice.created' - | 'invoice.deleted' - | 'invoice.finalization_failed' - | 'invoice.finalized' - | 'invoice.marked_uncollectible' - | 'invoice.paid' - | 'invoice.payment_action_required' - | 'invoice.payment_failed' - | 'invoice.payment_succeeded' - | 'invoice.sent' - | 'invoice.upcoming' - | 'invoice.updated' - | 'invoice.voided' - | 'invoiceitem.created' - | 'invoiceitem.deleted' - | 'invoiceitem.updated' - | 'issuing_authorization.created' - | 'issuing_authorization.request' - | 'issuing_authorization.updated' - | 'issuing_card.created' - | 'issuing_card.updated' - | 'issuing_cardholder.created' - | 'issuing_cardholder.updated' - | 'issuing_dispute.closed' - | 'issuing_dispute.created' - | 'issuing_dispute.funds_reinstated' - | 'issuing_dispute.submitted' - | 'issuing_dispute.updated' - | 'issuing_transaction.created' - | 'issuing_transaction.updated' - | 'mandate.updated' - | 'order.created' - | 'payment_intent.amount_capturable_updated' - | 'payment_intent.canceled' - | 'payment_intent.created' - | 'payment_intent.partially_funded' - | 'payment_intent.payment_failed' - | 'payment_intent.processing' - | 'payment_intent.requires_action' - | 'payment_intent.succeeded' - | 'payment_link.created' - | 'payment_link.updated' - | 'payment_method.attached' - | 'payment_method.automatically_updated' - | 'payment_method.detached' - | 'payment_method.updated' - | 'payout.canceled' - | 'payout.created' - | 'payout.failed' - | 'payout.paid' - | 'payout.updated' - | 'person.created' - | 'person.deleted' - | 'person.updated' - | 'plan.created' - | 'plan.deleted' - | 'plan.updated' - | 'price.created' - | 'price.deleted' - | 'price.updated' - | 'product.created' - | 'product.deleted' - | 'product.updated' - | 'promotion_code.created' - | 'promotion_code.updated' - | 'quote.accepted' - | 'quote.canceled' - | 'quote.created' - | 'quote.finalized' - | 'radar.early_fraud_warning.created' - | 'radar.early_fraud_warning.updated' - | 'recipient.created' - | 'recipient.deleted' - | 'recipient.updated' - | 'reporting.report_run.failed' - | 'reporting.report_run.succeeded' - | 'reporting.report_type.updated' - | 'review.closed' - | 'review.opened' - | 'setup_intent.canceled' - | 'setup_intent.created' - | 'setup_intent.requires_action' - | 'setup_intent.setup_failed' - | 'setup_intent.succeeded' - | 'sigma.scheduled_query_run.created' - | 'sku.created' - | 'sku.deleted' - | 'sku.updated' - | 'source.canceled' - | 'source.chargeable' - | 'source.failed' - | 'source.mandate_notification' - | 'source.refund_attributes_required' - | 'source.transaction.created' - | 'source.transaction.updated' - | 'subscription_schedule.aborted' - | 'subscription_schedule.canceled' - | 'subscription_schedule.completed' - | 'subscription_schedule.created' - | 'subscription_schedule.expiring' - | 'subscription_schedule.released' - | 'subscription_schedule.updated' - | 'tax_rate.created' - | 'tax_rate.updated' - | 'terminal.reader.action_failed' - | 'terminal.reader.action_succeeded' - | 'test_helpers.test_clock.advancing' - | 'test_helpers.test_clock.created' - | 'test_helpers.test_clock.deleted' - | 'test_helpers.test_clock.internal_failure' - | 'test_helpers.test_clock.ready' - | 'topup.canceled' - | 'topup.created' - | 'topup.failed' - | 'topup.reversed' - | 'topup.succeeded' - | 'transfer.created' - | 'transfer.reversed' - | 'transfer.updated' - | 'treasury.credit_reversal.created' - | 'treasury.credit_reversal.posted' - | 'treasury.debit_reversal.completed' - | 'treasury.debit_reversal.created' - | 'treasury.debit_reversal.initial_credit_granted' - | 'treasury.financial_account.closed' - | 'treasury.financial_account.created' - | 'treasury.financial_account.features_status_updated' - | 'treasury.inbound_transfer.canceled' - | 'treasury.inbound_transfer.created' - | 'treasury.inbound_transfer.failed' - | 'treasury.inbound_transfer.succeeded' - | 'treasury.outbound_payment.canceled' - | 'treasury.outbound_payment.created' - | 'treasury.outbound_payment.expected_arrival_date_updated' - | 'treasury.outbound_payment.failed' - | 'treasury.outbound_payment.posted' - | 'treasury.outbound_payment.returned' - | 'treasury.outbound_transfer.canceled' - | 'treasury.outbound_transfer.created' - | 'treasury.outbound_transfer.expected_arrival_date_updated' - | 'treasury.outbound_transfer.failed' - | 'treasury.outbound_transfer.posted' - | 'treasury.outbound_transfer.returned' - | 'treasury.received_credit.created' - | 'treasury.received_credit.failed' - | 'treasury.received_credit.succeeded' - | 'treasury.received_debit.created'; - } - - interface WebhookEndpointListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface WebhookEndpointDeleteParams {} - - class WebhookEndpointsResource { - /** - * A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. - */ - create( - params: WebhookEndpointCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the webhook endpoint with the given ID. - */ - retrieve( - id: string, - params?: WebhookEndpointRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. - */ - update( - id: string, - params?: WebhookEndpointUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your webhook endpoints. - */ - list( - params?: WebhookEndpointListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. - */ - del( - id: string, - params?: WebhookEndpointDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/2022-11-15/WebhookEndpointsResource.d.ts b/types/2022-11-15/WebhookEndpointsResource.d.ts new file mode 100644 index 0000000000..183f2604a9 --- /dev/null +++ b/types/2022-11-15/WebhookEndpointsResource.d.ts @@ -0,0 +1,688 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface WebhookEndpointCreateParams { + /** + * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. + */ + enabled_events: Array; + + /** + * The URL of the webhook endpoint. + */ + url: string; + + /** + * Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. + */ + api_version?: WebhookEndpointCreateParams.ApiVersion; + + /** + * Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. + */ + connect?: boolean; + + /** + * An optional description of what the webhook is used for. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + namespace WebhookEndpointCreateParams { + type ApiVersion = + | '2011-01-01' + | '2011-06-21' + | '2011-06-28' + | '2011-08-01' + | '2011-09-15' + | '2011-11-17' + | '2012-02-23' + | '2012-03-25' + | '2012-06-18' + | '2012-06-28' + | '2012-07-09' + | '2012-09-24' + | '2012-10-26' + | '2012-11-07' + | '2013-02-11' + | '2013-02-13' + | '2013-07-05' + | '2013-08-12' + | '2013-08-13' + | '2013-10-29' + | '2013-12-03' + | '2014-01-31' + | '2014-03-13' + | '2014-03-28' + | '2014-05-19' + | '2014-06-13' + | '2014-06-17' + | '2014-07-22' + | '2014-07-26' + | '2014-08-04' + | '2014-08-20' + | '2014-09-08' + | '2014-10-07' + | '2014-11-05' + | '2014-11-20' + | '2014-12-08' + | '2014-12-17' + | '2014-12-22' + | '2015-01-11' + | '2015-01-26' + | '2015-02-10' + | '2015-02-16' + | '2015-02-18' + | '2015-03-24' + | '2015-04-07' + | '2015-06-15' + | '2015-07-07' + | '2015-07-13' + | '2015-07-28' + | '2015-08-07' + | '2015-08-19' + | '2015-09-03' + | '2015-09-08' + | '2015-09-23' + | '2015-10-01' + | '2015-10-12' + | '2015-10-16' + | '2016-02-03' + | '2016-02-19' + | '2016-02-22' + | '2016-02-23' + | '2016-02-29' + | '2016-03-07' + | '2016-06-15' + | '2016-07-06' + | '2016-10-19' + | '2017-01-27' + | '2017-02-14' + | '2017-04-06' + | '2017-05-25' + | '2017-06-05' + | '2017-08-15' + | '2017-12-14' + | '2018-01-23' + | '2018-02-05' + | '2018-02-06' + | '2018-02-28' + | '2018-05-21' + | '2018-07-27' + | '2018-08-23' + | '2018-09-06' + | '2018-09-24' + | '2018-10-31' + | '2018-11-08' + | '2019-02-11' + | '2019-02-19' + | '2019-03-14' + | '2019-05-16' + | '2019-08-14' + | '2019-09-09' + | '2019-10-08' + | '2019-10-17' + | '2019-11-05' + | '2019-12-03' + | '2020-03-02' + | '2020-08-27' + | '2022-08-01' + | '2022-11-15'; + + type EnabledEvent = + | '*' + | 'account.application.authorized' + | 'account.application.deauthorized' + | 'account.external_account.created' + | 'account.external_account.deleted' + | 'account.external_account.updated' + | 'account.updated' + | 'application_fee.created' + | 'application_fee.refund.updated' + | 'application_fee.refunded' + | 'balance.available' + | 'billing_portal.configuration.created' + | 'billing_portal.configuration.updated' + | 'billing_portal.session.created' + | 'capability.updated' + | 'cash_balance.funds_available' + | 'charge.captured' + | 'charge.dispute.closed' + | 'charge.dispute.created' + | 'charge.dispute.funds_reinstated' + | 'charge.dispute.funds_withdrawn' + | 'charge.dispute.updated' + | 'charge.expired' + | 'charge.failed' + | 'charge.pending' + | 'charge.refund.updated' + | 'charge.refunded' + | 'charge.succeeded' + | 'charge.updated' + | 'checkout.session.async_payment_failed' + | 'checkout.session.async_payment_succeeded' + | 'checkout.session.completed' + | 'checkout.session.expired' + | 'coupon.created' + | 'coupon.deleted' + | 'coupon.updated' + | 'credit_note.created' + | 'credit_note.updated' + | 'credit_note.voided' + | 'customer.created' + | 'customer.deleted' + | 'customer.discount.created' + | 'customer.discount.deleted' + | 'customer.discount.updated' + | 'customer.source.created' + | 'customer.source.deleted' + | 'customer.source.expiring' + | 'customer.source.updated' + | 'customer.subscription.created' + | 'customer.subscription.deleted' + | 'customer.subscription.pending_update_applied' + | 'customer.subscription.pending_update_expired' + | 'customer.subscription.trial_will_end' + | 'customer.subscription.updated' + | 'customer.tax_id.created' + | 'customer.tax_id.deleted' + | 'customer.tax_id.updated' + | 'customer.updated' + | 'customer_cash_balance_transaction.created' + | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' + | 'identity.verification_session.canceled' + | 'identity.verification_session.created' + | 'identity.verification_session.processing' + | 'identity.verification_session.redacted' + | 'identity.verification_session.requires_input' + | 'identity.verification_session.verified' + | 'invoice.created' + | 'invoice.deleted' + | 'invoice.finalization_failed' + | 'invoice.finalized' + | 'invoice.marked_uncollectible' + | 'invoice.paid' + | 'invoice.payment_action_required' + | 'invoice.payment_failed' + | 'invoice.payment_succeeded' + | 'invoice.sent' + | 'invoice.upcoming' + | 'invoice.updated' + | 'invoice.voided' + | 'invoiceitem.created' + | 'invoiceitem.deleted' + | 'invoiceitem.updated' + | 'issuing_authorization.created' + | 'issuing_authorization.request' + | 'issuing_authorization.updated' + | 'issuing_card.created' + | 'issuing_card.updated' + | 'issuing_cardholder.created' + | 'issuing_cardholder.updated' + | 'issuing_dispute.closed' + | 'issuing_dispute.created' + | 'issuing_dispute.funds_reinstated' + | 'issuing_dispute.submitted' + | 'issuing_dispute.updated' + | 'issuing_transaction.created' + | 'issuing_transaction.updated' + | 'mandate.updated' + | 'order.created' + | 'payment_intent.amount_capturable_updated' + | 'payment_intent.canceled' + | 'payment_intent.created' + | 'payment_intent.partially_funded' + | 'payment_intent.payment_failed' + | 'payment_intent.processing' + | 'payment_intent.requires_action' + | 'payment_intent.succeeded' + | 'payment_link.created' + | 'payment_link.updated' + | 'payment_method.attached' + | 'payment_method.automatically_updated' + | 'payment_method.detached' + | 'payment_method.updated' + | 'payout.canceled' + | 'payout.created' + | 'payout.failed' + | 'payout.paid' + | 'payout.updated' + | 'person.created' + | 'person.deleted' + | 'person.updated' + | 'plan.created' + | 'plan.deleted' + | 'plan.updated' + | 'price.created' + | 'price.deleted' + | 'price.updated' + | 'product.created' + | 'product.deleted' + | 'product.updated' + | 'promotion_code.created' + | 'promotion_code.updated' + | 'quote.accepted' + | 'quote.canceled' + | 'quote.created' + | 'quote.finalized' + | 'radar.early_fraud_warning.created' + | 'radar.early_fraud_warning.updated' + | 'recipient.created' + | 'recipient.deleted' + | 'recipient.updated' + | 'reporting.report_run.failed' + | 'reporting.report_run.succeeded' + | 'reporting.report_type.updated' + | 'review.closed' + | 'review.opened' + | 'setup_intent.canceled' + | 'setup_intent.created' + | 'setup_intent.requires_action' + | 'setup_intent.setup_failed' + | 'setup_intent.succeeded' + | 'sigma.scheduled_query_run.created' + | 'sku.created' + | 'sku.deleted' + | 'sku.updated' + | 'source.canceled' + | 'source.chargeable' + | 'source.failed' + | 'source.mandate_notification' + | 'source.refund_attributes_required' + | 'source.transaction.created' + | 'source.transaction.updated' + | 'subscription_schedule.aborted' + | 'subscription_schedule.canceled' + | 'subscription_schedule.completed' + | 'subscription_schedule.created' + | 'subscription_schedule.expiring' + | 'subscription_schedule.released' + | 'subscription_schedule.updated' + | 'tax_rate.created' + | 'tax_rate.updated' + | 'terminal.reader.action_failed' + | 'terminal.reader.action_succeeded' + | 'test_helpers.test_clock.advancing' + | 'test_helpers.test_clock.created' + | 'test_helpers.test_clock.deleted' + | 'test_helpers.test_clock.internal_failure' + | 'test_helpers.test_clock.ready' + | 'topup.canceled' + | 'topup.created' + | 'topup.failed' + | 'topup.reversed' + | 'topup.succeeded' + | 'transfer.created' + | 'transfer.reversed' + | 'transfer.updated' + | 'treasury.credit_reversal.created' + | 'treasury.credit_reversal.posted' + | 'treasury.debit_reversal.completed' + | 'treasury.debit_reversal.created' + | 'treasury.debit_reversal.initial_credit_granted' + | 'treasury.financial_account.closed' + | 'treasury.financial_account.created' + | 'treasury.financial_account.features_status_updated' + | 'treasury.inbound_transfer.canceled' + | 'treasury.inbound_transfer.created' + | 'treasury.inbound_transfer.failed' + | 'treasury.inbound_transfer.succeeded' + | 'treasury.outbound_payment.canceled' + | 'treasury.outbound_payment.created' + | 'treasury.outbound_payment.expected_arrival_date_updated' + | 'treasury.outbound_payment.failed' + | 'treasury.outbound_payment.posted' + | 'treasury.outbound_payment.returned' + | 'treasury.outbound_transfer.canceled' + | 'treasury.outbound_transfer.created' + | 'treasury.outbound_transfer.expected_arrival_date_updated' + | 'treasury.outbound_transfer.failed' + | 'treasury.outbound_transfer.posted' + | 'treasury.outbound_transfer.returned' + | 'treasury.received_credit.created' + | 'treasury.received_credit.failed' + | 'treasury.received_credit.succeeded' + | 'treasury.received_debit.created'; + } + + interface WebhookEndpointRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface WebhookEndpointUpdateParams { + /** + * An optional description of what the webhook is used for. + */ + description?: string; + + /** + * Disable the webhook endpoint if set to true. + */ + disabled?: boolean; + + /** + * The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. + */ + enabled_events?: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * The URL of the webhook endpoint. + */ + url?: string; + } + + namespace WebhookEndpointUpdateParams { + type EnabledEvent = + | '*' + | 'account.application.authorized' + | 'account.application.deauthorized' + | 'account.external_account.created' + | 'account.external_account.deleted' + | 'account.external_account.updated' + | 'account.updated' + | 'application_fee.created' + | 'application_fee.refund.updated' + | 'application_fee.refunded' + | 'balance.available' + | 'billing_portal.configuration.created' + | 'billing_portal.configuration.updated' + | 'billing_portal.session.created' + | 'capability.updated' + | 'cash_balance.funds_available' + | 'charge.captured' + | 'charge.dispute.closed' + | 'charge.dispute.created' + | 'charge.dispute.funds_reinstated' + | 'charge.dispute.funds_withdrawn' + | 'charge.dispute.updated' + | 'charge.expired' + | 'charge.failed' + | 'charge.pending' + | 'charge.refund.updated' + | 'charge.refunded' + | 'charge.succeeded' + | 'charge.updated' + | 'checkout.session.async_payment_failed' + | 'checkout.session.async_payment_succeeded' + | 'checkout.session.completed' + | 'checkout.session.expired' + | 'coupon.created' + | 'coupon.deleted' + | 'coupon.updated' + | 'credit_note.created' + | 'credit_note.updated' + | 'credit_note.voided' + | 'customer.created' + | 'customer.deleted' + | 'customer.discount.created' + | 'customer.discount.deleted' + | 'customer.discount.updated' + | 'customer.source.created' + | 'customer.source.deleted' + | 'customer.source.expiring' + | 'customer.source.updated' + | 'customer.subscription.created' + | 'customer.subscription.deleted' + | 'customer.subscription.pending_update_applied' + | 'customer.subscription.pending_update_expired' + | 'customer.subscription.trial_will_end' + | 'customer.subscription.updated' + | 'customer.tax_id.created' + | 'customer.tax_id.deleted' + | 'customer.tax_id.updated' + | 'customer.updated' + | 'customer_cash_balance_transaction.created' + | 'file.created' + | 'financial_connections.account.created' + | 'financial_connections.account.deactivated' + | 'financial_connections.account.disconnected' + | 'financial_connections.account.reactivated' + | 'financial_connections.account.refreshed_balance' + | 'identity.verification_session.canceled' + | 'identity.verification_session.created' + | 'identity.verification_session.processing' + | 'identity.verification_session.redacted' + | 'identity.verification_session.requires_input' + | 'identity.verification_session.verified' + | 'invoice.created' + | 'invoice.deleted' + | 'invoice.finalization_failed' + | 'invoice.finalized' + | 'invoice.marked_uncollectible' + | 'invoice.paid' + | 'invoice.payment_action_required' + | 'invoice.payment_failed' + | 'invoice.payment_succeeded' + | 'invoice.sent' + | 'invoice.upcoming' + | 'invoice.updated' + | 'invoice.voided' + | 'invoiceitem.created' + | 'invoiceitem.deleted' + | 'invoiceitem.updated' + | 'issuing_authorization.created' + | 'issuing_authorization.request' + | 'issuing_authorization.updated' + | 'issuing_card.created' + | 'issuing_card.updated' + | 'issuing_cardholder.created' + | 'issuing_cardholder.updated' + | 'issuing_dispute.closed' + | 'issuing_dispute.created' + | 'issuing_dispute.funds_reinstated' + | 'issuing_dispute.submitted' + | 'issuing_dispute.updated' + | 'issuing_transaction.created' + | 'issuing_transaction.updated' + | 'mandate.updated' + | 'order.created' + | 'payment_intent.amount_capturable_updated' + | 'payment_intent.canceled' + | 'payment_intent.created' + | 'payment_intent.partially_funded' + | 'payment_intent.payment_failed' + | 'payment_intent.processing' + | 'payment_intent.requires_action' + | 'payment_intent.succeeded' + | 'payment_link.created' + | 'payment_link.updated' + | 'payment_method.attached' + | 'payment_method.automatically_updated' + | 'payment_method.detached' + | 'payment_method.updated' + | 'payout.canceled' + | 'payout.created' + | 'payout.failed' + | 'payout.paid' + | 'payout.updated' + | 'person.created' + | 'person.deleted' + | 'person.updated' + | 'plan.created' + | 'plan.deleted' + | 'plan.updated' + | 'price.created' + | 'price.deleted' + | 'price.updated' + | 'product.created' + | 'product.deleted' + | 'product.updated' + | 'promotion_code.created' + | 'promotion_code.updated' + | 'quote.accepted' + | 'quote.canceled' + | 'quote.created' + | 'quote.finalized' + | 'radar.early_fraud_warning.created' + | 'radar.early_fraud_warning.updated' + | 'recipient.created' + | 'recipient.deleted' + | 'recipient.updated' + | 'reporting.report_run.failed' + | 'reporting.report_run.succeeded' + | 'reporting.report_type.updated' + | 'review.closed' + | 'review.opened' + | 'setup_intent.canceled' + | 'setup_intent.created' + | 'setup_intent.requires_action' + | 'setup_intent.setup_failed' + | 'setup_intent.succeeded' + | 'sigma.scheduled_query_run.created' + | 'sku.created' + | 'sku.deleted' + | 'sku.updated' + | 'source.canceled' + | 'source.chargeable' + | 'source.failed' + | 'source.mandate_notification' + | 'source.refund_attributes_required' + | 'source.transaction.created' + | 'source.transaction.updated' + | 'subscription_schedule.aborted' + | 'subscription_schedule.canceled' + | 'subscription_schedule.completed' + | 'subscription_schedule.created' + | 'subscription_schedule.expiring' + | 'subscription_schedule.released' + | 'subscription_schedule.updated' + | 'tax_rate.created' + | 'tax_rate.updated' + | 'terminal.reader.action_failed' + | 'terminal.reader.action_succeeded' + | 'test_helpers.test_clock.advancing' + | 'test_helpers.test_clock.created' + | 'test_helpers.test_clock.deleted' + | 'test_helpers.test_clock.internal_failure' + | 'test_helpers.test_clock.ready' + | 'topup.canceled' + | 'topup.created' + | 'topup.failed' + | 'topup.reversed' + | 'topup.succeeded' + | 'transfer.created' + | 'transfer.reversed' + | 'transfer.updated' + | 'treasury.credit_reversal.created' + | 'treasury.credit_reversal.posted' + | 'treasury.debit_reversal.completed' + | 'treasury.debit_reversal.created' + | 'treasury.debit_reversal.initial_credit_granted' + | 'treasury.financial_account.closed' + | 'treasury.financial_account.created' + | 'treasury.financial_account.features_status_updated' + | 'treasury.inbound_transfer.canceled' + | 'treasury.inbound_transfer.created' + | 'treasury.inbound_transfer.failed' + | 'treasury.inbound_transfer.succeeded' + | 'treasury.outbound_payment.canceled' + | 'treasury.outbound_payment.created' + | 'treasury.outbound_payment.expected_arrival_date_updated' + | 'treasury.outbound_payment.failed' + | 'treasury.outbound_payment.posted' + | 'treasury.outbound_payment.returned' + | 'treasury.outbound_transfer.canceled' + | 'treasury.outbound_transfer.created' + | 'treasury.outbound_transfer.expected_arrival_date_updated' + | 'treasury.outbound_transfer.failed' + | 'treasury.outbound_transfer.posted' + | 'treasury.outbound_transfer.returned' + | 'treasury.received_credit.created' + | 'treasury.received_credit.failed' + | 'treasury.received_credit.succeeded' + | 'treasury.received_debit.created'; + } + + interface WebhookEndpointListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface WebhookEndpointDeleteParams {} + + class WebhookEndpointsResource { + /** + * A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. + */ + create( + params: WebhookEndpointCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the webhook endpoint with the given ID. + */ + retrieve( + id: string, + params?: WebhookEndpointRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. + */ + update( + id: string, + params?: WebhookEndpointUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your webhook endpoints. + */ + list( + params?: WebhookEndpointListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + */ + del( + id: string, + params?: WebhookEndpointDeleteParams, + options?: RequestOptions + ): Promise>; + del( + id: string, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/2022-11-15/index.d.ts b/types/2022-11-15/index.d.ts index d53f23723c..c9c6d21137 100644 --- a/types/2022-11-15/index.d.ts +++ b/types/2022-11-15/index.d.ts @@ -7,6 +7,110 @@ /// /// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -30,14 +134,12 @@ /// /// /// -/// /// /// /// /// /// /// -/// /// /// /// @@ -96,16 +198,7 @@ /// /// /// -/// -/// -/// -/// /// -/// -/// -/// -/// -/// /// /// /// From 219796d9ff06dca095b9021ca8adb3640bc01645 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 23 Nov 2022 11:08:41 -0800 Subject: [PATCH 09/23] Move child resource method params next to method declarations (#1626) --- types/2022-11-15/AccountsResource.d.ts | 739 ++++++++++++++++++ types/2022-11-15/ApplicationFeesResource.d.ts | 43 + types/2022-11-15/BankAccountsResource.d.ts | 5 - types/2022-11-15/CapabilitiesResource.d.ts | 31 - types/2022-11-15/CardsResource.d.ts | 5 - types/2022-11-15/CashBalancesResource.d.ts | 37 - .../CreditNoteLineItemsResource.d.ts | 12 - types/2022-11-15/CreditNotesResource.d.ts | 7 + .../CustomerBalanceTransactionsResource.d.ts | 63 -- ...stomerCashBalanceTransactionsResource.d.ts | 20 - types/2022-11-15/CustomerSourcesResource.d.ts | 157 ---- types/2022-11-15/CustomersResource.d.ts | 345 ++++++++ .../2022-11-15/ExternalAccountsResource.d.ts | 134 ---- types/2022-11-15/FeeRefundsResource.d.ts | 48 -- .../2022-11-15/InvoiceLineItemsResource.d.ts | 12 - types/2022-11-15/InvoicesResource.d.ts | 7 + types/2022-11-15/LoginLinksResource.d.ts | 12 - types/2022-11-15/PersonsResource.d.ts | 582 -------------- .../2022-11-15/SubscriptionItemsResource.d.ts | 33 + types/2022-11-15/TaxIdsResource.d.ts | 93 --- .../2022-11-15/TransferReversalsResource.d.ts | 58 -- types/2022-11-15/TransfersResource.d.ts | 53 ++ .../UsageRecordSummariesResource.d.ts | 12 - types/2022-11-15/UsageRecordsResource.d.ts | 31 - types/2022-11-15/index.d.ts | 81 +- 25 files changed, 1259 insertions(+), 1361 deletions(-) delete mode 100644 types/2022-11-15/BankAccountsResource.d.ts delete mode 100644 types/2022-11-15/CapabilitiesResource.d.ts delete mode 100644 types/2022-11-15/CardsResource.d.ts delete mode 100644 types/2022-11-15/CashBalancesResource.d.ts delete mode 100644 types/2022-11-15/CreditNoteLineItemsResource.d.ts delete mode 100644 types/2022-11-15/CustomerBalanceTransactionsResource.d.ts delete mode 100644 types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts delete mode 100644 types/2022-11-15/CustomerSourcesResource.d.ts delete mode 100644 types/2022-11-15/ExternalAccountsResource.d.ts delete mode 100644 types/2022-11-15/FeeRefundsResource.d.ts delete mode 100644 types/2022-11-15/InvoiceLineItemsResource.d.ts delete mode 100644 types/2022-11-15/LoginLinksResource.d.ts delete mode 100644 types/2022-11-15/PersonsResource.d.ts delete mode 100644 types/2022-11-15/TaxIdsResource.d.ts delete mode 100644 types/2022-11-15/TransferReversalsResource.d.ts delete mode 100644 types/2022-11-15/UsageRecordSummariesResource.d.ts delete mode 100644 types/2022-11-15/UsageRecordsResource.d.ts diff --git a/types/2022-11-15/AccountsResource.d.ts b/types/2022-11-15/AccountsResource.d.ts index 952dfbe459..5f287942fa 100644 --- a/types/2022-11-15/AccountsResource.d.ts +++ b/types/2022-11-15/AccountsResource.d.ts @@ -2419,6 +2419,745 @@ declare module 'stripe' { expand?: Array; } + interface CapabilityRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CapabilityUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface CapabilityListParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ExternalAccountCreateParams { + /** + * Please refer to full [documentation](https://stripe.com/docs/api) instead. + */ + external_account: string; + + /** + * When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. + */ + default_for_currency?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + interface ExternalAccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface ExternalAccountUpdateParams { + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name?: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type?: Stripe.Emptyable< + ExternalAccountUpdateParams.AccountHolderType + >; + + /** + * The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + */ + account_type?: ExternalAccountUpdateParams.AccountType; + + /** + * City/District/Suburb/Town/Village. + */ + address_city?: string; + + /** + * Billing address country, if provided when creating card. + */ + address_country?: string; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + address_line1?: string; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + address_line2?: string; + + /** + * State/County/Province/Region. + */ + address_state?: string; + + /** + * ZIP or postal code. + */ + address_zip?: string; + + /** + * When set to true, this becomes the default external account for its currency. + */ + default_for_currency?: boolean; + + /** + * Two digit number representing the card's expiration month. + */ + exp_month?: string; + + /** + * Four digit number representing the card's expiration year. + */ + exp_year?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Cardholder name. + */ + name?: string; + } + + namespace ExternalAccountUpdateParams { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'futsu' | 'savings' | 'toza'; + } + + interface ExternalAccountListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + object?: ExternalAccountListParams.Object; + } + + namespace ExternalAccountListParams { + type Object = 'bank_account' | 'card'; + } + + interface ExternalAccountDeleteParams {} + + interface LoginLinkCreateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PersonCreateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonCreateParams.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonCreateParams.Relationship; + + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: PersonCreateParams.Verification; + } + + namespace PersonCreateParams { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Documents { + /** + * One or more documents that demonstrate proof that this person is authorized to represent the company. + */ + company_authorization?: Documents.CompanyAuthorization; + + /** + * One or more documents showing the person's passport page with photo and personal data. + */ + passport?: Documents.Passport; + + /** + * One or more documents showing the person's visa required for living in the country where they are residing. + */ + visa?: Documents.Visa; + } + + namespace Documents { + interface CompanyAuthorization { + /** + * 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; + } + + interface Passport { + /** + * 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; + } + + interface Visa { + /** + * 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; + } + } + + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface PersonRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PersonUpdateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonUpdateParams.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonUpdateParams.Relationship; + + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: PersonUpdateParams.Verification; + } + + namespace PersonUpdateParams { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + interface Documents { + /** + * One or more documents that demonstrate proof that this person is authorized to represent the company. + */ + company_authorization?: Documents.CompanyAuthorization; + + /** + * One or more documents showing the person's passport page with photo and personal data. + */ + passport?: Documents.Passport; + + /** + * One or more documents showing the person's visa required for living in the country where they are residing. + */ + visa?: Documents.Visa; + } + + namespace Documents { + interface CompanyAuthorization { + /** + * 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; + } + + interface Passport { + /** + * 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; + } + + interface Visa { + /** + * 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; + } + } + + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + interface PersonListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filters on the list of people returned based on the person's relationship to the account's company. + */ + relationship?: PersonListParams.Relationship; + } + + namespace PersonListParams { + interface Relationship { + /** + * A filter on the list of people returned based on whether these people are directors of the account's company. + */ + director?: boolean; + + /** + * A filter on the list of people returned based on whether these people are executives of the account's company. + */ + executive?: boolean; + + /** + * A filter on the list of people returned based on whether these people are owners of the account's company. + */ + owner?: boolean; + + /** + * A filter on the list of people returned based on whether these people are the representative of the account's company. + */ + representative?: boolean; + } + } + + interface PersonDeleteParams {} + class AccountsResource { /** * With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. diff --git a/types/2022-11-15/ApplicationFeesResource.d.ts b/types/2022-11-15/ApplicationFeesResource.d.ts index 8ca36dd61c..3216e6a8c9 100644 --- a/types/2022-11-15/ApplicationFeesResource.d.ts +++ b/types/2022-11-15/ApplicationFeesResource.d.ts @@ -23,6 +23,49 @@ declare module 'stripe' { expand?: Array; } + interface FeeRefundCreateParams { + /** + * A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. + */ + amount?: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + } + + interface FeeRefundRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FeeRefundUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface FeeRefundListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class ApplicationFeesResource { /** * Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. diff --git a/types/2022-11-15/BankAccountsResource.d.ts b/types/2022-11-15/BankAccountsResource.d.ts deleted file mode 100644 index f5652f6bdc..0000000000 --- a/types/2022-11-15/BankAccountsResource.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe {} -} diff --git a/types/2022-11-15/CapabilitiesResource.d.ts b/types/2022-11-15/CapabilitiesResource.d.ts deleted file mode 100644 index 73202bce6e..0000000000 --- a/types/2022-11-15/CapabilitiesResource.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CapabilityRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CapabilityUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - - interface CapabilityListParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/CardsResource.d.ts b/types/2022-11-15/CardsResource.d.ts deleted file mode 100644 index f5652f6bdc..0000000000 --- a/types/2022-11-15/CardsResource.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe {} -} diff --git a/types/2022-11-15/CashBalancesResource.d.ts b/types/2022-11-15/CashBalancesResource.d.ts deleted file mode 100644 index 1f9b55fbd4..0000000000 --- a/types/2022-11-15/CashBalancesResource.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CashBalanceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CashBalanceUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A hash of settings for this cash balance. - */ - settings?: CashBalanceUpdateParams.Settings; - } - - namespace CashBalanceUpdateParams { - interface Settings { - /** - * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - */ - reconciliation_mode?: Settings.ReconciliationMode; - } - - namespace Settings { - type ReconciliationMode = 'automatic' | 'manual'; - } - } - } -} diff --git a/types/2022-11-15/CreditNoteLineItemsResource.d.ts b/types/2022-11-15/CreditNoteLineItemsResource.d.ts deleted file mode 100644 index 0f209bc927..0000000000 --- a/types/2022-11-15/CreditNoteLineItemsResource.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CreditNoteLineItemListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/CreditNotesResource.d.ts b/types/2022-11-15/CreditNotesResource.d.ts index 3b7e9de4b1..1f629f8099 100644 --- a/types/2022-11-15/CreditNotesResource.d.ts +++ b/types/2022-11-15/CreditNotesResource.d.ts @@ -383,6 +383,13 @@ declare module 'stripe' { expand?: Array; } + interface CreditNoteLineItemListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class CreditNotesResource { /** * Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces diff --git a/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts b/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts deleted file mode 100644 index f75d8d3b4a..0000000000 --- a/types/2022-11-15/CustomerBalanceTransactionsResource.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CustomerBalanceTransactionCreateParams { - /** - * The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. - */ - amount: 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. - */ - currency: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface CustomerBalanceTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerBalanceTransactionUpdateParams { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface CustomerBalanceTransactionListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts b/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts deleted file mode 100644 index 1a0d654d63..0000000000 --- a/types/2022-11-15/CustomerCashBalanceTransactionsResource.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CustomerCashBalanceTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerCashBalanceTransactionListParams - extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/CustomerSourcesResource.d.ts b/types/2022-11-15/CustomerSourcesResource.d.ts deleted file mode 100644 index d0bd884645..0000000000 --- a/types/2022-11-15/CustomerSourcesResource.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface CustomerSourceCreateParams { - /** - * Please refer to full [documentation](https://stripe.com/docs/api) instead. - */ - source: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - validate?: boolean; - } - - interface CustomerSourceRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerSourceUpdateParams { - /** - * The name of the person or business that owns the bank account. - */ - account_holder_name?: string; - - /** - * The type of entity that holds the account. This can be either `individual` or `company`. - */ - account_holder_type?: CustomerSourceUpdateParams.AccountHolderType; - - /** - * City/District/Suburb/Town/Village. - */ - address_city?: string; - - /** - * Billing address country, if provided when creating card. - */ - address_country?: string; - - /** - * Address line 1 (Street address/PO Box/Company name). - */ - address_line1?: string; - - /** - * Address line 2 (Apartment/Suite/Unit/Building). - */ - address_line2?: string; - - /** - * State/County/Province/Region. - */ - address_state?: string; - - /** - * ZIP or postal code. - */ - address_zip?: string; - - /** - * Two digit number representing the card's expiration month. - */ - exp_month?: string; - - /** - * Four digit number representing the card's expiration year. - */ - exp_year?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Cardholder name. - */ - name?: string; - - owner?: CustomerSourceUpdateParams.Owner; - } - - namespace CustomerSourceUpdateParams { - type AccountHolderType = 'company' | 'individual'; - - interface Owner { - /** - * Owner's address. - */ - address?: Stripe.AddressParam; - - /** - * Owner's email address. - */ - email?: string; - - /** - * Owner's full name. - */ - name?: string; - - /** - * Owner's phone number. - */ - phone?: string; - } - } - - interface CustomerSourceListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Filter sources according to a particular object type. - */ - object?: string; - } - - interface CustomerSourceDeleteParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CustomerSourceVerifyParams { - /** - * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. - */ - amounts?: Array; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/CustomersResource.d.ts b/types/2022-11-15/CustomersResource.d.ts index a740acd0d8..6682545a4b 100644 --- a/types/2022-11-15/CustomersResource.d.ts +++ b/types/2022-11-15/CustomersResource.d.ts @@ -636,6 +636,351 @@ declare module 'stripe' { page?: string; } + interface CashBalanceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CashBalanceUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A hash of settings for this cash balance. + */ + settings?: CashBalanceUpdateParams.Settings; + } + + namespace CashBalanceUpdateParams { + interface Settings { + /** + * Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + */ + reconciliation_mode?: Settings.ReconciliationMode; + } + + namespace Settings { + type ReconciliationMode = 'automatic' | 'manual'; + } + } + + interface CustomerBalanceTransactionCreateParams { + /** + * The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. + */ + amount: 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface CustomerBalanceTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerBalanceTransactionUpdateParams { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface CustomerBalanceTransactionListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerCashBalanceTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerCashBalanceTransactionListParams + extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerSourceCreateParams { + /** + * Please refer to full [documentation](https://stripe.com/docs/api) instead. + */ + source: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + validate?: boolean; + } + + interface CustomerSourceRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerSourceUpdateParams { + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name?: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type?: CustomerSourceUpdateParams.AccountHolderType; + + /** + * City/District/Suburb/Town/Village. + */ + address_city?: string; + + /** + * Billing address country, if provided when creating card. + */ + address_country?: string; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + address_line1?: string; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + address_line2?: string; + + /** + * State/County/Province/Region. + */ + address_state?: string; + + /** + * ZIP or postal code. + */ + address_zip?: string; + + /** + * Two digit number representing the card's expiration month. + */ + exp_month?: string; + + /** + * Four digit number representing the card's expiration year. + */ + exp_year?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Cardholder name. + */ + name?: string; + + owner?: CustomerSourceUpdateParams.Owner; + } + + namespace CustomerSourceUpdateParams { + type AccountHolderType = 'company' | 'individual'; + + interface Owner { + /** + * Owner's address. + */ + address?: Stripe.AddressParam; + + /** + * Owner's email address. + */ + email?: string; + + /** + * Owner's full name. + */ + name?: string; + + /** + * Owner's phone number. + */ + phone?: string; + } + } + + interface CustomerSourceListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Filter sources according to a particular object type. + */ + object?: string; + } + + interface CustomerSourceDeleteParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CustomerSourceVerifyParams { + /** + * Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxIdCreateParams { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxIdCreateParams.Type; + + /** + * Value of the tax ID. + */ + value: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + namespace TaxIdCreateParams { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + + interface TaxIdRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxIdListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TaxIdDeleteParams {} + class CustomersResource { /** * Creates a new customer object. diff --git a/types/2022-11-15/ExternalAccountsResource.d.ts b/types/2022-11-15/ExternalAccountsResource.d.ts deleted file mode 100644 index 0e851a8f31..0000000000 --- a/types/2022-11-15/ExternalAccountsResource.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface ExternalAccountCreateParams { - /** - * Please refer to full [documentation](https://stripe.com/docs/api) instead. - */ - external_account: string; - - /** - * When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. - */ - default_for_currency?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - interface ExternalAccountRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface ExternalAccountUpdateParams { - /** - * The name of the person or business that owns the bank account. - */ - account_holder_name?: string; - - /** - * The type of entity that holds the account. This can be either `individual` or `company`. - */ - account_holder_type?: Stripe.Emptyable< - ExternalAccountUpdateParams.AccountHolderType - >; - - /** - * The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. - */ - account_type?: ExternalAccountUpdateParams.AccountType; - - /** - * City/District/Suburb/Town/Village. - */ - address_city?: string; - - /** - * Billing address country, if provided when creating card. - */ - address_country?: string; - - /** - * Address line 1 (Street address/PO Box/Company name). - */ - address_line1?: string; - - /** - * Address line 2 (Apartment/Suite/Unit/Building). - */ - address_line2?: string; - - /** - * State/County/Province/Region. - */ - address_state?: string; - - /** - * ZIP or postal code. - */ - address_zip?: string; - - /** - * When set to true, this becomes the default external account for its currency. - */ - default_for_currency?: boolean; - - /** - * Two digit number representing the card's expiration month. - */ - exp_month?: string; - - /** - * Four digit number representing the card's expiration year. - */ - exp_year?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Cardholder name. - */ - name?: string; - } - - namespace ExternalAccountUpdateParams { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'futsu' | 'savings' | 'toza'; - } - - interface ExternalAccountListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - object?: ExternalAccountListParams.Object; - } - - namespace ExternalAccountListParams { - type Object = 'bank_account' | 'card'; - } - - interface ExternalAccountDeleteParams {} - } -} diff --git a/types/2022-11-15/FeeRefundsResource.d.ts b/types/2022-11-15/FeeRefundsResource.d.ts deleted file mode 100644 index c5c821686d..0000000000 --- a/types/2022-11-15/FeeRefundsResource.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface FeeRefundCreateParams { - /** - * A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. - */ - amount?: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - } - - interface FeeRefundRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FeeRefundUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface FeeRefundListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/InvoiceLineItemsResource.d.ts b/types/2022-11-15/InvoiceLineItemsResource.d.ts deleted file mode 100644 index 81a33104f5..0000000000 --- a/types/2022-11-15/InvoiceLineItemsResource.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface InvoiceLineItemListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/InvoicesResource.d.ts b/types/2022-11-15/InvoicesResource.d.ts index 36f85deda9..0764464bc3 100644 --- a/types/2022-11-15/InvoicesResource.d.ts +++ b/types/2022-11-15/InvoicesResource.d.ts @@ -2040,6 +2040,13 @@ declare module 'stripe' { expand?: Array; } + interface InvoiceLineItemListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class InvoicesResource { /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. diff --git a/types/2022-11-15/LoginLinksResource.d.ts b/types/2022-11-15/LoginLinksResource.d.ts deleted file mode 100644 index 3d676d3f02..0000000000 --- a/types/2022-11-15/LoginLinksResource.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface LoginLinkCreateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/PersonsResource.d.ts b/types/2022-11-15/PersonsResource.d.ts deleted file mode 100644 index 244afa0fa2..0000000000 --- a/types/2022-11-15/PersonsResource.d.ts +++ /dev/null @@ -1,582 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface PersonCreateParams { - /** - * The person's address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the person's address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the person's address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The person's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: PersonCreateParams.Documents; - - /** - * The person's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The person's first name. - */ - first_name?: string; - - /** - * The Kana variation of the person's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the person's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the person is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The person's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The person's last name. - */ - last_name?: string; - - /** - * The Kana variation of the person's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the person's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The person's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - */ - nationality?: string; - - /** - * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. - */ - person_token?: string; - - /** - * The person's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: string; - - /** - * The person's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The relationship that this person has with the account's legal entity. - */ - relationship?: PersonCreateParams.Relationship; - - /** - * The last four digits of the person's Social Security number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The person's verification status. - */ - verification?: PersonCreateParams.Verification; - } - - namespace PersonCreateParams { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Documents { - /** - * One or more documents that demonstrate proof that this person is authorized to represent the company. - */ - company_authorization?: Documents.CompanyAuthorization; - - /** - * One or more documents showing the person's passport page with photo and personal data. - */ - passport?: Documents.Passport; - - /** - * One or more documents showing the person's visa required for living in the country where they are residing. - */ - visa?: Documents.Visa; - } - - namespace Documents { - interface CompanyAuthorization { - /** - * 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; - } - - interface Passport { - /** - * 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; - } - - interface Visa { - /** - * 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; - } - } - - interface Relationship { - /** - * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - */ - director?: boolean; - - /** - * Whether the person has significant responsibility to control, manage, or direct the organization. - */ - executive?: boolean; - - /** - * Whether the person is an owner of the account's legal entity. - */ - owner?: boolean; - - /** - * The percent owned by the person of the account's legal entity. - */ - percent_ownership?: Stripe.Emptyable; - - /** - * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. - */ - representative?: boolean; - - /** - * The person's title (e.g., CEO, Support Engineer). - */ - title?: string; - } - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface PersonRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface PersonUpdateParams { - /** - * The person's address. - */ - address?: Stripe.AddressParam; - - /** - * The Kana variation of the person's address (Japan only). - */ - address_kana?: Stripe.JapanAddressParam; - - /** - * The Kanji variation of the person's address (Japan only). - */ - address_kanji?: Stripe.JapanAddressParam; - - /** - * The person's date of birth. - */ - dob?: Stripe.Emptyable; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: PersonUpdateParams.Documents; - - /** - * The person's email address. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The person's first name. - */ - first_name?: string; - - /** - * The Kana variation of the person's first name (Japan only). - */ - first_name_kana?: string; - - /** - * The Kanji variation of the person's first name (Japan only). - */ - first_name_kanji?: string; - - /** - * A list of alternate names or aliases that the person is known by. - */ - full_name_aliases?: Stripe.Emptyable>; - - /** - * The person's gender (International regulations require either "male" or "female"). - */ - gender?: string; - - /** - * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; - - /** - * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; - - /** - * The person's last name. - */ - last_name?: string; - - /** - * The Kana variation of the person's last name (Japan only). - */ - last_name_kana?: string; - - /** - * The Kanji variation of the person's last name (Japan only). - */ - last_name_kanji?: string; - - /** - * The person's maiden name. - */ - maiden_name?: 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`. - */ - metadata?: Stripe.Emptyable; - - /** - * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - */ - nationality?: string; - - /** - * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. - */ - person_token?: string; - - /** - * The person's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: string; - - /** - * The person's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The relationship that this person has with the account's legal entity. - */ - relationship?: PersonUpdateParams.Relationship; - - /** - * The last four digits of the person's Social Security number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The person's verification status. - */ - verification?: PersonUpdateParams.Verification; - } - - namespace PersonUpdateParams { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; - - /** - * The month of birth, between 1 and 12. - */ - month: number; - - /** - * The four-digit year of birth. - */ - year: number; - } - - interface Documents { - /** - * One or more documents that demonstrate proof that this person is authorized to represent the company. - */ - company_authorization?: Documents.CompanyAuthorization; - - /** - * One or more documents showing the person's passport page with photo and personal data. - */ - passport?: Documents.Passport; - - /** - * One or more documents showing the person's visa required for living in the country where they are residing. - */ - visa?: Documents.Visa; - } - - namespace Documents { - interface CompanyAuthorization { - /** - * 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; - } - - interface Passport { - /** - * 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; - } - - interface Visa { - /** - * 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; - } - } - - interface Relationship { - /** - * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - */ - director?: boolean; - - /** - * Whether the person has significant responsibility to control, manage, or direct the organization. - */ - executive?: boolean; - - /** - * Whether the person is an owner of the account's legal entity. - */ - owner?: boolean; - - /** - * The percent owned by the person of the account's legal entity. - */ - percent_ownership?: Stripe.Emptyable; - - /** - * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. - */ - representative?: boolean; - - /** - * The person's title (e.g., CEO, Support Engineer). - */ - title?: string; - } - - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; - - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } - - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface PersonListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Filters on the list of people returned based on the person's relationship to the account's company. - */ - relationship?: PersonListParams.Relationship; - } - - namespace PersonListParams { - interface Relationship { - /** - * A filter on the list of people returned based on whether these people are directors of the account's company. - */ - director?: boolean; - - /** - * A filter on the list of people returned based on whether these people are executives of the account's company. - */ - executive?: boolean; - - /** - * A filter on the list of people returned based on whether these people are owners of the account's company. - */ - owner?: boolean; - - /** - * A filter on the list of people returned based on whether these people are the representative of the account's company. - */ - representative?: boolean; - } - } - - interface PersonDeleteParams {} - } -} diff --git a/types/2022-11-15/SubscriptionItemsResource.d.ts b/types/2022-11-15/SubscriptionItemsResource.d.ts index 1f6e5a8d13..f8c89c5067 100644 --- a/types/2022-11-15/SubscriptionItemsResource.d.ts +++ b/types/2022-11-15/SubscriptionItemsResource.d.ts @@ -320,6 +320,39 @@ declare module 'stripe' { type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; } + interface UsageRecordCreateParams { + /** + * The usage quantity for the specified timestamp. + */ + quantity: number; + + /** + * Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. + */ + action?: UsageRecordCreateParams.Action; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. + */ + timestamp?: 'now' | number; + } + + namespace UsageRecordCreateParams { + type Action = 'increment' | 'set'; + } + + interface UsageRecordSummaryListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class SubscriptionItemsResource { /** * Adds a new item to an existing subscription. No existing items will be changed or replaced. diff --git a/types/2022-11-15/TaxIdsResource.d.ts b/types/2022-11-15/TaxIdsResource.d.ts deleted file mode 100644 index deb825b2c0..0000000000 --- a/types/2022-11-15/TaxIdsResource.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface TaxIdCreateParams { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxIdCreateParams.Type; - - /** - * Value of the tax ID. - */ - value: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - namespace TaxIdCreateParams { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - - interface TaxIdRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxIdListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TaxIdDeleteParams {} - } -} diff --git a/types/2022-11-15/TransferReversalsResource.d.ts b/types/2022-11-15/TransferReversalsResource.d.ts deleted file mode 100644 index c6e4c9d184..0000000000 --- a/types/2022-11-15/TransferReversalsResource.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface TransferReversalCreateParams { - /** - * A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. - */ - amount?: number; - - /** - * An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - - /** - * Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. - */ - refund_application_fee?: boolean; - } - - interface TransferReversalRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransferReversalUpdateParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TransferReversalListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/TransfersResource.d.ts b/types/2022-11-15/TransfersResource.d.ts index f50c0e646c..993822e6bc 100644 --- a/types/2022-11-15/TransfersResource.d.ts +++ b/types/2022-11-15/TransfersResource.d.ts @@ -96,6 +96,59 @@ declare module 'stripe' { transfer_group?: string; } + interface TransferReversalCreateParams { + /** + * A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. + */ + amount?: number; + + /** + * An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. + */ + refund_application_fee?: boolean; + } + + interface TransferReversalRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransferReversalUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TransferReversalListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class TransfersResource { /** * To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. diff --git a/types/2022-11-15/UsageRecordSummariesResource.d.ts b/types/2022-11-15/UsageRecordSummariesResource.d.ts deleted file mode 100644 index 92c7741a5e..0000000000 --- a/types/2022-11-15/UsageRecordSummariesResource.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface UsageRecordSummaryListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - } -} diff --git a/types/2022-11-15/UsageRecordsResource.d.ts b/types/2022-11-15/UsageRecordsResource.d.ts deleted file mode 100644 index df2a2d4bab..0000000000 --- a/types/2022-11-15/UsageRecordsResource.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - interface UsageRecordCreateParams { - /** - * The usage quantity for the specified timestamp. - */ - quantity: number; - - /** - * Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. - */ - action?: UsageRecordCreateParams.Action; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. - */ - timestamp?: 'now' | number; - } - - namespace UsageRecordCreateParams { - type Action = 'increment' | 'set'; - } - } -} diff --git a/types/2022-11-15/index.d.ts b/types/2022-11-15/index.d.ts index c9c6d21137..f62ed6fe28 100644 --- a/types/2022-11-15/index.d.ts +++ b/types/2022-11-15/index.d.ts @@ -11,65 +11,33 @@ /// /// /// -/// /// /// -/// -/// -/// -/// -/// -/// /// -/// /// /// /// -/// /// -/// -/// /// /// /// /// -/// -/// /// /// -/// -/// -/// -/// /// /// -/// -/// -/// -/// -/// -/// -/// /// /// /// /// -/// /// -/// /// /// /// /// /// -/// -/// -/// /// -/// -/// /// -/// /// /// /// @@ -78,17 +46,44 @@ /// /// /// -/// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// /// /// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// /// @@ -99,18 +94,6 @@ /// /// /// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// /// /// /// From 547d9d34d07f3dbcee131fb0a00368b09ed37741 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Wed, 23 Nov 2022 13:16:25 -0800 Subject: [PATCH 10/23] Remove API version from the path (#1625) --- package.json | 2 +- types/{2022-11-15 => }/AccountLinks.d.ts | 0 types/{2022-11-15 => }/AccountLinksResource.d.ts | 0 types/{2022-11-15 => }/Accounts.d.ts | 0 types/{2022-11-15 => }/AccountsResource.d.ts | 0 types/{2022-11-15 => }/ApplePayDomains.d.ts | 0 .../{2022-11-15 => }/ApplePayDomainsResource.d.ts | 0 types/{2022-11-15 => }/ApplicationFees.d.ts | 0 .../{2022-11-15 => }/ApplicationFeesResource.d.ts | 0 types/{2022-11-15 => }/Applications.d.ts | 0 types/{2022-11-15 => }/Apps/Secrets.d.ts | 0 types/{2022-11-15 => }/Apps/SecretsResource.d.ts | 0 types/{2022-11-15 => }/Balance.d.ts | 0 types/{2022-11-15 => }/BalanceResource.d.ts | 0 types/{2022-11-15 => }/BalanceTransactions.d.ts | 0 .../BalanceTransactionsResource.d.ts | 0 types/{2022-11-15 => }/BankAccounts.d.ts | 0 .../BillingPortal/Configurations.d.ts | 0 .../BillingPortal/ConfigurationsResource.d.ts | 0 types/{2022-11-15 => }/BillingPortal/Sessions.d.ts | 0 .../BillingPortal/SessionsResource.d.ts | 0 types/{2022-11-15 => }/Capabilities.d.ts | 0 types/{2022-11-15 => }/Cards.d.ts | 0 types/{2022-11-15 => }/CashBalances.d.ts | 0 types/{2022-11-15 => }/Charges.d.ts | 0 types/{2022-11-15 => }/ChargesResource.d.ts | 0 types/{2022-11-15 => }/Checkout/Sessions.d.ts | 0 .../Checkout/SessionsResource.d.ts | 0 .../ConnectCollectionTransfers.d.ts | 0 types/{2022-11-15 => }/CountrySpecs.d.ts | 0 types/{2022-11-15 => }/CountrySpecsResource.d.ts | 0 types/{2022-11-15 => }/Coupons.d.ts | 0 types/{2022-11-15 => }/CouponsResource.d.ts | 0 types/{2022-11-15 => }/CreditNoteLineItems.d.ts | 0 types/{2022-11-15 => }/CreditNotes.d.ts | 0 types/{2022-11-15 => }/CreditNotesResource.d.ts | 0 .../CustomerBalanceTransactions.d.ts | 0 .../CustomerCashBalanceTransactions.d.ts | 0 types/{2022-11-15 => }/Customers.d.ts | 0 types/{2022-11-15 => }/CustomersResource.d.ts | 0 types/{2022-11-15 => }/Discounts.d.ts | 0 types/{2022-11-15 => }/Disputes.d.ts | 0 types/{2022-11-15 => }/DisputesResource.d.ts | 0 types/{2022-11-15 => }/EphemeralKeys.d.ts | 0 types/{2022-11-15 => }/EphemeralKeysResource.d.ts | 0 types/{2022-11-15 => }/Events.d.ts | 0 types/{2022-11-15 => }/EventsResource.d.ts | 0 types/{2022-11-15 => }/ExchangeRates.d.ts | 0 types/{2022-11-15 => }/ExchangeRatesResource.d.ts | 0 types/{2022-11-15 => }/FeeRefunds.d.ts | 0 types/{2022-11-15 => }/FileLinks.d.ts | 0 types/{2022-11-15 => }/FileLinksResource.d.ts | 0 types/{2022-11-15 => }/Files.d.ts | 0 types/{2022-11-15 => }/FilesResource.d.ts | 0 .../FinancialConnections/AccountOwners.d.ts | 0 .../FinancialConnections/AccountOwnerships.d.ts | 0 .../FinancialConnections/Accounts.d.ts | 0 .../FinancialConnections/AccountsResource.d.ts | 0 .../FinancialConnections/Sessions.d.ts | 0 .../FinancialConnections/SessionsResource.d.ts | 0 types/{2022-11-15 => }/FundingInstructions.d.ts | 0 .../Identity/VerificationReports.d.ts | 0 .../Identity/VerificationReportsResource.d.ts | 0 .../Identity/VerificationSessions.d.ts | 0 .../Identity/VerificationSessionsResource.d.ts | 0 types/{2022-11-15 => }/InvoiceItems.d.ts | 0 types/{2022-11-15 => }/InvoiceItemsResource.d.ts | 0 types/{2022-11-15 => }/InvoiceLineItems.d.ts | 0 types/{2022-11-15 => }/Invoices.d.ts | 0 types/{2022-11-15 => }/InvoicesResource.d.ts | 0 types/{2022-11-15 => }/Issuing/Authorizations.d.ts | 0 .../Issuing/AuthorizationsResource.d.ts | 0 types/{2022-11-15 => }/Issuing/Cardholders.d.ts | 0 .../Issuing/CardholdersResource.d.ts | 0 types/{2022-11-15 => }/Issuing/Cards.d.ts | 0 types/{2022-11-15 => }/Issuing/CardsResource.d.ts | 0 types/{2022-11-15 => }/Issuing/Disputes.d.ts | 0 .../{2022-11-15 => }/Issuing/DisputesResource.d.ts | 0 types/{2022-11-15 => }/Issuing/Transactions.d.ts | 0 .../Issuing/TransactionsResource.d.ts | 0 types/{2022-11-15 => }/LineItems.d.ts | 0 types/{2022-11-15 => }/LoginLinks.d.ts | 0 types/{2022-11-15 => }/Mandates.d.ts | 0 types/{2022-11-15 => }/MandatesResource.d.ts | 0 types/{2022-11-15 => }/PaymentIntents.d.ts | 0 types/{2022-11-15 => }/PaymentIntentsResource.d.ts | 0 types/{2022-11-15 => }/PaymentLinks.d.ts | 0 types/{2022-11-15 => }/PaymentLinksResource.d.ts | 0 types/{2022-11-15 => }/PaymentMethods.d.ts | 0 types/{2022-11-15 => }/PaymentMethodsResource.d.ts | 0 types/{2022-11-15 => }/Payouts.d.ts | 0 types/{2022-11-15 => }/PayoutsResource.d.ts | 0 types/{2022-11-15 => }/Persons.d.ts | 0 types/{2022-11-15 => }/Plans.d.ts | 0 types/{2022-11-15 => }/PlansResource.d.ts | 0 types/{2022-11-15 => }/PlatformTaxFees.d.ts | 0 types/{2022-11-15 => }/Prices.d.ts | 0 types/{2022-11-15 => }/PricesResource.d.ts | 0 types/{2022-11-15 => }/Products.d.ts | 0 types/{2022-11-15 => }/ProductsResource.d.ts | 0 types/{2022-11-15 => }/PromotionCodes.d.ts | 0 types/{2022-11-15 => }/PromotionCodesResource.d.ts | 0 types/{2022-11-15 => }/Quotes.d.ts | 0 types/{2022-11-15 => }/QuotesResource.d.ts | 0 .../{2022-11-15 => }/Radar/EarlyFraudWarnings.d.ts | 0 .../Radar/EarlyFraudWarningsResource.d.ts | 0 types/{2022-11-15 => }/Radar/ValueListItems.d.ts | 0 .../Radar/ValueListItemsResource.d.ts | 0 types/{2022-11-15 => }/Radar/ValueLists.d.ts | 0 .../{2022-11-15 => }/Radar/ValueListsResource.d.ts | 0 types/{2022-11-15 => }/Refunds.d.ts | 0 types/{2022-11-15 => }/RefundsResource.d.ts | 0 types/{2022-11-15 => }/Reporting/ReportRuns.d.ts | 0 .../Reporting/ReportRunsResource.d.ts | 0 types/{2022-11-15 => }/Reporting/ReportTypes.d.ts | 0 .../Reporting/ReportTypesResource.d.ts | 0 types/{2022-11-15 => }/ReserveTransactions.d.ts | 0 types/{2022-11-15 => }/Reviews.d.ts | 0 types/{2022-11-15 => }/ReviewsResource.d.ts | 0 types/{2022-11-15 => }/SetupAttempts.d.ts | 0 types/{2022-11-15 => }/SetupAttemptsResource.d.ts | 0 types/{2022-11-15 => }/SetupIntents.d.ts | 0 types/{2022-11-15 => }/SetupIntentsResource.d.ts | 0 types/{2022-11-15 => }/ShippingRates.d.ts | 0 types/{2022-11-15 => }/ShippingRatesResource.d.ts | 0 .../{2022-11-15 => }/Sigma/ScheduledQueryRuns.d.ts | 0 .../Sigma/ScheduledQueryRunsResource.d.ts | 0 .../SourceMandateNotifications.d.ts | 0 types/{2022-11-15 => }/SourceTransactions.d.ts | 0 types/{2022-11-15 => }/Sources.d.ts | 0 types/{2022-11-15 => }/SourcesResource.d.ts | 0 types/{2022-11-15 => }/SubscriptionItems.d.ts | 0 .../SubscriptionItemsResource.d.ts | 0 types/{2022-11-15 => }/SubscriptionSchedules.d.ts | 0 .../SubscriptionSchedulesResource.d.ts | 0 types/{2022-11-15 => }/Subscriptions.d.ts | 0 types/{2022-11-15 => }/SubscriptionsResource.d.ts | 0 types/{2022-11-15 => }/TaxCodes.d.ts | 0 types/{2022-11-15 => }/TaxCodesResource.d.ts | 0 types/{2022-11-15 => }/TaxDeductedAtSources.d.ts | 0 types/{2022-11-15 => }/TaxIds.d.ts | 0 types/{2022-11-15 => }/TaxRates.d.ts | 0 types/{2022-11-15 => }/TaxRatesResource.d.ts | 0 .../{2022-11-15 => }/Terminal/Configurations.d.ts | 0 .../Terminal/ConfigurationsResource.d.ts | 0 .../Terminal/ConnectionTokens.d.ts | 0 .../Terminal/ConnectionTokensResource.d.ts | 0 types/{2022-11-15 => }/Terminal/Locations.d.ts | 0 .../Terminal/LocationsResource.d.ts | 0 types/{2022-11-15 => }/Terminal/Readers.d.ts | 0 .../{2022-11-15 => }/Terminal/ReadersResource.d.ts | 0 .../TestHelpers/CustomersResource.d.ts | 0 .../TestHelpers/Issuing/CardsResource.d.ts | 0 .../TestHelpers/RefundsResource.d.ts | 0 .../TestHelpers/Terminal/ReadersResource.d.ts | 0 types/{2022-11-15 => }/TestHelpers/TestClocks.d.ts | 0 .../TestHelpers/TestClocksResource.d.ts | 0 .../Treasury/InboundTransfersResource.d.ts | 0 .../Treasury/OutboundPaymentsResource.d.ts | 0 .../Treasury/OutboundTransfersResource.d.ts | 0 .../Treasury/ReceivedCreditsResource.d.ts | 0 .../Treasury/ReceivedDebitsResource.d.ts | 0 types/{2022-11-15 => }/Tokens.d.ts | 0 types/{2022-11-15 => }/TokensResource.d.ts | 0 types/{2022-11-15 => }/Topups.d.ts | 0 types/{2022-11-15 => }/TopupsResource.d.ts | 0 types/{2022-11-15 => }/TransferReversals.d.ts | 0 types/{2022-11-15 => }/Transfers.d.ts | 0 types/{2022-11-15 => }/TransfersResource.d.ts | 0 .../{2022-11-15 => }/Treasury/CreditReversals.d.ts | 0 .../Treasury/CreditReversalsResource.d.ts | 0 .../{2022-11-15 => }/Treasury/DebitReversals.d.ts | 0 .../Treasury/DebitReversalsResource.d.ts | 0 .../Treasury/FinancialAccountFeatures.d.ts | 0 .../Treasury/FinancialAccounts.d.ts | 0 .../Treasury/FinancialAccountsResource.d.ts | 0 .../Treasury/InboundTransfers.d.ts | 0 .../Treasury/InboundTransfersResource.d.ts | 0 .../Treasury/OutboundPayments.d.ts | 0 .../Treasury/OutboundPaymentsResource.d.ts | 0 .../Treasury/OutboundTransfers.d.ts | 0 .../Treasury/OutboundTransfersResource.d.ts | 0 .../{2022-11-15 => }/Treasury/ReceivedCredits.d.ts | 0 .../Treasury/ReceivedCreditsResource.d.ts | 0 .../{2022-11-15 => }/Treasury/ReceivedDebits.d.ts | 0 .../Treasury/ReceivedDebitsResource.d.ts | 0 .../Treasury/TransactionEntries.d.ts | 0 .../Treasury/TransactionEntriesResource.d.ts | 0 types/{2022-11-15 => }/Treasury/Transactions.d.ts | 0 .../Treasury/TransactionsResource.d.ts | 0 types/{2022-11-15 => }/UsageRecordSummaries.d.ts | 0 types/{2022-11-15 => }/UsageRecords.d.ts | 0 types/{2022-11-15 => }/WebhookEndpoints.d.ts | 0 .../{2022-11-15 => }/WebhookEndpointsResource.d.ts | 0 types/{2022-11-15 => }/index.d.ts | 14 +++++++------- types/test/typescriptTest.ts | 2 +- 196 files changed, 9 insertions(+), 9 deletions(-) rename types/{2022-11-15 => }/AccountLinks.d.ts (100%) rename types/{2022-11-15 => }/AccountLinksResource.d.ts (100%) rename types/{2022-11-15 => }/Accounts.d.ts (100%) rename types/{2022-11-15 => }/AccountsResource.d.ts (100%) rename types/{2022-11-15 => }/ApplePayDomains.d.ts (100%) rename types/{2022-11-15 => }/ApplePayDomainsResource.d.ts (100%) rename types/{2022-11-15 => }/ApplicationFees.d.ts (100%) rename types/{2022-11-15 => }/ApplicationFeesResource.d.ts (100%) rename types/{2022-11-15 => }/Applications.d.ts (100%) rename types/{2022-11-15 => }/Apps/Secrets.d.ts (100%) rename types/{2022-11-15 => }/Apps/SecretsResource.d.ts (100%) rename types/{2022-11-15 => }/Balance.d.ts (100%) rename types/{2022-11-15 => }/BalanceResource.d.ts (100%) rename types/{2022-11-15 => }/BalanceTransactions.d.ts (100%) rename types/{2022-11-15 => }/BalanceTransactionsResource.d.ts (100%) rename types/{2022-11-15 => }/BankAccounts.d.ts (100%) rename types/{2022-11-15 => }/BillingPortal/Configurations.d.ts (100%) rename types/{2022-11-15 => }/BillingPortal/ConfigurationsResource.d.ts (100%) rename types/{2022-11-15 => }/BillingPortal/Sessions.d.ts (100%) rename types/{2022-11-15 => }/BillingPortal/SessionsResource.d.ts (100%) rename types/{2022-11-15 => }/Capabilities.d.ts (100%) rename types/{2022-11-15 => }/Cards.d.ts (100%) rename types/{2022-11-15 => }/CashBalances.d.ts (100%) rename types/{2022-11-15 => }/Charges.d.ts (100%) rename types/{2022-11-15 => }/ChargesResource.d.ts (100%) rename types/{2022-11-15 => }/Checkout/Sessions.d.ts (100%) rename types/{2022-11-15 => }/Checkout/SessionsResource.d.ts (100%) rename types/{2022-11-15 => }/ConnectCollectionTransfers.d.ts (100%) rename types/{2022-11-15 => }/CountrySpecs.d.ts (100%) rename types/{2022-11-15 => }/CountrySpecsResource.d.ts (100%) rename types/{2022-11-15 => }/Coupons.d.ts (100%) rename types/{2022-11-15 => }/CouponsResource.d.ts (100%) rename types/{2022-11-15 => }/CreditNoteLineItems.d.ts (100%) rename types/{2022-11-15 => }/CreditNotes.d.ts (100%) rename types/{2022-11-15 => }/CreditNotesResource.d.ts (100%) rename types/{2022-11-15 => }/CustomerBalanceTransactions.d.ts (100%) rename types/{2022-11-15 => }/CustomerCashBalanceTransactions.d.ts (100%) rename types/{2022-11-15 => }/Customers.d.ts (100%) rename types/{2022-11-15 => }/CustomersResource.d.ts (100%) rename types/{2022-11-15 => }/Discounts.d.ts (100%) rename types/{2022-11-15 => }/Disputes.d.ts (100%) rename types/{2022-11-15 => }/DisputesResource.d.ts (100%) rename types/{2022-11-15 => }/EphemeralKeys.d.ts (100%) rename types/{2022-11-15 => }/EphemeralKeysResource.d.ts (100%) rename types/{2022-11-15 => }/Events.d.ts (100%) rename types/{2022-11-15 => }/EventsResource.d.ts (100%) rename types/{2022-11-15 => }/ExchangeRates.d.ts (100%) rename types/{2022-11-15 => }/ExchangeRatesResource.d.ts (100%) rename types/{2022-11-15 => }/FeeRefunds.d.ts (100%) rename types/{2022-11-15 => }/FileLinks.d.ts (100%) rename types/{2022-11-15 => }/FileLinksResource.d.ts (100%) rename types/{2022-11-15 => }/Files.d.ts (100%) rename types/{2022-11-15 => }/FilesResource.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/AccountOwners.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/AccountOwnerships.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/Accounts.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/AccountsResource.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/Sessions.d.ts (100%) rename types/{2022-11-15 => }/FinancialConnections/SessionsResource.d.ts (100%) rename types/{2022-11-15 => }/FundingInstructions.d.ts (100%) rename types/{2022-11-15 => }/Identity/VerificationReports.d.ts (100%) rename types/{2022-11-15 => }/Identity/VerificationReportsResource.d.ts (100%) rename types/{2022-11-15 => }/Identity/VerificationSessions.d.ts (100%) rename types/{2022-11-15 => }/Identity/VerificationSessionsResource.d.ts (100%) rename types/{2022-11-15 => }/InvoiceItems.d.ts (100%) rename types/{2022-11-15 => }/InvoiceItemsResource.d.ts (100%) rename types/{2022-11-15 => }/InvoiceLineItems.d.ts (100%) rename types/{2022-11-15 => }/Invoices.d.ts (100%) rename types/{2022-11-15 => }/InvoicesResource.d.ts (100%) rename types/{2022-11-15 => }/Issuing/Authorizations.d.ts (100%) rename types/{2022-11-15 => }/Issuing/AuthorizationsResource.d.ts (100%) rename types/{2022-11-15 => }/Issuing/Cardholders.d.ts (100%) rename types/{2022-11-15 => }/Issuing/CardholdersResource.d.ts (100%) rename types/{2022-11-15 => }/Issuing/Cards.d.ts (100%) rename types/{2022-11-15 => }/Issuing/CardsResource.d.ts (100%) rename types/{2022-11-15 => }/Issuing/Disputes.d.ts (100%) rename types/{2022-11-15 => }/Issuing/DisputesResource.d.ts (100%) rename types/{2022-11-15 => }/Issuing/Transactions.d.ts (100%) rename types/{2022-11-15 => }/Issuing/TransactionsResource.d.ts (100%) rename types/{2022-11-15 => }/LineItems.d.ts (100%) rename types/{2022-11-15 => }/LoginLinks.d.ts (100%) rename types/{2022-11-15 => }/Mandates.d.ts (100%) rename types/{2022-11-15 => }/MandatesResource.d.ts (100%) rename types/{2022-11-15 => }/PaymentIntents.d.ts (100%) rename types/{2022-11-15 => }/PaymentIntentsResource.d.ts (100%) rename types/{2022-11-15 => }/PaymentLinks.d.ts (100%) rename types/{2022-11-15 => }/PaymentLinksResource.d.ts (100%) rename types/{2022-11-15 => }/PaymentMethods.d.ts (100%) rename types/{2022-11-15 => }/PaymentMethodsResource.d.ts (100%) rename types/{2022-11-15 => }/Payouts.d.ts (100%) rename types/{2022-11-15 => }/PayoutsResource.d.ts (100%) rename types/{2022-11-15 => }/Persons.d.ts (100%) rename types/{2022-11-15 => }/Plans.d.ts (100%) rename types/{2022-11-15 => }/PlansResource.d.ts (100%) rename types/{2022-11-15 => }/PlatformTaxFees.d.ts (100%) rename types/{2022-11-15 => }/Prices.d.ts (100%) rename types/{2022-11-15 => }/PricesResource.d.ts (100%) rename types/{2022-11-15 => }/Products.d.ts (100%) rename types/{2022-11-15 => }/ProductsResource.d.ts (100%) rename types/{2022-11-15 => }/PromotionCodes.d.ts (100%) rename types/{2022-11-15 => }/PromotionCodesResource.d.ts (100%) rename types/{2022-11-15 => }/Quotes.d.ts (100%) rename types/{2022-11-15 => }/QuotesResource.d.ts (100%) rename types/{2022-11-15 => }/Radar/EarlyFraudWarnings.d.ts (100%) rename types/{2022-11-15 => }/Radar/EarlyFraudWarningsResource.d.ts (100%) rename types/{2022-11-15 => }/Radar/ValueListItems.d.ts (100%) rename types/{2022-11-15 => }/Radar/ValueListItemsResource.d.ts (100%) rename types/{2022-11-15 => }/Radar/ValueLists.d.ts (100%) rename types/{2022-11-15 => }/Radar/ValueListsResource.d.ts (100%) rename types/{2022-11-15 => }/Refunds.d.ts (100%) rename types/{2022-11-15 => }/RefundsResource.d.ts (100%) rename types/{2022-11-15 => }/Reporting/ReportRuns.d.ts (100%) rename types/{2022-11-15 => }/Reporting/ReportRunsResource.d.ts (100%) rename types/{2022-11-15 => }/Reporting/ReportTypes.d.ts (100%) rename types/{2022-11-15 => }/Reporting/ReportTypesResource.d.ts (100%) rename types/{2022-11-15 => }/ReserveTransactions.d.ts (100%) rename types/{2022-11-15 => }/Reviews.d.ts (100%) rename types/{2022-11-15 => }/ReviewsResource.d.ts (100%) rename types/{2022-11-15 => }/SetupAttempts.d.ts (100%) rename types/{2022-11-15 => }/SetupAttemptsResource.d.ts (100%) rename types/{2022-11-15 => }/SetupIntents.d.ts (100%) rename types/{2022-11-15 => }/SetupIntentsResource.d.ts (100%) rename types/{2022-11-15 => }/ShippingRates.d.ts (100%) rename types/{2022-11-15 => }/ShippingRatesResource.d.ts (100%) rename types/{2022-11-15 => }/Sigma/ScheduledQueryRuns.d.ts (100%) rename types/{2022-11-15 => }/Sigma/ScheduledQueryRunsResource.d.ts (100%) rename types/{2022-11-15 => }/SourceMandateNotifications.d.ts (100%) rename types/{2022-11-15 => }/SourceTransactions.d.ts (100%) rename types/{2022-11-15 => }/Sources.d.ts (100%) rename types/{2022-11-15 => }/SourcesResource.d.ts (100%) rename types/{2022-11-15 => }/SubscriptionItems.d.ts (100%) rename types/{2022-11-15 => }/SubscriptionItemsResource.d.ts (100%) rename types/{2022-11-15 => }/SubscriptionSchedules.d.ts (100%) rename types/{2022-11-15 => }/SubscriptionSchedulesResource.d.ts (100%) rename types/{2022-11-15 => }/Subscriptions.d.ts (100%) rename types/{2022-11-15 => }/SubscriptionsResource.d.ts (100%) rename types/{2022-11-15 => }/TaxCodes.d.ts (100%) rename types/{2022-11-15 => }/TaxCodesResource.d.ts (100%) rename types/{2022-11-15 => }/TaxDeductedAtSources.d.ts (100%) rename types/{2022-11-15 => }/TaxIds.d.ts (100%) rename types/{2022-11-15 => }/TaxRates.d.ts (100%) rename types/{2022-11-15 => }/TaxRatesResource.d.ts (100%) rename types/{2022-11-15 => }/Terminal/Configurations.d.ts (100%) rename types/{2022-11-15 => }/Terminal/ConfigurationsResource.d.ts (100%) rename types/{2022-11-15 => }/Terminal/ConnectionTokens.d.ts (100%) rename types/{2022-11-15 => }/Terminal/ConnectionTokensResource.d.ts (100%) rename types/{2022-11-15 => }/Terminal/Locations.d.ts (100%) rename types/{2022-11-15 => }/Terminal/LocationsResource.d.ts (100%) rename types/{2022-11-15 => }/Terminal/Readers.d.ts (100%) rename types/{2022-11-15 => }/Terminal/ReadersResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/CustomersResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Issuing/CardsResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/RefundsResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Terminal/ReadersResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/TestClocks.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/TestClocksResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Treasury/InboundTransfersResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Treasury/OutboundPaymentsResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Treasury/OutboundTransfersResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Treasury/ReceivedCreditsResource.d.ts (100%) rename types/{2022-11-15 => }/TestHelpers/Treasury/ReceivedDebitsResource.d.ts (100%) rename types/{2022-11-15 => }/Tokens.d.ts (100%) rename types/{2022-11-15 => }/TokensResource.d.ts (100%) rename types/{2022-11-15 => }/Topups.d.ts (100%) rename types/{2022-11-15 => }/TopupsResource.d.ts (100%) rename types/{2022-11-15 => }/TransferReversals.d.ts (100%) rename types/{2022-11-15 => }/Transfers.d.ts (100%) rename types/{2022-11-15 => }/TransfersResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/CreditReversals.d.ts (100%) rename types/{2022-11-15 => }/Treasury/CreditReversalsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/DebitReversals.d.ts (100%) rename types/{2022-11-15 => }/Treasury/DebitReversalsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/FinancialAccountFeatures.d.ts (100%) rename types/{2022-11-15 => }/Treasury/FinancialAccounts.d.ts (100%) rename types/{2022-11-15 => }/Treasury/FinancialAccountsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/InboundTransfers.d.ts (100%) rename types/{2022-11-15 => }/Treasury/InboundTransfersResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/OutboundPayments.d.ts (100%) rename types/{2022-11-15 => }/Treasury/OutboundPaymentsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/OutboundTransfers.d.ts (100%) rename types/{2022-11-15 => }/Treasury/OutboundTransfersResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/ReceivedCredits.d.ts (100%) rename types/{2022-11-15 => }/Treasury/ReceivedCreditsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/ReceivedDebits.d.ts (100%) rename types/{2022-11-15 => }/Treasury/ReceivedDebitsResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/TransactionEntries.d.ts (100%) rename types/{2022-11-15 => }/Treasury/TransactionEntriesResource.d.ts (100%) rename types/{2022-11-15 => }/Treasury/Transactions.d.ts (100%) rename types/{2022-11-15 => }/Treasury/TransactionsResource.d.ts (100%) rename types/{2022-11-15 => }/UsageRecordSummaries.d.ts (100%) rename types/{2022-11-15 => }/UsageRecords.d.ts (100%) rename types/{2022-11-15 => }/WebhookEndpoints.d.ts (100%) rename types/{2022-11-15 => }/WebhookEndpointsResource.d.ts (100%) rename types/{2022-11-15 => }/index.d.ts (98%) diff --git a/package.json b/package.json index b303c839f6..0ec6c5a08b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "node": ">=12.*" }, "main": "lib/stripe.js", - "types": "types/2022-11-15/index.d.ts", + "types": "types/index.d.ts", "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", diff --git a/types/2022-11-15/AccountLinks.d.ts b/types/AccountLinks.d.ts similarity index 100% rename from types/2022-11-15/AccountLinks.d.ts rename to types/AccountLinks.d.ts diff --git a/types/2022-11-15/AccountLinksResource.d.ts b/types/AccountLinksResource.d.ts similarity index 100% rename from types/2022-11-15/AccountLinksResource.d.ts rename to types/AccountLinksResource.d.ts diff --git a/types/2022-11-15/Accounts.d.ts b/types/Accounts.d.ts similarity index 100% rename from types/2022-11-15/Accounts.d.ts rename to types/Accounts.d.ts diff --git a/types/2022-11-15/AccountsResource.d.ts b/types/AccountsResource.d.ts similarity index 100% rename from types/2022-11-15/AccountsResource.d.ts rename to types/AccountsResource.d.ts diff --git a/types/2022-11-15/ApplePayDomains.d.ts b/types/ApplePayDomains.d.ts similarity index 100% rename from types/2022-11-15/ApplePayDomains.d.ts rename to types/ApplePayDomains.d.ts diff --git a/types/2022-11-15/ApplePayDomainsResource.d.ts b/types/ApplePayDomainsResource.d.ts similarity index 100% rename from types/2022-11-15/ApplePayDomainsResource.d.ts rename to types/ApplePayDomainsResource.d.ts diff --git a/types/2022-11-15/ApplicationFees.d.ts b/types/ApplicationFees.d.ts similarity index 100% rename from types/2022-11-15/ApplicationFees.d.ts rename to types/ApplicationFees.d.ts diff --git a/types/2022-11-15/ApplicationFeesResource.d.ts b/types/ApplicationFeesResource.d.ts similarity index 100% rename from types/2022-11-15/ApplicationFeesResource.d.ts rename to types/ApplicationFeesResource.d.ts diff --git a/types/2022-11-15/Applications.d.ts b/types/Applications.d.ts similarity index 100% rename from types/2022-11-15/Applications.d.ts rename to types/Applications.d.ts diff --git a/types/2022-11-15/Apps/Secrets.d.ts b/types/Apps/Secrets.d.ts similarity index 100% rename from types/2022-11-15/Apps/Secrets.d.ts rename to types/Apps/Secrets.d.ts diff --git a/types/2022-11-15/Apps/SecretsResource.d.ts b/types/Apps/SecretsResource.d.ts similarity index 100% rename from types/2022-11-15/Apps/SecretsResource.d.ts rename to types/Apps/SecretsResource.d.ts diff --git a/types/2022-11-15/Balance.d.ts b/types/Balance.d.ts similarity index 100% rename from types/2022-11-15/Balance.d.ts rename to types/Balance.d.ts diff --git a/types/2022-11-15/BalanceResource.d.ts b/types/BalanceResource.d.ts similarity index 100% rename from types/2022-11-15/BalanceResource.d.ts rename to types/BalanceResource.d.ts diff --git a/types/2022-11-15/BalanceTransactions.d.ts b/types/BalanceTransactions.d.ts similarity index 100% rename from types/2022-11-15/BalanceTransactions.d.ts rename to types/BalanceTransactions.d.ts diff --git a/types/2022-11-15/BalanceTransactionsResource.d.ts b/types/BalanceTransactionsResource.d.ts similarity index 100% rename from types/2022-11-15/BalanceTransactionsResource.d.ts rename to types/BalanceTransactionsResource.d.ts diff --git a/types/2022-11-15/BankAccounts.d.ts b/types/BankAccounts.d.ts similarity index 100% rename from types/2022-11-15/BankAccounts.d.ts rename to types/BankAccounts.d.ts diff --git a/types/2022-11-15/BillingPortal/Configurations.d.ts b/types/BillingPortal/Configurations.d.ts similarity index 100% rename from types/2022-11-15/BillingPortal/Configurations.d.ts rename to types/BillingPortal/Configurations.d.ts diff --git a/types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts b/types/BillingPortal/ConfigurationsResource.d.ts similarity index 100% rename from types/2022-11-15/BillingPortal/ConfigurationsResource.d.ts rename to types/BillingPortal/ConfigurationsResource.d.ts diff --git a/types/2022-11-15/BillingPortal/Sessions.d.ts b/types/BillingPortal/Sessions.d.ts similarity index 100% rename from types/2022-11-15/BillingPortal/Sessions.d.ts rename to types/BillingPortal/Sessions.d.ts diff --git a/types/2022-11-15/BillingPortal/SessionsResource.d.ts b/types/BillingPortal/SessionsResource.d.ts similarity index 100% rename from types/2022-11-15/BillingPortal/SessionsResource.d.ts rename to types/BillingPortal/SessionsResource.d.ts diff --git a/types/2022-11-15/Capabilities.d.ts b/types/Capabilities.d.ts similarity index 100% rename from types/2022-11-15/Capabilities.d.ts rename to types/Capabilities.d.ts diff --git a/types/2022-11-15/Cards.d.ts b/types/Cards.d.ts similarity index 100% rename from types/2022-11-15/Cards.d.ts rename to types/Cards.d.ts diff --git a/types/2022-11-15/CashBalances.d.ts b/types/CashBalances.d.ts similarity index 100% rename from types/2022-11-15/CashBalances.d.ts rename to types/CashBalances.d.ts diff --git a/types/2022-11-15/Charges.d.ts b/types/Charges.d.ts similarity index 100% rename from types/2022-11-15/Charges.d.ts rename to types/Charges.d.ts diff --git a/types/2022-11-15/ChargesResource.d.ts b/types/ChargesResource.d.ts similarity index 100% rename from types/2022-11-15/ChargesResource.d.ts rename to types/ChargesResource.d.ts diff --git a/types/2022-11-15/Checkout/Sessions.d.ts b/types/Checkout/Sessions.d.ts similarity index 100% rename from types/2022-11-15/Checkout/Sessions.d.ts rename to types/Checkout/Sessions.d.ts diff --git a/types/2022-11-15/Checkout/SessionsResource.d.ts b/types/Checkout/SessionsResource.d.ts similarity index 100% rename from types/2022-11-15/Checkout/SessionsResource.d.ts rename to types/Checkout/SessionsResource.d.ts diff --git a/types/2022-11-15/ConnectCollectionTransfers.d.ts b/types/ConnectCollectionTransfers.d.ts similarity index 100% rename from types/2022-11-15/ConnectCollectionTransfers.d.ts rename to types/ConnectCollectionTransfers.d.ts diff --git a/types/2022-11-15/CountrySpecs.d.ts b/types/CountrySpecs.d.ts similarity index 100% rename from types/2022-11-15/CountrySpecs.d.ts rename to types/CountrySpecs.d.ts diff --git a/types/2022-11-15/CountrySpecsResource.d.ts b/types/CountrySpecsResource.d.ts similarity index 100% rename from types/2022-11-15/CountrySpecsResource.d.ts rename to types/CountrySpecsResource.d.ts diff --git a/types/2022-11-15/Coupons.d.ts b/types/Coupons.d.ts similarity index 100% rename from types/2022-11-15/Coupons.d.ts rename to types/Coupons.d.ts diff --git a/types/2022-11-15/CouponsResource.d.ts b/types/CouponsResource.d.ts similarity index 100% rename from types/2022-11-15/CouponsResource.d.ts rename to types/CouponsResource.d.ts diff --git a/types/2022-11-15/CreditNoteLineItems.d.ts b/types/CreditNoteLineItems.d.ts similarity index 100% rename from types/2022-11-15/CreditNoteLineItems.d.ts rename to types/CreditNoteLineItems.d.ts diff --git a/types/2022-11-15/CreditNotes.d.ts b/types/CreditNotes.d.ts similarity index 100% rename from types/2022-11-15/CreditNotes.d.ts rename to types/CreditNotes.d.ts diff --git a/types/2022-11-15/CreditNotesResource.d.ts b/types/CreditNotesResource.d.ts similarity index 100% rename from types/2022-11-15/CreditNotesResource.d.ts rename to types/CreditNotesResource.d.ts diff --git a/types/2022-11-15/CustomerBalanceTransactions.d.ts b/types/CustomerBalanceTransactions.d.ts similarity index 100% rename from types/2022-11-15/CustomerBalanceTransactions.d.ts rename to types/CustomerBalanceTransactions.d.ts diff --git a/types/2022-11-15/CustomerCashBalanceTransactions.d.ts b/types/CustomerCashBalanceTransactions.d.ts similarity index 100% rename from types/2022-11-15/CustomerCashBalanceTransactions.d.ts rename to types/CustomerCashBalanceTransactions.d.ts diff --git a/types/2022-11-15/Customers.d.ts b/types/Customers.d.ts similarity index 100% rename from types/2022-11-15/Customers.d.ts rename to types/Customers.d.ts diff --git a/types/2022-11-15/CustomersResource.d.ts b/types/CustomersResource.d.ts similarity index 100% rename from types/2022-11-15/CustomersResource.d.ts rename to types/CustomersResource.d.ts diff --git a/types/2022-11-15/Discounts.d.ts b/types/Discounts.d.ts similarity index 100% rename from types/2022-11-15/Discounts.d.ts rename to types/Discounts.d.ts diff --git a/types/2022-11-15/Disputes.d.ts b/types/Disputes.d.ts similarity index 100% rename from types/2022-11-15/Disputes.d.ts rename to types/Disputes.d.ts diff --git a/types/2022-11-15/DisputesResource.d.ts b/types/DisputesResource.d.ts similarity index 100% rename from types/2022-11-15/DisputesResource.d.ts rename to types/DisputesResource.d.ts diff --git a/types/2022-11-15/EphemeralKeys.d.ts b/types/EphemeralKeys.d.ts similarity index 100% rename from types/2022-11-15/EphemeralKeys.d.ts rename to types/EphemeralKeys.d.ts diff --git a/types/2022-11-15/EphemeralKeysResource.d.ts b/types/EphemeralKeysResource.d.ts similarity index 100% rename from types/2022-11-15/EphemeralKeysResource.d.ts rename to types/EphemeralKeysResource.d.ts diff --git a/types/2022-11-15/Events.d.ts b/types/Events.d.ts similarity index 100% rename from types/2022-11-15/Events.d.ts rename to types/Events.d.ts diff --git a/types/2022-11-15/EventsResource.d.ts b/types/EventsResource.d.ts similarity index 100% rename from types/2022-11-15/EventsResource.d.ts rename to types/EventsResource.d.ts diff --git a/types/2022-11-15/ExchangeRates.d.ts b/types/ExchangeRates.d.ts similarity index 100% rename from types/2022-11-15/ExchangeRates.d.ts rename to types/ExchangeRates.d.ts diff --git a/types/2022-11-15/ExchangeRatesResource.d.ts b/types/ExchangeRatesResource.d.ts similarity index 100% rename from types/2022-11-15/ExchangeRatesResource.d.ts rename to types/ExchangeRatesResource.d.ts diff --git a/types/2022-11-15/FeeRefunds.d.ts b/types/FeeRefunds.d.ts similarity index 100% rename from types/2022-11-15/FeeRefunds.d.ts rename to types/FeeRefunds.d.ts diff --git a/types/2022-11-15/FileLinks.d.ts b/types/FileLinks.d.ts similarity index 100% rename from types/2022-11-15/FileLinks.d.ts rename to types/FileLinks.d.ts diff --git a/types/2022-11-15/FileLinksResource.d.ts b/types/FileLinksResource.d.ts similarity index 100% rename from types/2022-11-15/FileLinksResource.d.ts rename to types/FileLinksResource.d.ts diff --git a/types/2022-11-15/Files.d.ts b/types/Files.d.ts similarity index 100% rename from types/2022-11-15/Files.d.ts rename to types/Files.d.ts diff --git a/types/2022-11-15/FilesResource.d.ts b/types/FilesResource.d.ts similarity index 100% rename from types/2022-11-15/FilesResource.d.ts rename to types/FilesResource.d.ts diff --git a/types/2022-11-15/FinancialConnections/AccountOwners.d.ts b/types/FinancialConnections/AccountOwners.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/AccountOwners.d.ts rename to types/FinancialConnections/AccountOwners.d.ts diff --git a/types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts b/types/FinancialConnections/AccountOwnerships.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts rename to types/FinancialConnections/AccountOwnerships.d.ts diff --git a/types/2022-11-15/FinancialConnections/Accounts.d.ts b/types/FinancialConnections/Accounts.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/Accounts.d.ts rename to types/FinancialConnections/Accounts.d.ts diff --git a/types/2022-11-15/FinancialConnections/AccountsResource.d.ts b/types/FinancialConnections/AccountsResource.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/AccountsResource.d.ts rename to types/FinancialConnections/AccountsResource.d.ts diff --git a/types/2022-11-15/FinancialConnections/Sessions.d.ts b/types/FinancialConnections/Sessions.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/Sessions.d.ts rename to types/FinancialConnections/Sessions.d.ts diff --git a/types/2022-11-15/FinancialConnections/SessionsResource.d.ts b/types/FinancialConnections/SessionsResource.d.ts similarity index 100% rename from types/2022-11-15/FinancialConnections/SessionsResource.d.ts rename to types/FinancialConnections/SessionsResource.d.ts diff --git a/types/2022-11-15/FundingInstructions.d.ts b/types/FundingInstructions.d.ts similarity index 100% rename from types/2022-11-15/FundingInstructions.d.ts rename to types/FundingInstructions.d.ts diff --git a/types/2022-11-15/Identity/VerificationReports.d.ts b/types/Identity/VerificationReports.d.ts similarity index 100% rename from types/2022-11-15/Identity/VerificationReports.d.ts rename to types/Identity/VerificationReports.d.ts diff --git a/types/2022-11-15/Identity/VerificationReportsResource.d.ts b/types/Identity/VerificationReportsResource.d.ts similarity index 100% rename from types/2022-11-15/Identity/VerificationReportsResource.d.ts rename to types/Identity/VerificationReportsResource.d.ts diff --git a/types/2022-11-15/Identity/VerificationSessions.d.ts b/types/Identity/VerificationSessions.d.ts similarity index 100% rename from types/2022-11-15/Identity/VerificationSessions.d.ts rename to types/Identity/VerificationSessions.d.ts diff --git a/types/2022-11-15/Identity/VerificationSessionsResource.d.ts b/types/Identity/VerificationSessionsResource.d.ts similarity index 100% rename from types/2022-11-15/Identity/VerificationSessionsResource.d.ts rename to types/Identity/VerificationSessionsResource.d.ts diff --git a/types/2022-11-15/InvoiceItems.d.ts b/types/InvoiceItems.d.ts similarity index 100% rename from types/2022-11-15/InvoiceItems.d.ts rename to types/InvoiceItems.d.ts diff --git a/types/2022-11-15/InvoiceItemsResource.d.ts b/types/InvoiceItemsResource.d.ts similarity index 100% rename from types/2022-11-15/InvoiceItemsResource.d.ts rename to types/InvoiceItemsResource.d.ts diff --git a/types/2022-11-15/InvoiceLineItems.d.ts b/types/InvoiceLineItems.d.ts similarity index 100% rename from types/2022-11-15/InvoiceLineItems.d.ts rename to types/InvoiceLineItems.d.ts diff --git a/types/2022-11-15/Invoices.d.ts b/types/Invoices.d.ts similarity index 100% rename from types/2022-11-15/Invoices.d.ts rename to types/Invoices.d.ts diff --git a/types/2022-11-15/InvoicesResource.d.ts b/types/InvoicesResource.d.ts similarity index 100% rename from types/2022-11-15/InvoicesResource.d.ts rename to types/InvoicesResource.d.ts diff --git a/types/2022-11-15/Issuing/Authorizations.d.ts b/types/Issuing/Authorizations.d.ts similarity index 100% rename from types/2022-11-15/Issuing/Authorizations.d.ts rename to types/Issuing/Authorizations.d.ts diff --git a/types/2022-11-15/Issuing/AuthorizationsResource.d.ts b/types/Issuing/AuthorizationsResource.d.ts similarity index 100% rename from types/2022-11-15/Issuing/AuthorizationsResource.d.ts rename to types/Issuing/AuthorizationsResource.d.ts diff --git a/types/2022-11-15/Issuing/Cardholders.d.ts b/types/Issuing/Cardholders.d.ts similarity index 100% rename from types/2022-11-15/Issuing/Cardholders.d.ts rename to types/Issuing/Cardholders.d.ts diff --git a/types/2022-11-15/Issuing/CardholdersResource.d.ts b/types/Issuing/CardholdersResource.d.ts similarity index 100% rename from types/2022-11-15/Issuing/CardholdersResource.d.ts rename to types/Issuing/CardholdersResource.d.ts diff --git a/types/2022-11-15/Issuing/Cards.d.ts b/types/Issuing/Cards.d.ts similarity index 100% rename from types/2022-11-15/Issuing/Cards.d.ts rename to types/Issuing/Cards.d.ts diff --git a/types/2022-11-15/Issuing/CardsResource.d.ts b/types/Issuing/CardsResource.d.ts similarity index 100% rename from types/2022-11-15/Issuing/CardsResource.d.ts rename to types/Issuing/CardsResource.d.ts diff --git a/types/2022-11-15/Issuing/Disputes.d.ts b/types/Issuing/Disputes.d.ts similarity index 100% rename from types/2022-11-15/Issuing/Disputes.d.ts rename to types/Issuing/Disputes.d.ts diff --git a/types/2022-11-15/Issuing/DisputesResource.d.ts b/types/Issuing/DisputesResource.d.ts similarity index 100% rename from types/2022-11-15/Issuing/DisputesResource.d.ts rename to types/Issuing/DisputesResource.d.ts diff --git a/types/2022-11-15/Issuing/Transactions.d.ts b/types/Issuing/Transactions.d.ts similarity index 100% rename from types/2022-11-15/Issuing/Transactions.d.ts rename to types/Issuing/Transactions.d.ts diff --git a/types/2022-11-15/Issuing/TransactionsResource.d.ts b/types/Issuing/TransactionsResource.d.ts similarity index 100% rename from types/2022-11-15/Issuing/TransactionsResource.d.ts rename to types/Issuing/TransactionsResource.d.ts diff --git a/types/2022-11-15/LineItems.d.ts b/types/LineItems.d.ts similarity index 100% rename from types/2022-11-15/LineItems.d.ts rename to types/LineItems.d.ts diff --git a/types/2022-11-15/LoginLinks.d.ts b/types/LoginLinks.d.ts similarity index 100% rename from types/2022-11-15/LoginLinks.d.ts rename to types/LoginLinks.d.ts diff --git a/types/2022-11-15/Mandates.d.ts b/types/Mandates.d.ts similarity index 100% rename from types/2022-11-15/Mandates.d.ts rename to types/Mandates.d.ts diff --git a/types/2022-11-15/MandatesResource.d.ts b/types/MandatesResource.d.ts similarity index 100% rename from types/2022-11-15/MandatesResource.d.ts rename to types/MandatesResource.d.ts diff --git a/types/2022-11-15/PaymentIntents.d.ts b/types/PaymentIntents.d.ts similarity index 100% rename from types/2022-11-15/PaymentIntents.d.ts rename to types/PaymentIntents.d.ts diff --git a/types/2022-11-15/PaymentIntentsResource.d.ts b/types/PaymentIntentsResource.d.ts similarity index 100% rename from types/2022-11-15/PaymentIntentsResource.d.ts rename to types/PaymentIntentsResource.d.ts diff --git a/types/2022-11-15/PaymentLinks.d.ts b/types/PaymentLinks.d.ts similarity index 100% rename from types/2022-11-15/PaymentLinks.d.ts rename to types/PaymentLinks.d.ts diff --git a/types/2022-11-15/PaymentLinksResource.d.ts b/types/PaymentLinksResource.d.ts similarity index 100% rename from types/2022-11-15/PaymentLinksResource.d.ts rename to types/PaymentLinksResource.d.ts diff --git a/types/2022-11-15/PaymentMethods.d.ts b/types/PaymentMethods.d.ts similarity index 100% rename from types/2022-11-15/PaymentMethods.d.ts rename to types/PaymentMethods.d.ts diff --git a/types/2022-11-15/PaymentMethodsResource.d.ts b/types/PaymentMethodsResource.d.ts similarity index 100% rename from types/2022-11-15/PaymentMethodsResource.d.ts rename to types/PaymentMethodsResource.d.ts diff --git a/types/2022-11-15/Payouts.d.ts b/types/Payouts.d.ts similarity index 100% rename from types/2022-11-15/Payouts.d.ts rename to types/Payouts.d.ts diff --git a/types/2022-11-15/PayoutsResource.d.ts b/types/PayoutsResource.d.ts similarity index 100% rename from types/2022-11-15/PayoutsResource.d.ts rename to types/PayoutsResource.d.ts diff --git a/types/2022-11-15/Persons.d.ts b/types/Persons.d.ts similarity index 100% rename from types/2022-11-15/Persons.d.ts rename to types/Persons.d.ts diff --git a/types/2022-11-15/Plans.d.ts b/types/Plans.d.ts similarity index 100% rename from types/2022-11-15/Plans.d.ts rename to types/Plans.d.ts diff --git a/types/2022-11-15/PlansResource.d.ts b/types/PlansResource.d.ts similarity index 100% rename from types/2022-11-15/PlansResource.d.ts rename to types/PlansResource.d.ts diff --git a/types/2022-11-15/PlatformTaxFees.d.ts b/types/PlatformTaxFees.d.ts similarity index 100% rename from types/2022-11-15/PlatformTaxFees.d.ts rename to types/PlatformTaxFees.d.ts diff --git a/types/2022-11-15/Prices.d.ts b/types/Prices.d.ts similarity index 100% rename from types/2022-11-15/Prices.d.ts rename to types/Prices.d.ts diff --git a/types/2022-11-15/PricesResource.d.ts b/types/PricesResource.d.ts similarity index 100% rename from types/2022-11-15/PricesResource.d.ts rename to types/PricesResource.d.ts diff --git a/types/2022-11-15/Products.d.ts b/types/Products.d.ts similarity index 100% rename from types/2022-11-15/Products.d.ts rename to types/Products.d.ts diff --git a/types/2022-11-15/ProductsResource.d.ts b/types/ProductsResource.d.ts similarity index 100% rename from types/2022-11-15/ProductsResource.d.ts rename to types/ProductsResource.d.ts diff --git a/types/2022-11-15/PromotionCodes.d.ts b/types/PromotionCodes.d.ts similarity index 100% rename from types/2022-11-15/PromotionCodes.d.ts rename to types/PromotionCodes.d.ts diff --git a/types/2022-11-15/PromotionCodesResource.d.ts b/types/PromotionCodesResource.d.ts similarity index 100% rename from types/2022-11-15/PromotionCodesResource.d.ts rename to types/PromotionCodesResource.d.ts diff --git a/types/2022-11-15/Quotes.d.ts b/types/Quotes.d.ts similarity index 100% rename from types/2022-11-15/Quotes.d.ts rename to types/Quotes.d.ts diff --git a/types/2022-11-15/QuotesResource.d.ts b/types/QuotesResource.d.ts similarity index 100% rename from types/2022-11-15/QuotesResource.d.ts rename to types/QuotesResource.d.ts diff --git a/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts b/types/Radar/EarlyFraudWarnings.d.ts similarity index 100% rename from types/2022-11-15/Radar/EarlyFraudWarnings.d.ts rename to types/Radar/EarlyFraudWarnings.d.ts diff --git a/types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts b/types/Radar/EarlyFraudWarningsResource.d.ts similarity index 100% rename from types/2022-11-15/Radar/EarlyFraudWarningsResource.d.ts rename to types/Radar/EarlyFraudWarningsResource.d.ts diff --git a/types/2022-11-15/Radar/ValueListItems.d.ts b/types/Radar/ValueListItems.d.ts similarity index 100% rename from types/2022-11-15/Radar/ValueListItems.d.ts rename to types/Radar/ValueListItems.d.ts diff --git a/types/2022-11-15/Radar/ValueListItemsResource.d.ts b/types/Radar/ValueListItemsResource.d.ts similarity index 100% rename from types/2022-11-15/Radar/ValueListItemsResource.d.ts rename to types/Radar/ValueListItemsResource.d.ts diff --git a/types/2022-11-15/Radar/ValueLists.d.ts b/types/Radar/ValueLists.d.ts similarity index 100% rename from types/2022-11-15/Radar/ValueLists.d.ts rename to types/Radar/ValueLists.d.ts diff --git a/types/2022-11-15/Radar/ValueListsResource.d.ts b/types/Radar/ValueListsResource.d.ts similarity index 100% rename from types/2022-11-15/Radar/ValueListsResource.d.ts rename to types/Radar/ValueListsResource.d.ts diff --git a/types/2022-11-15/Refunds.d.ts b/types/Refunds.d.ts similarity index 100% rename from types/2022-11-15/Refunds.d.ts rename to types/Refunds.d.ts diff --git a/types/2022-11-15/RefundsResource.d.ts b/types/RefundsResource.d.ts similarity index 100% rename from types/2022-11-15/RefundsResource.d.ts rename to types/RefundsResource.d.ts diff --git a/types/2022-11-15/Reporting/ReportRuns.d.ts b/types/Reporting/ReportRuns.d.ts similarity index 100% rename from types/2022-11-15/Reporting/ReportRuns.d.ts rename to types/Reporting/ReportRuns.d.ts diff --git a/types/2022-11-15/Reporting/ReportRunsResource.d.ts b/types/Reporting/ReportRunsResource.d.ts similarity index 100% rename from types/2022-11-15/Reporting/ReportRunsResource.d.ts rename to types/Reporting/ReportRunsResource.d.ts diff --git a/types/2022-11-15/Reporting/ReportTypes.d.ts b/types/Reporting/ReportTypes.d.ts similarity index 100% rename from types/2022-11-15/Reporting/ReportTypes.d.ts rename to types/Reporting/ReportTypes.d.ts diff --git a/types/2022-11-15/Reporting/ReportTypesResource.d.ts b/types/Reporting/ReportTypesResource.d.ts similarity index 100% rename from types/2022-11-15/Reporting/ReportTypesResource.d.ts rename to types/Reporting/ReportTypesResource.d.ts diff --git a/types/2022-11-15/ReserveTransactions.d.ts b/types/ReserveTransactions.d.ts similarity index 100% rename from types/2022-11-15/ReserveTransactions.d.ts rename to types/ReserveTransactions.d.ts diff --git a/types/2022-11-15/Reviews.d.ts b/types/Reviews.d.ts similarity index 100% rename from types/2022-11-15/Reviews.d.ts rename to types/Reviews.d.ts diff --git a/types/2022-11-15/ReviewsResource.d.ts b/types/ReviewsResource.d.ts similarity index 100% rename from types/2022-11-15/ReviewsResource.d.ts rename to types/ReviewsResource.d.ts diff --git a/types/2022-11-15/SetupAttempts.d.ts b/types/SetupAttempts.d.ts similarity index 100% rename from types/2022-11-15/SetupAttempts.d.ts rename to types/SetupAttempts.d.ts diff --git a/types/2022-11-15/SetupAttemptsResource.d.ts b/types/SetupAttemptsResource.d.ts similarity index 100% rename from types/2022-11-15/SetupAttemptsResource.d.ts rename to types/SetupAttemptsResource.d.ts diff --git a/types/2022-11-15/SetupIntents.d.ts b/types/SetupIntents.d.ts similarity index 100% rename from types/2022-11-15/SetupIntents.d.ts rename to types/SetupIntents.d.ts diff --git a/types/2022-11-15/SetupIntentsResource.d.ts b/types/SetupIntentsResource.d.ts similarity index 100% rename from types/2022-11-15/SetupIntentsResource.d.ts rename to types/SetupIntentsResource.d.ts diff --git a/types/2022-11-15/ShippingRates.d.ts b/types/ShippingRates.d.ts similarity index 100% rename from types/2022-11-15/ShippingRates.d.ts rename to types/ShippingRates.d.ts diff --git a/types/2022-11-15/ShippingRatesResource.d.ts b/types/ShippingRatesResource.d.ts similarity index 100% rename from types/2022-11-15/ShippingRatesResource.d.ts rename to types/ShippingRatesResource.d.ts diff --git a/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts b/types/Sigma/ScheduledQueryRuns.d.ts similarity index 100% rename from types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts rename to types/Sigma/ScheduledQueryRuns.d.ts diff --git a/types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts b/types/Sigma/ScheduledQueryRunsResource.d.ts similarity index 100% rename from types/2022-11-15/Sigma/ScheduledQueryRunsResource.d.ts rename to types/Sigma/ScheduledQueryRunsResource.d.ts diff --git a/types/2022-11-15/SourceMandateNotifications.d.ts b/types/SourceMandateNotifications.d.ts similarity index 100% rename from types/2022-11-15/SourceMandateNotifications.d.ts rename to types/SourceMandateNotifications.d.ts diff --git a/types/2022-11-15/SourceTransactions.d.ts b/types/SourceTransactions.d.ts similarity index 100% rename from types/2022-11-15/SourceTransactions.d.ts rename to types/SourceTransactions.d.ts diff --git a/types/2022-11-15/Sources.d.ts b/types/Sources.d.ts similarity index 100% rename from types/2022-11-15/Sources.d.ts rename to types/Sources.d.ts diff --git a/types/2022-11-15/SourcesResource.d.ts b/types/SourcesResource.d.ts similarity index 100% rename from types/2022-11-15/SourcesResource.d.ts rename to types/SourcesResource.d.ts diff --git a/types/2022-11-15/SubscriptionItems.d.ts b/types/SubscriptionItems.d.ts similarity index 100% rename from types/2022-11-15/SubscriptionItems.d.ts rename to types/SubscriptionItems.d.ts diff --git a/types/2022-11-15/SubscriptionItemsResource.d.ts b/types/SubscriptionItemsResource.d.ts similarity index 100% rename from types/2022-11-15/SubscriptionItemsResource.d.ts rename to types/SubscriptionItemsResource.d.ts diff --git a/types/2022-11-15/SubscriptionSchedules.d.ts b/types/SubscriptionSchedules.d.ts similarity index 100% rename from types/2022-11-15/SubscriptionSchedules.d.ts rename to types/SubscriptionSchedules.d.ts diff --git a/types/2022-11-15/SubscriptionSchedulesResource.d.ts b/types/SubscriptionSchedulesResource.d.ts similarity index 100% rename from types/2022-11-15/SubscriptionSchedulesResource.d.ts rename to types/SubscriptionSchedulesResource.d.ts diff --git a/types/2022-11-15/Subscriptions.d.ts b/types/Subscriptions.d.ts similarity index 100% rename from types/2022-11-15/Subscriptions.d.ts rename to types/Subscriptions.d.ts diff --git a/types/2022-11-15/SubscriptionsResource.d.ts b/types/SubscriptionsResource.d.ts similarity index 100% rename from types/2022-11-15/SubscriptionsResource.d.ts rename to types/SubscriptionsResource.d.ts diff --git a/types/2022-11-15/TaxCodes.d.ts b/types/TaxCodes.d.ts similarity index 100% rename from types/2022-11-15/TaxCodes.d.ts rename to types/TaxCodes.d.ts diff --git a/types/2022-11-15/TaxCodesResource.d.ts b/types/TaxCodesResource.d.ts similarity index 100% rename from types/2022-11-15/TaxCodesResource.d.ts rename to types/TaxCodesResource.d.ts diff --git a/types/2022-11-15/TaxDeductedAtSources.d.ts b/types/TaxDeductedAtSources.d.ts similarity index 100% rename from types/2022-11-15/TaxDeductedAtSources.d.ts rename to types/TaxDeductedAtSources.d.ts diff --git a/types/2022-11-15/TaxIds.d.ts b/types/TaxIds.d.ts similarity index 100% rename from types/2022-11-15/TaxIds.d.ts rename to types/TaxIds.d.ts diff --git a/types/2022-11-15/TaxRates.d.ts b/types/TaxRates.d.ts similarity index 100% rename from types/2022-11-15/TaxRates.d.ts rename to types/TaxRates.d.ts diff --git a/types/2022-11-15/TaxRatesResource.d.ts b/types/TaxRatesResource.d.ts similarity index 100% rename from types/2022-11-15/TaxRatesResource.d.ts rename to types/TaxRatesResource.d.ts diff --git a/types/2022-11-15/Terminal/Configurations.d.ts b/types/Terminal/Configurations.d.ts similarity index 100% rename from types/2022-11-15/Terminal/Configurations.d.ts rename to types/Terminal/Configurations.d.ts diff --git a/types/2022-11-15/Terminal/ConfigurationsResource.d.ts b/types/Terminal/ConfigurationsResource.d.ts similarity index 100% rename from types/2022-11-15/Terminal/ConfigurationsResource.d.ts rename to types/Terminal/ConfigurationsResource.d.ts diff --git a/types/2022-11-15/Terminal/ConnectionTokens.d.ts b/types/Terminal/ConnectionTokens.d.ts similarity index 100% rename from types/2022-11-15/Terminal/ConnectionTokens.d.ts rename to types/Terminal/ConnectionTokens.d.ts diff --git a/types/2022-11-15/Terminal/ConnectionTokensResource.d.ts b/types/Terminal/ConnectionTokensResource.d.ts similarity index 100% rename from types/2022-11-15/Terminal/ConnectionTokensResource.d.ts rename to types/Terminal/ConnectionTokensResource.d.ts diff --git a/types/2022-11-15/Terminal/Locations.d.ts b/types/Terminal/Locations.d.ts similarity index 100% rename from types/2022-11-15/Terminal/Locations.d.ts rename to types/Terminal/Locations.d.ts diff --git a/types/2022-11-15/Terminal/LocationsResource.d.ts b/types/Terminal/LocationsResource.d.ts similarity index 100% rename from types/2022-11-15/Terminal/LocationsResource.d.ts rename to types/Terminal/LocationsResource.d.ts diff --git a/types/2022-11-15/Terminal/Readers.d.ts b/types/Terminal/Readers.d.ts similarity index 100% rename from types/2022-11-15/Terminal/Readers.d.ts rename to types/Terminal/Readers.d.ts diff --git a/types/2022-11-15/Terminal/ReadersResource.d.ts b/types/Terminal/ReadersResource.d.ts similarity index 100% rename from types/2022-11-15/Terminal/ReadersResource.d.ts rename to types/Terminal/ReadersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/CustomersResource.d.ts b/types/TestHelpers/CustomersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/CustomersResource.d.ts rename to types/TestHelpers/CustomersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Issuing/CardsResource.d.ts b/types/TestHelpers/Issuing/CardsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Issuing/CardsResource.d.ts rename to types/TestHelpers/Issuing/CardsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/RefundsResource.d.ts b/types/TestHelpers/RefundsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/RefundsResource.d.ts rename to types/TestHelpers/RefundsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Terminal/ReadersResource.d.ts b/types/TestHelpers/Terminal/ReadersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Terminal/ReadersResource.d.ts rename to types/TestHelpers/Terminal/ReadersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/TestClocks.d.ts b/types/TestHelpers/TestClocks.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/TestClocks.d.ts rename to types/TestHelpers/TestClocks.d.ts diff --git a/types/2022-11-15/TestHelpers/TestClocksResource.d.ts b/types/TestHelpers/TestClocksResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/TestClocksResource.d.ts rename to types/TestHelpers/TestClocksResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/InboundTransfersResource.d.ts b/types/TestHelpers/Treasury/InboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/InboundTransfersResource.d.ts rename to types/TestHelpers/Treasury/InboundTransfersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/OutboundPaymentsResource.d.ts b/types/TestHelpers/Treasury/OutboundPaymentsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/OutboundPaymentsResource.d.ts rename to types/TestHelpers/Treasury/OutboundPaymentsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/OutboundTransfersResource.d.ts b/types/TestHelpers/Treasury/OutboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/OutboundTransfersResource.d.ts rename to types/TestHelpers/Treasury/OutboundTransfersResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/ReceivedCreditsResource.d.ts b/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/ReceivedCreditsResource.d.ts rename to types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts diff --git a/types/2022-11-15/TestHelpers/Treasury/ReceivedDebitsResource.d.ts b/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts similarity index 100% rename from types/2022-11-15/TestHelpers/Treasury/ReceivedDebitsResource.d.ts rename to types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts diff --git a/types/2022-11-15/Tokens.d.ts b/types/Tokens.d.ts similarity index 100% rename from types/2022-11-15/Tokens.d.ts rename to types/Tokens.d.ts diff --git a/types/2022-11-15/TokensResource.d.ts b/types/TokensResource.d.ts similarity index 100% rename from types/2022-11-15/TokensResource.d.ts rename to types/TokensResource.d.ts diff --git a/types/2022-11-15/Topups.d.ts b/types/Topups.d.ts similarity index 100% rename from types/2022-11-15/Topups.d.ts rename to types/Topups.d.ts diff --git a/types/2022-11-15/TopupsResource.d.ts b/types/TopupsResource.d.ts similarity index 100% rename from types/2022-11-15/TopupsResource.d.ts rename to types/TopupsResource.d.ts diff --git a/types/2022-11-15/TransferReversals.d.ts b/types/TransferReversals.d.ts similarity index 100% rename from types/2022-11-15/TransferReversals.d.ts rename to types/TransferReversals.d.ts diff --git a/types/2022-11-15/Transfers.d.ts b/types/Transfers.d.ts similarity index 100% rename from types/2022-11-15/Transfers.d.ts rename to types/Transfers.d.ts diff --git a/types/2022-11-15/TransfersResource.d.ts b/types/TransfersResource.d.ts similarity index 100% rename from types/2022-11-15/TransfersResource.d.ts rename to types/TransfersResource.d.ts diff --git a/types/2022-11-15/Treasury/CreditReversals.d.ts b/types/Treasury/CreditReversals.d.ts similarity index 100% rename from types/2022-11-15/Treasury/CreditReversals.d.ts rename to types/Treasury/CreditReversals.d.ts diff --git a/types/2022-11-15/Treasury/CreditReversalsResource.d.ts b/types/Treasury/CreditReversalsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/CreditReversalsResource.d.ts rename to types/Treasury/CreditReversalsResource.d.ts diff --git a/types/2022-11-15/Treasury/DebitReversals.d.ts b/types/Treasury/DebitReversals.d.ts similarity index 100% rename from types/2022-11-15/Treasury/DebitReversals.d.ts rename to types/Treasury/DebitReversals.d.ts diff --git a/types/2022-11-15/Treasury/DebitReversalsResource.d.ts b/types/Treasury/DebitReversalsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/DebitReversalsResource.d.ts rename to types/Treasury/DebitReversalsResource.d.ts diff --git a/types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts b/types/Treasury/FinancialAccountFeatures.d.ts similarity index 100% rename from types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts rename to types/Treasury/FinancialAccountFeatures.d.ts diff --git a/types/2022-11-15/Treasury/FinancialAccounts.d.ts b/types/Treasury/FinancialAccounts.d.ts similarity index 100% rename from types/2022-11-15/Treasury/FinancialAccounts.d.ts rename to types/Treasury/FinancialAccounts.d.ts diff --git a/types/2022-11-15/Treasury/FinancialAccountsResource.d.ts b/types/Treasury/FinancialAccountsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/FinancialAccountsResource.d.ts rename to types/Treasury/FinancialAccountsResource.d.ts diff --git a/types/2022-11-15/Treasury/InboundTransfers.d.ts b/types/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2022-11-15/Treasury/InboundTransfers.d.ts rename to types/Treasury/InboundTransfers.d.ts diff --git a/types/2022-11-15/Treasury/InboundTransfersResource.d.ts b/types/Treasury/InboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/InboundTransfersResource.d.ts rename to types/Treasury/InboundTransfersResource.d.ts diff --git a/types/2022-11-15/Treasury/OutboundPayments.d.ts b/types/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2022-11-15/Treasury/OutboundPayments.d.ts rename to types/Treasury/OutboundPayments.d.ts diff --git a/types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts b/types/Treasury/OutboundPaymentsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/OutboundPaymentsResource.d.ts rename to types/Treasury/OutboundPaymentsResource.d.ts diff --git a/types/2022-11-15/Treasury/OutboundTransfers.d.ts b/types/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2022-11-15/Treasury/OutboundTransfers.d.ts rename to types/Treasury/OutboundTransfers.d.ts diff --git a/types/2022-11-15/Treasury/OutboundTransfersResource.d.ts b/types/Treasury/OutboundTransfersResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/OutboundTransfersResource.d.ts rename to types/Treasury/OutboundTransfersResource.d.ts diff --git a/types/2022-11-15/Treasury/ReceivedCredits.d.ts b/types/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2022-11-15/Treasury/ReceivedCredits.d.ts rename to types/Treasury/ReceivedCredits.d.ts diff --git a/types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts b/types/Treasury/ReceivedCreditsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/ReceivedCreditsResource.d.ts rename to types/Treasury/ReceivedCreditsResource.d.ts diff --git a/types/2022-11-15/Treasury/ReceivedDebits.d.ts b/types/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2022-11-15/Treasury/ReceivedDebits.d.ts rename to types/Treasury/ReceivedDebits.d.ts diff --git a/types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts b/types/Treasury/ReceivedDebitsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/ReceivedDebitsResource.d.ts rename to types/Treasury/ReceivedDebitsResource.d.ts diff --git a/types/2022-11-15/Treasury/TransactionEntries.d.ts b/types/Treasury/TransactionEntries.d.ts similarity index 100% rename from types/2022-11-15/Treasury/TransactionEntries.d.ts rename to types/Treasury/TransactionEntries.d.ts diff --git a/types/2022-11-15/Treasury/TransactionEntriesResource.d.ts b/types/Treasury/TransactionEntriesResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/TransactionEntriesResource.d.ts rename to types/Treasury/TransactionEntriesResource.d.ts diff --git a/types/2022-11-15/Treasury/Transactions.d.ts b/types/Treasury/Transactions.d.ts similarity index 100% rename from types/2022-11-15/Treasury/Transactions.d.ts rename to types/Treasury/Transactions.d.ts diff --git a/types/2022-11-15/Treasury/TransactionsResource.d.ts b/types/Treasury/TransactionsResource.d.ts similarity index 100% rename from types/2022-11-15/Treasury/TransactionsResource.d.ts rename to types/Treasury/TransactionsResource.d.ts diff --git a/types/2022-11-15/UsageRecordSummaries.d.ts b/types/UsageRecordSummaries.d.ts similarity index 100% rename from types/2022-11-15/UsageRecordSummaries.d.ts rename to types/UsageRecordSummaries.d.ts diff --git a/types/2022-11-15/UsageRecords.d.ts b/types/UsageRecords.d.ts similarity index 100% rename from types/2022-11-15/UsageRecords.d.ts rename to types/UsageRecords.d.ts diff --git a/types/2022-11-15/WebhookEndpoints.d.ts b/types/WebhookEndpoints.d.ts similarity index 100% rename from types/2022-11-15/WebhookEndpoints.d.ts rename to types/WebhookEndpoints.d.ts diff --git a/types/2022-11-15/WebhookEndpointsResource.d.ts b/types/WebhookEndpointsResource.d.ts similarity index 100% rename from types/2022-11-15/WebhookEndpointsResource.d.ts rename to types/WebhookEndpointsResource.d.ts diff --git a/types/2022-11-15/index.d.ts b/types/index.d.ts similarity index 98% rename from types/2022-11-15/index.d.ts rename to types/index.d.ts index f62ed6fe28..e1d31b5505 100644 --- a/types/2022-11-15/index.d.ts +++ b/types/index.d.ts @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec -/// -/// -/// -/// -/// -/// -/// +/// +/// +/// +/// +/// +/// +/// /// /// /// diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index 08c2418b2b..983ff53088 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -5,7 +5,7 @@ * and to perform a basic sanity check that types are exported as intended. */ -/// +/// import Stripe from 'stripe'; let stripe = new Stripe('sk_test_123', { From f73f7d84bd363d6c83a13068b1d0a6b6f32cec66 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 28 Nov 2022 11:32:58 +0800 Subject: [PATCH 11/23] remove unneeded IIFE not needed in esm --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 13b2974a8d..fc32dba5ec 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,11 @@ Or using ES modules and `async`/`await`: import Stripe from 'stripe'; const stripe = new Stripe('sk_test_...'); -(async () => { - const customer = await stripe.customers.create({ - email: 'customer@example.com', - }); +const customer = await stripe.customers.create({ + email: 'customer@example.com', +}); - console.log(customer.id); -})(); +console.log(customer.id); ``` ### Usage with TypeScript From cb83973a37f540038aecad920ead9495e1e181a6 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 29 Nov 2022 10:44:14 -0800 Subject: [PATCH 12/23] Make id non-optional except for upcoming invoice --- types/Invoices.d.ts | 2 +- types/InvoicesResource.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/Invoices.d.ts b/types/Invoices.d.ts index ebab8c1b58..cf259360fd 100644 --- a/types/Invoices.d.ts +++ b/types/Invoices.d.ts @@ -40,7 +40,7 @@ declare module 'stripe' { /** * Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. */ - id?: string; + id: string; /** * String representing the object's type. Objects of the same type share the same value. diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 0764464bc3..417c9b2700 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -2168,10 +2168,10 @@ declare module 'stripe' { retrieveUpcoming( params?: InvoiceRetrieveUpcomingParams, options?: RequestOptions - ): Promise>; + ): Promise>>; retrieveUpcoming( options?: RequestOptions - ): Promise>; + ): Promise>>; /** * Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). From 6a2576bb1579af6034db69e0ef2310df394b77e2 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 29 Nov 2022 22:43:42 -0800 Subject: [PATCH 13/23] add Stripe.UpcomingInvoice --- types/InvoicesResource.d.ts | 4 ++-- types/UpcomingInvoices.d.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 types/UpcomingInvoices.d.ts diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index 417c9b2700..a055886235 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -2168,10 +2168,10 @@ declare module 'stripe' { retrieveUpcoming( params?: InvoiceRetrieveUpcomingParams, options?: RequestOptions - ): Promise>>; + ): Promise>; retrieveUpcoming( options?: RequestOptions - ): Promise>>; + ): Promise>; /** * Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). diff --git a/types/UpcomingInvoices.d.ts b/types/UpcomingInvoices.d.ts new file mode 100644 index 0000000000..c309ef56c9 --- /dev/null +++ b/types/UpcomingInvoices.d.ts @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + type UpcomingInvoice = Omit; + } +} From c85072c6990c3074a538ca2d6faf6c53881988c9 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 29 Nov 2022 23:17:26 -0800 Subject: [PATCH 14/23] index.d.ts --- types/index.d.ts | 1 + types/test/typescriptTest.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index e1d31b5505..9903ffea28 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -7,6 +7,7 @@ /// /// /// +/// /// /// /// diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index 983ff53088..082e46d789 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -123,6 +123,10 @@ stripe = new Stripe('sk_test_123', { return undefined; }); + // @ts-expect-error + (await stripe.invoices.retrieveUpcoming()).id; + (await stripe.invoices.retrieve('')).id; + try { await stripe.paymentIntents.create({amount: 100, currency: 'USD'}); } catch (err) { From c6b9b93cf7c0e4bd9e0d6ebcc17d8189ec996f1b Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 1 Dec 2022 09:24:29 -0800 Subject: [PATCH 15/23] Update types/UpcomingInvoices.d.ts --- types/UpcomingInvoices.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/UpcomingInvoices.d.ts b/types/UpcomingInvoices.d.ts index c309ef56c9..d78cb5e7d0 100644 --- a/types/UpcomingInvoices.d.ts +++ b/types/UpcomingInvoices.d.ts @@ -1,4 +1,3 @@ -// File generated from our OpenAPI spec declare module 'stripe' { namespace Stripe { From f8fa70b96e42ad7e85387551f551d2e65572f6c8 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 1 Dec 2022 12:30:32 -0800 Subject: [PATCH 16/23] Update types/UpcomingInvoices.d.ts --- types/UpcomingInvoices.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/UpcomingInvoices.d.ts b/types/UpcomingInvoices.d.ts index d78cb5e7d0..02a5efc7d8 100644 --- a/types/UpcomingInvoices.d.ts +++ b/types/UpcomingInvoices.d.ts @@ -1,4 +1,3 @@ - declare module 'stripe' { namespace Stripe { type UpcomingInvoice = Omit; From dae38f9c4cb4f6eef32bc5aea696d3fe8975af79 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Mon, 5 Dec 2022 14:51:37 -0800 Subject: [PATCH 17/23] Remove BASIC_METHODS from TS definitions (#1630) --- src/Types.d.ts | 1 - types/lib.d.ts | 27 +-------------------------- types/test/typescriptTest.ts | 1 - 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Types.d.ts b/src/Types.d.ts index 037ad8d207..604b0f007f 100644 --- a/src/Types.d.ts +++ b/src/Types.d.ts @@ -193,7 +193,6 @@ type StripeResourceObject = { basePath: UrlInterpolator; path: UrlInterpolator; resourcePath: string; - includeBasic?: Array; createResourcePathWithSymbols: (path: string | null | undefined) => string; createFullPath: ( interpolator: UrlInterpolator, diff --git a/types/lib.d.ts b/types/lib.d.ts index f63308e3a4..13aa005d9b 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -15,11 +15,7 @@ declare module 'stripe' { export class StripeResource { static extend< // eslint-disable-next-line @typescript-eslint/no-explicit-any - T extends {[prop: string]: any} & { - includeBasic?: Array< - 'create' | 'retrieve' | 'update' | 'list' | 'del' - >; - } + T extends {[prop: string]: any} >(spec: T): StripeResourceExtension; static method(spec: { method: string; @@ -29,27 +25,6 @@ declare module 'stripe' { // change/removal at any time. methodType?: 'list' | 'search'; }): (...args: any[]) => Response; //eslint-disable-line @typescript-eslint/no-explicit-any - static BASIC_METHODS: { - create( - params: CouponCreateParams, - options?: RequestOptions - ): Promise; - retrieve( - id: string, - params?: CouponRetrieveParams, - options?: RequestOptions - ): Promise; - update( - id: string, - params?: CouponUpdateParams, - options?: RequestOptions - ): Promise; - list( - params?: CouponListParams, - options?: RequestOptions - ): ApiListPromise; - del(id: string, options?: RequestOptions): Promise; - }; static MAX_BUFFERED_REQUEST_METRICS: number; } export type LatestApiVersion = '2022-11-15'; diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index 082e46d789..a6f35c6d3c 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -170,7 +170,6 @@ stripe = new Stripe('sk_test_123', { })(); const Foo = Stripe.StripeResource.extend({ - includeBasic: ['retrieve'], foo: Stripe.StripeResource.method({ method: 'create', path: 'foo', From 71d1240ea1e9f5f1288cb1e51fb632cc1b4823e3 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Mon, 5 Dec 2022 17:13:22 -0800 Subject: [PATCH 18/23] Codegen for openapi v211 --- OPENAPI_VERSION | 2 +- lib/resources.js | 14 +- src/resources.js | 14 +- .../resources/generated_examples_test.spec.js | 504 +++++++++--------- types/Accounts.d.ts | 7 + types/AccountsResource.d.ts | 24 + types/Checkout/Sessions.d.ts | 76 +++ types/Checkout/SessionsResource.d.ts | 78 +++ types/InvoiceItemsResource.d.ts | 4 +- types/InvoicesResource.d.ts | 4 +- types/Issuing/Authorizations.d.ts | 10 +- types/Issuing/Transactions.d.ts | 2 +- types/PaymentLinksResource.d.ts | 8 +- types/SubscriptionSchedules.d.ts | 5 + types/SubscriptionSchedulesResource.d.ts | 10 + 15 files changed, 488 insertions(+), 274 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 807458b5fa..ec25eb3028 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v210 \ No newline at end of file +v211 \ No newline at end of file diff --git a/lib/resources.js b/lib/resources.js index eb497e3587..3a8231c117 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -2,10 +2,10 @@ 'use strict'; const resourceNamespace = require('./ResourceNamespace'); module.exports = { - Accounts: require('./resources/Accounts'), // Support Accounts for consistency, Account for backwards compatibility Account: require('./resources/Accounts'), AccountLinks: require('./resources/AccountLinks'), + Accounts: require('./resources/Accounts'), ApplePayDomains: require('./resources/ApplePayDomains'), ApplicationFees: require('./resources/ApplicationFees'), Balance: require('./resources/Balance'), @@ -19,10 +19,10 @@ module.exports = { EphemeralKeys: require('./resources/EphemeralKeys'), Events: require('./resources/Events'), ExchangeRates: require('./resources/ExchangeRates'), - Files: require('./resources/Files'), FileLinks: require('./resources/FileLinks'), - Invoices: require('./resources/Invoices'), + Files: require('./resources/Files'), InvoiceItems: require('./resources/InvoiceItems'), + Invoices: require('./resources/Invoices'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), PaymentIntents: require('./resources/PaymentIntents'), @@ -40,8 +40,8 @@ module.exports = { SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), Sources: require('./resources/Sources'), - Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), + Subscriptions: require('./resources/Subscriptions'), SubscriptionSchedules: require('./resources/SubscriptionSchedules'), TaxCodes: require('./resources/TaxCodes'), TaxRates: require('./resources/TaxRates'), @@ -69,15 +69,15 @@ module.exports = { }), Issuing: resourceNamespace('issuing', { Authorizations: require('./resources/Issuing/Authorizations'), - Cards: require('./resources/Issuing/Cards'), Cardholders: require('./resources/Issuing/Cardholders'), + Cards: require('./resources/Issuing/Cards'), Disputes: require('./resources/Issuing/Disputes'), Transactions: require('./resources/Issuing/Transactions'), }), Radar: resourceNamespace('radar', { EarlyFraudWarnings: require('./resources/Radar/EarlyFraudWarnings'), - ValueLists: require('./resources/Radar/ValueLists'), ValueListItems: require('./resources/Radar/ValueListItems'), + ValueLists: require('./resources/Radar/ValueLists'), }), Reporting: resourceNamespace('reporting', { ReportRuns: require('./resources/Reporting/ReportRuns'), @@ -119,7 +119,7 @@ module.exports = { OutboundTransfers: require('./resources/Treasury/OutboundTransfers'), ReceivedCredits: require('./resources/Treasury/ReceivedCredits'), ReceivedDebits: require('./resources/Treasury/ReceivedDebits'), - Transactions: require('./resources/Treasury/Transactions'), TransactionEntries: require('./resources/Treasury/TransactionEntries'), + Transactions: require('./resources/Treasury/Transactions'), }), }; diff --git a/src/resources.js b/src/resources.js index 5e36ae42d3..3b24b4f8bd 100644 --- a/src/resources.js +++ b/src/resources.js @@ -5,10 +5,10 @@ const resourceNamespace = require('./ResourceNamespace'); module.exports = { - Accounts: require('./resources/Accounts'), // Support Accounts for consistency, Account for backwards compatibility Account: require('./resources/Accounts'), AccountLinks: require('./resources/AccountLinks'), + Accounts: require('./resources/Accounts'), ApplePayDomains: require('./resources/ApplePayDomains'), ApplicationFees: require('./resources/ApplicationFees'), Balance: require('./resources/Balance'), @@ -22,10 +22,10 @@ module.exports = { EphemeralKeys: require('./resources/EphemeralKeys'), Events: require('./resources/Events'), ExchangeRates: require('./resources/ExchangeRates'), - Files: require('./resources/Files'), FileLinks: require('./resources/FileLinks'), - Invoices: require('./resources/Invoices'), + Files: require('./resources/Files'), InvoiceItems: require('./resources/InvoiceItems'), + Invoices: require('./resources/Invoices'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), PaymentIntents: require('./resources/PaymentIntents'), @@ -43,8 +43,8 @@ module.exports = { SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), Sources: require('./resources/Sources'), - Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), + Subscriptions: require('./resources/Subscriptions'), SubscriptionSchedules: require('./resources/SubscriptionSchedules'), TaxCodes: require('./resources/TaxCodes'), TaxRates: require('./resources/TaxRates'), @@ -72,15 +72,15 @@ module.exports = { }), Issuing: resourceNamespace('issuing', { Authorizations: require('./resources/Issuing/Authorizations'), - Cards: require('./resources/Issuing/Cards'), Cardholders: require('./resources/Issuing/Cardholders'), + Cards: require('./resources/Issuing/Cards'), Disputes: require('./resources/Issuing/Disputes'), Transactions: require('./resources/Issuing/Transactions'), }), Radar: resourceNamespace('radar', { EarlyFraudWarnings: require('./resources/Radar/EarlyFraudWarnings'), - ValueLists: require('./resources/Radar/ValueLists'), ValueListItems: require('./resources/Radar/ValueListItems'), + ValueLists: require('./resources/Radar/ValueLists'), }), Reporting: resourceNamespace('reporting', { ReportRuns: require('./resources/Reporting/ReportRuns'), @@ -122,7 +122,7 @@ module.exports = { OutboundTransfers: require('./resources/Treasury/OutboundTransfers'), ReceivedCredits: require('./resources/Treasury/ReceivedCredits'), ReceivedDebits: require('./resources/Treasury/ReceivedDebits'), - Transactions: require('./resources/Treasury/Transactions'), TransactionEntries: require('./resources/Treasury/TransactionEntries'), + Transactions: require('./resources/Treasury/Transactions'), }), }; diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index d51bcf971a..343d609e9c 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -5,7 +5,7 @@ const stripe = require('../../testUtils').getStripeMockClient(); const expect = require('chai').expect; -describe('Apps.Secret', function() { +describe('Apps.Secrets', function() { it('list method', async function() { const secrets = await stripe.apps.secrets.list({ scope: {type: 'account'}, @@ -49,7 +49,7 @@ describe('Apps.Secret', function() { }); }); -describe('Checkout.Session', function() { +describe('Checkout.Sessions', function() { it('create method', async function() { const session = await stripe.checkout.sessions.create({ success_url: 'https://example.com/success', @@ -111,7 +111,7 @@ describe('Checkout.Session', function() { }); }); -describe('CashBalance', function() { +describe('CashBalances', function() { it('retrieveCashBalance method', async function() { const cashBalance = await stripe.customers.retrieveCashBalance('cus_123'); expect(cashBalance).not.to.be.null; @@ -125,7 +125,7 @@ describe('CashBalance', function() { }); }); -describe('Customer', function() { +describe('Customers', function() { it('createFundingInstructions method', async function() { const fundingInstructions = await stripe.customers.createFundingInstructions( 'cus_123', @@ -149,14 +149,6 @@ describe('Customer', function() { expect(paymentMethods).not.to.be.null; }); - it('fundCashBalance method', async function() { - const customerCashBalanceTransaction = await stripe.testHelpers.customers.fundCashBalance( - 'cus_123', - {amount: 30, currency: 'eur'} - ); - expect(customerCashBalanceTransaction).not.to.be.null; - }); - it('list method', async function() { const customers = await stripe.customers.list({limit: 3}); expect(customers).not.to.be.null; @@ -214,7 +206,7 @@ describe('Customer', function() { }); }); -describe('FinancialConnections.Account', function() { +describe('FinancialConnections.Accounts', function() { it('list method', async function() { const accounts = await stripe.financialConnections.accounts.list(); expect(accounts).not.to.be.null; @@ -273,7 +265,7 @@ describe('FinancialConnections.Account', function() { }); }); -describe('FinancialConnections.Session', function() { +describe('FinancialConnections.Sessions', function() { it('create method', async function() { const session = await stripe.financialConnections.sessions.create({ account_holder: {type: 'customer', customer: 'cus_123'}, @@ -306,7 +298,7 @@ describe('FinancialConnections.Session', function() { }); }); -describe('PaymentIntent', function() { +describe('PaymentIntents', function() { it('create method', async function() { const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, @@ -397,7 +389,7 @@ describe('PaymentIntent', function() { }); }); -describe('PaymentLink', function() { +describe('PaymentLinks', function() { it('create method', async function() { const paymentLink = await stripe.paymentLinks.create({ line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 1}], @@ -443,7 +435,7 @@ describe('PaymentLink', function() { }); }); -describe('Price', function() { +describe('Prices', function() { it('create method', async function() { const price = await stripe.prices.create({ unit_amount: 2000, @@ -493,7 +485,7 @@ describe('Price', function() { }); }); -describe('SetupAttempt', function() { +describe('SetupAttempts', function() { it('list method', async function() { const setupAttempts = await stripe.setupAttempts.list({ limit: 3, @@ -503,7 +495,7 @@ describe('SetupAttempt', function() { }); }); -describe('SetupIntent', function() { +describe('SetupIntents', function() { it('verifyMicrodeposits method', async function() { const setupIntent = await stripe.setupIntents.verifyMicrodeposits( 'seti_xxxxxxxxxxxxx' @@ -551,7 +543,7 @@ describe('SetupIntent', function() { }); }); -describe('ShippingRate', function() { +describe('ShippingRates', function() { it('list method', async function() { const shippingRates = await stripe.shippingRates.list(); expect(shippingRates).not.to.be.null; @@ -596,7 +588,7 @@ describe('ShippingRate', function() { }); }); -describe('Terminal.Configuration', function() { +describe('Terminal.Configurations', function() { it('list method', async function() { const configurations = await stripe.terminal.configurations.list(); expect(configurations).not.to.be.null; @@ -664,7 +656,17 @@ describe('Terminal.Configuration', function() { }); }); -describe('Issuing.Card', function() { +describe('TestHelpers.Customers', function() { + it('fundCashBalance method', async function() { + const customerCashBalanceTransaction = await stripe.testHelpers.customers.fundCashBalance( + 'cus_123', + {amount: 30, currency: 'eur'} + ); + expect(customerCashBalanceTransaction).not.to.be.null; + }); +}); + +describe('TestHelpers.Issuing.Cards', function() { it('deliverCard method', async function() { const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123'); expect(card).not.to.be.null; @@ -684,71 +686,16 @@ describe('Issuing.Card', function() { const card = await stripe.testHelpers.issuing.cards.shipCard('card_123'); expect(card).not.to.be.null; }); - - it('list method', async function() { - const cards = await stripe.issuing.cards.list({limit: 3}); - expect(cards).not.to.be.null; - }); - - it('create method', async function() { - const card = await stripe.issuing.cards.create({ - cardholder: 'ich_xxxxxxxxxxxxx', - currency: 'usd', - type: 'virtual', - }); - expect(card).not.to.be.null; - }); - - it('retrieve method', async function() { - const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); - expect(card).not.to.be.null; - }); - - it('update method', async function() { - const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(card).not.to.be.null; - }); }); -describe('Refund', function() { +describe('TestHelpers.Refunds', function() { it('expire method', async function() { const refund = await stripe.testHelpers.refunds.expire('re_123'); expect(refund).not.to.be.null; }); - - it('list method', async function() { - const refunds = await stripe.refunds.list({limit: 3}); - expect(refunds).not.to.be.null; - }); - - it('create method', async function() { - const refund = await stripe.refunds.create({ - charge: 'ch_xxxxxxxxxxxxx', - }); - expect(refund).not.to.be.null; - }); - - it('retrieve method', async function() { - const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); - expect(refund).not.to.be.null; - }); - - it('update method', async function() { - const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(refund).not.to.be.null; - }); - - it('cancel method', async function() { - const refund = await stripe.refunds.cancel('re_xxxxxxxxxxxxx'); - expect(refund).not.to.be.null; - }); }); -describe('TestHelpers.TestClock', function() { +describe('TestHelpers.TestClocks', function() { it('list method', async function() { const testClocks = await stripe.testHelpers.testClocks.list(); expect(testClocks).not.to.be.null; @@ -814,7 +761,7 @@ describe('TestHelpers.TestClock', function() { }); }); -describe('Treasury.InboundTransfer', function() { +describe('TestHelpers.Treasury.InboundTransfers', function() { it('fail method', async function() { const inboundTransfer = await stripe.testHelpers.treasury.inboundTransfers.fail( 'ibt_123', @@ -836,42 +783,9 @@ describe('Treasury.InboundTransfer', function() { ); expect(inboundTransfer).not.to.be.null; }); - - it('list method', async function() { - const inboundTransfers = await stripe.treasury.inboundTransfers.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(inboundTransfers).not.to.be.null; - }); - - it('create method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.create({ - financial_account: 'fa_xxxxxxxxxxxxx', - amount: 10000, - currency: 'usd', - origin_payment_method: 'pm_xxxxxxxxxxxxx', - description: 'InboundTransfer from my bank account', - }); - expect(inboundTransfer).not.to.be.null; - }); - - it('retrieve method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.retrieve( - 'ibt_xxxxxxxxxxxxx' - ); - expect(inboundTransfer).not.to.be.null; - }); - - it('cancel method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.cancel( - 'ibt_xxxxxxxxxxxxx' - ); - expect(inboundTransfer).not.to.be.null; - }); }); -describe('Treasury.OutboundTransfer', function() { +describe('TestHelpers.Treasury.OutboundTransfers', function() { it('fail method', async function() { const outboundTransfer = await stripe.testHelpers.treasury.outboundTransfers.fail( 'obt_123' @@ -893,42 +807,9 @@ describe('Treasury.OutboundTransfer', function() { ); expect(outboundTransfer).not.to.be.null; }); - - it('list method', async function() { - const outboundTransfers = await stripe.treasury.outboundTransfers.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(outboundTransfers).not.to.be.null; - }); - - it('create method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.create({ - financial_account: 'fa_xxxxxxxxxxxxx', - destination_payment_method: 'pm_xxxxxxxxxxxxx', - amount: 500, - currency: 'usd', - description: 'OutboundTransfer to my external bank account', - }); - expect(outboundTransfer).not.to.be.null; - }); - - it('retrieve method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.retrieve( - 'obt_xxxxxxxxxxxxx' - ); - expect(outboundTransfer).not.to.be.null; - }); - - it('cancel method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.cancel( - 'obt_xxxxxxxxxxxxx' - ); - expect(outboundTransfer).not.to.be.null; - }); }); -describe('Treasury.ReceivedCredit', function() { +describe('TestHelpers.Treasury.ReceivedCredits', function() { it('create method', async function() { const receivedCredit = await stripe.testHelpers.treasury.receivedCredits.create( { @@ -940,24 +821,9 @@ describe('Treasury.ReceivedCredit', function() { ); expect(receivedCredit).not.to.be.null; }); - - it('list method', async function() { - const receivedCredits = await stripe.treasury.receivedCredits.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(receivedCredits).not.to.be.null; - }); - - it('retrieve method', async function() { - const receivedCredit = await stripe.treasury.receivedCredits.retrieve( - 'rc_xxxxxxxxxxxxx' - ); - expect(receivedCredit).not.to.be.null; - }); }); -describe('Treasury.ReceivedDebit', function() { +describe('TestHelpers.Treasury.ReceivedDebits', function() { it('create method', async function() { const receivedDebit = await stripe.testHelpers.treasury.receivedDebits.create( { @@ -969,24 +835,9 @@ describe('Treasury.ReceivedDebit', function() { ); expect(receivedDebit).not.to.be.null; }); - - it('list method', async function() { - const receivedDebits = await stripe.treasury.receivedDebits.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(receivedDebits).not.to.be.null; - }); - - it('retrieve method', async function() { - const receivedDebit = await stripe.treasury.receivedDebits.retrieve( - 'rd_xxxxxxxxxxxxx' - ); - expect(receivedDebit).not.to.be.null; - }); }); -describe('Token', function() { +describe('Tokens', function() { it('create method', async function() { const token = await stripe.tokens.create({ card: { @@ -1052,7 +903,7 @@ describe('Token', function() { }); }); -describe('AccountLink', function() { +describe('AccountLinks', function() { it('create method', async function() { const accountLink = await stripe.accountLinks.create({ account: 'acct_xxxxxxxxxxxxx', @@ -1064,7 +915,7 @@ describe('AccountLink', function() { }); }); -describe('Account', function() { +describe('Accounts', function() { it('list method', async function() { const accounts = await stripe.accounts.list({limit: 3}); expect(accounts).not.to.be.null; @@ -1108,7 +959,7 @@ describe('Account', function() { }); }); -describe('Capability', function() { +describe('Capabilities', function() { it('listCapabilities method', async function() { const capabilities = await stripe.accounts.listCapabilities( 'acct_xxxxxxxxxxxxx' @@ -1134,7 +985,7 @@ describe('Capability', function() { }); }); -describe('LoginLink', function() { +describe('LoginLinks', function() { it('createLoginLink method', async function() { const loginLink = await stripe.accounts.createLoginLink( 'acct_xxxxxxxxxxxxx' @@ -1143,7 +994,7 @@ describe('LoginLink', function() { }); }); -describe('Person', function() { +describe('Persons', function() { it('listPersons method', async function() { const persons = await stripe.accounts.listPersons('acct_xxxxxxxxxxxxx', { limit: 3, @@ -1185,7 +1036,7 @@ describe('Person', function() { }); }); -describe('ApplicationFee', function() { +describe('ApplicationFees', function() { it('list method', async function() { const applicationFees = await stripe.applicationFees.list({limit: 3}); expect(applicationFees).not.to.be.null; @@ -1199,7 +1050,7 @@ describe('ApplicationFee', function() { }); }); -describe('FeeRefund', function() { +describe('FeeRefunds', function() { it('listRefunds method', async function() { const refunds = await stripe.applicationFees.listRefunds( 'fee_xxxxxxxxxxxxx', @@ -1233,7 +1084,7 @@ describe('FeeRefund', function() { }); }); -describe('BalanceTransaction', function() { +describe('BalanceTransactions', function() { it('list method', async function() { const balanceTransactions = await stripe.balanceTransactions.list({ limit: 3, @@ -1249,7 +1100,7 @@ describe('BalanceTransaction', function() { }); }); -describe('BillingPortal.Configuration', function() { +describe('BillingPortal.Configurations', function() { it('list method', async function() { const configurations = await stripe.billingPortal.configurations.list({ limit: 3, @@ -1295,7 +1146,7 @@ describe('BillingPortal.Configuration', function() { }); }); -describe('BillingPortal.Session', function() { +describe('BillingPortal.Sessions', function() { it('create method', async function() { const session = await stripe.billingPortal.sessions.create({ customer: 'cus_xxxxxxxxxxxxx', @@ -1305,7 +1156,7 @@ describe('BillingPortal.Session', function() { }); }); -describe('Charge', function() { +describe('Charges', function() { it('list method', async function() { const charges = await stripe.charges.list({limit: 3}); expect(charges).not.to.be.null; @@ -1346,7 +1197,7 @@ describe('Charge', function() { }); }); -describe('CountrySpec', function() { +describe('CountrySpecs', function() { it('list method', async function() { const countrySpecs = await stripe.countrySpecs.list({limit: 3}); expect(countrySpecs).not.to.be.null; @@ -1358,7 +1209,7 @@ describe('CountrySpec', function() { }); }); -describe('Coupon', function() { +describe('Coupons', function() { it('list method', async function() { const coupons = await stripe.coupons.list({limit: 3}); expect(coupons).not.to.be.null; @@ -1391,7 +1242,7 @@ describe('Coupon', function() { }); }); -describe('CreditNote', function() { +describe('CreditNotes', function() { it('list method', async function() { const creditNotes = await stripe.creditNotes.list({limit: 3}); expect(creditNotes).not.to.be.null; @@ -1433,7 +1284,7 @@ describe('CreditNote', function() { }); }); -describe('CreditNoteLineItem', function() { +describe('CreditNoteLineItems', function() { it('listLineItems method', async function() { const lineItems = await stripe.creditNotes.listLineItems( 'cn_xxxxxxxxxxxxx', @@ -1443,7 +1294,7 @@ describe('CreditNoteLineItem', function() { }); }); -describe('CustomerBalanceTransaction', function() { +describe('CustomerBalanceTransactions', function() { it('listBalanceTransactions method', async function() { const balanceTransactions = await stripe.customers.listBalanceTransactions( 'cus_xxxxxxxxxxxxx', @@ -1478,7 +1329,7 @@ describe('CustomerBalanceTransaction', function() { }); }); -describe('CustomerSource', function() { +describe('CustomerSources', function() { it('verifySource method', async function() { const bankAccount = await stripe.customers.verifySource( 'cus_xxxxxxxxxxxxx', @@ -1489,7 +1340,7 @@ describe('CustomerSource', function() { }); }); -describe('TaxId', function() { +describe('TaxIds', function() { it('listTaxIds method', async function() { const taxIds = await stripe.customers.listTaxIds('cus_xxxxxxxxxxxxx', { limit: 3, @@ -1522,7 +1373,7 @@ describe('TaxId', function() { }); }); -describe('Dispute', function() { +describe('Disputes', function() { it('list method', async function() { const disputes = await stripe.disputes.list({limit: 3}); expect(disputes).not.to.be.null; @@ -1546,7 +1397,7 @@ describe('Dispute', function() { }); }); -describe('Event', function() { +describe('Events', function() { it('list method', async function() { const events = await stripe.events.list({limit: 3}); expect(events).not.to.be.null; @@ -1558,7 +1409,7 @@ describe('Event', function() { }); }); -describe('FileLink', function() { +describe('FileLinks', function() { it('list method', async function() { const fileLinks = await stripe.fileLinks.list({limit: 3}); expect(fileLinks).not.to.be.null; @@ -1584,7 +1435,7 @@ describe('FileLink', function() { }); }); -describe('File', function() { +describe('Files', function() { it('list method', async function() { const files = await stripe.files.list({limit: 3}); expect(files).not.to.be.null; @@ -1596,7 +1447,7 @@ describe('File', function() { }); }); -describe('Identity.VerificationReport', function() { +describe('Identity.VerificationReports', function() { it('list method', async function() { const verificationReports = await stripe.identity.verificationReports.list({ limit: 3, @@ -1612,7 +1463,7 @@ describe('Identity.VerificationReport', function() { }); }); -describe('Identity.VerificationSession', function() { +describe('Identity.VerificationSessions', function() { it('list method', async function() { const verificationSessions = await stripe.identity.verificationSessions.list( {limit: 3} @@ -1657,7 +1508,7 @@ describe('Identity.VerificationSession', function() { }); }); -describe('InvoiceItem', function() { +describe('InvoiceItems', function() { it('list method', async function() { const invoiceItems = await stripe.invoiceItems.list({limit: 3}); expect(invoiceItems).not.to.be.null; @@ -1689,7 +1540,7 @@ describe('InvoiceItem', function() { }); }); -describe('Invoice', function() { +describe('Invoices', function() { it('list method', async function() { const invoices = await stripe.invoices.list({limit: 3}); expect(invoices).not.to.be.null; @@ -1752,7 +1603,7 @@ describe('Invoice', function() { }); }); -describe('Issuing.Authorization', function() { +describe('Issuing.Authorizations', function() { it('list method', async function() { const authorizations = await stripe.issuing.authorizations.list({ limit: 3, @@ -1790,7 +1641,7 @@ describe('Issuing.Authorization', function() { }); }); -describe('Issuing.Cardholder', function() { +describe('Issuing.Cardholders', function() { it('list method', async function() { const cardholders = await stripe.issuing.cardholders.list({limit: 3}); expect(cardholders).not.to.be.null; @@ -1831,7 +1682,35 @@ describe('Issuing.Cardholder', function() { }); }); -describe('Issuing.Dispute', function() { +describe('Issuing.Cards', function() { + it('list method', async function() { + const cards = await stripe.issuing.cards.list({limit: 3}); + expect(cards).not.to.be.null; + }); + + it('create method', async function() { + const card = await stripe.issuing.cards.create({ + cardholder: 'ich_xxxxxxxxxxxxx', + currency: 'usd', + type: 'virtual', + }); + expect(card).not.to.be.null; + }); + + it('retrieve method', async function() { + const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); + expect(card).not.to.be.null; + }); + + it('update method', async function() { + const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(card).not.to.be.null; + }); +}); + +describe('Issuing.Disputes', function() { it('list method', async function() { const disputes = await stripe.issuing.disputes.list({limit: 3}); expect(disputes).not.to.be.null; @@ -1859,7 +1738,7 @@ describe('Issuing.Dispute', function() { }); }); -describe('Issuing.Transaction', function() { +describe('Issuing.Transactions', function() { it('list method', async function() { const transactions = await stripe.issuing.transactions.list({limit: 3}); expect(transactions).not.to.be.null; @@ -1881,14 +1760,14 @@ describe('Issuing.Transaction', function() { }); }); -describe('Mandate', function() { +describe('Mandates', function() { it('retrieve method', async function() { const mandate = await stripe.mandates.retrieve('mandate_xxxxxxxxxxxxx'); expect(mandate).not.to.be.null; }); }); -describe('PaymentMethod', function() { +describe('PaymentMethods', function() { it('list method', async function() { const paymentMethods = await stripe.paymentMethods.list({ customer: 'cus_xxxxxxxxxxxxx', @@ -1941,7 +1820,7 @@ describe('PaymentMethod', function() { }); }); -describe('Payout', function() { +describe('Payouts', function() { it('list method', async function() { const payouts = await stripe.payouts.list({limit: 3}); expect(payouts).not.to.be.null; @@ -1978,7 +1857,7 @@ describe('Payout', function() { }); }); -describe('Plan', function() { +describe('Plans', function() { it('list method', async function() { const plans = await stripe.plans.list({limit: 3}); expect(plans).not.to.be.null; @@ -2012,7 +1891,7 @@ describe('Plan', function() { }); }); -describe('Product', function() { +describe('Products', function() { it('list method', async function() { const products = await stripe.products.list({limit: 3}); expect(products).not.to.be.null; @@ -2048,7 +1927,7 @@ describe('Product', function() { }); }); -describe('PromotionCode', function() { +describe('PromotionCodes', function() { it('list method', async function() { const promotionCodes = await stripe.promotionCodes.list({limit: 3}); expect(promotionCodes).not.to.be.null; @@ -2077,7 +1956,7 @@ describe('PromotionCode', function() { }); }); -describe('Quote', function() { +describe('Quotes', function() { it('list method', async function() { const quotes = await stripe.quotes.list({limit: 3}); expect(quotes).not.to.be.null; @@ -2119,7 +1998,7 @@ describe('Quote', function() { }); }); -describe('Radar.EarlyFraudWarning', function() { +describe('Radar.EarlyFraudWarnings', function() { it('list method', async function() { const earlyFraudWarnings = await stripe.radar.earlyFraudWarnings.list({ limit: 3, @@ -2135,7 +2014,7 @@ describe('Radar.EarlyFraudWarning', function() { }); }); -describe('Radar.ValueListItem', function() { +describe('Radar.ValueListItems', function() { it('list method', async function() { const valueListItems = await stripe.radar.valueListItems.list({ limit: 3, @@ -2165,7 +2044,7 @@ describe('Radar.ValueListItem', function() { }); }); -describe('Radar.ValueList', function() { +describe('Radar.ValueLists', function() { it('list method', async function() { const valueLists = await stripe.radar.valueLists.list({limit: 3}); expect(valueLists).not.to.be.null; @@ -2201,7 +2080,38 @@ describe('Radar.ValueList', function() { }); }); -describe('Reporting.ReportRun', function() { +describe('Refunds', function() { + it('list method', async function() { + const refunds = await stripe.refunds.list({limit: 3}); + expect(refunds).not.to.be.null; + }); + + it('create method', async function() { + const refund = await stripe.refunds.create({ + charge: 'ch_xxxxxxxxxxxxx', + }); + expect(refund).not.to.be.null; + }); + + it('retrieve method', async function() { + const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); + + it('update method', async function() { + const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(refund).not.to.be.null; + }); + + it('cancel method', async function() { + const refund = await stripe.refunds.cancel('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); +}); + +describe('Reporting.ReportRuns', function() { it('list method', async function() { const reportRuns = await stripe.reporting.reportRuns.list({limit: 3}); expect(reportRuns).not.to.be.null; @@ -2223,7 +2133,7 @@ describe('Reporting.ReportRun', function() { }); }); -describe('Reporting.ReportType', function() { +describe('Reporting.ReportTypes', function() { it('list method', async function() { const reportTypes = await stripe.reporting.reportTypes.list(); expect(reportTypes).not.to.be.null; @@ -2237,7 +2147,7 @@ describe('Reporting.ReportType', function() { }); }); -describe('Review', function() { +describe('Reviews', function() { it('list method', async function() { const reviews = await stripe.reviews.list({limit: 3}); expect(reviews).not.to.be.null; @@ -2254,7 +2164,7 @@ describe('Review', function() { }); }); -describe('Sigma.ScheduledQueryRun', function() { +describe('Sigma.ScheduledQueryRuns', function() { it('list method', async function() { const scheduledQueryRuns = await stripe.sigma.scheduledQueryRuns.list({ limit: 3, @@ -2270,7 +2180,7 @@ describe('Sigma.ScheduledQueryRun', function() { }); }); -describe('Source', function() { +describe('Sources', function() { it('retrieve method', async function() { const source = await stripe.sources.retrieve('src_xxxxxxxxxxxxx'); expect(source).not.to.be.null; @@ -2289,7 +2199,7 @@ describe('Source', function() { }); }); -describe('SubscriptionItem', function() { +describe('SubscriptionItems', function() { it('list method', async function() { const subscriptionItems = await stripe.subscriptionItems.list({ subscription: 'sub_xxxxxxxxxxxxx', @@ -2327,7 +2237,7 @@ describe('SubscriptionItem', function() { }); }); -describe('UsageRecordSummary', function() { +describe('UsageRecordSummaries', function() { it('listUsageRecordSummaries method', async function() { const usageRecordSummaries = await stripe.subscriptionItems.listUsageRecordSummaries( 'si_xxxxxxxxxxxxx', @@ -2337,7 +2247,7 @@ describe('UsageRecordSummary', function() { }); }); -describe('UsageRecord', function() { +describe('UsageRecords', function() { it('createUsageRecord method', async function() { const usageRecord = await stripe.subscriptionItems.createUsageRecord( 'si_xxxxxxxxxxxxx', @@ -2347,7 +2257,7 @@ describe('UsageRecord', function() { }); }); -describe('SubscriptionSchedule', function() { +describe('SubscriptionSchedules', function() { it('list method', async function() { const subscriptionSchedules = await stripe.subscriptionSchedules.list({ limit: 3, @@ -2400,7 +2310,7 @@ describe('SubscriptionSchedule', function() { }); }); -describe('Subscription', function() { +describe('Subscriptions', function() { it('list method', async function() { const subscriptions = await stripe.subscriptions.list({limit: 3}); expect(subscriptions).not.to.be.null; @@ -2442,7 +2352,7 @@ describe('Subscription', function() { }); }); -describe('TaxCode', function() { +describe('TaxCodes', function() { it('list method', async function() { const taxCodes = await stripe.taxCodes.list({limit: 3}); expect(taxCodes).not.to.be.null; @@ -2454,7 +2364,7 @@ describe('TaxCode', function() { }); }); -describe('TaxRate', function() { +describe('TaxRates', function() { it('list method', async function() { const taxRates = await stripe.taxRates.list({limit: 3}); expect(taxRates).not.to.be.null; @@ -2484,14 +2394,14 @@ describe('TaxRate', function() { }); }); -describe('Terminal.ConnectionToken', function() { +describe('Terminal.ConnectionTokens', function() { it('create method', async function() { const connectionToken = await stripe.terminal.connectionTokens.create(); expect(connectionToken).not.to.be.null; }); }); -describe('Terminal.Location', function() { +describe('Terminal.Locations', function() { it('list method', async function() { const locations = await stripe.terminal.locations.list({limit: 3}); expect(locations).not.to.be.null; @@ -2531,7 +2441,7 @@ describe('Terminal.Location', function() { }); }); -describe('Terminal.Reader', function() { +describe('Terminal.Readers', function() { it('list method', async function() { const readers = await stripe.terminal.readers.list({limit: 3}); expect(readers).not.to.be.null; @@ -2579,7 +2489,7 @@ describe('Terminal.Reader', function() { }); }); -describe('Topup', function() { +describe('Topups', function() { it('list method', async function() { const topups = await stripe.topups.list({limit: 3}); expect(topups).not.to.be.null; @@ -2613,7 +2523,7 @@ describe('Topup', function() { }); }); -describe('Transfer', function() { +describe('Transfers', function() { it('list method', async function() { const transfers = await stripe.transfers.list({limit: 3}); expect(transfers).not.to.be.null; @@ -2642,7 +2552,7 @@ describe('Transfer', function() { }); }); -describe('TransferReversal', function() { +describe('TransferReversals', function() { it('listReversals method', async function() { const reversals = await stripe.transfers.listReversals('tr_xxxxxxxxxxxxx', { limit: 3, @@ -2675,7 +2585,7 @@ describe('TransferReversal', function() { }); }); -describe('Treasury.CreditReversal', function() { +describe('Treasury.CreditReversals', function() { it('list method', async function() { const creditReversals = await stripe.treasury.creditReversals.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2699,7 +2609,7 @@ describe('Treasury.CreditReversal', function() { }); }); -describe('Treasury.DebitReversal', function() { +describe('Treasury.DebitReversals', function() { it('list method', async function() { const debitReversals = await stripe.treasury.debitReversals.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2723,7 +2633,7 @@ describe('Treasury.DebitReversal', function() { }); }); -describe('Treasury.FinancialAccount', function() { +describe('Treasury.FinancialAccounts', function() { it('list method', async function() { const financialAccounts = await stripe.treasury.financialAccounts.list({ limit: 3, @@ -2770,7 +2680,42 @@ describe('Treasury.FinancialAccount', function() { }); }); -describe('Treasury.OutboundPayment', function() { +describe('Treasury.InboundTransfers', function() { + it('list method', async function() { + const inboundTransfers = await stripe.treasury.inboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(inboundTransfers).not.to.be.null; + }); + + it('create method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + amount: 10000, + currency: 'usd', + origin_payment_method: 'pm_xxxxxxxxxxxxx', + description: 'InboundTransfer from my bank account', + }); + expect(inboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.retrieve( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('cancel method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.cancel( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); +}); + +describe('Treasury.OutboundPayments', function() { it('list method', async function() { const outboundPayments = await stripe.treasury.outboundPayments.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2806,7 +2751,76 @@ describe('Treasury.OutboundPayment', function() { }); }); -describe('Treasury.TransactionEntry', function() { +describe('Treasury.OutboundTransfers', function() { + it('list method', async function() { + const outboundTransfers = await stripe.treasury.outboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(outboundTransfers).not.to.be.null; + }); + + it('create method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + destination_payment_method: 'pm_xxxxxxxxxxxxx', + amount: 500, + currency: 'usd', + description: 'OutboundTransfer to my external bank account', + }); + expect(outboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.retrieve( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('cancel method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.cancel( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedCredits', function() { + it('list method', async function() { + const receivedCredits = await stripe.treasury.receivedCredits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedCredits).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedCredit = await stripe.treasury.receivedCredits.retrieve( + 'rc_xxxxxxxxxxxxx' + ); + expect(receivedCredit).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedDebits', function() { + it('list method', async function() { + const receivedDebits = await stripe.treasury.receivedDebits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedDebits).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedDebit = await stripe.treasury.receivedDebits.retrieve( + 'rd_xxxxxxxxxxxxx' + ); + expect(receivedDebit).not.to.be.null; + }); +}); + +describe('Treasury.TransactionEntries', function() { it('list method', async function() { const transactionEntries = await stripe.treasury.transactionEntries.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2823,7 +2837,7 @@ describe('Treasury.TransactionEntry', function() { }); }); -describe('Treasury.Transaction', function() { +describe('Treasury.Transactions', function() { it('list method', async function() { const transactions = await stripe.treasury.transactions.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2840,7 +2854,7 @@ describe('Treasury.Transaction', function() { }); }); -describe('WebhookEndpoint', function() { +describe('WebhookEndpoints', function() { it('list method', async function() { const webhookEndpoints = await stripe.webhookEndpoints.list({limit: 3}); expect(webhookEndpoints).not.to.be.null; diff --git a/types/Accounts.d.ts b/types/Accounts.d.ts index 5f3b45178d..714e4a0e88 100644 --- a/types/Accounts.d.ts +++ b/types/Accounts.d.ts @@ -246,6 +246,11 @@ declare module 'stripe' { */ ideal_payments?: Capabilities.IdealPayments; + /** + * The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. + */ + india_international_payments?: Capabilities.IndiaInternationalPayments; + /** * 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. */ @@ -362,6 +367,8 @@ declare module 'stripe' { type IdealPayments = 'active' | 'inactive' | 'pending'; + type IndiaInternationalPayments = 'active' | 'inactive' | 'pending'; + type JcbPayments = 'active' | 'inactive' | 'pending'; type KlarnaPayments = 'active' | 'inactive' | 'pending'; diff --git a/types/AccountsResource.d.ts b/types/AccountsResource.d.ts index 5f287942fa..c0375dc4d4 100644 --- a/types/AccountsResource.d.ts +++ b/types/AccountsResource.d.ts @@ -221,6 +221,11 @@ declare module 'stripe' { */ ideal_payments?: Capabilities.IdealPayments; + /** + * The india_international_payments capability. + */ + india_international_payments?: Capabilities.IndiaInternationalPayments; + /** * The jcb_payments capability. */ @@ -422,6 +427,13 @@ declare module 'stripe' { requested?: boolean; } + interface IndiaInternationalPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + interface JcbPayments { /** * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. @@ -1436,6 +1448,11 @@ declare module 'stripe' { */ ideal_payments?: Capabilities.IdealPayments; + /** + * The india_international_payments capability. + */ + india_international_payments?: Capabilities.IndiaInternationalPayments; + /** * The jcb_payments capability. */ @@ -1637,6 +1654,13 @@ declare module 'stripe' { requested?: boolean; } + interface IndiaInternationalPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + interface JcbPayments { /** * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. diff --git a/types/Checkout/Sessions.d.ts b/types/Checkout/Sessions.d.ts index c14042bb1f..b12a2cbb91 100644 --- a/types/Checkout/Sessions.d.ts +++ b/types/Checkout/Sessions.d.ts @@ -125,6 +125,16 @@ declare module 'stripe' { */ expires_at: number; + /** + * ID of the invoice created by the Checkout Session, if it exists. + */ + invoice: string | Stripe.Invoice | null; + + /** + * Details on the state of invoice creation for the Checkout Session. + */ + invoice_creation: Session.InvoiceCreation | null; + /** * The line items purchased by the customer. */ @@ -476,6 +486,72 @@ declare module 'stripe' { } } + interface InvoiceCreation { + /** + * Indicates whether invoice creation is enabled for the Checkout Session. + */ + enabled: boolean; + + invoice_data: InvoiceCreation.InvoiceData; + } + + namespace InvoiceCreation { + interface InvoiceData { + /** + * The account tax IDs associated with the invoice. + */ + account_tax_ids: Array< + string | Stripe.TaxId | Stripe.DeletedTaxId + > | null; + + /** + * Custom fields displayed on the invoice. + */ + custom_fields: Array | null; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * Footer displayed on the invoice. + */ + footer: string | null; + + /** + * 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. + */ + metadata: Stripe.Metadata | null; + + /** + * Options for invoice PDF rendering. + */ + rendering_options: InvoiceData.RenderingOptions | null; + } + + namespace InvoiceData { + interface CustomField { + /** + * The name of the custom field. + */ + name: string; + + /** + * The value of the custom field. + */ + value: string; + } + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + */ + amount_tax_display: string | null; + } + } + } + type Locale = | 'auto' | 'bg' diff --git a/types/Checkout/SessionsResource.d.ts b/types/Checkout/SessionsResource.d.ts index 4f51a7aa7c..2df711a354 100644 --- a/types/Checkout/SessionsResource.d.ts +++ b/types/Checkout/SessionsResource.d.ts @@ -116,6 +116,11 @@ declare module 'stripe' { */ expires_at?: number; + /** + * Generate a post-purchase Invoice for one-time payments. + */ + 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). * @@ -345,6 +350,79 @@ declare module 'stripe' { promotion_code?: string; } + interface InvoiceCreation { + /** + * Set to `true` to enable invoice creation. + */ + enabled: boolean; + + /** + * Parameters passed when creating invoices for payment-mode Checkout Sessions. + */ + invoice_data?: InvoiceCreation.InvoiceData; + } + + namespace InvoiceCreation { + interface InvoiceData { + /** + * The account tax IDs associated with the invoice. + */ + account_tax_ids?: Stripe.Emptyable>; + + /** + * Default custom fields to be displayed on invoices for this customer. + */ + custom_fields?: Stripe.Emptyable>; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Default footer to be displayed on invoices for this customer. + */ + footer?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * Default options for invoice PDF rendering for this customer. + */ + rendering_options?: Stripe.Emptyable; + } + + namespace InvoiceData { + interface CustomField { + /** + * The name of the custom field. This may be up to 30 characters. + */ + name: string; + + /** + * The value of the custom field. This may be up to 30 characters. + */ + value: string; + } + + interface RenderingOptions { + /** + * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + */ + amount_tax_display?: Stripe.Emptyable< + RenderingOptions.AmountTaxDisplay + >; + } + + namespace RenderingOptions { + type AmountTaxDisplay = 'exclude_tax' | 'include_inclusive_tax'; + } + } + } + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. diff --git a/types/InvoiceItemsResource.d.ts b/types/InvoiceItemsResource.d.ts index c74f31a76d..8eb93470c3 100644 --- a/types/InvoiceItemsResource.d.ts +++ b/types/InvoiceItemsResource.d.ts @@ -49,7 +49,7 @@ declare module 'stripe' { metadata?: Stripe.Emptyable; /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. */ period?: InvoiceItemCreateParams.Period; @@ -197,7 +197,7 @@ declare module 'stripe' { metadata?: Stripe.Emptyable; /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. */ period?: InvoiceItemUpdateParams.Period; diff --git a/types/InvoicesResource.d.ts b/types/InvoicesResource.d.ts index a055886235..a8fb18fa1b 100644 --- a/types/InvoicesResource.d.ts +++ b/types/InvoicesResource.d.ts @@ -1212,7 +1212,7 @@ declare module 'stripe' { metadata?: Stripe.Emptyable; /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. */ period?: InvoiceItem.Period; @@ -1777,7 +1777,7 @@ declare module 'stripe' { metadata?: Stripe.Emptyable; /** - * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. + * The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. */ period?: InvoiceItem.Period; diff --git a/types/Issuing/Authorizations.d.ts b/types/Issuing/Authorizations.d.ts index 776163a27f..46b2fa56b8 100644 --- a/types/Issuing/Authorizations.d.ts +++ b/types/Issuing/Authorizations.d.ts @@ -99,7 +99,7 @@ declare module 'stripe' { pending_request: Authorization.PendingRequest | null; /** - * History of every time `pending_request` was approved/denied, either by you directly or by Stripe (e.g. based on your `spending_controls`). If the merchant changes the authorization by performing an [incremental authorization](https://stripe.com/docs/issuing/purchases/authorizations), you can look at this field to see the previous requests for the authorization. + * History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. */ request_history: Array; @@ -121,7 +121,7 @@ declare module 'stripe' { verification_data: Authorization.VerificationData; /** - * The digital wallet used for this authorization. One of `apple_pay`, `google_pay`, or `samsung_pay`. + * The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. */ wallet: string | null; } @@ -168,7 +168,7 @@ declare module 'stripe' { name: string | null; /** - * Identifier assigned to the seller by the card brand + * Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. */ network_id: string; @@ -185,7 +185,7 @@ declare module 'stripe' { interface NetworkData { /** - * ID from the network that identifies the acquiring financial institution. For Visa and Mastercard credit transactions this is as 6 digit code. For Maestro debit transactions this is a 9 digit code. Uncommonly, acquiring institution ID is not provided. When this occurs, the value will be null. + * Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. */ acquiring_institution_id: string | null; } @@ -268,7 +268,7 @@ declare module 'stripe' { merchant_currency: string; /** - * The reason for the approval or decline. + * When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. */ reason: RequestHistory.Reason; diff --git a/types/Issuing/Transactions.d.ts b/types/Issuing/Transactions.d.ts index a891943e44..19e768707b 100644 --- a/types/Issuing/Transactions.d.ts +++ b/types/Issuing/Transactions.d.ts @@ -144,7 +144,7 @@ declare module 'stripe' { name: string | null; /** - * Identifier assigned to the seller by the card brand + * Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. */ network_id: string; diff --git a/types/PaymentLinksResource.d.ts b/types/PaymentLinksResource.d.ts index 846c8d7a6d..2ea1787de1 100644 --- a/types/PaymentLinksResource.d.ts +++ b/types/PaymentLinksResource.d.ts @@ -251,12 +251,12 @@ declare module 'stripe' { enabled: boolean; /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. */ maximum?: number; /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + * The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. */ minimum?: number; } @@ -801,12 +801,12 @@ declare module 'stripe' { enabled: boolean; /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. */ maximum?: number; /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + * The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. */ minimum?: number; } diff --git a/types/SubscriptionSchedules.d.ts b/types/SubscriptionSchedules.d.ts index 52dd3cdedc..e309b2bf9c 100644 --- a/types/SubscriptionSchedules.d.ts +++ b/types/SubscriptionSchedules.d.ts @@ -361,6 +361,11 @@ declare module 'stripe' { */ billing_thresholds: Item.BillingThresholds | null; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + */ + metadata: Stripe.Metadata | null; + /** * ID of the plan to which the customer should be subscribed. */ diff --git a/types/SubscriptionSchedulesResource.d.ts b/types/SubscriptionSchedulesResource.d.ts index 780204360f..3f5b3273d2 100644 --- a/types/SubscriptionSchedulesResource.d.ts +++ b/types/SubscriptionSchedulesResource.d.ts @@ -344,6 +344,11 @@ declare module 'stripe' { */ billing_thresholds?: Stripe.Emptyable; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + */ + metadata?: Stripe.MetadataParam; + /** * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. */ @@ -794,6 +799,11 @@ declare module 'stripe' { */ billing_thresholds?: Stripe.Emptyable; + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + */ + metadata?: Stripe.MetadataParam; + /** * The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. */ From 1309e7978ddf9375b146e4b3a0231c5dc1690830 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 6 Dec 2022 10:58:49 -0800 Subject: [PATCH 19/23] Codegen for openapi v212 --- OPENAPI_VERSION | 2 +- types/BillingPortal/Sessions.d.ts | 65 ++++++++++++++++++++++ types/BillingPortal/SessionsResource.d.ts | 68 +++++++++++++++++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ec25eb3028..eaf5acec6b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v211 \ No newline at end of file +v212 \ No newline at end of file diff --git a/types/BillingPortal/Sessions.d.ts b/types/BillingPortal/Sessions.d.ts index a0e9a767b0..b2f72d0170 100644 --- a/types/BillingPortal/Sessions.d.ts +++ b/types/BillingPortal/Sessions.d.ts @@ -45,6 +45,11 @@ declare module 'stripe' { */ customer: string; + /** + * Information about a specific flow for the customer to go through. + */ + flow: Session.Flow | null; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ @@ -72,6 +77,66 @@ declare module 'stripe' { } namespace Session { + interface Flow { + after_completion: Flow.AfterCompletion; + + /** + * Configuration when `flow.type=subscription_cancel`. + */ + subscription_cancel: Flow.SubscriptionCancel | null; + + /** + * Type of flow that the customer will go through. + */ + type: Flow.Type; + } + + namespace Flow { + interface AfterCompletion { + /** + * Configuration when `after_completion.type=hosted_confirmation`. + */ + hosted_confirmation: AfterCompletion.HostedConfirmation | null; + + /** + * Configuration when `after_completion.type=redirect`. + */ + redirect: AfterCompletion.Redirect | null; + + /** + * The specified type of behavior after the flow is completed. + */ + type: AfterCompletion.Type; + } + + namespace AfterCompletion { + interface HostedConfirmation { + /** + * A custom message to display to the customer after the flow is completed. + */ + custom_message: string | null; + } + + interface Redirect { + /** + * The URL the customer will be redirected to after the flow is completed. + */ + return_url: string; + } + + type Type = 'hosted_confirmation' | 'portal_homepage' | 'redirect'; + } + + interface SubscriptionCancel { + /** + * The ID of the subscription to be canceled. + */ + subscription: string; + } + + type Type = 'payment_method_update' | 'subscription_cancel'; + } + type Locale = | 'auto' | 'bg' diff --git a/types/BillingPortal/SessionsResource.d.ts b/types/BillingPortal/SessionsResource.d.ts index 10b8bf8042..4fa9916d3f 100644 --- a/types/BillingPortal/SessionsResource.d.ts +++ b/types/BillingPortal/SessionsResource.d.ts @@ -19,6 +19,11 @@ declare module 'stripe' { */ expand?: Array; + /** + * Information about a specific flow for the customer to go through. + */ + flow_data?: SessionCreateParams.FlowData; + /** * The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. */ @@ -36,6 +41,69 @@ declare module 'stripe' { } namespace SessionCreateParams { + interface FlowData { + /** + * Behavior after the flow is completed. + */ + after_completion?: FlowData.AfterCompletion; + + /** + * Configuration when `flow_data.type=subscription_cancel`. + */ + subscription_cancel?: FlowData.SubscriptionCancel; + + /** + * Type of flow that the customer will go through. + */ + type: FlowData.Type; + } + + namespace FlowData { + interface AfterCompletion { + /** + * Configuration when `after_completion.type=hosted_confirmation`. + */ + hosted_confirmation?: AfterCompletion.HostedConfirmation; + + /** + * Configuration when `after_completion.type=redirect`. + */ + redirect?: AfterCompletion.Redirect; + + /** + * The specified behavior after the flow is completed. + */ + type: AfterCompletion.Type; + } + + namespace AfterCompletion { + interface HostedConfirmation { + /** + * A custom message to display to the customer after the flow is completed. + */ + custom_message?: string; + } + + interface Redirect { + /** + * The URL the customer will be redirected to after the flow is completed. + */ + return_url: string; + } + + type Type = 'hosted_confirmation' | 'portal_homepage' | 'redirect'; + } + + interface SubscriptionCancel { + /** + * The ID of the subscription to be canceled. + */ + subscription: string; + } + + type Type = 'payment_method_update' | 'subscription_cancel'; + } + type Locale = | 'auto' | 'bg' From a91857ad68c2ff1a317f2a3cdb51e5aebf7df6b2 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 6 Dec 2022 12:45:16 -0800 Subject: [PATCH 20/23] Bump version to 11.2.0 --- CHANGELOG.md | 16 ++++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0139e99f09..76305c9e23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 11.2.0 - 2022-12-06 +* [#1632](https://github.com/stripe/stripe-node/pull/1632) API Updates + * Add support for `flow_data` on `BillingPortalSessionCreateParams` + * Add support for `flow` on `BillingPortal.Session` +* [#1631](https://github.com/stripe/stripe-node/pull/1631) API Updates + * Add support for `india_international_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities` + * Add support for `invoice_creation` on `Checkout.Session` and `CheckoutSessionCreateParams` + * Add support for `invoice` on `Checkout.Session` + * Add support for `metadata` on `SubscriptionSchedule.phases[].items[]`, `SubscriptionScheduleCreateParams.phases[].items[]`, and `SubscriptionScheduleUpdateParams.phases[].items[]` +* [#1630](https://github.com/stripe/stripe-node/pull/1630) Remove BASIC_METHODS from TS definitions +* [#1629](https://github.com/stripe/stripe-node/pull/1629) Narrower type for stripe.invoices.retrieveUpcoming() +* [#1627](https://github.com/stripe/stripe-node/pull/1627) remove unneeded IIFE +* [#1625](https://github.com/stripe/stripe-node/pull/1625) Remove API version from the path +* [#1626](https://github.com/stripe/stripe-node/pull/1626) Move child resource method params next to method declarations +* [#1624](https://github.com/stripe/stripe-node/pull/1624) Split resource and service types + ## 11.1.0 - 2022-11-17 * [#1623](https://github.com/stripe/stripe-node/pull/1623) API Updates * Add support for `hosted_instructions_url` on `PaymentIntent.next_action.wechat_pay_display_qr_code` diff --git a/VERSION b/VERSION index 68d8f15e23..b85c6c7b03 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.1.0 +11.2.0 diff --git a/package.json b/package.json index 0ec6c5a08b..e574f98a73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "11.1.0", + "version": "11.2.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 0355ad112ecb06b74d15818be7522f7c40f4784e Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 8 Dec 2022 11:36:10 -0800 Subject: [PATCH 21/23] Set version to 11.2.0 to simplify merge --- VERSION | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f81e7642e8..b85c6c7b03 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.18.0-beta.1 +11.2.0 diff --git a/package.json b/package.json index 44a8f87069..2ca2698209 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "10.18.0-beta.1", + "version": "11.2.0", "description": "Stripe API wrapper", "keywords": [ "stripe", From 495db76cf0914de34b72714440ddc81a1ef3f21d Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 8 Dec 2022 11:36:47 -0800 Subject: [PATCH 22/23] Reset version to 10.18.0-beta.1 --- VERSION | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b85c6c7b03..f81e7642e8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.2.0 +10.18.0-beta.1 diff --git a/package.json b/package.json index e574f98a73..b3a621c6cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "11.2.0", + "version": "10.18.0-beta.1", "description": "Stripe API wrapper", "keywords": [ "stripe", From 3d3a0a50fa8c23655dbd0c77c1fc54bdcfb4a5c4 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 8 Dec 2022 11:37:06 -0800 Subject: [PATCH 23/23] Codegen for openapi v212 --- lib/resources.js | 17 +- lib/resources/AccountSessions.js | 3 +- lib/resources/Capital/FinancingOffers.js | 7 +- lib/resources/Capital/FinancingSummary.js | 3 +- .../Capital/FinancingTransactions.js | 5 +- lib/resources/GiftCards/Cards.js | 11 +- lib/resources/GiftCards/Transactions.js | 13 +- lib/resources/Orders.js | 40 + lib/resources/QuotePhases.js | 7 +- lib/resources/SubscriptionSchedules.js | 2 +- lib/resources/Terminal/Readers.js | 2 +- src/resources.js | 17 +- src/resources/AccountSessions.js | 4 +- src/resources/Capital/FinancingOffers.js | 8 +- src/resources/Capital/FinancingSummary.js | 4 +- .../Capital/FinancingTransactions.js | 6 +- src/resources/GiftCards/Cards.js | 12 +- src/resources/GiftCards/Transactions.js | 14 +- src/resources/Orders.js | 50 + src/resources/QuotePhases.js | 8 +- src/resources/SubscriptionSchedules.js | 2 +- src/resources/Terminal/Readers.js | 2 +- .../resources/generated_examples_test.spec.js | 590 +-- types/AccountSessions.d.ts | 22 - types/AccountSessionsResource.d.ts | 27 + types/Accounts.d.ts | 14 + types/AccountsResource.d.ts | 4421 ++++++++--------- types/Capital/FinancingOffers.d.ts | 88 - types/Capital/FinancingOffersResource.d.ts | 95 + types/Capital/FinancingSummary.d.ts | 20 - types/Capital/FinancingSummaryResource.d.ts | 27 + types/Capital/FinancingTransactions.d.ts | 56 - .../FinancingTransactionsResource.d.ts | 63 + types/Coupons.d.ts | 2 +- types/CouponsResource.d.ts | 131 - types/GiftCards/Cards.d.ts | 152 - types/GiftCards/CardsResource.d.ts | 159 + types/GiftCards/Transactions.d.ts | 194 - types/GiftCards/TransactionsResource.d.ts | 201 + types/LineItems.d.ts | 7 + types/Mandates.d.ts | 4 + types/Orders.d.ts | 950 ++++ types/OrdersResource.d.ts | 2569 ++++++++++ types/PaymentIntents.d.ts | 83 + types/PaymentIntentsResource.d.ts | 1883 ------- types/PaymentLinks.d.ts | 1 + types/PaymentLinksResource.d.ts | 614 +-- types/PaymentMethods.d.ts | 17 +- types/PaymentMethodsResource.d.ts | 801 --- types/Prices.d.ts | 22 + types/PricesResource.d.ts | 345 -- types/Products.d.ts | 39 + types/ProductsResource.d.ts | 204 - types/QuotePhases.d.ts | 62 - types/QuotePhasesResource.d.ts | 67 + types/Quotes.d.ts | 50 + types/QuotesResource.d.ts | 564 --- types/SetupIntents.d.ts | 35 + types/SetupIntentsResource.d.ts | 623 --- types/SubscriptionItems.d.ts | 23 + types/SubscriptionItemsResource.d.ts | 155 +- types/SubscriptionSchedules.d.ts | 189 + types/SubscriptionSchedulesResource.d.ts | 595 +-- types/Subscriptions.d.ts | 32 + types/SubscriptionsResource.d.ts | 580 --- types/Terminal/Readers.d.ts | 47 + types/Terminal/ReadersResource.d.ts | 294 -- types/Treasury/OutboundTransfers.d.ts | 181 - types/Treasury/OutboundTransfersResource.d.ts | 26 + types/index.d.ts | 10 + 70 files changed, 7328 insertions(+), 10243 deletions(-) create mode 100644 lib/resources/Orders.js create mode 100644 src/resources/Orders.js create mode 100644 types/AccountSessionsResource.d.ts create mode 100644 types/Capital/FinancingOffersResource.d.ts create mode 100644 types/Capital/FinancingSummaryResource.d.ts create mode 100644 types/Capital/FinancingTransactionsResource.d.ts create mode 100644 types/GiftCards/CardsResource.d.ts create mode 100644 types/GiftCards/TransactionsResource.d.ts create mode 100644 types/Orders.d.ts create mode 100644 types/OrdersResource.d.ts create mode 100644 types/QuotePhasesResource.d.ts diff --git a/lib/resources.js b/lib/resources.js index f89e89c42a..84176104f3 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -2,10 +2,10 @@ 'use strict'; const resourceNamespace = require('./ResourceNamespace'); module.exports = { - Accounts: require('./resources/Accounts'), // Support Accounts for consistency, Account for backwards compatibility Account: require('./resources/Accounts'), AccountLinks: require('./resources/AccountLinks'), + Accounts: require('./resources/Accounts'), AccountSessions: require('./resources/AccountSessions'), ApplePayDomains: require('./resources/ApplePayDomains'), ApplicationFees: require('./resources/ApplicationFees'), @@ -20,10 +20,10 @@ module.exports = { EphemeralKeys: require('./resources/EphemeralKeys'), Events: require('./resources/Events'), ExchangeRates: require('./resources/ExchangeRates'), - Files: require('./resources/Files'), FileLinks: require('./resources/FileLinks'), - Invoices: require('./resources/Invoices'), + Files: require('./resources/Files'), InvoiceItems: require('./resources/InvoiceItems'), + Invoices: require('./resources/Invoices'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), Orders: require('./resources/Orders'), @@ -35,17 +35,16 @@ module.exports = { Prices: require('./resources/Prices'), Products: require('./resources/Products'), PromotionCodes: require('./resources/PromotionCodes'), - Quotes: require('./resources/Quotes'), QuotePhases: require('./resources/QuotePhases'), + Quotes: require('./resources/Quotes'), Refunds: require('./resources/Refunds'), Reviews: require('./resources/Reviews'), SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), - Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), + Subscriptions: require('./resources/Subscriptions'), SubscriptionSchedules: require('./resources/SubscriptionSchedules'), TaxCodes: require('./resources/TaxCodes'), TaxRates: require('./resources/TaxRates'), @@ -82,15 +81,15 @@ module.exports = { }), Issuing: resourceNamespace('issuing', { Authorizations: require('./resources/Issuing/Authorizations'), - Cards: require('./resources/Issuing/Cards'), Cardholders: require('./resources/Issuing/Cardholders'), + Cards: require('./resources/Issuing/Cards'), Disputes: require('./resources/Issuing/Disputes'), Transactions: require('./resources/Issuing/Transactions'), }), Radar: resourceNamespace('radar', { EarlyFraudWarnings: require('./resources/Radar/EarlyFraudWarnings'), - ValueLists: require('./resources/Radar/ValueLists'), ValueListItems: require('./resources/Radar/ValueListItems'), + ValueLists: require('./resources/Radar/ValueLists'), }), Reporting: resourceNamespace('reporting', { ReportRuns: require('./resources/Reporting/ReportRuns'), @@ -132,7 +131,7 @@ module.exports = { OutboundTransfers: require('./resources/Treasury/OutboundTransfers'), ReceivedCredits: require('./resources/Treasury/ReceivedCredits'), ReceivedDebits: require('./resources/Treasury/ReceivedDebits'), - Transactions: require('./resources/Treasury/Transactions'), TransactionEntries: require('./resources/Treasury/TransactionEntries'), + Transactions: require('./resources/Treasury/Transactions'), }), }; diff --git a/lib/resources/AccountSessions.js b/lib/resources/AccountSessions.js index 34b19c4ec8..adcf1dd5e8 100644 --- a/lib/resources/AccountSessions.js +++ b/lib/resources/AccountSessions.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_sessions', }), }); diff --git a/lib/resources/Capital/FinancingOffers.js b/lib/resources/Capital/FinancingOffers.js index 6fdd5d1ef3..9c3a0484ea 100644 --- a/lib/resources/Capital/FinancingOffers.js +++ b/lib/resources/Capital/FinancingOffers.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_offers', retrieve: stripeMethod({ method: 'GET', - path: '/{financingOffer}', + fullPath: '/v1/capital/financing_offers/{financing_offer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_offers', methodType: 'list', }), markDelivered: stripeMethod({ method: 'POST', - path: '/{financingOffer}/mark_delivered', + fullPath: '/v1/capital/financing_offers/{financing_offer}/mark_delivered', }), }); diff --git a/lib/resources/Capital/FinancingSummary.js b/lib/resources/Capital/FinancingSummary.js index 5dceb357b7..b5f6aa2b9e 100644 --- a/lib/resources/Capital/FinancingSummary.js +++ b/lib/resources/Capital/FinancingSummary.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_summary', retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_summary', }), }); diff --git a/lib/resources/Capital/FinancingTransactions.js b/lib/resources/Capital/FinancingTransactions.js index 8bbeeae2f3..84c9c200f4 100644 --- a/lib/resources/Capital/FinancingTransactions.js +++ b/lib/resources/Capital/FinancingTransactions.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{financingTransaction}', + fullPath: '/v1/capital/financing_transactions/{financing_transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_transactions', methodType: 'list', }), }); diff --git a/lib/resources/GiftCards/Cards.js b/lib/resources/GiftCards/Cards.js index 0100906b7e..44f5c4a41c 100644 --- a/lib/resources/GiftCards/Cards.js +++ b/lib/resources/GiftCards/Cards.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'gift_cards/cards', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/gift_cards/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/gift_cards/cards/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/gift_cards/cards/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/gift_cards/cards', methodType: 'list', }), validate: stripeMethod({ method: 'POST', - path: '/validate', + fullPath: '/v1/gift_cards/cards/validate', }), }); diff --git a/lib/resources/GiftCards/Transactions.js b/lib/resources/GiftCards/Transactions.js index 0e2ecfee67..c1c940b2ee 100644 --- a/lib/resources/GiftCards/Transactions.js +++ b/lib/resources/GiftCards/Transactions.js @@ -3,30 +3,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'gift_cards/transactions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/gift_cards/transactions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/gift_cards/transactions/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/gift_cards/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/gift_cards/transactions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/gift_cards/transactions/{id}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{id}/confirm', + fullPath: '/v1/gift_cards/transactions/{id}/confirm', }), }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js new file mode 100644 index 0000000000..371e173956 --- /dev/null +++ b/lib/resources/Orders.js @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +'use strict'; +const StripeResource = require('../StripeResource'); +const stripeMethod = StripeResource.method; +module.exports = StripeResource.extend({ + create: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders', + }), + retrieve: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders/{id}', + }), + update: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}', + }), + list: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders', + methodType: 'list', + }), + cancel: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/cancel', + }), + listLineItems: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders/{id}/line_items', + methodType: 'list', + }), + reopen: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/reopen', + }), + submit: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/submit', + }), +}); diff --git a/lib/resources/QuotePhases.js b/lib/resources/QuotePhases.js index 4b87914b36..a5f7fc8d91 100644 --- a/lib/resources/QuotePhases.js +++ b/lib/resources/QuotePhases.js @@ -3,19 +3,18 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quote_phases', retrieve: stripeMethod({ method: 'GET', - path: '/{quotePhase}', + fullPath: '/v1/quote_phases/{quote_phase}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quote_phases', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quotePhase}/line_items', + fullPath: '/v1/quote_phases/{quote_phase}/line_items', methodType: 'list', }), }); diff --git a/lib/resources/SubscriptionSchedules.js b/lib/resources/SubscriptionSchedules.js index fc453ff14e..7108b83284 100644 --- a/lib/resources/SubscriptionSchedules.js +++ b/lib/resources/SubscriptionSchedules.js @@ -22,7 +22,7 @@ module.exports = StripeResource.extend({ }), amend: stripeMethod({ method: 'POST', - path: '/{schedule}/amend', + fullPath: '/v1/subscription_schedules/{schedule}/amend', }), cancel: stripeMethod({ method: 'POST', diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index b8f9e59650..b94aa41e3d 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -38,7 +38,7 @@ module.exports = StripeResource.extend({ }), refundPayment: stripeMethod({ method: 'POST', - path: '/{reader}/refund_payment', + fullPath: '/v1/terminal/readers/{reader}/refund_payment', }), setReaderDisplay: stripeMethod({ method: 'POST', diff --git a/src/resources.js b/src/resources.js index 646c1c23ac..4b28b2ce0f 100644 --- a/src/resources.js +++ b/src/resources.js @@ -5,10 +5,10 @@ const resourceNamespace = require('./ResourceNamespace'); module.exports = { - Accounts: require('./resources/Accounts'), // Support Accounts for consistency, Account for backwards compatibility Account: require('./resources/Accounts'), AccountLinks: require('./resources/AccountLinks'), + Accounts: require('./resources/Accounts'), AccountSessions: require('./resources/AccountSessions'), ApplePayDomains: require('./resources/ApplePayDomains'), ApplicationFees: require('./resources/ApplicationFees'), @@ -23,10 +23,10 @@ module.exports = { EphemeralKeys: require('./resources/EphemeralKeys'), Events: require('./resources/Events'), ExchangeRates: require('./resources/ExchangeRates'), - Files: require('./resources/Files'), FileLinks: require('./resources/FileLinks'), - Invoices: require('./resources/Invoices'), + Files: require('./resources/Files'), InvoiceItems: require('./resources/InvoiceItems'), + Invoices: require('./resources/Invoices'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), Orders: require('./resources/Orders'), @@ -38,17 +38,16 @@ module.exports = { Prices: require('./resources/Prices'), Products: require('./resources/Products'), PromotionCodes: require('./resources/PromotionCodes'), - Quotes: require('./resources/Quotes'), QuotePhases: require('./resources/QuotePhases'), + Quotes: require('./resources/Quotes'), Refunds: require('./resources/Refunds'), Reviews: require('./resources/Reviews'), SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), - Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), + Subscriptions: require('./resources/Subscriptions'), SubscriptionSchedules: require('./resources/SubscriptionSchedules'), TaxCodes: require('./resources/TaxCodes'), TaxRates: require('./resources/TaxRates'), @@ -85,15 +84,15 @@ module.exports = { }), Issuing: resourceNamespace('issuing', { Authorizations: require('./resources/Issuing/Authorizations'), - Cards: require('./resources/Issuing/Cards'), Cardholders: require('./resources/Issuing/Cardholders'), + Cards: require('./resources/Issuing/Cards'), Disputes: require('./resources/Issuing/Disputes'), Transactions: require('./resources/Issuing/Transactions'), }), Radar: resourceNamespace('radar', { EarlyFraudWarnings: require('./resources/Radar/EarlyFraudWarnings'), - ValueLists: require('./resources/Radar/ValueLists'), ValueListItems: require('./resources/Radar/ValueListItems'), + ValueLists: require('./resources/Radar/ValueLists'), }), Reporting: resourceNamespace('reporting', { ReportRuns: require('./resources/Reporting/ReportRuns'), @@ -135,7 +134,7 @@ module.exports = { OutboundTransfers: require('./resources/Treasury/OutboundTransfers'), ReceivedCredits: require('./resources/Treasury/ReceivedCredits'), ReceivedDebits: require('./resources/Treasury/ReceivedDebits'), - Transactions: require('./resources/Treasury/Transactions'), TransactionEntries: require('./resources/Treasury/TransactionEntries'), + Transactions: require('./resources/Treasury/Transactions'), }), }; diff --git a/src/resources/AccountSessions.js b/src/resources/AccountSessions.js index dc5c3365d3..c0418ae565 100644 --- a/src/resources/AccountSessions.js +++ b/src/resources/AccountSessions.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_sessions', }), }); diff --git a/src/resources/Capital/FinancingOffers.js b/src/resources/Capital/FinancingOffers.js index f14172a563..ca3bcf84c1 100644 --- a/src/resources/Capital/FinancingOffers.js +++ b/src/resources/Capital/FinancingOffers.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_offers', - retrieve: stripeMethod({ method: 'GET', - path: '/{financingOffer}', + fullPath: '/v1/capital/financing_offers/{financing_offer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_offers', methodType: 'list', }), markDelivered: stripeMethod({ method: 'POST', - path: '/{financingOffer}/mark_delivered', + fullPath: '/v1/capital/financing_offers/{financing_offer}/mark_delivered', }), }); diff --git a/src/resources/Capital/FinancingSummary.js b/src/resources/Capital/FinancingSummary.js index a3e102f499..e80f14812b 100644 --- a/src/resources/Capital/FinancingSummary.js +++ b/src/resources/Capital/FinancingSummary.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_summary', - retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_summary', }), }); diff --git a/src/resources/Capital/FinancingTransactions.js b/src/resources/Capital/FinancingTransactions.js index 3e3740a8d1..9b704fd217 100644 --- a/src/resources/Capital/FinancingTransactions.js +++ b/src/resources/Capital/FinancingTransactions.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'capital/financing_transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{financingTransaction}', + fullPath: '/v1/capital/financing_transactions/{financing_transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/capital/financing_transactions', methodType: 'list', }), }); diff --git a/src/resources/GiftCards/Cards.js b/src/resources/GiftCards/Cards.js index 5baa1df68a..27e9dd291b 100644 --- a/src/resources/GiftCards/Cards.js +++ b/src/resources/GiftCards/Cards.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'gift_cards/cards', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/gift_cards/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/gift_cards/cards/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/gift_cards/cards/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/gift_cards/cards', methodType: 'list', }), validate: stripeMethod({ method: 'POST', - path: '/validate', + fullPath: '/v1/gift_cards/cards/validate', }), }); diff --git a/src/resources/GiftCards/Transactions.js b/src/resources/GiftCards/Transactions.js index b604e119df..6d3c3ca88c 100644 --- a/src/resources/GiftCards/Transactions.js +++ b/src/resources/GiftCards/Transactions.js @@ -6,36 +6,34 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'gift_cards/transactions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/gift_cards/transactions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/gift_cards/transactions/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/gift_cards/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/gift_cards/transactions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/gift_cards/transactions/{id}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{id}/confirm', + fullPath: '/v1/gift_cards/transactions/{id}/confirm', }), }); diff --git a/src/resources/Orders.js b/src/resources/Orders.js new file mode 100644 index 0000000000..71f391de3b --- /dev/null +++ b/src/resources/Orders.js @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + create: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders', + }), + + retrieve: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders/{id}', + }), + + update: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}', + }), + + list: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders', + methodType: 'list', + }), + + cancel: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/cancel', + }), + + listLineItems: stripeMethod({ + method: 'GET', + fullPath: '/v1/orders/{id}/line_items', + methodType: 'list', + }), + + reopen: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/reopen', + }), + + submit: stripeMethod({ + method: 'POST', + fullPath: '/v1/orders/{id}/submit', + }), +}); diff --git a/src/resources/QuotePhases.js b/src/resources/QuotePhases.js index 54c2db1c69..896542dd98 100644 --- a/src/resources/QuotePhases.js +++ b/src/resources/QuotePhases.js @@ -6,22 +6,20 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quote_phases', - retrieve: stripeMethod({ method: 'GET', - path: '/{quotePhase}', + fullPath: '/v1/quote_phases/{quote_phase}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quote_phases', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quotePhase}/line_items', + fullPath: '/v1/quote_phases/{quote_phase}/line_items', methodType: 'list', }), }); diff --git a/src/resources/SubscriptionSchedules.js b/src/resources/SubscriptionSchedules.js index de8780fc49..6708639802 100644 --- a/src/resources/SubscriptionSchedules.js +++ b/src/resources/SubscriptionSchedules.js @@ -29,7 +29,7 @@ module.exports = StripeResource.extend({ amend: stripeMethod({ method: 'POST', - path: '/{schedule}/amend', + fullPath: '/v1/subscription_schedules/{schedule}/amend', }), cancel: stripeMethod({ diff --git a/src/resources/Terminal/Readers.js b/src/resources/Terminal/Readers.js index 00742d209b..554449db6c 100644 --- a/src/resources/Terminal/Readers.js +++ b/src/resources/Terminal/Readers.js @@ -49,7 +49,7 @@ module.exports = StripeResource.extend({ refundPayment: stripeMethod({ method: 'POST', - path: '/{reader}/refund_payment', + fullPath: '/v1/terminal/readers/{reader}/refund_payment', }), setReaderDisplay: stripeMethod({ diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 6d8dcaa58d..343d609e9c 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -5,7 +5,7 @@ const stripe = require('../../testUtils').getStripeMockClient(); const expect = require('chai').expect; -describe('Apps.Secret', function() { +describe('Apps.Secrets', function() { it('list method', async function() { const secrets = await stripe.apps.secrets.list({ scope: {type: 'account'}, @@ -49,7 +49,7 @@ describe('Apps.Secret', function() { }); }); -describe('Checkout.Session', function() { +describe('Checkout.Sessions', function() { it('create method', async function() { const session = await stripe.checkout.sessions.create({ success_url: 'https://example.com/success', @@ -111,7 +111,7 @@ describe('Checkout.Session', function() { }); }); -describe('CashBalance', function() { +describe('CashBalances', function() { it('retrieveCashBalance method', async function() { const cashBalance = await stripe.customers.retrieveCashBalance('cus_123'); expect(cashBalance).not.to.be.null; @@ -125,7 +125,7 @@ describe('CashBalance', function() { }); }); -describe('Customer', function() { +describe('Customers', function() { it('createFundingInstructions method', async function() { const fundingInstructions = await stripe.customers.createFundingInstructions( 'cus_123', @@ -149,14 +149,6 @@ describe('Customer', function() { expect(paymentMethods).not.to.be.null; }); - it('fundCashBalance method', async function() { - const customerCashBalanceTransaction = await stripe.testHelpers.customers.fundCashBalance( - 'cus_123', - {amount: 30, currency: 'eur'} - ); - expect(customerCashBalanceTransaction).not.to.be.null; - }); - it('list method', async function() { const customers = await stripe.customers.list({limit: 3}); expect(customers).not.to.be.null; @@ -214,7 +206,7 @@ describe('Customer', function() { }); }); -describe('FinancialConnections.Account', function() { +describe('FinancialConnections.Accounts', function() { it('list method', async function() { const accounts = await stripe.financialConnections.accounts.list(); expect(accounts).not.to.be.null; @@ -273,7 +265,7 @@ describe('FinancialConnections.Account', function() { }); }); -describe('FinancialConnections.Session', function() { +describe('FinancialConnections.Sessions', function() { it('create method', async function() { const session = await stripe.financialConnections.sessions.create({ account_holder: {type: 'customer', customer: 'cus_123'}, @@ -306,58 +298,7 @@ describe('FinancialConnections.Session', function() { }); }); -describe('Order', function() { - it('create method', async function() { - const order = await stripe.orders.create({ - description: 'description', - currency: 'usd', - line_items: [{description: 'my line item'}], - }); - expect(order).not.to.be.null; - }); - - it('retrieve method', async function() { - const order = await stripe.orders.retrieve('order_xyz'); - expect(order).not.to.be.null; - }); - - it('update method', async function() { - const order = await stripe.orders.update('order_xyz', { - metadata: {reference_number: '123'}, - ip_address: '0.0.0.0', - }); - expect(order).not.to.be.null; - }); - - it('cancel method', async function() { - const order = await stripe.orders.cancel('order_xyz'); - expect(order).not.to.be.null; - }); - - it('listLineItems method', async function() { - const lineItems = await stripe.orders.listLineItems('order_xyz'); - expect(lineItems).not.to.be.null; - }); - - it('reopen method', async function() { - const order = await stripe.orders.reopen('order_xyz'); - expect(order).not.to.be.null; - }); - - it('submit method', async function() { - const order = await stripe.orders.submit('order_xyz', { - expected_total: 100, - }); - expect(order).not.to.be.null; - }); - - it('list method', async function() { - const orders = await stripe.orders.list({limit: 3}); - expect(orders).not.to.be.null; - }); -}); - -describe('PaymentIntent', function() { +describe('PaymentIntents', function() { it('create method', async function() { const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, @@ -448,7 +389,7 @@ describe('PaymentIntent', function() { }); }); -describe('PaymentLink', function() { +describe('PaymentLinks', function() { it('create method', async function() { const paymentLink = await stripe.paymentLinks.create({ line_items: [{price: 'price_xxxxxxxxxxxxx', quantity: 1}], @@ -494,7 +435,7 @@ describe('PaymentLink', function() { }); }); -describe('Price', function() { +describe('Prices', function() { it('create method', async function() { const price = await stripe.prices.create({ unit_amount: 2000, @@ -544,7 +485,7 @@ describe('Price', function() { }); }); -describe('SetupAttempt', function() { +describe('SetupAttempts', function() { it('list method', async function() { const setupAttempts = await stripe.setupAttempts.list({ limit: 3, @@ -554,7 +495,7 @@ describe('SetupAttempt', function() { }); }); -describe('SetupIntent', function() { +describe('SetupIntents', function() { it('verifyMicrodeposits method', async function() { const setupIntent = await stripe.setupIntents.verifyMicrodeposits( 'seti_xxxxxxxxxxxxx' @@ -602,7 +543,7 @@ describe('SetupIntent', function() { }); }); -describe('ShippingRate', function() { +describe('ShippingRates', function() { it('list method', async function() { const shippingRates = await stripe.shippingRates.list(); expect(shippingRates).not.to.be.null; @@ -647,7 +588,7 @@ describe('ShippingRate', function() { }); }); -describe('Terminal.Configuration', function() { +describe('Terminal.Configurations', function() { it('list method', async function() { const configurations = await stripe.terminal.configurations.list(); expect(configurations).not.to.be.null; @@ -715,7 +656,17 @@ describe('Terminal.Configuration', function() { }); }); -describe('Issuing.Card', function() { +describe('TestHelpers.Customers', function() { + it('fundCashBalance method', async function() { + const customerCashBalanceTransaction = await stripe.testHelpers.customers.fundCashBalance( + 'cus_123', + {amount: 30, currency: 'eur'} + ); + expect(customerCashBalanceTransaction).not.to.be.null; + }); +}); + +describe('TestHelpers.Issuing.Cards', function() { it('deliverCard method', async function() { const card = await stripe.testHelpers.issuing.cards.deliverCard('card_123'); expect(card).not.to.be.null; @@ -735,71 +686,16 @@ describe('Issuing.Card', function() { const card = await stripe.testHelpers.issuing.cards.shipCard('card_123'); expect(card).not.to.be.null; }); - - it('list method', async function() { - const cards = await stripe.issuing.cards.list({limit: 3}); - expect(cards).not.to.be.null; - }); - - it('create method', async function() { - const card = await stripe.issuing.cards.create({ - cardholder: 'ich_xxxxxxxxxxxxx', - currency: 'usd', - type: 'virtual', - }); - expect(card).not.to.be.null; - }); - - it('retrieve method', async function() { - const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); - expect(card).not.to.be.null; - }); - - it('update method', async function() { - const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(card).not.to.be.null; - }); }); -describe('Refund', function() { +describe('TestHelpers.Refunds', function() { it('expire method', async function() { const refund = await stripe.testHelpers.refunds.expire('re_123'); expect(refund).not.to.be.null; }); - - it('list method', async function() { - const refunds = await stripe.refunds.list({limit: 3}); - expect(refunds).not.to.be.null; - }); - - it('create method', async function() { - const refund = await stripe.refunds.create({ - charge: 'ch_xxxxxxxxxxxxx', - }); - expect(refund).not.to.be.null; - }); - - it('retrieve method', async function() { - const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); - expect(refund).not.to.be.null; - }); - - it('update method', async function() { - const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(refund).not.to.be.null; - }); - - it('cancel method', async function() { - const refund = await stripe.refunds.cancel('re_xxxxxxxxxxxxx'); - expect(refund).not.to.be.null; - }); }); -describe('TestHelpers.TestClock', function() { +describe('TestHelpers.TestClocks', function() { it('list method', async function() { const testClocks = await stripe.testHelpers.testClocks.list(); expect(testClocks).not.to.be.null; @@ -865,7 +761,7 @@ describe('TestHelpers.TestClock', function() { }); }); -describe('Treasury.InboundTransfer', function() { +describe('TestHelpers.Treasury.InboundTransfers', function() { it('fail method', async function() { const inboundTransfer = await stripe.testHelpers.treasury.inboundTransfers.fail( 'ibt_123', @@ -887,42 +783,9 @@ describe('Treasury.InboundTransfer', function() { ); expect(inboundTransfer).not.to.be.null; }); - - it('list method', async function() { - const inboundTransfers = await stripe.treasury.inboundTransfers.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(inboundTransfers).not.to.be.null; - }); - - it('create method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.create({ - financial_account: 'fa_xxxxxxxxxxxxx', - amount: 10000, - currency: 'usd', - origin_payment_method: 'pm_xxxxxxxxxxxxx', - description: 'InboundTransfer from my bank account', - }); - expect(inboundTransfer).not.to.be.null; - }); - - it('retrieve method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.retrieve( - 'ibt_xxxxxxxxxxxxx' - ); - expect(inboundTransfer).not.to.be.null; - }); - - it('cancel method', async function() { - const inboundTransfer = await stripe.treasury.inboundTransfers.cancel( - 'ibt_xxxxxxxxxxxxx' - ); - expect(inboundTransfer).not.to.be.null; - }); }); -describe('Treasury.OutboundTransfer', function() { +describe('TestHelpers.Treasury.OutboundTransfers', function() { it('fail method', async function() { const outboundTransfer = await stripe.testHelpers.treasury.outboundTransfers.fail( 'obt_123' @@ -944,42 +807,9 @@ describe('Treasury.OutboundTransfer', function() { ); expect(outboundTransfer).not.to.be.null; }); - - it('list method', async function() { - const outboundTransfers = await stripe.treasury.outboundTransfers.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(outboundTransfers).not.to.be.null; - }); - - it('create method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.create({ - financial_account: 'fa_xxxxxxxxxxxxx', - destination_payment_method: 'pm_xxxxxxxxxxxxx', - amount: 500, - currency: 'usd', - description: 'OutboundTransfer to my external bank account', - }); - expect(outboundTransfer).not.to.be.null; - }); - - it('retrieve method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.retrieve( - 'obt_xxxxxxxxxxxxx' - ); - expect(outboundTransfer).not.to.be.null; - }); - - it('cancel method', async function() { - const outboundTransfer = await stripe.treasury.outboundTransfers.cancel( - 'obt_xxxxxxxxxxxxx' - ); - expect(outboundTransfer).not.to.be.null; - }); }); -describe('Treasury.ReceivedCredit', function() { +describe('TestHelpers.Treasury.ReceivedCredits', function() { it('create method', async function() { const receivedCredit = await stripe.testHelpers.treasury.receivedCredits.create( { @@ -991,24 +821,9 @@ describe('Treasury.ReceivedCredit', function() { ); expect(receivedCredit).not.to.be.null; }); - - it('list method', async function() { - const receivedCredits = await stripe.treasury.receivedCredits.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(receivedCredits).not.to.be.null; - }); - - it('retrieve method', async function() { - const receivedCredit = await stripe.treasury.receivedCredits.retrieve( - 'rc_xxxxxxxxxxxxx' - ); - expect(receivedCredit).not.to.be.null; - }); }); -describe('Treasury.ReceivedDebit', function() { +describe('TestHelpers.Treasury.ReceivedDebits', function() { it('create method', async function() { const receivedDebit = await stripe.testHelpers.treasury.receivedDebits.create( { @@ -1020,24 +835,9 @@ describe('Treasury.ReceivedDebit', function() { ); expect(receivedDebit).not.to.be.null; }); - - it('list method', async function() { - const receivedDebits = await stripe.treasury.receivedDebits.list({ - financial_account: 'fa_xxxxxxxxxxxxx', - limit: 3, - }); - expect(receivedDebits).not.to.be.null; - }); - - it('retrieve method', async function() { - const receivedDebit = await stripe.treasury.receivedDebits.retrieve( - 'rd_xxxxxxxxxxxxx' - ); - expect(receivedDebit).not.to.be.null; - }); }); -describe('Token', function() { +describe('Tokens', function() { it('create method', async function() { const token = await stripe.tokens.create({ card: { @@ -1103,7 +903,7 @@ describe('Token', function() { }); }); -describe('AccountLink', function() { +describe('AccountLinks', function() { it('create method', async function() { const accountLink = await stripe.accountLinks.create({ account: 'acct_xxxxxxxxxxxxx', @@ -1115,7 +915,7 @@ describe('AccountLink', function() { }); }); -describe('Account', function() { +describe('Accounts', function() { it('list method', async function() { const accounts = await stripe.accounts.list({limit: 3}); expect(accounts).not.to.be.null; @@ -1159,7 +959,7 @@ describe('Account', function() { }); }); -describe('Capability', function() { +describe('Capabilities', function() { it('listCapabilities method', async function() { const capabilities = await stripe.accounts.listCapabilities( 'acct_xxxxxxxxxxxxx' @@ -1185,7 +985,7 @@ describe('Capability', function() { }); }); -describe('LoginLink', function() { +describe('LoginLinks', function() { it('createLoginLink method', async function() { const loginLink = await stripe.accounts.createLoginLink( 'acct_xxxxxxxxxxxxx' @@ -1194,7 +994,7 @@ describe('LoginLink', function() { }); }); -describe('Person', function() { +describe('Persons', function() { it('listPersons method', async function() { const persons = await stripe.accounts.listPersons('acct_xxxxxxxxxxxxx', { limit: 3, @@ -1236,7 +1036,7 @@ describe('Person', function() { }); }); -describe('ApplicationFee', function() { +describe('ApplicationFees', function() { it('list method', async function() { const applicationFees = await stripe.applicationFees.list({limit: 3}); expect(applicationFees).not.to.be.null; @@ -1250,7 +1050,7 @@ describe('ApplicationFee', function() { }); }); -describe('FeeRefund', function() { +describe('FeeRefunds', function() { it('listRefunds method', async function() { const refunds = await stripe.applicationFees.listRefunds( 'fee_xxxxxxxxxxxxx', @@ -1284,7 +1084,7 @@ describe('FeeRefund', function() { }); }); -describe('BalanceTransaction', function() { +describe('BalanceTransactions', function() { it('list method', async function() { const balanceTransactions = await stripe.balanceTransactions.list({ limit: 3, @@ -1300,7 +1100,7 @@ describe('BalanceTransaction', function() { }); }); -describe('BillingPortal.Configuration', function() { +describe('BillingPortal.Configurations', function() { it('list method', async function() { const configurations = await stripe.billingPortal.configurations.list({ limit: 3, @@ -1346,7 +1146,7 @@ describe('BillingPortal.Configuration', function() { }); }); -describe('BillingPortal.Session', function() { +describe('BillingPortal.Sessions', function() { it('create method', async function() { const session = await stripe.billingPortal.sessions.create({ customer: 'cus_xxxxxxxxxxxxx', @@ -1356,7 +1156,7 @@ describe('BillingPortal.Session', function() { }); }); -describe('Charge', function() { +describe('Charges', function() { it('list method', async function() { const charges = await stripe.charges.list({limit: 3}); expect(charges).not.to.be.null; @@ -1397,7 +1197,7 @@ describe('Charge', function() { }); }); -describe('CountrySpec', function() { +describe('CountrySpecs', function() { it('list method', async function() { const countrySpecs = await stripe.countrySpecs.list({limit: 3}); expect(countrySpecs).not.to.be.null; @@ -1409,7 +1209,7 @@ describe('CountrySpec', function() { }); }); -describe('Coupon', function() { +describe('Coupons', function() { it('list method', async function() { const coupons = await stripe.coupons.list({limit: 3}); expect(coupons).not.to.be.null; @@ -1442,7 +1242,7 @@ describe('Coupon', function() { }); }); -describe('CreditNote', function() { +describe('CreditNotes', function() { it('list method', async function() { const creditNotes = await stripe.creditNotes.list({limit: 3}); expect(creditNotes).not.to.be.null; @@ -1484,7 +1284,7 @@ describe('CreditNote', function() { }); }); -describe('CreditNoteLineItem', function() { +describe('CreditNoteLineItems', function() { it('listLineItems method', async function() { const lineItems = await stripe.creditNotes.listLineItems( 'cn_xxxxxxxxxxxxx', @@ -1494,7 +1294,7 @@ describe('CreditNoteLineItem', function() { }); }); -describe('CustomerBalanceTransaction', function() { +describe('CustomerBalanceTransactions', function() { it('listBalanceTransactions method', async function() { const balanceTransactions = await stripe.customers.listBalanceTransactions( 'cus_xxxxxxxxxxxxx', @@ -1529,7 +1329,7 @@ describe('CustomerBalanceTransaction', function() { }); }); -describe('CustomerSource', function() { +describe('CustomerSources', function() { it('verifySource method', async function() { const bankAccount = await stripe.customers.verifySource( 'cus_xxxxxxxxxxxxx', @@ -1540,7 +1340,7 @@ describe('CustomerSource', function() { }); }); -describe('TaxId', function() { +describe('TaxIds', function() { it('listTaxIds method', async function() { const taxIds = await stripe.customers.listTaxIds('cus_xxxxxxxxxxxxx', { limit: 3, @@ -1573,7 +1373,7 @@ describe('TaxId', function() { }); }); -describe('Dispute', function() { +describe('Disputes', function() { it('list method', async function() { const disputes = await stripe.disputes.list({limit: 3}); expect(disputes).not.to.be.null; @@ -1597,7 +1397,7 @@ describe('Dispute', function() { }); }); -describe('Event', function() { +describe('Events', function() { it('list method', async function() { const events = await stripe.events.list({limit: 3}); expect(events).not.to.be.null; @@ -1609,7 +1409,7 @@ describe('Event', function() { }); }); -describe('FileLink', function() { +describe('FileLinks', function() { it('list method', async function() { const fileLinks = await stripe.fileLinks.list({limit: 3}); expect(fileLinks).not.to.be.null; @@ -1635,7 +1435,7 @@ describe('FileLink', function() { }); }); -describe('File', function() { +describe('Files', function() { it('list method', async function() { const files = await stripe.files.list({limit: 3}); expect(files).not.to.be.null; @@ -1647,7 +1447,7 @@ describe('File', function() { }); }); -describe('Identity.VerificationReport', function() { +describe('Identity.VerificationReports', function() { it('list method', async function() { const verificationReports = await stripe.identity.verificationReports.list({ limit: 3, @@ -1663,7 +1463,7 @@ describe('Identity.VerificationReport', function() { }); }); -describe('Identity.VerificationSession', function() { +describe('Identity.VerificationSessions', function() { it('list method', async function() { const verificationSessions = await stripe.identity.verificationSessions.list( {limit: 3} @@ -1708,7 +1508,7 @@ describe('Identity.VerificationSession', function() { }); }); -describe('InvoiceItem', function() { +describe('InvoiceItems', function() { it('list method', async function() { const invoiceItems = await stripe.invoiceItems.list({limit: 3}); expect(invoiceItems).not.to.be.null; @@ -1740,7 +1540,7 @@ describe('InvoiceItem', function() { }); }); -describe('Invoice', function() { +describe('Invoices', function() { it('list method', async function() { const invoices = await stripe.invoices.list({limit: 3}); expect(invoices).not.to.be.null; @@ -1803,7 +1603,7 @@ describe('Invoice', function() { }); }); -describe('Issuing.Authorization', function() { +describe('Issuing.Authorizations', function() { it('list method', async function() { const authorizations = await stripe.issuing.authorizations.list({ limit: 3, @@ -1841,7 +1641,7 @@ describe('Issuing.Authorization', function() { }); }); -describe('Issuing.Cardholder', function() { +describe('Issuing.Cardholders', function() { it('list method', async function() { const cardholders = await stripe.issuing.cardholders.list({limit: 3}); expect(cardholders).not.to.be.null; @@ -1882,7 +1682,35 @@ describe('Issuing.Cardholder', function() { }); }); -describe('Issuing.Dispute', function() { +describe('Issuing.Cards', function() { + it('list method', async function() { + const cards = await stripe.issuing.cards.list({limit: 3}); + expect(cards).not.to.be.null; + }); + + it('create method', async function() { + const card = await stripe.issuing.cards.create({ + cardholder: 'ich_xxxxxxxxxxxxx', + currency: 'usd', + type: 'virtual', + }); + expect(card).not.to.be.null; + }); + + it('retrieve method', async function() { + const card = await stripe.issuing.cards.retrieve('ic_xxxxxxxxxxxxx'); + expect(card).not.to.be.null; + }); + + it('update method', async function() { + const card = await stripe.issuing.cards.update('ic_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(card).not.to.be.null; + }); +}); + +describe('Issuing.Disputes', function() { it('list method', async function() { const disputes = await stripe.issuing.disputes.list({limit: 3}); expect(disputes).not.to.be.null; @@ -1910,7 +1738,7 @@ describe('Issuing.Dispute', function() { }); }); -describe('Issuing.Transaction', function() { +describe('Issuing.Transactions', function() { it('list method', async function() { const transactions = await stripe.issuing.transactions.list({limit: 3}); expect(transactions).not.to.be.null; @@ -1932,14 +1760,14 @@ describe('Issuing.Transaction', function() { }); }); -describe('Mandate', function() { +describe('Mandates', function() { it('retrieve method', async function() { const mandate = await stripe.mandates.retrieve('mandate_xxxxxxxxxxxxx'); expect(mandate).not.to.be.null; }); }); -describe('PaymentMethod', function() { +describe('PaymentMethods', function() { it('list method', async function() { const paymentMethods = await stripe.paymentMethods.list({ customer: 'cus_xxxxxxxxxxxxx', @@ -1992,7 +1820,7 @@ describe('PaymentMethod', function() { }); }); -describe('Payout', function() { +describe('Payouts', function() { it('list method', async function() { const payouts = await stripe.payouts.list({limit: 3}); expect(payouts).not.to.be.null; @@ -2029,7 +1857,7 @@ describe('Payout', function() { }); }); -describe('Plan', function() { +describe('Plans', function() { it('list method', async function() { const plans = await stripe.plans.list({limit: 3}); expect(plans).not.to.be.null; @@ -2063,7 +1891,7 @@ describe('Plan', function() { }); }); -describe('Product', function() { +describe('Products', function() { it('list method', async function() { const products = await stripe.products.list({limit: 3}); expect(products).not.to.be.null; @@ -2099,7 +1927,7 @@ describe('Product', function() { }); }); -describe('PromotionCode', function() { +describe('PromotionCodes', function() { it('list method', async function() { const promotionCodes = await stripe.promotionCodes.list({limit: 3}); expect(promotionCodes).not.to.be.null; @@ -2128,7 +1956,7 @@ describe('PromotionCode', function() { }); }); -describe('Quote', function() { +describe('Quotes', function() { it('list method', async function() { const quotes = await stripe.quotes.list({limit: 3}); expect(quotes).not.to.be.null; @@ -2170,7 +1998,7 @@ describe('Quote', function() { }); }); -describe('Radar.EarlyFraudWarning', function() { +describe('Radar.EarlyFraudWarnings', function() { it('list method', async function() { const earlyFraudWarnings = await stripe.radar.earlyFraudWarnings.list({ limit: 3, @@ -2186,7 +2014,7 @@ describe('Radar.EarlyFraudWarning', function() { }); }); -describe('Radar.ValueListItem', function() { +describe('Radar.ValueListItems', function() { it('list method', async function() { const valueListItems = await stripe.radar.valueListItems.list({ limit: 3, @@ -2216,7 +2044,7 @@ describe('Radar.ValueListItem', function() { }); }); -describe('Radar.ValueList', function() { +describe('Radar.ValueLists', function() { it('list method', async function() { const valueLists = await stripe.radar.valueLists.list({limit: 3}); expect(valueLists).not.to.be.null; @@ -2252,7 +2080,38 @@ describe('Radar.ValueList', function() { }); }); -describe('Reporting.ReportRun', function() { +describe('Refunds', function() { + it('list method', async function() { + const refunds = await stripe.refunds.list({limit: 3}); + expect(refunds).not.to.be.null; + }); + + it('create method', async function() { + const refund = await stripe.refunds.create({ + charge: 'ch_xxxxxxxxxxxxx', + }); + expect(refund).not.to.be.null; + }); + + it('retrieve method', async function() { + const refund = await stripe.refunds.retrieve('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); + + it('update method', async function() { + const refund = await stripe.refunds.update('re_xxxxxxxxxxxxx', { + metadata: {order_id: '6735'}, + }); + expect(refund).not.to.be.null; + }); + + it('cancel method', async function() { + const refund = await stripe.refunds.cancel('re_xxxxxxxxxxxxx'); + expect(refund).not.to.be.null; + }); +}); + +describe('Reporting.ReportRuns', function() { it('list method', async function() { const reportRuns = await stripe.reporting.reportRuns.list({limit: 3}); expect(reportRuns).not.to.be.null; @@ -2274,7 +2133,7 @@ describe('Reporting.ReportRun', function() { }); }); -describe('Reporting.ReportType', function() { +describe('Reporting.ReportTypes', function() { it('list method', async function() { const reportTypes = await stripe.reporting.reportTypes.list(); expect(reportTypes).not.to.be.null; @@ -2288,7 +2147,7 @@ describe('Reporting.ReportType', function() { }); }); -describe('Review', function() { +describe('Reviews', function() { it('list method', async function() { const reviews = await stripe.reviews.list({limit: 3}); expect(reviews).not.to.be.null; @@ -2305,7 +2164,7 @@ describe('Review', function() { }); }); -describe('Sigma.ScheduledQueryRun', function() { +describe('Sigma.ScheduledQueryRuns', function() { it('list method', async function() { const scheduledQueryRuns = await stripe.sigma.scheduledQueryRuns.list({ limit: 3, @@ -2321,42 +2180,7 @@ describe('Sigma.ScheduledQueryRun', function() { }); }); -describe('Sku', function() { - it('list method', async function() { - const skus = await stripe.skus.list({limit: 3}); - expect(skus).not.to.be.null; - }); - - it('create method', async function() { - const sku = await stripe.skus.create({ - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 1500, - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - product: 'prod_xxxxxxxxxxxxx', - }); - expect(sku).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.skus.del('sku_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; - }); - - it('retrieve method', async function() { - const sku = await stripe.skus.retrieve('sku_xxxxxxxxxxxxx'); - expect(sku).not.to.be.null; - }); - - it('update method', async function() { - const sku = await stripe.skus.update('sku_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(sku).not.to.be.null; - }); -}); - -describe('Source', function() { +describe('Sources', function() { it('retrieve method', async function() { const source = await stripe.sources.retrieve('src_xxxxxxxxxxxxx'); expect(source).not.to.be.null; @@ -2375,7 +2199,7 @@ describe('Source', function() { }); }); -describe('SubscriptionItem', function() { +describe('SubscriptionItems', function() { it('list method', async function() { const subscriptionItems = await stripe.subscriptionItems.list({ subscription: 'sub_xxxxxxxxxxxxx', @@ -2413,7 +2237,7 @@ describe('SubscriptionItem', function() { }); }); -describe('UsageRecordSummary', function() { +describe('UsageRecordSummaries', function() { it('listUsageRecordSummaries method', async function() { const usageRecordSummaries = await stripe.subscriptionItems.listUsageRecordSummaries( 'si_xxxxxxxxxxxxx', @@ -2423,7 +2247,7 @@ describe('UsageRecordSummary', function() { }); }); -describe('UsageRecord', function() { +describe('UsageRecords', function() { it('createUsageRecord method', async function() { const usageRecord = await stripe.subscriptionItems.createUsageRecord( 'si_xxxxxxxxxxxxx', @@ -2433,7 +2257,7 @@ describe('UsageRecord', function() { }); }); -describe('SubscriptionSchedule', function() { +describe('SubscriptionSchedules', function() { it('list method', async function() { const subscriptionSchedules = await stripe.subscriptionSchedules.list({ limit: 3, @@ -2486,7 +2310,7 @@ describe('SubscriptionSchedule', function() { }); }); -describe('Subscription', function() { +describe('Subscriptions', function() { it('list method', async function() { const subscriptions = await stripe.subscriptions.list({limit: 3}); expect(subscriptions).not.to.be.null; @@ -2528,7 +2352,7 @@ describe('Subscription', function() { }); }); -describe('TaxCode', function() { +describe('TaxCodes', function() { it('list method', async function() { const taxCodes = await stripe.taxCodes.list({limit: 3}); expect(taxCodes).not.to.be.null; @@ -2540,7 +2364,7 @@ describe('TaxCode', function() { }); }); -describe('TaxRate', function() { +describe('TaxRates', function() { it('list method', async function() { const taxRates = await stripe.taxRates.list({limit: 3}); expect(taxRates).not.to.be.null; @@ -2570,14 +2394,14 @@ describe('TaxRate', function() { }); }); -describe('Terminal.ConnectionToken', function() { +describe('Terminal.ConnectionTokens', function() { it('create method', async function() { const connectionToken = await stripe.terminal.connectionTokens.create(); expect(connectionToken).not.to.be.null; }); }); -describe('Terminal.Location', function() { +describe('Terminal.Locations', function() { it('list method', async function() { const locations = await stripe.terminal.locations.list({limit: 3}); expect(locations).not.to.be.null; @@ -2617,7 +2441,7 @@ describe('Terminal.Location', function() { }); }); -describe('Terminal.Reader', function() { +describe('Terminal.Readers', function() { it('list method', async function() { const readers = await stripe.terminal.readers.list({limit: 3}); expect(readers).not.to.be.null; @@ -2665,7 +2489,7 @@ describe('Terminal.Reader', function() { }); }); -describe('Topup', function() { +describe('Topups', function() { it('list method', async function() { const topups = await stripe.topups.list({limit: 3}); expect(topups).not.to.be.null; @@ -2699,7 +2523,7 @@ describe('Topup', function() { }); }); -describe('Transfer', function() { +describe('Transfers', function() { it('list method', async function() { const transfers = await stripe.transfers.list({limit: 3}); expect(transfers).not.to.be.null; @@ -2728,7 +2552,7 @@ describe('Transfer', function() { }); }); -describe('TransferReversal', function() { +describe('TransferReversals', function() { it('listReversals method', async function() { const reversals = await stripe.transfers.listReversals('tr_xxxxxxxxxxxxx', { limit: 3, @@ -2761,7 +2585,7 @@ describe('TransferReversal', function() { }); }); -describe('Treasury.CreditReversal', function() { +describe('Treasury.CreditReversals', function() { it('list method', async function() { const creditReversals = await stripe.treasury.creditReversals.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2785,7 +2609,7 @@ describe('Treasury.CreditReversal', function() { }); }); -describe('Treasury.DebitReversal', function() { +describe('Treasury.DebitReversals', function() { it('list method', async function() { const debitReversals = await stripe.treasury.debitReversals.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2809,7 +2633,7 @@ describe('Treasury.DebitReversal', function() { }); }); -describe('Treasury.FinancialAccount', function() { +describe('Treasury.FinancialAccounts', function() { it('list method', async function() { const financialAccounts = await stripe.treasury.financialAccounts.list({ limit: 3, @@ -2856,7 +2680,42 @@ describe('Treasury.FinancialAccount', function() { }); }); -describe('Treasury.OutboundPayment', function() { +describe('Treasury.InboundTransfers', function() { + it('list method', async function() { + const inboundTransfers = await stripe.treasury.inboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(inboundTransfers).not.to.be.null; + }); + + it('create method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + amount: 10000, + currency: 'usd', + origin_payment_method: 'pm_xxxxxxxxxxxxx', + description: 'InboundTransfer from my bank account', + }); + expect(inboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.retrieve( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); + + it('cancel method', async function() { + const inboundTransfer = await stripe.treasury.inboundTransfers.cancel( + 'ibt_xxxxxxxxxxxxx' + ); + expect(inboundTransfer).not.to.be.null; + }); +}); + +describe('Treasury.OutboundPayments', function() { it('list method', async function() { const outboundPayments = await stripe.treasury.outboundPayments.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2892,7 +2751,76 @@ describe('Treasury.OutboundPayment', function() { }); }); -describe('Treasury.TransactionEntry', function() { +describe('Treasury.OutboundTransfers', function() { + it('list method', async function() { + const outboundTransfers = await stripe.treasury.outboundTransfers.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(outboundTransfers).not.to.be.null; + }); + + it('create method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.create({ + financial_account: 'fa_xxxxxxxxxxxxx', + destination_payment_method: 'pm_xxxxxxxxxxxxx', + amount: 500, + currency: 'usd', + description: 'OutboundTransfer to my external bank account', + }); + expect(outboundTransfer).not.to.be.null; + }); + + it('retrieve method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.retrieve( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); + + it('cancel method', async function() { + const outboundTransfer = await stripe.treasury.outboundTransfers.cancel( + 'obt_xxxxxxxxxxxxx' + ); + expect(outboundTransfer).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedCredits', function() { + it('list method', async function() { + const receivedCredits = await stripe.treasury.receivedCredits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedCredits).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedCredit = await stripe.treasury.receivedCredits.retrieve( + 'rc_xxxxxxxxxxxxx' + ); + expect(receivedCredit).not.to.be.null; + }); +}); + +describe('Treasury.ReceivedDebits', function() { + it('list method', async function() { + const receivedDebits = await stripe.treasury.receivedDebits.list({ + financial_account: 'fa_xxxxxxxxxxxxx', + limit: 3, + }); + expect(receivedDebits).not.to.be.null; + }); + + it('retrieve method', async function() { + const receivedDebit = await stripe.treasury.receivedDebits.retrieve( + 'rd_xxxxxxxxxxxxx' + ); + expect(receivedDebit).not.to.be.null; + }); +}); + +describe('Treasury.TransactionEntries', function() { it('list method', async function() { const transactionEntries = await stripe.treasury.transactionEntries.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2909,7 +2837,7 @@ describe('Treasury.TransactionEntry', function() { }); }); -describe('Treasury.Transaction', function() { +describe('Treasury.Transactions', function() { it('list method', async function() { const transactions = await stripe.treasury.transactions.list({ financial_account: 'fa_xxxxxxxxxxxxx', @@ -2926,7 +2854,7 @@ describe('Treasury.Transaction', function() { }); }); -describe('WebhookEndpoint', function() { +describe('WebhookEndpoints', function() { it('list method', async function() { const webhookEndpoints = await stripe.webhookEndpoints.list({limit: 3}); expect(webhookEndpoints).not.to.be.null; diff --git a/types/AccountSessions.d.ts b/types/AccountSessions.d.ts index 5b6e5d47b9..4eafbfa10e 100644 --- a/types/AccountSessions.d.ts +++ b/types/AccountSessions.d.ts @@ -41,27 +41,5 @@ declare module 'stripe' { */ livemode: boolean; } - - interface AccountSessionCreateParams { - /** - * The identifier of the account to create an Account Session for. - */ - account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class AccountSessionsResource { - /** - * Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. - */ - create( - params: AccountSessionCreateParams, - options?: RequestOptions - ): Promise>; - } } } diff --git a/types/AccountSessionsResource.d.ts b/types/AccountSessionsResource.d.ts new file mode 100644 index 0000000000..e45cb76de7 --- /dev/null +++ b/types/AccountSessionsResource.d.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface AccountSessionCreateParams { + /** + * The identifier of the account to create an Account Session for. + */ + account: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class AccountSessionsResource { + /** + * Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + */ + create( + params: AccountSessionCreateParams, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/Accounts.d.ts b/types/Accounts.d.ts index 714e4a0e88..726579369d 100644 --- a/types/Accounts.d.ts +++ b/types/Accounts.d.ts @@ -221,6 +221,11 @@ declare module 'stripe' { */ cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; + /** + * The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + */ + cashapp_payments?: Capabilities.CashappPayments; + /** * The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. */ @@ -330,6 +335,11 @@ declare module 'stripe' { * The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. */ us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; + + /** + * The status of the Zip capability of the account, or whether the account can directly process Zip charges. + */ + zip_payments?: Capabilities.ZipPayments; } namespace Capabilities { @@ -357,6 +367,8 @@ declare module 'stripe' { type CartesBancairesPayments = 'active' | 'inactive' | 'pending'; + type CashappPayments = 'active' | 'inactive' | 'pending'; + type EpsPayments = 'active' | 'inactive' | 'pending'; type FpxPayments = 'active' | 'inactive' | 'pending'; @@ -400,6 +412,8 @@ declare module 'stripe' { type Treasury = 'active' | 'inactive' | 'pending'; type UsBankAccountAchPayments = 'active' | 'inactive' | 'pending'; + + type ZipPayments = 'active' | 'inactive' | 'pending'; } interface Company { diff --git a/types/AccountsResource.d.ts b/types/AccountsResource.d.ts index 92f12c0690..3d22db8dd1 100644 --- a/types/AccountsResource.d.ts +++ b/types/AccountsResource.d.ts @@ -2,156 +2,131 @@ declare module 'stripe' { namespace Stripe { - /** - * This is an object representing a Stripe account. You can retrieve it to see - * properties on the account like its current e-mail address or if the account is - * enabled yet to make live charges. - * - * Some properties, marked below, are available only to platforms that want to - * [create and manage Express or Custom accounts](https://stripe.com/docs/connect/accounts). - */ - interface Account { - /** - * Unique identifier for the object. - */ - id: string; - + interface AccountCreateParams { /** - * String representing the object's type. Objects of the same type share the same value. + * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. */ - object: 'account'; + account_token?: string; /** * Business information about the account. */ - business_profile?: Account.BusinessProfile | null; + business_profile?: AccountCreateParams.BusinessProfile; /** * The business type. */ - business_type?: Account.BusinessType | null; - - capabilities?: Account.Capabilities; + business_type?: AccountCreateParams.BusinessType; /** - * Whether the account can create live charges. + * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. */ - charges_enabled: boolean; - - company?: Account.Company; - - controller?: Account.Controller; + capabilities?: AccountCreateParams.Capabilities; /** - * The account's country. + * Information about the company or business. This field is available for any `business_type`. */ - country?: string; + company?: AccountCreateParams.Company; /** - * Time at which the account was connected. Measured in seconds since the Unix epoch. + * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. */ - created?: number; + country?: string; /** * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). */ default_currency?: string; - deleted?: void; - /** - * Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * Documents that may be submitted to satisfy various informational requests. */ - details_submitted: boolean; + documents?: AccountCreateParams.Documents; /** - * An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. + * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. */ - email: string | null; + email?: string; /** - * External accounts (bank accounts and debit cards) currently attached to this account + * Specifies which fields in the response should be expanded. */ - external_accounts?: ApiList; - - future_requirements?: Account.FutureRequirements; + expand?: Array; /** - * This is an object representing a person associated with a Stripe account. - * - * A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - * See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps. + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. * - * Related guide: [Handling Identity Verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information). + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. */ - individual?: Stripe.Person; + external_account?: string | AccountCreateParams.ExternalAccount; /** - * 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. + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. */ - metadata?: Stripe.Metadata; + individual?: AccountCreateParams.Individual; /** - * Whether Stripe can send payouts to this account. + * 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`. */ - payouts_enabled: boolean; - - requirements?: Account.Requirements; + metadata?: Stripe.Emptyable; /** * Options for customizing how the account functions within Stripe. */ - settings?: Account.Settings | null; + settings?: AccountCreateParams.Settings; - tos_acceptance?: Account.TosAcceptance; + /** + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + */ + tos_acceptance?: AccountCreateParams.TosAcceptance; /** - * The Stripe account type. Can be `standard`, `express`, or `custom`. + * The type of Stripe account to create. May be one of `custom`, `express` or `standard`. */ - type: Account.Type; + type?: AccountCreateParams.Type; } - namespace Account { + namespace AccountCreateParams { interface BusinessProfile { /** * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. */ - mcc: string | null; + mcc?: string; /** * The customer-facing business name. */ - name: string | null; + name?: string; /** - * Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. */ - product_description?: string | null; + product_description?: string; /** * A publicly available mailing address for sending support issues to. */ - support_address: Stripe.Address | null; + support_address?: Stripe.AddressParam; /** * A publicly available email address for sending support issues to. */ - support_email: string | null; + support_email?: string; /** * A publicly available phone number to call with support issues. */ - support_phone: string | null; + support_phone?: string; /** * A publicly available website for handling support issues. */ - support_url: string | null; + support_url?: Stripe.Emptyable; /** * The business's publicly available website. */ - url: string | null; + url?: string; } type BusinessType = @@ -162,3028 +137,2710 @@ declare module 'stripe' { interface Capabilities { /** - * The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. + * The acss_debit_payments capability. */ acss_debit_payments?: Capabilities.AcssDebitPayments; /** - * The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + * The affirm_payments capability. */ affirm_payments?: Capabilities.AffirmPayments; /** - * The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. + * The afterpay_clearpay_payments capability. */ afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; /** - * The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. + * The au_becs_debit_payments capability. */ au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; /** - * The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. + * The bacs_debit_payments capability. */ bacs_debit_payments?: Capabilities.BacsDebitPayments; /** - * The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. + * The bancontact_payments capability. */ bancontact_payments?: Capabilities.BancontactPayments; /** - * The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. + * The bank_transfer_payments capability. */ bank_transfer_payments?: Capabilities.BankTransferPayments; /** - * The status of the blik payments capability of the account, or whether the account can directly process blik charges. + * The blik_payments capability. */ blik_payments?: Capabilities.BlikPayments; /** - * The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. + * The boleto_payments capability. */ boleto_payments?: Capabilities.BoletoPayments; /** - * The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards + * The card_issuing capability. */ card_issuing?: Capabilities.CardIssuing; /** - * The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. + * The card_payments capability. */ card_payments?: Capabilities.CardPayments; /** - * The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. + * The cartes_bancaires_payments capability. */ cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; /** - * The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + * The cashapp_payments capability. */ cashapp_payments?: Capabilities.CashappPayments; /** - * The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. + * The eps_payments capability. */ eps_payments?: Capabilities.EpsPayments; /** - * The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. + * The fpx_payments capability. */ fpx_payments?: Capabilities.FpxPayments; /** - * The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. + * The giropay_payments capability. */ giropay_payments?: Capabilities.GiropayPayments; /** - * The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. + * The grabpay_payments capability. */ grabpay_payments?: Capabilities.GrabpayPayments; /** - * The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. + * The ideal_payments capability. */ ideal_payments?: Capabilities.IdealPayments; /** - * 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. + * The india_international_payments capability. + */ + india_international_payments?: Capabilities.IndiaInternationalPayments; + + /** + * The jcb_payments capability. */ jcb_payments?: Capabilities.JcbPayments; /** - * The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. + * The klarna_payments capability. */ klarna_payments?: Capabilities.KlarnaPayments; /** - * The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. + * The konbini_payments capability. */ konbini_payments?: Capabilities.KonbiniPayments; /** - * The status of the legacy payments capability of the account. + * The legacy_payments capability. */ legacy_payments?: Capabilities.LegacyPayments; /** - * The status of the link_payments capability of the account, or whether the account can directly process Link charges. + * The link_payments capability. */ link_payments?: Capabilities.LinkPayments; /** - * The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. + * The oxxo_payments capability. */ oxxo_payments?: Capabilities.OxxoPayments; /** - * The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. + * The p24_payments capability. */ p24_payments?: Capabilities.P24Payments; /** - * The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. + * The paynow_payments capability. */ paynow_payments?: Capabilities.PaynowPayments; /** - * The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. + * The promptpay_payments capability. */ promptpay_payments?: Capabilities.PromptpayPayments; /** - * The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. + * The sepa_debit_payments capability. */ sepa_debit_payments?: Capabilities.SepaDebitPayments; /** - * The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. + * The sofort_payments capability. */ sofort_payments?: Capabilities.SofortPayments; /** - * The status of the tax reporting 1099-K (US) capability of the account. + * The tax_reporting_us_1099_k capability. */ tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; /** - * The status of the tax reporting 1099-MISC (US) capability of the account. + * The tax_reporting_us_1099_misc capability. */ tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; /** - * The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + * The transfers capability. */ transfers?: Capabilities.Transfers; /** - * The status of the banking capability, or whether the account can have bank accounts. + * The treasury capability. */ treasury?: Capabilities.Treasury; /** - * The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. + * The us_bank_account_ach_payments capability. */ us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; /** - * The status of the Zip capability of the account, or whether the account can directly process Zip charges. + * The zip_payments capability. */ zip_payments?: Capabilities.ZipPayments; } namespace Capabilities { - type AcssDebitPayments = 'active' | 'inactive' | 'pending'; - - type AffirmPayments = 'active' | 'inactive' | 'pending'; - - type AfterpayClearpayPayments = 'active' | 'inactive' | 'pending'; - - type AuBecsDebitPayments = 'active' | 'inactive' | 'pending'; - - type BacsDebitPayments = 'active' | 'inactive' | 'pending'; - - type BancontactPayments = 'active' | 'inactive' | 'pending'; - - type BankTransferPayments = 'active' | 'inactive' | 'pending'; - - type BlikPayments = 'active' | 'inactive' | 'pending'; - - type BoletoPayments = 'active' | 'inactive' | 'pending'; - - type CardIssuing = 'active' | 'inactive' | 'pending'; - - type CardPayments = 'active' | 'inactive' | 'pending'; - - type CartesBancairesPayments = 'active' | 'inactive' | 'pending'; - - type CashappPayments = 'active' | 'inactive' | 'pending'; - - type EpsPayments = 'active' | 'inactive' | 'pending'; - - type FpxPayments = 'active' | 'inactive' | 'pending'; - - type GiropayPayments = 'active' | 'inactive' | 'pending'; - - type GrabpayPayments = 'active' | 'inactive' | 'pending'; - - type IdealPayments = 'active' | 'inactive' | 'pending'; - - type JcbPayments = 'active' | 'inactive' | 'pending'; - - type KlarnaPayments = 'active' | 'inactive' | 'pending'; - - type KonbiniPayments = 'active' | 'inactive' | 'pending'; - - type LegacyPayments = 'active' | 'inactive' | 'pending'; - - type LinkPayments = 'active' | 'inactive' | 'pending'; - - type OxxoPayments = 'active' | 'inactive' | 'pending'; - - type P24Payments = 'active' | 'inactive' | 'pending'; - - type PaynowPayments = 'active' | 'inactive' | 'pending'; - - type PromptpayPayments = 'active' | 'inactive' | 'pending'; - - type SepaDebitPayments = 'active' | 'inactive' | 'pending'; - - type SofortPayments = 'active' | 'inactive' | 'pending'; - - type TaxReportingUs1099K = 'active' | 'inactive' | 'pending'; - - type TaxReportingUs1099Misc = 'active' | 'inactive' | 'pending'; - - type Transfers = 'active' | 'inactive' | 'pending'; - - type Treasury = 'active' | 'inactive' | 'pending'; - - type UsBankAccountAchPayments = 'active' | 'inactive' | 'pending'; - - type ZipPayments = 'active' | 'inactive' | 'pending'; - } - - interface Company { - address?: Stripe.Address; - - /** - * The Kana variation of the company's primary address (Japan only). - */ - address_kana?: Company.AddressKana | null; - - /** - * The Kanji variation of the company's primary address (Japan only). - */ - address_kanji?: Company.AddressKanji | null; - - /** - * Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). - */ - directors_provided?: boolean; - - /** - * Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. - */ - executives_provided?: boolean; - - /** - * The company's legal name. - */ - name?: string | null; - - /** - * The Kana variation of the company's legal name (Japan only). - */ - name_kana?: string | null; - - /** - * The Kanji variation of the company's legal name (Japan only). - */ - name_kanji?: string | null; - - /** - * Whether the company's owners have been provided. This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). - */ - owners_provided?: boolean; - - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - */ - ownership_declaration?: Company.OwnershipDeclaration | null; - - /** - * The company's phone number (used for verification). - */ - phone?: string | null; - - /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - */ - structure?: Company.Structure; - - /** - * Whether the company's business ID number was provided. - */ - tax_id_provided?: boolean; - - /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - */ - tax_id_registrar?: string; - - /** - * Whether the company's business VAT number was provided. - */ - vat_id_provided?: boolean; - - /** - * Information on the verification state of the company. - */ - verification?: Company.Verification | null; - } - - namespace Company { - interface AddressKana { + interface AcssDebitPayments { /** - * City/Ward. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - city: string | null; + requested?: boolean; + } + interface AffirmPayments { /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - country: string | null; + requested?: boolean; + } + interface AfterpayClearpayPayments { /** - * Block/Building number. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - line1: string | null; + requested?: boolean; + } + interface AuBecsDebitPayments { /** - * Building details. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - line2: string | null; + requested?: boolean; + } + interface BacsDebitPayments { /** - * ZIP or postal code. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - postal_code: string | null; + requested?: boolean; + } + interface BancontactPayments { /** - * Prefecture. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - state: string | null; + requested?: boolean; + } + interface BankTransferPayments { /** - * Town/cho-me. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - town: string | null; + requested?: boolean; } - interface AddressKanji { + interface BlikPayments { /** - * City/Ward. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - city: string | null; + requested?: boolean; + } + interface BoletoPayments { /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - country: string | null; + requested?: boolean; + } + interface CardIssuing { /** - * Block/Building number. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - line1: string | null; + requested?: boolean; + } + interface CardPayments { /** - * Building details. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - line2: string | null; + requested?: boolean; + } + interface CartesBancairesPayments { /** - * ZIP or postal code. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - postal_code: string | null; + requested?: boolean; + } + interface CashappPayments { /** - * Prefecture. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - state: string | null; + requested?: boolean; + } + interface EpsPayments { /** - * Town/cho-me. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - town: string | null; + requested?: boolean; } - interface OwnershipDeclaration { + interface FpxPayments { /** - * The Unix timestamp marking when the beneficial owner attestation was made. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - date: number | null; + requested?: boolean; + } + interface GiropayPayments { /** - * The IP address from which the beneficial owner attestation was made. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - ip: string | null; + requested?: boolean; + } + interface GrabpayPayments { /** - * The user-agent string from the browser where the beneficial owner attestation was made. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - user_agent: string | null; + requested?: boolean; } - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; + interface IdealPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - interface Verification { - document: Verification.Document; + interface IndiaInternationalPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - */ - back: string | Stripe.File | null; + interface JcbPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * A user-displayable string describing the verification state of this document. - */ - details: string | null; + interface KlarnaPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document. - */ - details_code: string | null; + interface KonbiniPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - */ - front: string | Stripe.File | null; - } + interface LegacyPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - } - interface Controller { - /** - * `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. - */ - is_controller?: boolean; + interface LinkPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. - */ - type: Controller.Type; - } + interface OxxoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface P24Payments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PaynowPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface PromptpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SepaDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface SofortPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099K { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface TaxReportingUs1099Misc { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Transfers { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface Treasury { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } + + interface UsBankAccountAchPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - namespace Controller { - type Type = 'account' | 'application'; + interface ZipPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } } - interface FutureRequirements { + interface Company { /** - * Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + * The company's primary address. */ - alternatives: Array | null; + address?: Stripe.AddressParam; /** - * Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + * The Kana variation of the company's primary address (Japan only). */ - current_deadline: number | null; + address_kana?: Stripe.JapanAddressParam; /** - * Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + * The Kanji variation of the company's primary address (Japan only). */ - currently_due: Array | null; + address_kanji?: Stripe.JapanAddressParam; /** - * This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. */ - disabled_reason: string | null; + directors_provided?: boolean; /** - * Fields that are `currently_due` and need to be collected again because validation or verification failed. + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. */ - errors: Array | null; + executives_provided?: boolean; /** - * Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + * The company's legal name. */ - eventually_due: Array | null; + name?: string; /** - * Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + * The Kana variation of the company's legal name (Japan only). */ - past_due: Array | null; + name_kana?: string; /** - * Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. + * The Kanji variation of the company's legal name (Japan only). */ - pending_verification: Array | null; - } - - namespace FutureRequirements { - interface Alternative { - /** - * Fields that can be provided to satisfy all fields in `original_fields_due`. - */ - alternative_fields_due: Array; - - /** - * Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - */ - original_fields_due: Array; - } - - interface Error { - /** - * The code for the type of error. - */ - code: Error.Code; - - /** - * An informative message that indicates the error type and provides additional details about the error. - */ - reason: string; - - /** - * The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - */ - requirement: string; - } - - namespace Error { - type Code = - | 'invalid_address_city_state_postal_code' - | 'invalid_dob_age_under_18' - | 'invalid_representative_country' - | 'invalid_street_address' - | 'invalid_tos_acceptance' - | 'invalid_value_other' - | 'verification_document_address_mismatch' - | 'verification_document_address_missing' - | 'verification_document_corrupt' - | 'verification_document_country_not_supported' - | 'verification_document_dob_mismatch' - | 'verification_document_duplicate_type' - | 'verification_document_expired' - | 'verification_document_failed_copy' - | 'verification_document_failed_greyscale' - | 'verification_document_failed_other' - | 'verification_document_failed_test_mode' - | 'verification_document_fraudulent' - | 'verification_document_id_number_mismatch' - | 'verification_document_id_number_missing' - | 'verification_document_incomplete' - | 'verification_document_invalid' - | 'verification_document_issue_or_expiry_date_missing' - | 'verification_document_manipulated' - | 'verification_document_missing_back' - | 'verification_document_missing_front' - | 'verification_document_name_mismatch' - | 'verification_document_name_missing' - | 'verification_document_nationality_mismatch' - | 'verification_document_not_readable' - | 'verification_document_not_signed' - | 'verification_document_not_uploaded' - | 'verification_document_photo_mismatch' - | 'verification_document_too_large' - | 'verification_document_type_not_supported' - | 'verification_failed_address_match' - | 'verification_failed_business_iec_number' - | 'verification_failed_document_match' - | 'verification_failed_id_number_match' - | 'verification_failed_keyed_identity' - | 'verification_failed_keyed_match' - | 'verification_failed_name_match' - | 'verification_failed_other' - | 'verification_failed_residential_address' - | 'verification_failed_tax_id_match' - | 'verification_failed_tax_id_not_issued' - | 'verification_missing_executives' - | 'verification_missing_owners' - | 'verification_requires_additional_memorandum_of_associations'; - } - } + name_kanji?: string; - interface Requirements { /** - * Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. */ - alternatives: Array | null; + owners_provided?: boolean; /** - * Date by which the fields in `currently_due` must be collected to keep the account enabled. These fields may disable the account sooner if the next threshold is reached before they are collected. + * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. */ - current_deadline: number | null; + ownership_declaration?: Company.OwnershipDeclaration; /** - * Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + * The company's phone number (used for verification). */ - currently_due: Array | null; + phone?: string; /** - * If the account is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. + * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). */ - disabled_reason: string | null; + registration_number?: string; /** - * Fields that are `currently_due` and need to be collected again because validation or verification failed. + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. */ - errors: Array | null; + structure?: Stripe.Emptyable; /** - * Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) */ - eventually_due: Array | null; + tax_id?: string; /** - * Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the account. + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). */ - past_due: Array | null; + tax_id_registrar?: string; /** - * Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + * The VAT number of the company. */ - pending_verification: Array | null; - } - - namespace Requirements { - interface Alternative { - /** - * Fields that can be provided to satisfy all fields in `original_fields_due`. - */ - alternative_fields_due: Array; - - /** - * Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - */ - original_fields_due: Array; - } - - interface Error { - /** - * The code for the type of error. - */ - code: Error.Code; - - /** - * An informative message that indicates the error type and provides additional details about the error. - */ - reason: string; - - /** - * The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - */ - requirement: string; - } - - namespace Error { - type Code = - | 'invalid_address_city_state_postal_code' - | 'invalid_dob_age_under_18' - | 'invalid_representative_country' - | 'invalid_street_address' - | 'invalid_tos_acceptance' - | 'invalid_value_other' - | 'verification_document_address_mismatch' - | 'verification_document_address_missing' - | 'verification_document_corrupt' - | 'verification_document_country_not_supported' - | 'verification_document_dob_mismatch' - | 'verification_document_duplicate_type' - | 'verification_document_expired' - | 'verification_document_failed_copy' - | 'verification_document_failed_greyscale' - | 'verification_document_failed_other' - | 'verification_document_failed_test_mode' - | 'verification_document_fraudulent' - | 'verification_document_id_number_mismatch' - | 'verification_document_id_number_missing' - | 'verification_document_incomplete' - | 'verification_document_invalid' - | 'verification_document_issue_or_expiry_date_missing' - | 'verification_document_manipulated' - | 'verification_document_missing_back' - | 'verification_document_missing_front' - | 'verification_document_name_mismatch' - | 'verification_document_name_missing' - | 'verification_document_nationality_mismatch' - | 'verification_document_not_readable' - | 'verification_document_not_signed' - | 'verification_document_not_uploaded' - | 'verification_document_photo_mismatch' - | 'verification_document_too_large' - | 'verification_document_type_not_supported' - | 'verification_failed_address_match' - | 'verification_failed_business_iec_number' - | 'verification_failed_document_match' - | 'verification_failed_id_number_match' - | 'verification_failed_keyed_identity' - | 'verification_failed_keyed_match' - | 'verification_failed_name_match' - | 'verification_failed_other' - | 'verification_failed_residential_address' - | 'verification_failed_tax_id_match' - | 'verification_failed_tax_id_not_issued' - | 'verification_missing_executives' - | 'verification_missing_owners' - | 'verification_requires_additional_memorandum_of_associations'; - } - } - - interface Settings { - bacs_debit_payments?: Settings.BacsDebitPayments; - - branding: Settings.Branding; - - card_issuing?: Settings.CardIssuing; - - card_payments: Settings.CardPayments; - - dashboard: Settings.Dashboard; - - payments: Settings.Payments; - - payouts?: Settings.Payouts; - - sepa_debit_payments?: Settings.SepaDebitPayments; + vat_id?: string; - treasury?: Settings.Treasury; + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; } - namespace Settings { - interface BacsDebitPayments { - /** - * The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this will appear on the mandate, and as the statement descriptor. - */ - display_name?: string; - } - - interface Branding { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. - */ - icon: string | Stripe.File | null; - + namespace Company { + interface OwnershipDeclaration { /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + * The Unix timestamp marking when the beneficial owner attestation was made. */ - logo: string | Stripe.File | null; + date?: number; /** - * A CSS hex color value representing the primary branding color for this account + * The IP address from which the beneficial owner attestation was made. */ - primary_color: string | null; + ip?: string; /** - * A CSS hex color value representing the secondary branding color for this account + * The user agent of the browser from which the beneficial owner attestation was made. */ - secondary_color: string | null; - } - - interface CardIssuing { - tos_acceptance?: CardIssuing.TosAcceptance; + user_agent?: string; } - namespace CardIssuing { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date: number | null; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip: string | null; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - - interface CardPayments { - decline_on?: CardPayments.DeclineOn; - - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix: string | null; - - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kana: string | null; + type Structure = + | 'free_zone_establishment' + | 'free_zone_llc' + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'llc' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'single_member_llc' + | 'sole_establishment' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + interface Verification { /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + * A document verifying the business. */ - statement_descriptor_prefix_kanji: string | null; + document?: Verification.Document; } - namespace CardPayments { - interface DeclineOn { + namespace Verification { + interface Document { /** - * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - avs_failure: boolean; + back?: string; /** - * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - cvc_failure: boolean; + front?: string; } } + } - interface Dashboard { - /** - * The display name for this account. This is used on the Stripe Dashboard to differentiate between accounts. - */ - display_name: string | null; + interface Documents { + /** + * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + */ + bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; - /** - * The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). - */ - timezone: string | null; - } + /** + * One or more documents that demonstrate proof of a company's license to operate. + */ + company_license?: Documents.CompanyLicense; - interface Payments { - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. - */ - statement_descriptor: string | null; + /** + * One or more documents showing the company's Memorandum of Association. + */ + company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only) - */ - statement_descriptor_kana: string | null; + /** + * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + */ + company_ministerial_decree?: Documents.CompanyMinisterialDecree; - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only) - */ - statement_descriptor_kanji: string | null; + /** + * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + */ + company_registration_verification?: Documents.CompanyRegistrationVerification; + + /** + * One or more documents that demonstrate proof of a company's tax ID. + */ + company_tax_id_verification?: Documents.CompanyTaxIdVerification; + /** + * One or more documents showing the company's proof of registration with the national business registry. + */ + proof_of_registration?: Documents.ProofOfRegistration; + } + + namespace Documents { + interface BankAccountOwnershipVerification { /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - statement_descriptor_prefix_kana: string | null; + files?: Array; + } + interface CompanyLicense { /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - statement_descriptor_prefix_kanji: string | null; + files?: Array; } - interface Payouts { + interface CompanyMemorandumOfAssociation { /** - * A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. Default value is `false` for Custom accounts, otherwise `true`. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - debit_negative_balances: boolean; - - schedule: Payouts.Schedule; + files?: Array; + } + interface CompanyMinisterialDecree { /** - * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - statement_descriptor: string | null; + files?: Array; } - namespace Payouts { - interface Schedule { - /** - * The number of days charges for the account will be held before being paid out. - */ - delay_days: number; - - /** - * How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. - */ - interval: string; - - /** - * The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. - */ - monthly_anchor?: number; - - /** - * The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. - */ - weekly_anchor?: string; - } + interface CompanyRegistrationVerification { + /** + * 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; } - interface SepaDebitPayments { + interface CompanyTaxIdVerification { /** - * SEPA creditor identifier that identifies the company making the payment. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - creditor_id?: string; + files?: Array; } - interface Treasury { - tos_acceptance?: Treasury.TosAcceptance; + 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`. + */ + files?: Array; } + } - namespace Treasury { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date: number | null; + interface ExternalAccount { + /** + * The type of external account. Should be bank_account. + */ + object: string; - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip: string | null; + /** + * The country in which the bank account is located. + */ + country: string; - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - } + /** + * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports](https://stripe.com/docs/payouts). + */ + currency: string; - interface TosAcceptance { /** - * The Unix timestamp marking when the account representative accepted their service agreement + * The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. */ - date?: number | null; + account_holder_name?: string; /** - * The IP address from which the account representative accepted their service agreement + * The type of entity that holds the account. This can be either individual or company. This field is required when attaching the bank account to a Customer object. */ - ip?: string | null; + account_holder_type?: string; /** - * The user's service agreement type + * The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for account_number, this field is not required. */ - service_agreement?: string; + routing_number?: string; /** - * The user agent of the browser from which the account representative accepted their service agreement + * The account number for the bank account, in string form. Must be a checking account. */ - user_agent?: string | null; + account_number: string; } - type Type = 'custom' | 'express' | 'standard'; - } - - /** - * The DeletedAccount object. - */ - interface DeletedAccount { - /** - * Unique identifier for the object. - */ - id: string; + interface Individual { + /** + * The individual's primary address. + */ + address?: Stripe.AddressParam; - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'account'; + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; - /** - * Always true for a deleted object - */ - deleted: true; - } + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; - interface AccountCreateParams { - /** - * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - */ - account_token?: string; + /** + * The individual's date of birth. + */ + dob?: Stripe.Emptyable; - /** - * Business information about the account. - */ - business_profile?: AccountCreateParams.BusinessProfile; + /** + * The individual's email address. + */ + email?: string; - /** - * The business type. - */ - business_type?: AccountCreateParams.BusinessType; + /** + * The individual's first name. + */ + first_name?: string; - /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. - */ - capabilities?: AccountCreateParams.Capabilities; + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; - /** - * Information about the company or business. This field is available for any `business_type`. - */ - company?: AccountCreateParams.Company; + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; - /** - * The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. - */ - country?: string; - - /** - * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - */ - default_currency?: string; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: AccountCreateParams.Documents; - - /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - */ - external_account?: string | AccountCreateParams.ExternalAccount; - - /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. - */ - individual?: AccountCreateParams.Individual; - - /** - * 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; - - /** - * Options for customizing how the account functions within Stripe. - */ - settings?: AccountCreateParams.Settings; - - /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - */ - tos_acceptance?: AccountCreateParams.TosAcceptance; - - /** - * The type of Stripe account to create. May be one of `custom`, `express` or `standard`. - */ - type?: AccountCreateParams.Type; - } - - namespace AccountCreateParams { - interface BusinessProfile { - /** - * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. - */ - mcc?: string; + /** + * A list of alternate names or aliases that the individual is known by. + */ + full_name_aliases?: Stripe.Emptyable>; /** - * The customer-facing business name. + * The individual's gender (International regulations require either "male" or "female"). */ - name?: string; + gender?: string; /** - * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). */ - product_description?: string; + id_number?: string; /** - * A publicly available mailing address for sending support issues to. + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). */ - support_address?: Stripe.AddressParam; + id_number_secondary?: string; /** - * A publicly available email address for sending support issues to. + * The individual's last name. */ - support_email?: string; + last_name?: string; /** - * A publicly available phone number to call with support issues. + * The Kana variation of the individual's last name (Japan only). */ - support_phone?: string; + last_name_kana?: string; /** - * A publicly available website for handling support issues. + * The Kanji variation of the individual's last name (Japan only). */ - support_url?: Stripe.Emptyable; + last_name_kanji?: string; /** - * The business's publicly available website. + * The individual's maiden name. */ - url?: string; - } - - type BusinessType = - | 'company' - | 'government_entity' - | 'individual' - | 'non_profit'; + maiden_name?: string; - interface Capabilities { /** - * The acss_debit_payments capability. + * 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`. */ - acss_debit_payments?: Capabilities.AcssDebitPayments; + metadata?: Stripe.Emptyable; /** - * The affirm_payments capability. + * The individual's phone number. */ - affirm_payments?: Capabilities.AffirmPayments; + phone?: string; /** - * The afterpay_clearpay_payments capability. + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. */ - afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; + political_exposure?: Individual.PoliticalExposure; /** - * The au_becs_debit_payments capability. + * The individual's registered address. */ - au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; + registered_address?: Stripe.AddressParam; /** - * The bacs_debit_payments capability. + * The last four digits of the individual's Social Security Number (U.S. only). */ - bacs_debit_payments?: Capabilities.BacsDebitPayments; + ssn_last_4?: string; /** - * The bancontact_payments capability. + * The individual's verification document information. */ - bancontact_payments?: Capabilities.BancontactPayments; + verification?: Individual.Verification; + } - /** - * The bank_transfer_payments capability. - */ - bank_transfer_payments?: Capabilities.BankTransferPayments; + namespace Individual { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; - /** - * The blik_payments capability. - */ - blik_payments?: Capabilities.BlikPayments; + /** + * The month of birth, between 1 and 12. + */ + month: number; - /** - * The boleto_payments capability. - */ - boleto_payments?: Capabilities.BoletoPayments; + /** + * The four-digit year of birth. + */ + year: number; + } - /** - * The card_issuing capability. - */ - card_issuing?: Capabilities.CardIssuing; + type PoliticalExposure = 'existing' | 'none'; - /** - * The card_payments capability. - */ - card_payments?: Capabilities.CardPayments; + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; - /** - * The cartes_bancaires_payments capability. - */ - cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } - /** - * The cashapp_payments capability. - */ - cashapp_payments?: Capabilities.CashappPayments; + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - /** - * The eps_payments capability. - */ - eps_payments?: Capabilities.EpsPayments; + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } - /** - * The fpx_payments capability. - */ - fpx_payments?: Capabilities.FpxPayments; + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - /** - * The giropay_payments capability. - */ - giropay_payments?: Capabilities.GiropayPayments; + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + interface Settings { /** - * The grabpay_payments capability. + * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. */ - grabpay_payments?: Capabilities.GrabpayPayments; + branding?: Settings.Branding; /** - * The ideal_payments capability. + * Settings specific to the account's use of the Card Issuing product. */ - ideal_payments?: Capabilities.IdealPayments; + card_issuing?: Settings.CardIssuing; /** - * The jcb_payments capability. + * Settings specific to card charging on the account. */ - jcb_payments?: Capabilities.JcbPayments; + card_payments?: Settings.CardPayments; /** - * The klarna_payments capability. + * Settings that apply across payment methods for charging on the account. */ - klarna_payments?: Capabilities.KlarnaPayments; + payments?: Settings.Payments; /** - * The konbini_payments capability. + * Settings specific to the account's payouts. */ - konbini_payments?: Capabilities.KonbiniPayments; + payouts?: Settings.Payouts; /** - * The legacy_payments capability. + * Settings specific to the account's Treasury FinancialAccounts. */ - legacy_payments?: Capabilities.LegacyPayments; + treasury?: Settings.Treasury; + } - /** - * The link_payments capability. - */ - link_payments?: Capabilities.LinkPayments; + namespace Settings { + interface Branding { + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + */ + icon?: string; - /** - * The oxxo_payments capability. - */ - oxxo_payments?: Capabilities.OxxoPayments; + /** + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + */ + logo?: string; - /** - * The p24_payments capability. - */ - p24_payments?: Capabilities.P24Payments; - - /** - * The paynow_payments capability. - */ - paynow_payments?: Capabilities.PaynowPayments; - - /** - * The promptpay_payments capability. - */ - promptpay_payments?: Capabilities.PromptpayPayments; - - /** - * The sepa_debit_payments capability. - */ - sepa_debit_payments?: Capabilities.SepaDebitPayments; - - /** - * The sofort_payments capability. - */ - sofort_payments?: Capabilities.SofortPayments; - - /** - * The tax_reporting_us_1099_k capability. - */ - tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; - - /** - * The tax_reporting_us_1099_misc capability. - */ - tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; - - /** - * The transfers capability. - */ - transfers?: Capabilities.Transfers; - - /** - * The treasury capability. - */ - treasury?: Capabilities.Treasury; - - /** - * The us_bank_account_ach_payments capability. - */ - us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; - - /** - * The zip_payments capability. - */ - zip_payments?: Capabilities.ZipPayments; - } - - namespace Capabilities { - interface AcssDebitPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A CSS hex color value representing the primary branding color for this account. */ - requested?: boolean; - } + primary_color?: string; - interface AffirmPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A CSS hex color value representing the secondary branding color for this account. */ - requested?: boolean; + secondary_color?: string; } - interface AfterpayClearpayPayments { + interface CardIssuing { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). */ - requested?: boolean; + tos_acceptance?: CardIssuing.TosAcceptance; } - interface AuBecsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace CardIssuing { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; - interface BacsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; - interface BancontactPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } } - interface BankTransferPayments { + interface CardPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. */ - requested?: boolean; - } + decline_on?: CardPayments.DeclineOn; - interface BlikPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; - } + statement_descriptor_prefix?: string; - interface BoletoPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; - } + statement_descriptor_prefix_kana?: Stripe.Emptyable; - interface CardIssuing { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; + statement_descriptor_prefix_kanji?: Stripe.Emptyable; } - interface CardPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace CardPayments { + interface DeclineOn { + /** + * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + */ + avs_failure?: boolean; - interface CartesBancairesPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + /** + * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + */ + cvc_failure?: boolean; + } } - interface CashappPayments { + interface Payments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. */ - requested?: boolean; - } + statement_descriptor?: string; - interface EpsPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). */ - requested?: boolean; - } + statement_descriptor_kana?: string; - interface FpxPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). */ - requested?: boolean; + statement_descriptor_kanji?: string; } - interface GiropayPayments { + interface Payouts { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). */ - requested?: boolean; - } + debit_negative_balances?: boolean; - interface GrabpayPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. */ - requested?: boolean; - } + schedule?: Payouts.Schedule; - interface IdealPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. */ - requested?: boolean; + statement_descriptor?: string; } - interface JcbPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace Payouts { + interface Schedule { + /** + * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. + */ + delay_days?: 'minimum' | number; - interface KlarnaPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + */ + interval?: Schedule.Interval; - interface KonbiniPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + */ + monthly_anchor?: number; - interface LegacyPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) + */ + weekly_anchor?: Schedule.WeeklyAnchor; + } - interface LinkPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + namespace Schedule { + type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; + + type WeeklyAnchor = + | 'friday' + | 'monday' + | 'saturday' + | 'sunday' + | 'thursday' + | 'tuesday' + | 'wednesday'; + } } - interface OxxoPayments { + interface Treasury { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on the account's acceptance of the Stripe Treasury Services Agreement. */ - requested?: boolean; + tos_acceptance?: Treasury.TosAcceptance; } - interface P24Payments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace Treasury { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; - interface PaynowPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; - interface PromptpayPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } } + } - interface SepaDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted their service agreement. + */ + date?: number; - interface SofortPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The IP address from which the account representative accepted their service agreement. + */ + ip?: string; - interface TaxReportingUs1099K { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The user's service agreement type. + */ + service_agreement?: string; - interface TaxReportingUs1099Misc { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The user agent of the browser from which the account representative accepted their service agreement. + */ + user_agent?: string; + } - interface Transfers { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + type Type = 'custom' | 'express' | 'standard'; + } - interface Treasury { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + interface AccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - interface UsBankAccountAchPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + interface AccountUpdateParams { + /** + * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + */ + account_token?: string; - interface ZipPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } - } + /** + * Business information about the account. + */ + business_profile?: AccountUpdateParams.BusinessProfile; - interface Company { + /** + * The business type. + */ + business_type?: AccountUpdateParams.BusinessType; + + /** + * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. + */ + capabilities?: AccountUpdateParams.Capabilities; + + /** + * Information about the company or business. This field is available for any `business_type`. + */ + company?: AccountUpdateParams.Company; + + /** + * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + */ + default_currency?: string; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: AccountUpdateParams.Documents; + + /** + * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + * + * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + */ + external_account?: string; + + /** + * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. + */ + individual?: AccountUpdateParams.Individual; + + /** + * 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; + + /** + * Options for customizing how the account functions within Stripe. + */ + settings?: AccountUpdateParams.Settings; + + /** + * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + */ + tos_acceptance?: AccountUpdateParams.TosAcceptance; + } + + namespace AccountUpdateParams { + interface BusinessProfile { /** - * The company's primary address. + * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. */ - address?: Stripe.AddressParam; + mcc?: string; /** - * The Kana variation of the company's primary address (Japan only). + * The customer-facing business name. */ - address_kana?: Stripe.JapanAddressParam; + name?: string; /** - * The Kanji variation of the company's primary address (Japan only). + * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. */ - address_kanji?: Stripe.JapanAddressParam; + product_description?: string; /** - * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + * A publicly available mailing address for sending support issues to. */ - directors_provided?: boolean; + support_address?: Stripe.AddressParam; /** - * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + * A publicly available email address for sending support issues to. */ - executives_provided?: boolean; + support_email?: string; /** - * The company's legal name. + * A publicly available phone number to call with support issues. */ - name?: string; + support_phone?: string; /** - * The Kana variation of the company's legal name (Japan only). + * A publicly available website for handling support issues. */ - name_kana?: string; + support_url?: Stripe.Emptyable; /** - * The Kanji variation of the company's legal name (Japan only). + * The business's publicly available website. */ - name_kanji?: string; + url?: string; + } + + type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + interface Capabilities { /** - * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + * The acss_debit_payments capability. */ - owners_provided?: boolean; + acss_debit_payments?: Capabilities.AcssDebitPayments; /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + * The affirm_payments capability. */ - ownership_declaration?: Company.OwnershipDeclaration; + affirm_payments?: Capabilities.AffirmPayments; /** - * The company's phone number (used for verification). + * The afterpay_clearpay_payments capability. */ - phone?: string; + afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; /** - * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + * The au_becs_debit_payments capability. */ - registration_number?: string; + au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + * The bacs_debit_payments capability. */ - structure?: Stripe.Emptyable; + bacs_debit_payments?: Capabilities.BacsDebitPayments; /** - * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + * The bancontact_payments capability. */ - tax_id?: string; + bancontact_payments?: Capabilities.BancontactPayments; /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + * The bank_transfer_payments capability. */ - tax_id_registrar?: string; + bank_transfer_payments?: Capabilities.BankTransferPayments; /** - * The VAT number of the company. + * The blik_payments capability. */ - vat_id?: string; + blik_payments?: Capabilities.BlikPayments; /** - * Information on the verification state of the company. + * The boleto_payments capability. */ - verification?: Company.Verification; - } + boleto_payments?: Capabilities.BoletoPayments; - namespace Company { - interface OwnershipDeclaration { - /** - * The Unix timestamp marking when the beneficial owner attestation was made. - */ - date?: number; - - /** - * The IP address from which the beneficial owner attestation was made. - */ - ip?: string; - - /** - * The user agent of the browser from which the beneficial owner attestation was made. - */ - user_agent?: string; - } - - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; - - interface Verification { - /** - * A document verifying the business. - */ - document?: Verification.Document; - } - - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } - - interface Documents { /** - * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + * The card_issuing capability. */ - bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; + card_issuing?: Capabilities.CardIssuing; /** - * One or more documents that demonstrate proof of a company's license to operate. + * The card_payments capability. */ - company_license?: Documents.CompanyLicense; + card_payments?: Capabilities.CardPayments; /** - * One or more documents showing the company's Memorandum of Association. + * The cartes_bancaires_payments capability. */ - company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; + cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; /** - * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + * The cashapp_payments capability. */ - company_ministerial_decree?: Documents.CompanyMinisterialDecree; + cashapp_payments?: Capabilities.CashappPayments; /** - * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + * The eps_payments capability. */ - company_registration_verification?: Documents.CompanyRegistrationVerification; + eps_payments?: Capabilities.EpsPayments; /** - * One or more documents that demonstrate proof of a company's tax ID. + * The fpx_payments capability. */ - company_tax_id_verification?: Documents.CompanyTaxIdVerification; + fpx_payments?: Capabilities.FpxPayments; /** - * One or more documents showing the company's proof of registration with the national business registry. + * The giropay_payments capability. */ - proof_of_registration?: Documents.ProofOfRegistration; - } - - namespace Documents { - interface BankAccountOwnershipVerification { - /** - * 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; - } - - interface CompanyLicense { - /** - * 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; - } - - interface CompanyMemorandumOfAssociation { - /** - * 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; - } - - interface CompanyMinisterialDecree { - /** - * 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; - } - - interface CompanyRegistrationVerification { - /** - * 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; - } - - interface CompanyTaxIdVerification { - /** - * 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; - } - - 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`. - */ - files?: Array; - } - } + giropay_payments?: Capabilities.GiropayPayments; - interface ExternalAccount { /** - * The type of external account. Should be bank_account. + * The grabpay_payments capability. */ - object: string; + grabpay_payments?: Capabilities.GrabpayPayments; /** - * The country in which the bank account is located. + * The ideal_payments capability. */ - country: string; + ideal_payments?: Capabilities.IdealPayments; /** - * The currency the bank account is in. This must be a country/currency pairing that [Stripe supports](https://stripe.com/docs/payouts). + * The india_international_payments capability. */ - currency: string; + india_international_payments?: Capabilities.IndiaInternationalPayments; /** - * The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. + * The jcb_payments capability. */ - account_holder_name?: string; + jcb_payments?: Capabilities.JcbPayments; /** - * The type of entity that holds the account. This can be either individual or company. This field is required when attaching the bank account to a Customer object. + * The klarna_payments capability. */ - account_holder_type?: string; + klarna_payments?: Capabilities.KlarnaPayments; /** - * The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for account_number, this field is not required. + * The konbini_payments capability. */ - routing_number?: string; + konbini_payments?: Capabilities.KonbiniPayments; /** - * The account number for the bank account, in string form. Must be a checking account. + * The legacy_payments capability. */ - account_number: string; - } + legacy_payments?: Capabilities.LegacyPayments; - interface Individual { /** - * The individual's primary address. + * The link_payments capability. */ - address?: Stripe.AddressParam; + link_payments?: Capabilities.LinkPayments; /** - * The Kana variation of the the individual's primary address (Japan only). + * The oxxo_payments capability. */ - address_kana?: Stripe.JapanAddressParam; + oxxo_payments?: Capabilities.OxxoPayments; /** - * The Kanji variation of the the individual's primary address (Japan only). + * The p24_payments capability. */ - address_kanji?: Stripe.JapanAddressParam; + p24_payments?: Capabilities.P24Payments; /** - * The individual's date of birth. + * The paynow_payments capability. */ - dob?: Stripe.Emptyable; + paynow_payments?: Capabilities.PaynowPayments; /** - * The individual's email address. + * The promptpay_payments capability. */ - email?: string; + promptpay_payments?: Capabilities.PromptpayPayments; /** - * The individual's first name. + * The sepa_debit_payments capability. */ - first_name?: string; + sepa_debit_payments?: Capabilities.SepaDebitPayments; /** - * The Kana variation of the the individual's first name (Japan only). + * The sofort_payments capability. */ - first_name_kana?: string; + sofort_payments?: Capabilities.SofortPayments; /** - * The Kanji variation of the individual's first name (Japan only). + * The tax_reporting_us_1099_k capability. */ - first_name_kanji?: string; + tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; /** - * A list of alternate names or aliases that the individual is known by. + * The tax_reporting_us_1099_misc capability. */ - full_name_aliases?: Stripe.Emptyable>; + tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; /** - * The individual's gender (International regulations require either "male" or "female"). + * The transfers capability. */ - gender?: string; + transfers?: Capabilities.Transfers; /** - * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + * The treasury capability. */ - id_number?: string; + treasury?: Capabilities.Treasury; /** - * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + * The us_bank_account_ach_payments capability. */ - id_number_secondary?: string; + us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; /** - * The individual's last name. + * The zip_payments capability. */ - last_name?: string; + zip_payments?: Capabilities.ZipPayments; + } - /** - * The Kana variation of the individual's last name (Japan only). - */ - last_name_kana?: string; + namespace Capabilities { + interface AcssDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The Kanji variation of the individual's last name (Japan only). - */ - last_name_kanji?: string; + interface AffirmPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The individual's maiden name. - */ - maiden_name?: string; + interface AfterpayClearpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * 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; - - /** - * The individual's phone number. - */ - phone?: string; - - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: Individual.PoliticalExposure; - - /** - * The individual's registered address. - */ - registered_address?: Stripe.AddressParam; - - /** - * The last four digits of the individual's Social Security Number (U.S. only). - */ - ssn_last_4?: string; - - /** - * The individual's verification document information. - */ - verification?: Individual.Verification; - } - - namespace Individual { - interface Dob { + interface AuBecsDebitPayments { /** - * The day of birth, between 1 and 31. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - day: number; + requested?: boolean; + } + interface BacsDebitPayments { /** - * The month of birth, between 1 and 12. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - month: number; + requested?: boolean; + } + interface BancontactPayments { /** - * The four-digit year of birth. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - year: number; + requested?: boolean; } - type PoliticalExposure = 'existing' | 'none'; - - interface Verification { + interface BankTransferPayments { /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - additional_document?: Verification.AdditionalDocument; + requested?: boolean; + } + interface BlikPayments { /** - * An identifying document, either a passport or local ID card. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - document?: Verification.Document; + requested?: boolean; } - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; - - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } + interface BoletoPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - } - - interface Settings { - /** - * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. - */ - branding?: Settings.Branding; - - /** - * Settings specific to the account's use of the Card Issuing product. - */ - card_issuing?: Settings.CardIssuing; - - /** - * Settings specific to card charging on the account. - */ - card_payments?: Settings.CardPayments; - - /** - * Settings that apply across payment methods for charging on the account. - */ - payments?: Settings.Payments; - - /** - * Settings specific to the account's payouts. - */ - payouts?: Settings.Payouts; - /** - * Settings specific to the account's Treasury FinancialAccounts. - */ - treasury?: Settings.Treasury; - } - - namespace Settings { - interface Branding { + interface CardIssuing { /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - icon?: string; + requested?: boolean; + } + interface CardPayments { /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - logo?: string; + requested?: boolean; + } + interface CartesBancairesPayments { /** - * A CSS hex color value representing the primary branding color for this account. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - primary_color?: string; + requested?: boolean; + } + interface CashappPayments { /** - * A CSS hex color value representing the secondary branding color for this account. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - secondary_color?: string; + requested?: boolean; } - interface CardIssuing { + interface EpsPayments { /** - * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - tos_acceptance?: CardIssuing.TosAcceptance; + requested?: boolean; } - namespace CardIssuing { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } + interface FpxPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - interface CardPayments { + interface GiropayPayments { /** - * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - decline_on?: CardPayments.DeclineOn; + requested?: boolean; + } + interface GrabpayPayments { /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor_prefix?: string; + requested?: boolean; + } + interface IdealPayments { /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor_prefix_kana?: Stripe.Emptyable; + requested?: boolean; + } + interface IndiaInternationalPayments { /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor_prefix_kanji?: Stripe.Emptyable; + requested?: boolean; } - namespace CardPayments { - interface DeclineOn { - /** - * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. - */ - avs_failure?: boolean; - - /** - * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. - */ - cvc_failure?: boolean; - } + interface JcbPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - interface Payments { + interface KlarnaPayments { /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor?: string; + requested?: boolean; + } + interface KonbiniPayments { /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor_kana?: string; + requested?: boolean; + } + interface LegacyPayments { /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor_kanji?: string; + requested?: boolean; } - interface Payouts { + interface LinkPayments { /** - * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - debit_negative_balances?: boolean; + requested?: boolean; + } + interface OxxoPayments { /** - * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - schedule?: Payouts.Schedule; + requested?: boolean; + } + interface P24Payments { /** - * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - statement_descriptor?: string; + requested?: boolean; } - namespace Payouts { - interface Schedule { - /** - * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. - */ - delay_days?: 'minimum' | number; + interface PaynowPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. - */ - interval?: Schedule.Interval; + interface PromptpayPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. - */ - monthly_anchor?: number; + interface SepaDebitPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) - */ - weekly_anchor?: Schedule.WeeklyAnchor; - } + interface SofortPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - namespace Schedule { - type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; + interface TaxReportingUs1099K { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - type WeeklyAnchor = - | 'friday' - | 'monday' - | 'saturday' - | 'sunday' - | 'thursday' - | 'tuesday' - | 'wednesday'; - } + interface TaxReportingUs1099Misc { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } - interface Treasury { + interface Transfers { /** - * Details on the account's acceptance of the Stripe Treasury Services Agreement. + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. */ - tos_acceptance?: Treasury.TosAcceptance; + requested?: boolean; } - namespace Treasury { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; + interface Treasury { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; + interface UsBankAccountAchPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } + interface ZipPayments { + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; } } - interface TosAcceptance { + interface Company { /** - * The Unix timestamp marking when the account representative accepted their service agreement. + * The company's primary address. */ - date?: number; + address?: Stripe.AddressParam; /** - * The IP address from which the account representative accepted their service agreement. + * The Kana variation of the company's primary address (Japan only). */ - ip?: string; + address_kana?: Stripe.JapanAddressParam; /** - * The user's service agreement type. + * The Kanji variation of the company's primary address (Japan only). */ - service_agreement?: string; + address_kanji?: Stripe.JapanAddressParam; /** - * The user agent of the browser from which the account representative accepted their service agreement. + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. */ - user_agent?: string; - } - - type Type = 'custom' | 'express' | 'standard'; - } - - interface AccountRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountUpdateParams { - /** - * An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - */ - account_token?: string; - - /** - * Business information about the account. - */ - business_profile?: AccountUpdateParams.BusinessProfile; - - /** - * The business type. - */ - business_type?: AccountUpdateParams.BusinessType; - - /** - * Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive. - */ - capabilities?: AccountUpdateParams.Capabilities; - - /** - * Information about the company or business. This field is available for any `business_type`. - */ - company?: AccountUpdateParams.Company; - - /** - * Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - */ - default_currency?: string; - - /** - * Documents that may be submitted to satisfy various informational requests. - */ - documents?: AccountUpdateParams.Documents; - - /** - * The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent. - */ - email?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - * - * By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - */ - external_account?: string; - - /** - * Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. - */ - individual?: AccountUpdateParams.Individual; - - /** - * 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; - - /** - * Options for customizing how the account functions within Stripe. - */ - settings?: AccountUpdateParams.Settings; - - /** - * Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - */ - tos_acceptance?: AccountUpdateParams.TosAcceptance; - } + directors_provided?: boolean; - namespace AccountUpdateParams { - interface BusinessProfile { /** - * [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. */ - mcc?: string; + executives_provided?: boolean; /** - * The customer-facing business name. + * The company's legal name. */ name?: string; /** - * Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. + * The Kana variation of the company's legal name (Japan only). */ - product_description?: string; + name_kana?: string; /** - * A publicly available mailing address for sending support issues to. + * The Kanji variation of the company's legal name (Japan only). */ - support_address?: Stripe.AddressParam; + name_kanji?: string; /** - * A publicly available email address for sending support issues to. + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. */ - support_email?: string; + owners_provided?: boolean; /** - * A publicly available phone number to call with support issues. + * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. */ - support_phone?: string; + ownership_declaration?: Company.OwnershipDeclaration; /** - * A publicly available website for handling support issues. + * The company's phone number (used for verification). */ - support_url?: Stripe.Emptyable; + phone?: string; /** - * The business's publicly available website. + * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). */ - url?: string; - } - - type BusinessType = - | 'company' - | 'government_entity' - | 'individual' - | 'non_profit'; + registration_number?: string; - interface Capabilities { /** - * The acss_debit_payments capability. + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. */ - acss_debit_payments?: Capabilities.AcssDebitPayments; + structure?: Stripe.Emptyable; /** - * The affirm_payments capability. + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) */ - affirm_payments?: Capabilities.AffirmPayments; + tax_id?: string; /** - * The afterpay_clearpay_payments capability. + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). */ - afterpay_clearpay_payments?: Capabilities.AfterpayClearpayPayments; + tax_id_registrar?: string; /** - * The au_becs_debit_payments capability. + * The VAT number of the company. */ - au_becs_debit_payments?: Capabilities.AuBecsDebitPayments; + vat_id?: string; /** - * The bacs_debit_payments capability. + * Information on the verification state of the company. */ - bacs_debit_payments?: Capabilities.BacsDebitPayments; + verification?: Company.Verification; + } - /** - * The bancontact_payments capability. - */ - bancontact_payments?: Capabilities.BancontactPayments; + namespace Company { + interface OwnershipDeclaration { + /** + * The Unix timestamp marking when the beneficial owner attestation was made. + */ + date?: number; + + /** + * The IP address from which the beneficial owner attestation was made. + */ + ip?: string; + + /** + * The user agent of the browser from which the beneficial owner attestation was made. + */ + user_agent?: string; + } + + type Structure = + | 'free_zone_establishment' + | 'free_zone_llc' + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'llc' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'single_member_llc' + | 'sole_establishment' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + namespace Verification { + interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + interface Documents { /** - * The bank_transfer_payments capability. + * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. */ - bank_transfer_payments?: Capabilities.BankTransferPayments; + bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; /** - * The blik_payments capability. + * One or more documents that demonstrate proof of a company's license to operate. */ - blik_payments?: Capabilities.BlikPayments; + company_license?: Documents.CompanyLicense; /** - * The boleto_payments capability. + * One or more documents showing the company's Memorandum of Association. */ - boleto_payments?: Capabilities.BoletoPayments; + company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; /** - * The card_issuing capability. + * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. */ - card_issuing?: Capabilities.CardIssuing; + company_ministerial_decree?: Documents.CompanyMinisterialDecree; /** - * The card_payments capability. + * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. */ - card_payments?: Capabilities.CardPayments; + company_registration_verification?: Documents.CompanyRegistrationVerification; /** - * The cartes_bancaires_payments capability. + * One or more documents that demonstrate proof of a company's tax ID. */ - cartes_bancaires_payments?: Capabilities.CartesBancairesPayments; + company_tax_id_verification?: Documents.CompanyTaxIdVerification; /** - * The cashapp_payments capability. + * One or more documents showing the company's proof of registration with the national business registry. */ - cashapp_payments?: Capabilities.CashappPayments; + proof_of_registration?: Documents.ProofOfRegistration; + } + + namespace Documents { + interface BankAccountOwnershipVerification { + /** + * 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; + } + + interface CompanyLicense { + /** + * 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; + } + + interface CompanyMemorandumOfAssociation { + /** + * 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; + } + + interface CompanyMinisterialDecree { + /** + * 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; + } + + interface CompanyRegistrationVerification { + /** + * 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; + } + + interface CompanyTaxIdVerification { + /** + * 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; + } + + 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`. + */ + files?: Array; + } + } + interface Individual { /** - * The eps_payments capability. + * The individual's primary address. */ - eps_payments?: Capabilities.EpsPayments; + address?: Stripe.AddressParam; /** - * The fpx_payments capability. + * The Kana variation of the the individual's primary address (Japan only). */ - fpx_payments?: Capabilities.FpxPayments; + address_kana?: Stripe.JapanAddressParam; /** - * The giropay_payments capability. + * The Kanji variation of the the individual's primary address (Japan only). */ - giropay_payments?: Capabilities.GiropayPayments; + address_kanji?: Stripe.JapanAddressParam; /** - * The grabpay_payments capability. + * The individual's date of birth. */ - grabpay_payments?: Capabilities.GrabpayPayments; + dob?: Stripe.Emptyable; /** - * The ideal_payments capability. + * The individual's email address. */ - ideal_payments?: Capabilities.IdealPayments; + email?: string; /** - * The jcb_payments capability. + * The individual's first name. */ - jcb_payments?: Capabilities.JcbPayments; + first_name?: string; /** - * The klarna_payments capability. + * The Kana variation of the the individual's first name (Japan only). */ - klarna_payments?: Capabilities.KlarnaPayments; + first_name_kana?: string; /** - * The konbini_payments capability. + * The Kanji variation of the individual's first name (Japan only). */ - konbini_payments?: Capabilities.KonbiniPayments; + first_name_kanji?: string; /** - * The legacy_payments capability. + * A list of alternate names or aliases that the individual is known by. */ - legacy_payments?: Capabilities.LegacyPayments; + full_name_aliases?: Stripe.Emptyable>; /** - * The link_payments capability. + * The individual's gender (International regulations require either "male" or "female"). */ - link_payments?: Capabilities.LinkPayments; + gender?: string; /** - * The oxxo_payments capability. + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). */ - oxxo_payments?: Capabilities.OxxoPayments; + id_number?: string; /** - * The p24_payments capability. + * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). */ - p24_payments?: Capabilities.P24Payments; + id_number_secondary?: string; /** - * The paynow_payments capability. + * The individual's last name. */ - paynow_payments?: Capabilities.PaynowPayments; + last_name?: string; /** - * The promptpay_payments capability. + * The Kana variation of the individual's last name (Japan only). */ - promptpay_payments?: Capabilities.PromptpayPayments; + last_name_kana?: string; /** - * The sepa_debit_payments capability. + * The Kanji variation of the individual's last name (Japan only). */ - sepa_debit_payments?: Capabilities.SepaDebitPayments; + last_name_kanji?: string; /** - * The sofort_payments capability. + * The individual's maiden name. */ - sofort_payments?: Capabilities.SofortPayments; + maiden_name?: string; /** - * The tax_reporting_us_1099_k capability. + * 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`. */ - tax_reporting_us_1099_k?: Capabilities.TaxReportingUs1099K; + metadata?: Stripe.Emptyable; /** - * The tax_reporting_us_1099_misc capability. + * The individual's phone number. */ - tax_reporting_us_1099_misc?: Capabilities.TaxReportingUs1099Misc; + phone?: string; /** - * The transfers capability. + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. */ - transfers?: Capabilities.Transfers; + political_exposure?: Individual.PoliticalExposure; /** - * The treasury capability. + * The individual's registered address. */ - treasury?: Capabilities.Treasury; + registered_address?: Stripe.AddressParam; /** - * The us_bank_account_ach_payments capability. + * The last four digits of the individual's Social Security Number (U.S. only). */ - us_bank_account_ach_payments?: Capabilities.UsBankAccountAchPayments; + ssn_last_4?: string; /** - * The zip_payments capability. + * The individual's verification document information. */ - zip_payments?: Capabilities.ZipPayments; + verification?: Individual.Verification; } - namespace Capabilities { - interface AcssDebitPayments { + namespace Individual { + interface Dob { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The day of birth, between 1 and 31. */ - requested?: boolean; - } + day: number; - interface AffirmPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The month of birth, between 1 and 12. */ - requested?: boolean; - } + month: number; - interface AfterpayClearpayPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The four-digit year of birth. */ - requested?: boolean; + year: number; } - interface AuBecsDebitPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + type PoliticalExposure = 'existing' | 'none'; - interface BacsDebitPayments { + interface Verification { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. */ - requested?: boolean; - } + additional_document?: Verification.AdditionalDocument; - interface BancontactPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * An identifying document, either a passport or local ID card. */ - requested?: boolean; + document?: Verification.Document; } - interface BankTransferPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - interface BlikPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } - interface BoletoPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - interface CardIssuing { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } } + } - interface CardPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + interface Settings { + /** + * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + */ + branding?: Settings.Branding; - interface CartesBancairesPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * Settings specific to the account's use of the Card Issuing product. + */ + card_issuing?: Settings.CardIssuing; - interface CashappPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * Settings specific to card charging on the account. + */ + card_payments?: Settings.CardPayments; - interface EpsPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + /** + * Settings that apply across payment methods for charging on the account. + */ + payments?: Settings.Payments; - interface FpxPayments { + /** + * Settings specific to the account's payouts. + */ + payouts?: Settings.Payouts; + + /** + * Settings specific to the account's Treasury FinancialAccounts. + */ + treasury?: Settings.Treasury; + } + + namespace Settings { + interface Branding { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. */ - requested?: boolean; - } + icon?: string; - interface GiropayPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. */ - requested?: boolean; - } + logo?: string; - interface GrabpayPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A CSS hex color value representing the primary branding color for this account. */ - requested?: boolean; - } + primary_color?: string; - interface IdealPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A CSS hex color value representing the secondary branding color for this account. */ - requested?: boolean; + secondary_color?: string; } - interface JcbPayments { + interface CardIssuing { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). */ - requested?: boolean; + tos_acceptance?: CardIssuing.TosAcceptance; } - interface KlarnaPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + namespace CardIssuing { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; + + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } } - interface KonbiniPayments { + interface CardPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. */ - requested?: boolean; - } + decline_on?: CardPayments.DeclineOn; - interface LegacyPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; - } + statement_descriptor_prefix?: string; - interface LinkPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; - } + statement_descriptor_prefix_kana?: Stripe.Emptyable; - interface OxxoPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. */ - requested?: boolean; + statement_descriptor_prefix_kanji?: Stripe.Emptyable; } - interface P24Payments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + namespace CardPayments { + interface DeclineOn { + /** + * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + */ + avs_failure?: boolean; + + /** + * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + */ + cvc_failure?: boolean; + } } - interface PaynowPayments { + interface Payments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. */ - requested?: boolean; - } + statement_descriptor?: string; - interface PromptpayPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). */ - requested?: boolean; - } + statement_descriptor_kana?: string; - interface SepaDebitPayments { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). */ - requested?: boolean; + statement_descriptor_kanji?: string; } - interface SofortPayments { + interface Payouts { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). */ - requested?: boolean; - } + debit_negative_balances?: boolean; - interface TaxReportingUs1099K { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. */ - requested?: boolean; - } + schedule?: Payouts.Schedule; - interface TaxReportingUs1099Misc { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. */ - requested?: boolean; + statement_descriptor?: string; } - interface Transfers { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + namespace Payouts { + interface Schedule { + /** + * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. + */ + delay_days?: 'minimum' | number; + + /** + * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. + */ + interval?: Schedule.Interval; + + /** + * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. + */ + monthly_anchor?: number; + + /** + * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) + */ + weekly_anchor?: Schedule.WeeklyAnchor; + } + + namespace Schedule { + type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; + + type WeeklyAnchor = + | 'friday' + | 'monday' + | 'saturday' + | 'sunday' + | 'thursday' + | 'tuesday' + | 'wednesday'; + } } interface Treasury { /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + * Details on the account's acceptance of the Stripe Treasury Services Agreement. */ - requested?: boolean; + tos_acceptance?: Treasury.TosAcceptance; } - interface UsBankAccountAchPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; - } + namespace Treasury { + interface TosAcceptance { + /** + * The Unix timestamp marking when the account representative accepted the service agreement. + */ + date?: number; - interface ZipPayments { - /** - * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. - */ - requested?: boolean; + /** + * The IP address from which the account representative accepted the service agreement. + */ + ip?: string; + + /** + * The user agent of the browser from which the account representative accepted the service agreement. + */ + user_agent?: string; + } } } - interface Company { + interface TosAcceptance { /** - * The company's primary address. + * The Unix timestamp marking when the account representative accepted their service agreement. */ - address?: Stripe.AddressParam; + date?: number; /** - * The Kana variation of the company's primary address (Japan only). + * The IP address from which the account representative accepted their service agreement. */ - address_kana?: Stripe.JapanAddressParam; + ip?: string; /** - * The Kanji variation of the company's primary address (Japan only). + * The user's service agreement type. */ - address_kanji?: Stripe.JapanAddressParam; + service_agreement?: string; /** - * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + * The user agent of the browser from which the account representative accepted their service agreement. */ - directors_provided?: boolean; + user_agent?: string; + } + } - /** - * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - */ - executives_provided?: boolean; + interface AccountListParams extends PaginationParams { + created?: Stripe.RangeQueryParam | number; - /** - * The company's legal name. - */ - name?: string; + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * The Kana variation of the company's legal name (Japan only). - */ - name_kana?: string; + interface AccountDeleteParams {} - /** - * The Kanji variation of the company's legal name (Japan only). - */ - name_kanji?: string; + interface AccountRejectParams { + /** + * The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. + */ + reason: string; - /** - * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - */ - owners_provided?: boolean; + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - */ - ownership_declaration?: Company.OwnershipDeclaration; + interface CapabilityRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * The company's phone number (used for verification). - */ - phone?: string; + interface CapabilityUpdateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; - /** - * The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - */ - registration_number?: string; + /** + * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + */ + requested?: boolean; + } - /** - * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - */ - structure?: Stripe.Emptyable; + interface CapabilityListParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) - */ - tax_id?: string; + interface ExternalAccountCreateParams { + /** + * Please refer to full [documentation](https://stripe.com/docs/api) instead. + */ + external_account: string; - /** - * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - */ - tax_id_registrar?: string; + /** + * When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. + */ + default_for_currency?: boolean; - /** - * The VAT number of the company. - */ - vat_id?: string; + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; - /** - * Information on the verification state of the company. - */ - verification?: Company.Verification; - } + /** + * 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.MetadataParam; + } - namespace Company { - interface OwnershipDeclaration { - /** - * The Unix timestamp marking when the beneficial owner attestation was made. - */ - date?: number; + interface ExternalAccountRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * The IP address from which the beneficial owner attestation was made. - */ - ip?: string; + interface ExternalAccountUpdateParams { + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name?: string; - /** - * The user agent of the browser from which the beneficial owner attestation was made. - */ - user_agent?: string; - } + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type?: Stripe.Emptyable< + ExternalAccountUpdateParams.AccountHolderType + >; - type Structure = - | 'free_zone_establishment' - | 'free_zone_llc' - | 'government_instrumentality' - | 'governmental_unit' - | 'incorporated_non_profit' - | 'limited_liability_partnership' - | 'llc' - | 'multi_member_llc' - | 'private_company' - | 'private_corporation' - | 'private_partnership' - | 'public_company' - | 'public_corporation' - | 'public_partnership' - | 'single_member_llc' - | 'sole_establishment' - | 'sole_proprietorship' - | 'tax_exempt_government_instrumentality' - | 'unincorporated_association' - | 'unincorporated_non_profit'; + /** + * The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + */ + account_type?: ExternalAccountUpdateParams.AccountType; - interface Verification { - /** - * A document verifying the business. - */ - document?: Verification.Document; - } + /** + * City/District/Suburb/Town/Village. + */ + address_city?: string; + + /** + * Billing address country, if provided when creating card. + */ + address_country?: string; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + address_line1?: string; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + address_line2?: string; + + /** + * State/County/Province/Region. + */ + address_state?: string; + + /** + * ZIP or postal code. + */ + address_zip?: string; + + /** + * When set to true, this becomes the default external account for its currency. + */ + default_for_currency?: boolean; + + /** + * Two digit number representing the card's expiration month. + */ + exp_month?: string; + + /** + * Four digit number representing the card's expiration year. + */ + exp_year?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + + /** + * Cardholder name. + */ + name?: string; + } + + namespace ExternalAccountUpdateParams { + type AccountHolderType = 'company' | 'individual'; + + type AccountType = 'checking' | 'futsu' | 'savings' | 'toza'; + } + + interface ExternalAccountListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + object?: ExternalAccountListParams.Object; + } + + namespace ExternalAccountListParams { + type Object = 'bank_account' | 'card'; + } + + interface ExternalAccountDeleteParams {} + + interface LoginLinkCreateParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface PersonCreateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; + + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonCreateParams.Documents; + + /** + * The person's email address. + */ + email?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; + + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; - namespace Verification { - interface Document { - /** - * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonCreateParams.Relationship; - /** - * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; - interface Documents { - /** - * One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - */ - bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification; + /** + * The person's verification status. + */ + verification?: PersonCreateParams.Verification; + } + namespace PersonCreateParams { + interface Dob { /** - * One or more documents that demonstrate proof of a company's license to operate. + * The day of birth, between 1 and 31. */ - company_license?: Documents.CompanyLicense; + day: number; /** - * One or more documents showing the company's Memorandum of Association. + * The month of birth, between 1 and 12. */ - company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation; + month: number; /** - * (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + * The four-digit year of birth. */ - company_ministerial_decree?: Documents.CompanyMinisterialDecree; + year: number; + } + interface Documents { /** - * One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + * One or more documents that demonstrate proof that this person is authorized to represent the company. */ - company_registration_verification?: Documents.CompanyRegistrationVerification; + company_authorization?: Documents.CompanyAuthorization; /** - * One or more documents that demonstrate proof of a company's tax ID. + * One or more documents showing the person's passport page with photo and personal data. */ - company_tax_id_verification?: Documents.CompanyTaxIdVerification; + passport?: Documents.Passport; /** - * One or more documents showing the company's proof of registration with the national business registry. + * One or more documents showing the person's visa required for living in the country where they are residing. */ - proof_of_registration?: Documents.ProofOfRegistration; + visa?: Documents.Visa; } namespace Documents { - interface BankAccountOwnershipVerification { - /** - * 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; - } - - interface CompanyLicense { - /** - * 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; - } - - interface CompanyMemorandumOfAssociation { - /** - * 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; - } - - interface CompanyMinisterialDecree { - /** - * 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; - } - - interface CompanyRegistrationVerification { + interface CompanyAuthorization { /** * 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; } - interface CompanyTaxIdVerification { + interface Passport { /** * 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; } - interface ProofOfRegistration { + interface Visa { /** * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ @@ -3191,437 +2848,387 @@ declare module 'stripe' { } } - interface Individual { + interface Relationship { /** - * The individual's primary address. + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. */ - address?: Stripe.AddressParam; + director?: boolean; /** - * The Kana variation of the the individual's primary address (Japan only). + * Whether the person has significant responsibility to control, manage, or direct the organization. */ - address_kana?: Stripe.JapanAddressParam; + executive?: boolean; /** - * The Kanji variation of the the individual's primary address (Japan only). + * Whether the person is an owner of the account's legal entity. */ - address_kanji?: Stripe.JapanAddressParam; + owner?: boolean; /** - * The individual's date of birth. + * The percent owned by the person of the account's legal entity. */ - dob?: Stripe.Emptyable; + percent_ownership?: Stripe.Emptyable; /** - * The individual's email address. + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. */ - email?: string; + representative?: boolean; /** - * The individual's first name. + * The person's title (e.g., CEO, Support Engineer). */ - first_name?: string; + title?: string; + } + interface Verification { /** - * The Kana variation of the the individual's first name (Japan only). + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. */ - first_name_kana?: string; + additional_document?: Verification.AdditionalDocument; /** - * The Kanji variation of the individual's first name (Japan only). + * An identifying document, either a passport or local ID card. */ - first_name_kanji?: string; + document?: Verification.Document; + } - /** - * A list of alternate names or aliases that the individual is known by. - */ - full_name_aliases?: Stripe.Emptyable>; + namespace Verification { + interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - /** - * The individual's gender (International regulations require either "male" or "female"). - */ - gender?: string; + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } - /** - * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number?: string; + interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; - /** - * The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). - */ - id_number_secondary?: string; + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } - /** - * The individual's last name. - */ - last_name?: string; + interface PersonRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } - /** - * The Kana variation of the individual's last name (Japan only). - */ - last_name_kana?: string; + interface PersonUpdateParams { + /** + * The person's address. + */ + address?: Stripe.AddressParam; - /** - * The Kanji variation of the individual's last name (Japan only). - */ - last_name_kanji?: string; + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: Stripe.JapanAddressParam; - /** - * The individual's maiden name. - */ - maiden_name?: string; + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: Stripe.JapanAddressParam; - /** - * 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; + /** + * The person's date of birth. + */ + dob?: Stripe.Emptyable; - /** - * The individual's phone number. - */ - phone?: string; + /** + * Documents that may be submitted to satisfy various informational requests. + */ + documents?: PersonUpdateParams.Documents; - /** - * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - */ - political_exposure?: Individual.PoliticalExposure; + /** + * The person's email address. + */ + email?: string; - /** - * The individual's registered address. - */ - registered_address?: Stripe.AddressParam; + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; - /** - * The last four digits of the individual's Social Security Number (U.S. only). - */ - ssn_last_4?: string; + /** + * The person's first name. + */ + first_name?: string; - /** - * The individual's verification document information. - */ - verification?: Individual.Verification; - } + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; - namespace Individual { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number; + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; - /** - * The month of birth, between 1 and 12. - */ - month: number; + /** + * A list of alternate names or aliases that the person is known by. + */ + full_name_aliases?: Stripe.Emptyable>; - /** - * The four-digit year of birth. - */ - year: number; - } + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; - type PoliticalExposure = 'existing' | 'none'; + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number?: string; - interface Verification { - /** - * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - */ - additional_document?: Verification.AdditionalDocument; + /** + * The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii). + */ + id_number_secondary?: string; - /** - * An identifying document, either a passport or local ID card. - */ - document?: Verification.Document; - } + /** + * The person's last name. + */ + last_name?: string; - namespace Verification { - interface AdditionalDocument { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: 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`. + */ + metadata?: Stripe.Emptyable; + + /** + * The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + */ + nationality?: string; + + /** + * A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + */ + person_token?: string; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: string; + + /** + * The person's registered address. + */ + registered_address?: Stripe.AddressParam; - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: PersonUpdateParams.Relationship; - interface Document { - /** - * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - back?: string; + /** + * The last four digits of the person's Social Security number (U.S. only). + */ + ssn_last_4?: string; - /** - * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - */ - front?: string; - } - } - } + /** + * The person's verification status. + */ + verification?: PersonUpdateParams.Verification; + } - interface Settings { + namespace PersonUpdateParams { + interface Dob { /** - * Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + * The day of birth, between 1 and 31. */ - branding?: Settings.Branding; + day: number; /** - * Settings specific to the account's use of the Card Issuing product. + * The month of birth, between 1 and 12. */ - card_issuing?: Settings.CardIssuing; + month: number; /** - * Settings specific to card charging on the account. + * The four-digit year of birth. */ - card_payments?: Settings.CardPayments; + year: number; + } + interface Documents { /** - * Settings that apply across payment methods for charging on the account. + * One or more documents that demonstrate proof that this person is authorized to represent the company. */ - payments?: Settings.Payments; + company_authorization?: Documents.CompanyAuthorization; /** - * Settings specific to the account's payouts. + * One or more documents showing the person's passport page with photo and personal data. */ - payouts?: Settings.Payouts; + passport?: Documents.Passport; /** - * Settings specific to the account's Treasury FinancialAccounts. + * One or more documents showing the person's visa required for living in the country where they are residing. */ - treasury?: Settings.Treasury; + visa?: Documents.Visa; } - namespace Settings { - interface Branding { - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. - */ - icon?: string; - - /** - * (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. - */ - logo?: string; - + namespace Documents { + interface CompanyAuthorization { /** - * A CSS hex color value representing the primary branding color for this account. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - primary_color?: string; + files?: Array; + } + interface Passport { /** - * A CSS hex color value representing the secondary branding color for this account. + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - secondary_color?: string; + files?: Array; } - interface CardIssuing { + interface Visa { /** - * Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + * One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. */ - tos_acceptance?: CardIssuing.TosAcceptance; + files?: Array; } + } - namespace CardIssuing { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; - - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } + interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; - interface CardPayments { - /** - * Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. - */ - decline_on?: CardPayments.DeclineOn; + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix?: string; + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; - /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kana?: Stripe.Emptyable; + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: Stripe.Emptyable; - /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - */ - statement_descriptor_prefix_kanji?: Stripe.Emptyable; - } + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; - namespace CardPayments { - interface DeclineOn { - /** - * Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. - */ - avs_failure?: boolean; + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } - /** - * Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. - */ - cvc_failure?: boolean; - } - } + interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; - interface Payments { - /** - * The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. - */ - statement_descriptor?: string; + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + namespace Verification { + interface AdditionalDocument { /** - * The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - statement_descriptor_kana?: string; + back?: string; /** - * The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - statement_descriptor_kanji?: string; + front?: string; } - interface Payouts { - /** - * A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). - */ - debit_negative_balances?: boolean; - - /** - * Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. - */ - schedule?: Payouts.Schedule; - + interface Document { /** - * The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - statement_descriptor?: string; - } - - namespace Payouts { - interface Schedule { - /** - * The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`. - */ - delay_days?: 'minimum' | number; - - /** - * How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. - */ - interval?: Schedule.Interval; - - /** - * The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. - */ - monthly_anchor?: number; - - /** - * The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) - */ - weekly_anchor?: Schedule.WeeklyAnchor; - } - - namespace Schedule { - type Interval = 'daily' | 'manual' | 'monthly' | 'weekly'; - - type WeeklyAnchor = - | 'friday' - | 'monday' - | 'saturday' - | 'sunday' - | 'thursday' - | 'tuesday' - | 'wednesday'; - } - } + back?: string; - interface Treasury { /** - * Details on the account's acceptance of the Stripe Treasury Services Agreement. + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. */ - tos_acceptance?: Treasury.TosAcceptance; + front?: string; } + } + } - namespace Treasury { - interface TosAcceptance { - /** - * The Unix timestamp marking when the account representative accepted the service agreement. - */ - date?: number; - - /** - * The IP address from which the account representative accepted the service agreement. - */ - ip?: string; + interface PersonListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; - /** - * The user agent of the browser from which the account representative accepted the service agreement. - */ - user_agent?: string; - } - } - } + /** + * Filters on the list of people returned based on the person's relationship to the account's company. + */ + relationship?: PersonListParams.Relationship; + } - interface TosAcceptance { + namespace PersonListParams { + interface Relationship { /** - * The Unix timestamp marking when the account representative accepted their service agreement. + * A filter on the list of people returned based on whether these people are directors of the account's company. */ - date?: number; + director?: boolean; /** - * The IP address from which the account representative accepted their service agreement. + * A filter on the list of people returned based on whether these people are executives of the account's company. */ - ip?: string; + executive?: boolean; /** - * The user's service agreement type. + * A filter on the list of people returned based on whether these people are owners of the account's company. */ - service_agreement?: string; + owner?: boolean; /** - * The user agent of the browser from which the account representative accepted their service agreement. + * A filter on the list of people returned based on whether these people are the representative of the account's company. */ - user_agent?: string; + representative?: boolean; } } - interface AccountListParams extends PaginationParams { - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface AccountDeleteParams {} - - interface AccountRejectParams { - /** - * The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. - */ - reason: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } + interface PersonDeleteParams {} class AccountsResource { /** diff --git a/types/Capital/FinancingOffers.d.ts b/types/Capital/FinancingOffers.d.ts index a99fc90c62..ca5cf49431 100644 --- a/types/Capital/FinancingOffers.d.ts +++ b/types/Capital/FinancingOffers.d.ts @@ -178,94 +178,6 @@ declare module 'stripe' { type Type = 'cash_advance' | 'flex_loan'; } - - interface FinancingOfferRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FinancingOfferListParams extends PaginationParams { - /** - * limit list to offers belonging to given connected account - */ - connected_account?: string; - - created?: Stripe.RangeQueryParam | number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * limit list to offers with given status - */ - status?: FinancingOfferListParams.Status; - } - - namespace FinancingOfferListParams { - type Status = - | 'accepted' - | 'canceled' - | 'completed' - | 'delivered' - | 'expired' - | 'fully_repaid' - | 'paid_out' - | 'rejected' - | 'revoked' - | 'undelivered'; - } - - interface FinancingOfferMarkDeliveredParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class FinancingOffersResource { - /** - * Get the details of the financing offer - */ - retrieve( - id: string, - params?: FinancingOfferRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the financing offers available for Connected accounts that belong to your platform. - */ - list( - params?: FinancingOfferListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Acknowledges that platform has received and delivered the financing_offer to - * the intended merchant recipient. This is required to make the application - * accessible. - */ - markDelivered( - id: string, - params?: FinancingOfferMarkDeliveredParams, - options?: RequestOptions - ): Promise>; - markDelivered( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/Capital/FinancingOffersResource.d.ts b/types/Capital/FinancingOffersResource.d.ts new file mode 100644 index 0000000000..960eba877c --- /dev/null +++ b/types/Capital/FinancingOffersResource.d.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + interface FinancingOfferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancingOfferListParams extends PaginationParams { + /** + * limit list to offers belonging to given connected account + */ + connected_account?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * limit list to offers with given status + */ + status?: FinancingOfferListParams.Status; + } + + namespace FinancingOfferListParams { + type Status = + | 'accepted' + | 'canceled' + | 'completed' + | 'delivered' + | 'expired' + | 'fully_repaid' + | 'paid_out' + | 'rejected' + | 'revoked' + | 'undelivered'; + } + + interface FinancingOfferMarkDeliveredParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class FinancingOffersResource { + /** + * Get the details of the financing offer + */ + retrieve( + id: string, + params?: FinancingOfferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + list( + params?: FinancingOfferListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Acknowledges that platform has received and delivered the financing_offer to + * the intended merchant recipient. This is required to make the application + * accessible. + */ + markDelivered( + id: string, + params?: FinancingOfferMarkDeliveredParams, + options?: RequestOptions + ): Promise>; + markDelivered( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/Capital/FinancingSummary.d.ts b/types/Capital/FinancingSummary.d.ts index 28613dbb5b..c1c7390093 100644 --- a/types/Capital/FinancingSummary.d.ts +++ b/types/Capital/FinancingSummary.d.ts @@ -96,26 +96,6 @@ declare module 'stripe' { type Status = 'accepted' | 'delivered' | 'none'; } - - interface FinancingSummaryRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class FinancingSummaryResource { - /** - * Retrieve the financing state for the account that was authenticated in the request. - */ - retrieve( - params?: FinancingSummaryRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/Capital/FinancingSummaryResource.d.ts b/types/Capital/FinancingSummaryResource.d.ts new file mode 100644 index 0000000000..abab91dd15 --- /dev/null +++ b/types/Capital/FinancingSummaryResource.d.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + interface FinancingSummaryRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class FinancingSummaryResource { + /** + * Retrieve the financing state for the account that was authenticated in the request. + */ + retrieve( + params?: FinancingSummaryRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/Capital/FinancingTransactions.d.ts b/types/Capital/FinancingTransactions.d.ts index 94ab723cd7..ee7ee2603b 100644 --- a/types/Capital/FinancingTransactions.d.ts +++ b/types/Capital/FinancingTransactions.d.ts @@ -114,62 +114,6 @@ declare module 'stripe' { type Type = 'payment' | 'payout' | 'reversal'; } - - interface FinancingTransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface FinancingTransactionListParams extends PaginationParams { - /** - * For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge. - */ - charge?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Returns transactions that were created that apply to this financing offer ID. - */ - financing_offer?: string; - - /** - * Only returns transactions that are responsible for reversing this financing transaction ID. - */ - reversed_transaction?: string; - } - - class FinancingTransactionsResource { - /** - * Retrieves a financing transaction for a financing offer. - */ - retrieve( - id: string, - params?: FinancingTransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of financing transactions. The transactions are returned in sorted order, - * with the most recent transactions appearing first. - */ - list( - params?: FinancingTransactionListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - } } } } diff --git a/types/Capital/FinancingTransactionsResource.d.ts b/types/Capital/FinancingTransactionsResource.d.ts new file mode 100644 index 0000000000..0756ab36df --- /dev/null +++ b/types/Capital/FinancingTransactionsResource.d.ts @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + interface FinancingTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancingTransactionListParams extends PaginationParams { + /** + * For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge. + */ + charge?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Returns transactions that were created that apply to this financing offer ID. + */ + financing_offer?: string; + + /** + * Only returns transactions that are responsible for reversing this financing transaction ID. + */ + reversed_transaction?: string; + } + + class FinancingTransactionsResource { + /** + * Retrieves a financing transaction for a financing offer. + */ + retrieve( + id: string, + params?: FinancingTransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, + * with the most recent transactions appearing first. + */ + list( + params?: FinancingTransactionListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/Coupons.d.ts b/types/Coupons.d.ts index d8c6909f46..0d1a1337f1 100644 --- a/types/Coupons.d.ts +++ b/types/Coupons.d.ts @@ -110,7 +110,7 @@ declare module 'stripe' { amount_off: number; } - type Duration = 'forever' | 'once' | 'repeating'; + type Duration = 'forever' | 'once' | 'repeating' | 'variable'; } /** diff --git a/types/CouponsResource.d.ts b/types/CouponsResource.d.ts index f0eb9eea28..c4e235d314 100644 --- a/types/CouponsResource.d.ts +++ b/types/CouponsResource.d.ts @@ -2,137 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A coupon contains information about a percent-off or amount-off discount you - * might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), - * [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). - */ - interface Coupon { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'coupon'; - - /** - * Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. - */ - amount_off: number | null; - - applies_to?: Coupon.AppliesTo; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. - */ - 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; - - /** - * One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. - */ - duration: Coupon.Duration; - - /** - * If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. - */ - duration_in_months: number | null; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - */ - max_redemptions: number | null; - - /** - * 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. - */ - metadata: Stripe.Metadata | null; - - /** - * Name of the coupon displayed to customers on for instance invoices or receipts. - */ - name: string | null; - - /** - * Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. - */ - percent_off: number | null; - - /** - * Date after which the coupon can no longer be redeemed. - */ - redeem_by: number | null; - - /** - * Number of times this coupon has been applied to a customer. - */ - times_redeemed: number; - - /** - * Taking account of the above properties, whether this coupon can still be applied to a customer. - */ - valid: boolean; - } - - namespace Coupon { - interface AppliesTo { - /** - * A list of product IDs this coupon applies to - */ - 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' | 'variable'; - } - - /** - * The DeletedCoupon object. - */ - interface DeletedCoupon { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'coupon'; - - /** - * Always true for a deleted object - */ - deleted: true; - } - interface CouponCreateParams { /** * A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). diff --git a/types/GiftCards/Cards.d.ts b/types/GiftCards/Cards.d.ts index 91a9707900..62a36ca524 100644 --- a/types/GiftCards/Cards.d.ts +++ b/types/GiftCards/Cards.d.ts @@ -113,158 +113,6 @@ declare module 'stripe' { type Type = 'checkout' | 'order' | 'payment'; } } - - interface CardCreateParams { - /** - * 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 active state for the new gift card, defaults to false. The active state can be updated after creation. - */ - active?: boolean; - - /** - * Related objects which created this gift card. - */ - created_by?: CardCreateParams.CreatedBy; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The initial amount to load onto the new gift card, defaults to 0. - */ - initial_amount?: number; - - /** - * 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.MetadataParam; - } - - namespace CardCreateParams { - interface CreatedBy { - /** - * The details for the payment that created this object. - */ - payment: CreatedBy.Payment; - - /** - * The type of event that created this object. - */ - type: 'payment'; - } - - namespace CreatedBy { - interface Payment { - /** - * The PaymentIntent used to collect payment for this object. - */ - payment_intent: string; - } - } - } - - interface CardRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CardUpdateParams { - /** - * The new active state for the gift card. - */ - active?: boolean; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface CardListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface CardValidateParams { - /** - * The gift card code to be validated. - */ - code: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The pin associated with the gift card. Not all gift cards have pins. - */ - giftcard_pin?: string; - } - - class CardsResource { - /** - * Creates a new gift card object. - */ - create( - params: CardCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieve a gift card by id - */ - retrieve( - id: string, - params?: CardRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Update a gift card - */ - update( - id: string, - params?: CardUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * List gift cards for an account - */ - list( - params?: CardListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Validates a gift card code, returning the matching gift card object if it exists. - */ - validate( - params: CardValidateParams, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/GiftCards/CardsResource.d.ts b/types/GiftCards/CardsResource.d.ts new file mode 100644 index 0000000000..a4dba21eef --- /dev/null +++ b/types/GiftCards/CardsResource.d.ts @@ -0,0 +1,159 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace GiftCards { + interface CardCreateParams { + /** + * 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 active state for the new gift card, defaults to false. The active state can be updated after creation. + */ + active?: boolean; + + /** + * Related objects which created this gift card. + */ + created_by?: CardCreateParams.CreatedBy; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The initial amount to load onto the new gift card, defaults to 0. + */ + initial_amount?: number; + + /** + * 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.MetadataParam; + } + + namespace CardCreateParams { + interface CreatedBy { + /** + * The details for the payment that created this object. + */ + payment: CreatedBy.Payment; + + /** + * The type of event that created this object. + */ + type: 'payment'; + } + + namespace CreatedBy { + interface Payment { + /** + * The PaymentIntent used to collect payment for this object. + */ + payment_intent: string; + } + } + } + + interface CardRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CardUpdateParams { + /** + * The new active state for the gift card. + */ + active?: boolean; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface CardListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface CardValidateParams { + /** + * The gift card code to be validated. + */ + code: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The pin associated with the gift card. Not all gift cards have pins. + */ + giftcard_pin?: string; + } + + class CardsResource { + /** + * Creates a new gift card object. + */ + create( + params: CardCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieve a gift card by id + */ + retrieve( + id: string, + params?: CardRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Update a gift card + */ + update( + id: string, + params?: CardUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * List gift cards for an account + */ + list( + params?: CardListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Validates a gift card code, returning the matching gift card object if it exists. + */ + validate( + params: CardValidateParams, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/GiftCards/Transactions.d.ts b/types/GiftCards/Transactions.d.ts index 1b884ee7df..58a35fbd99 100644 --- a/types/GiftCards/Transactions.d.ts +++ b/types/GiftCards/Transactions.d.ts @@ -124,200 +124,6 @@ declare module 'stripe' { type Status = 'canceled' | 'confirmed' | 'held' | 'invalid'; } - - interface TransactionCreateParams { - /** - * The amount of the transaction. A negative amount deducts funds, and a positive amount adds funds. - */ - amount: number; - - /** - * The currency of the transaction. This must match the currency of the gift card. - */ - currency: string; - - /** - * The gift card to create a new transaction on. - */ - gift_card: string; - - /** - * Whether this is a confirmed transaction. A confirmed transaction immediately deducts from/adds to the `amount_available` on the gift card. Otherwise, it creates a held transaction that increments the `amount_held` on the gift card. - */ - confirm?: boolean; - - /** - * Related objects which created this transaction. - */ - created_by?: TransactionCreateParams.CreatedBy; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. - */ - transfer_group?: string; - } - - namespace TransactionCreateParams { - interface CreatedBy { - /** - * The details for the payment that created this object. - */ - payment: CreatedBy.Payment; - - /** - * The type of event that created this object. - */ - type: 'payment'; - } - - namespace CreatedBy { - interface Payment { - /** - * The PaymentIntent used to collect payment for this object. - */ - payment_intent: string; - } - } - } - - interface TransactionRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransactionUpdateParams { - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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; - } - - interface TransactionListParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The gift card to list transactions for. - */ - gift_card?: string; - - /** - * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. - */ - transfer_group?: string; - } - - interface TransactionCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface TransactionConfirmParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class TransactionsResource { - /** - * Create a gift card transaction - */ - create( - params: TransactionCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the gift card transaction. - */ - retrieve( - id: string, - params?: TransactionRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Update a gift card transaction - */ - update( - id: string, - params?: TransactionUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * List gift card transactions for a gift card - */ - list( - params?: TransactionListParams, - options?: RequestOptions - ): ApiListPromise; - list( - options?: RequestOptions - ): ApiListPromise; - - /** - * Cancel a gift card transaction - */ - cancel( - id: string, - params?: TransactionCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Confirm a gift card transaction - */ - confirm( - id: string, - params?: TransactionConfirmParams, - options?: RequestOptions - ): Promise>; - confirm( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/GiftCards/TransactionsResource.d.ts b/types/GiftCards/TransactionsResource.d.ts new file mode 100644 index 0000000000..e8f4d7a1d7 --- /dev/null +++ b/types/GiftCards/TransactionsResource.d.ts @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace GiftCards { + interface TransactionCreateParams { + /** + * The amount of the transaction. A negative amount deducts funds, and a positive amount adds funds. + */ + amount: number; + + /** + * The currency of the transaction. This must match the currency of the gift card. + */ + currency: string; + + /** + * The gift card to create a new transaction on. + */ + gift_card: string; + + /** + * Whether this is a confirmed transaction. A confirmed transaction immediately deducts from/adds to the `amount_available` on the gift card. Otherwise, it creates a held transaction that increments the `amount_held` on the gift card. + */ + confirm?: boolean; + + /** + * Related objects which created this transaction. + */ + created_by?: TransactionCreateParams.CreatedBy; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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.MetadataParam; + + /** + * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. + */ + transfer_group?: string; + } + + namespace TransactionCreateParams { + interface CreatedBy { + /** + * The details for the payment that created this object. + */ + payment: CreatedBy.Payment; + + /** + * The type of event that created this object. + */ + type: 'payment'; + } + + namespace CreatedBy { + interface Payment { + /** + * The PaymentIntent used to collect payment for this object. + */ + payment_intent: string; + } + } + } + + interface TransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionUpdateParams { + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * 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; + } + + interface TransactionListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The gift card to list transactions for. + */ + gift_card?: string; + + /** + * A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers) for details. + */ + transfer_group?: string; + } + + interface TransactionCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface TransactionConfirmParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class TransactionsResource { + /** + * Create a gift card transaction + */ + create( + params: TransactionCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the gift card transaction. + */ + retrieve( + id: string, + params?: TransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Update a gift card transaction + */ + update( + id: string, + params?: TransactionUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * List gift card transactions for a gift card + */ + list( + params?: TransactionListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Cancel a gift card transaction + */ + cancel( + id: string, + params?: TransactionCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Confirm a gift card transaction + */ + confirm( + id: string, + params?: TransactionConfirmParams, + options?: RequestOptions + ): Promise>; + confirm( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/LineItems.d.ts b/types/LineItems.d.ts index 9c88c9a8ba..eff3ec0f3c 100644 --- a/types/LineItems.d.ts +++ b/types/LineItems.d.ts @@ -56,6 +56,13 @@ declare module 'stripe' { */ price: Stripe.Price | null; + /** + * The ID of the product for this line item. + * + * This will always be the same as `price.product`. + */ + product?: string | Stripe.Product | Stripe.DeletedProduct; + /** * The quantity of products being purchased. */ diff --git a/types/Mandates.d.ts b/types/Mandates.d.ts index 35857a315e..39f90cece7 100644 --- a/types/Mandates.d.ts +++ b/types/Mandates.d.ts @@ -93,6 +93,8 @@ declare module 'stripe' { card?: PaymentMethodDetails.Card; + cashapp?: PaymentMethodDetails.Cashapp; + link?: PaymentMethodDetails.Link; sepa_debit?: PaymentMethodDetails.SepaDebit; @@ -210,6 +212,8 @@ declare module 'stripe' { interface Card {} + interface Cashapp {} + interface Link {} interface SepaDebit { diff --git a/types/Orders.d.ts b/types/Orders.d.ts new file mode 100644 index 0000000000..5c96948e9a --- /dev/null +++ b/types/Orders.d.ts @@ -0,0 +1,950 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + /** + * An Order describes a purchase being made by a customer, including the + * products & quantities being purchased, the order status, the payment information, + * and the billing/shipping details. + * + * Related guide: [Orders overview](https://stripe.com/docs/orders) + */ + interface Order { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'order'; + + amount_remaining?: number; + + /** + * Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + */ + amount_subtotal: number; + + /** + * Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + */ + amount_total: number; + + /** + * ID of the Connect application that created the Order, if any. + */ + application: string | Stripe.Application | null; + + automatic_tax?: Order.AutomaticTax; + + /** + * Customer billing details associated with the order. + */ + billing_details: Order.BillingDetails | null; + + /** + * The client secret of this Order. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + * + * Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. + */ + client_secret: string | null; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * The credits applied to the Order. At most 10 credits can be applied to an Order. + */ + credits?: Array; + + /** + * 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 customer which this orders belongs to. + */ + customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The discounts applied to the order. Use `expand[]=discounts` to expand each discount. + */ + discounts: Array | null; + + /** + * A recent IP address of the purchaser used for tax reporting and tax location inference. + */ + ip_address: string | null; + + /** + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. + */ + line_items?: ApiList; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * 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. + */ + metadata: Stripe.Metadata | null; + + payment: Order.Payment; + + /** + * The details of the customer cost of shipping, including the customer chosen ShippingRate. + */ + shipping_cost: Order.ShippingCost | null; + + /** + * Customer shipping information associated with the order. + */ + shipping_details: Order.ShippingDetails | null; + + /** + * The overall status of the order. + */ + status: Order.Status; + + tax_details?: Order.TaxDetails; + + total_details: Order.TotalDetails; + } + + namespace Order { + interface AutomaticTax { + /** + * Whether Stripe automatically computes tax on this Order. + */ + enabled: boolean; + + /** + * The status of the most recent automated tax calculation for this Order. + */ + status: AutomaticTax.Status | null; + } + + namespace AutomaticTax { + type Status = 'complete' | 'failed' | 'requires_location_inputs'; + } + + interface BillingDetails { + /** + * Billing address for the order. + */ + address: Stripe.Address | null; + + /** + * Email address for the order. + */ + email: string | null; + + /** + * Full name for the order. + */ + name: string | null; + + /** + * Billing phone number for the order (including extension). + */ + phone: string | null; + } + + interface Credit { + /** + * The amount of this credit to apply to the order. + */ + amount: number; + + /** + * Details for a gift card. + */ + gift_card: Credit.GiftCard | null; + + /** + * Line items on this order that are ineligible for this credit + */ + ineligible_line_items: Array | null; + + /** + * The type of credit to apply to the order, only `gift_card` currently supported. + */ + type: 'gift_card'; + } + + namespace Credit { + interface GiftCard { + /** + * The token of the gift card applied to the order + */ + card: string; + } + } + + interface Payment { + /** + * ID of the payment intent associated with this order. Null when the order is `open`. + */ + payment_intent: string | Stripe.PaymentIntent | null; + + /** + * Settings describing how the order should configure generated PaymentIntents. + */ + settings: Payment.Settings | null; + + /** + * The status of the underlying payment associated with this order, if any. Null when the order is `open`. + */ + status: Payment.Status | null; + } + + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount: number | null; + + /** + * Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. + */ + automatic_payment_methods: Settings.AutomaticPaymentMethods | null; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options: Settings.PaymentMethodOptions | null; + + /** + * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types: Array | null; + + /** + * The URL to redirect the customer to after they authenticate their payment. + */ + return_url: string | null; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor: string | null; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix: string | null; + + /** + * Provides configuration for completing a transfer for the order after it is paid. + */ + transfer_data: Settings.TransferData | null; + } + + namespace Settings { + interface AutomaticPaymentMethods { + /** + * Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + enabled: boolean; + } + + interface PaymentMethodOptions { + acss_debit?: PaymentMethodOptions.AcssDebit; + + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + + alipay?: PaymentMethodOptions.Alipay; + + bancontact?: PaymentMethodOptions.Bancontact; + + card?: PaymentMethodOptions.Card; + + customer_balance?: PaymentMethodOptions.CustomerBalance; + + ideal?: PaymentMethodOptions.Ideal; + + klarna?: PaymentMethodOptions.Klarna; + + link?: PaymentMethodOptions.Link; + + oxxo?: PaymentMethodOptions.Oxxo; + + p24?: PaymentMethodOptions.P24; + + paypal?: PaymentMethodOptions.Paypal; + + sepa_debit?: PaymentMethodOptions.SepaDebit; + + sofort?: PaymentMethodOptions.Sofort; + + wechat_pay?: PaymentMethodOptions.WechatPay; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: AcssDebit.SetupFutureUsage; + + /** + * Bank account verification method. + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text + */ + custom_mandate_url?: string; + + /** + * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description: string | null; + + /** + * Payment schedule for the mandate. + */ + payment_schedule: MandateOptions.PaymentSchedule | null; + + /** + * Transaction type of the mandate. + */ + transaction_type: MandateOptions.TransactionType | null; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference: string | null; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Alipay.SetupFutureUsage; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Bancontact.SetupFutureUsage; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type: 'bank_transfer' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array< + BankTransfer.RequestedAddressType + >; + + /** + * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type | null; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: EuBankTransfer.Country; + } + + namespace EuBankTransfer { + type Country = 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Ideal.SetupFutureUsage; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the Klarna checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Token used for persistent Link logins. + */ + persistent_token: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Link.SetupFutureUsage; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + interface Paypal { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the PayPal checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + + /** + * A unique reference ID of the PayPal transaction. This must be a globally unique ID across all PayPal transactions or the transaction will fail. + */ + reference_id?: string | null; + } + + interface SepaDebit { + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: SepaDebit.SetupFutureUsage; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Preferred language of the SOFORT authorization page that the customer is redirected to. + */ + preferred_language: Sofort.PreferredLanguage | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Sofort.SetupFutureUsage; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id: string | null; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount: number | null; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string | Stripe.Account; + } + } + + type Status = + | 'canceled' + | 'complete' + | 'not_required' + | 'processing' + | 'requires_action' + | 'requires_capture' + | 'requires_confirmation' + | 'requires_payment_method'; + } + + interface ShippingCost { + /** + * Total shipping cost before any discounts or taxes are applied. + */ + amount_subtotal: number; + + /** + * Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + */ + amount_tax: number; + + /** + * Total shipping cost after discounts and taxes are applied. + */ + amount_total: number; + + /** + * The ID of the ShippingRate for this order. + */ + shipping_rate: string | Stripe.ShippingRate | null; + + /** + * The taxes applied to the shipping rate. + */ + taxes?: Array; + } + + namespace ShippingCost { + interface Tax { + /** + * Amount of tax applied for this rate. + */ + amount: number; + + /** + * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + * + * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + */ + rate: Stripe.TaxRate; + } + } + + interface ShippingDetails { + /** + * Recipient shipping address. Required if the order includes products that are shippable. + */ + address: Stripe.Address | null; + + /** + * Recipient name. + */ + name: string | null; + + /** + * Recipient phone (including extension). + */ + phone: string | null; + } + + type Status = + | 'canceled' + | 'complete' + | 'open' + | 'processing' + | 'submitted'; + + interface TaxDetails { + /** + * Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt: TaxDetails.TaxExempt; + + /** + * The purchaser's tax IDs to be used in calculation of tax for this Order. + */ + tax_ids: Array; + } + + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` + */ + type: TaxId.Type; + + /** + * The value of the tax ID. + */ + value: string | null; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'unknown' + | 'us_ein' + | 'za_vat'; + } + } + + interface TotalDetails { + amount_credit?: number; + + /** + * This is the sum of all the discounts. + */ + amount_discount: number; + + /** + * This is the sum of all the shipping amounts. + */ + amount_shipping: number | null; + + /** + * This is the sum of all the tax amounts. + */ + amount_tax: number; + + breakdown?: TotalDetails.Breakdown; + } + + namespace TotalDetails { + interface Breakdown { + /** + * The aggregated discounts. + */ + discounts: Array; + + /** + * The aggregated tax amounts by rate. + */ + taxes: Array; + } + + namespace Breakdown { + interface Discount { + /** + * The amount discounted. + */ + amount: number; + + /** + * 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). + */ + discount: Stripe.Discount; + } + + interface Tax { + /** + * Amount of tax applied for this rate. + */ + amount: number; + + /** + * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + * + * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + */ + rate: Stripe.TaxRate; + } + } + } + } + } +} diff --git a/types/OrdersResource.d.ts b/types/OrdersResource.d.ts new file mode 100644 index 0000000000..49d3155560 --- /dev/null +++ b/types/OrdersResource.d.ts @@ -0,0 +1,2569 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface OrderCreateParams { + /** + * 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; + + /** + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + */ + line_items: Array; + + /** + * Settings for automatic tax calculation for this order. + */ + automatic_tax?: OrderCreateParams.AutomaticTax; + + /** + * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + */ + billing_details?: Stripe.Emptyable; + + /** + * The credits to apply to the order, only `gift_card` currently supported. + */ + credits?: Stripe.Emptyable>; + + /** + * The customer associated with this order. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The coupons, promotion codes, and/or discounts to apply to the order. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The IP address of the purchaser for this order. + */ + ip_address?: 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`. + */ + metadata?: Stripe.MetadataParam; + + /** + * Payment information associated with the order, including payment settings. + */ + payment?: OrderCreateParams.Payment; + + /** + * Settings for the customer cost of shipping for this order. + */ + shipping_cost?: Stripe.Emptyable; + + /** + * Shipping details for the order. + */ + shipping_details?: Stripe.Emptyable; + + /** + * Additional tax details about the purchaser to be used for this order. + */ + tax_details?: OrderCreateParams.TaxDetails; + } + + namespace OrderCreateParams { + interface AutomaticTax { + /** + * Enable automatic tax calculation which will automatically compute tax rates on this order. + */ + enabled: boolean; + } + + interface BillingDetails { + /** + * The billing address provided by the customer. + */ + address?: Stripe.AddressParam; + + /** + * The billing email provided by the customer. + */ + email?: string; + + /** + * The billing name provided by the customer. + */ + name?: string; + + /** + * The billing phone number provided by the customer. + */ + phone?: string; + } + + interface Credit { + /** + * The gift card to apply to the order. + */ + gift_card?: string; + + /** + * The type of credit to apply to the order, only `gift_card` currently supported. + */ + type: 'gift_card'; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface LineItem { + /** + * The description for the line item. Will default to the name of the associated product. + */ + description?: string; + + /** + * The discounts applied to this line item. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. + * + * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + */ + price?: string; + + /** + * Data used to generate a new Price object inline. + * + * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + * + * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + */ + price_data?: LineItem.PriceData; + + /** + * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. + * + * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + */ + product?: string; + + /** + * Defines a Product inline and adds it to the Order. + * + * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + * + * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + */ + product_data?: LineItem.ProductData; + + /** + * The quantity of the line item. + */ + quantity?: number; + + /** + * The tax rates applied to this line item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace LineItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface PriceData { + /** + * 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 product this price belongs to. + * + * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. + */ + product?: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface ProductData { + /** + * 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. + */ + description?: string; + + /** + * A unique identifier for this product. + * + * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + */ + id: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Stripe.Emptyable>; + + /** + * 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; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: Stripe.Emptyable; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: Stripe.Emptyable; + } + + namespace ProductData { + interface PackageDimensions { + /** + * Height, in inches. Maximum precision is 2 decimal places. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + } + } + + interface Payment { + /** + * Settings describing how the order should configure generated PaymentIntents. + */ + settings: Payment.Settings; + } + + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount?: number; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options?: Settings.PaymentMethodOptions; + + /** + * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types?: Array; + + /** + * The URL to redirect the customer to after they authenticate their payment. + */ + return_url?: string; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * Provides configuration for completing a transfer for the order after it is paid. + */ + transfer_data?: Settings.TransferData; + } + + namespace Settings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + */ + acss_debit?: PaymentMethodOptions.AcssDebit; + + /** + * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + */ + afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; + + /** + * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + */ + alipay?: PaymentMethodOptions.Alipay; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + */ + bancontact?: PaymentMethodOptions.Bancontact; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + */ + card?: PaymentMethodOptions.Card; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + */ + customer_balance?: PaymentMethodOptions.CustomerBalance; + + /** + * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + */ + ideal?: PaymentMethodOptions.Ideal; + + /** + * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + */ + klarna?: PaymentMethodOptions.Klarna; + + /** + * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + */ + link?: PaymentMethodOptions.Link; + + /** + * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + */ + oxxo?: PaymentMethodOptions.Oxxo; + + /** + * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + */ + p24?: PaymentMethodOptions.P24; + + /** + * If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + */ + paypal?: PaymentMethodOptions.Paypal; + + /** + * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + */ + sepa_debit?: PaymentMethodOptions.SepaDebit; + + /** + * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + */ + sofort?: PaymentMethodOptions.Sofort; + + /** + * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + */ + wechat_pay?: PaymentMethodOptions.WechatPay; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + Bancontact.SetupFutureUsage + >; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array< + BankTransfer.RequestedAddressType + >; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-CH' + | 'de-DE' + | 'en-AT' + | 'en-AU' + | 'en-BE' + | 'en-CA' + | 'en-CH' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-NZ' + | 'en-PL' + | 'en-PT' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-CA' + | 'fr-CH' + | 'fr-FR' + | 'it-CH' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'pl-PL' + | 'pt-PT' + | 'sv-FI' + | 'sv-SE'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + + reference_id?: string; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string; + } + } + } + + interface ShippingCost { + /** + * The ID of the shipping rate to use for this order. + */ + shipping_rate?: string; + + /** + * Parameters to create a new ad-hoc shipping rate for this order. + */ + shipping_rate_data?: ShippingCost.ShippingRateData; + } + + namespace ShippingCost { + interface ShippingRateData { + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateData.DeliveryEstimate; + + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateData.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.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateData.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateData { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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; + + /** + * 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 ShippingDetails { + /** + * The shipping address for the order. + */ + address: Stripe.AddressParam; + + /** + * The name of the recipient of the order. + */ + name: string; + + /** + * The phone number (including extension) for the recipient of the order. + */ + phone?: string; + } + + interface TaxDetails { + /** + * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The purchaser's tax IDs to be used for this order. + */ + tax_ids?: Array; + } + + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + } + + interface OrderRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderUpdateParams { + /** + * Settings for automatic tax calculation for this order. + */ + automatic_tax?: OrderUpdateParams.AutomaticTax; + + /** + * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. + */ + billing_details?: Stripe.Emptyable; + + /** + * The credits to apply to the order, only `gift_card` currently supported. Pass the empty string `""` to unset this field. + */ + credits?: Stripe.Emptyable>; + + /** + * 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 customer associated with this order. + */ + customer?: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description?: string; + + /** + * The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. + */ + discounts?: Stripe.Emptyable>; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The IP address of the purchaser for this order. + */ + ip_address?: string; + + /** + * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. + */ + line_items?: Array; + + /** + * 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; + + /** + * Payment information associated with the order, including payment settings. + */ + payment?: OrderUpdateParams.Payment; + + /** + * Settings for the customer cost of shipping for this order. + */ + shipping_cost?: Stripe.Emptyable; + + /** + * Shipping details for the order. + */ + shipping_details?: Stripe.Emptyable; + + /** + * Additional tax details about the purchaser to be used for this order. + */ + tax_details?: OrderUpdateParams.TaxDetails; + } + + namespace OrderUpdateParams { + interface AutomaticTax { + /** + * Enable automatic tax calculation which will automatically compute tax rates on this order. + */ + enabled: boolean; + } + + interface BillingDetails { + /** + * The billing address provided by the customer. + */ + address?: Stripe.AddressParam; + + /** + * The billing email provided by the customer. + */ + email?: string; + + /** + * The billing name provided by the customer. + */ + name?: string; + + /** + * The billing phone number provided by the customer. + */ + phone?: string; + } + + interface Credit { + /** + * The gift card to apply to the order. + */ + gift_card?: string; + + /** + * The type of credit to apply to the order, only `gift_card` currently supported. + */ + type: 'gift_card'; + } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + + /** + * ID of the promotion code to create a new discount for. + */ + promotion_code?: string; + } + + interface LineItem { + /** + * The description for the line item. Will default to the name of the associated product. + */ + description?: string; + + /** + * The discounts applied to this line item. + */ + discounts?: Stripe.Emptyable>; + + /** + * The ID of an existing line item on the order. + */ + id?: string; + + /** + * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. + * + * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. + */ + price?: string; + + /** + * Data used to generate a new Price object inline. + * + * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. + * + * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. + */ + price_data?: LineItem.PriceData; + + /** + * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. + * + * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. + */ + product?: string; + + /** + * Defines a Product inline and adds it to the Order. + * + * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. + * + * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. + */ + product_data?: LineItem.ProductData; + + /** + * The quantity of the line item. + */ + quantity?: number; + + /** + * The tax rates applied to this line item. + */ + tax_rates?: Stripe.Emptyable>; + } + + namespace LineItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon?: string; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount?: string; + } + + interface PriceData { + /** + * 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 product this price belongs to. + * + * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. + */ + product?: string; + + /** + * 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?: PriceData.TaxBehavior; + + /** + * 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 PriceData { + type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; + } + + interface ProductData { + /** + * 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. + */ + description?: string; + + /** + * A unique identifier for this product. + * + * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. + */ + id: string; + + /** + * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + */ + images?: Stripe.Emptyable>; + + /** + * 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; + + /** + * The product's name, meant to be displayable to the customer. + */ + name: string; + + /** + * The dimensions of this product for shipping purposes. + */ + package_dimensions?: Stripe.Emptyable; + + /** + * Whether this product is shipped (i.e., physical goods). + */ + shippable?: boolean; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + */ + tax_code?: string; + + /** + * A URL of a publicly-accessible webpage for this product. + */ + url?: Stripe.Emptyable; + } + + namespace ProductData { + interface PackageDimensions { + /** + * Height, in inches. Maximum precision is 2 decimal places. + */ + height: number; + + /** + * Length, in inches. Maximum precision is 2 decimal places. + */ + length: number; + + /** + * Weight, in ounces. Maximum precision is 2 decimal places. + */ + weight: number; + + /** + * Width, in inches. Maximum precision is 2 decimal places. + */ + width: number; + } + } + } + + interface Payment { + /** + * Settings describing how the order should configure generated PaymentIntents. + */ + settings: Payment.Settings; + } + + namespace Payment { + interface Settings { + /** + * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + */ + application_fee_amount?: Stripe.Emptyable; + + /** + * PaymentMethod-specific configuration to provide to the order's PaymentIntent. + */ + payment_method_options?: Settings.PaymentMethodOptions; + + /** + * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + */ + payment_method_types?: Array; + + /** + * The URL to redirect the customer to after they authenticate their payment. + */ + return_url?: Stripe.Emptyable; + + /** + * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + */ + statement_descriptor?: string; + + /** + * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + */ + statement_descriptor_suffix?: string; + + /** + * Provides configuration for completing a transfer for the order after it is paid. + */ + transfer_data?: Stripe.Emptyable; + } + + namespace Settings { + interface PaymentMethodOptions { + /** + * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. + */ + acss_debit?: Stripe.Emptyable; + + /** + * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. + */ + afterpay_clearpay?: Stripe.Emptyable< + PaymentMethodOptions.AfterpayClearpay + >; + + /** + * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. + */ + alipay?: Stripe.Emptyable; + + /** + * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. + */ + bancontact?: Stripe.Emptyable; + + /** + * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. + */ + card?: Stripe.Emptyable; + + /** + * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. + */ + customer_balance?: Stripe.Emptyable< + PaymentMethodOptions.CustomerBalance + >; + + /** + * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. + */ + ideal?: Stripe.Emptyable; + + /** + * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. + */ + klarna?: Stripe.Emptyable; + + /** + * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. + */ + link?: Stripe.Emptyable; + + /** + * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. + */ + oxxo?: Stripe.Emptyable; + + /** + * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. + */ + p24?: Stripe.Emptyable; + + /** + * If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + */ + paypal?: Stripe.Emptyable; + + /** + * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. + */ + sepa_debit?: Stripe.Emptyable; + + /** + * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. + */ + sofort?: Stripe.Emptyable; + + /** + * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. + */ + wechat_pay?: Stripe.Emptyable; + } + + namespace PaymentMethodOptions { + interface AcssDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: AcssDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + + /** + * Verification method for the intent + */ + verification_method?: AcssDebit.VerificationMethod; + } + + namespace AcssDebit { + interface MandateOptions { + /** + * A URL for custom mandate text to render during confirmation step. + * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, + * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + */ + custom_mandate_url?: Stripe.Emptyable; + + /** + * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + */ + interval_description?: string; + + /** + * Payment schedule for the mandate. + */ + payment_schedule?: MandateOptions.PaymentSchedule; + + /** + * Transaction type of the mandate. + */ + transaction_type?: MandateOptions.TransactionType; + } + + namespace MandateOptions { + type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; + + type TransactionType = 'business' | 'personal'; + } + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + + type VerificationMethod = + | 'automatic' + | 'instant' + | 'microdeposits'; + } + + interface AfterpayClearpay { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: AfterpayClearpay.CaptureMethod; + + /** + * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about + * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + */ + reference?: string; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace AfterpayClearpay { + type CaptureMethod = 'automatic' | 'manual'; + } + + interface Alipay { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Alipay { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Bancontact { + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + */ + preferred_language?: Bancontact.PreferredLanguage; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable< + Bancontact.SetupFutureUsage + >; + } + + namespace Bancontact { + type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Card { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: Card.CaptureMethod; + + /** + * Indicates that you intend to make future payments with the payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Card.SetupFutureUsage; + } + + namespace Card { + type CaptureMethod = 'automatic' | 'manual'; + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface CustomerBalance { + /** + * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + */ + bank_transfer?: CustomerBalance.BankTransfer; + + /** + * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + */ + funding_type?: 'bank_transfer'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace CustomerBalance { + interface BankTransfer { + eu_bank_transfer?: BankTransfer.EuBankTransfer; + + /** + * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + * + * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + */ + requested_address_types?: Array< + BankTransfer.RequestedAddressType + >; + + /** + * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. + */ + type: BankTransfer.Type; + } + + namespace BankTransfer { + interface EuBankTransfer { + /** + * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + */ + country: string; + } + + type RequestedAddressType = + | 'iban' + | 'sepa' + | 'sort_code' + | 'spei' + | 'zengin'; + + type Type = + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer'; + } + } + + interface Ideal { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Ideal { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Klarna { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to + */ + preferred_locale?: Klarna.PreferredLocale; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace Klarna { + type PreferredLocale = + | 'da-DK' + | 'de-AT' + | 'de-CH' + | 'de-DE' + | 'en-AT' + | 'en-AU' + | 'en-BE' + | 'en-CA' + | 'en-CH' + | 'en-DE' + | 'en-DK' + | 'en-ES' + | 'en-FI' + | 'en-FR' + | 'en-GB' + | 'en-IE' + | 'en-IT' + | 'en-NL' + | 'en-NO' + | 'en-NZ' + | 'en-PL' + | 'en-PT' + | 'en-SE' + | 'en-US' + | 'es-ES' + | 'es-US' + | 'fi-FI' + | 'fr-BE' + | 'fr-CA' + | 'fr-CH' + | 'fr-FR' + | 'it-CH' + | 'it-IT' + | 'nb-NO' + | 'nl-BE' + | 'nl-NL' + | 'pl-PL' + | 'pt-PT' + | 'sv-FI' + | 'sv-SE'; + } + + interface Link { + /** + * Controls when the funds will be captured from the customer's account. + * + * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + * + * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + */ + capture_method?: Stripe.Emptyable<'manual'>; + + /** + * Token used for persistent Link logins. + */ + persistent_token?: string; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Link { + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface Oxxo { + /** + * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + */ + expires_after_days?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + interface P24 { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + + /** + * Confirm that the payer has accepted the P24 terms and conditions. + */ + tos_shown_and_accepted?: boolean; + } + + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + + reference_id?: string; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + + interface SepaDebit { + /** + * Additional fields for Mandate creation + */ + mandate_options?: SepaDebit.MandateOptions; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace SepaDebit { + interface MandateOptions {} + + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + + interface Sofort { + /** + * Language shown to the payer on redirect. + */ + preferred_language?: Stripe.Emptyable; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: Stripe.Emptyable; + } + + namespace Sofort { + type PreferredLanguage = + | 'de' + | 'en' + | 'es' + | 'fr' + | 'it' + | 'nl' + | 'pl'; + + type SetupFutureUsage = 'none' | 'off_session'; + } + + interface WechatPay { + /** + * The app ID registered with WeChat Pay. Only required when client is ios or android. + */ + app_id?: string; + + /** + * The client type that the end customer will pay from + */ + client: WechatPay.Client; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: 'none'; + } + + namespace WechatPay { + type Client = 'android' | 'ios' | 'web'; + } + } + + type PaymentMethodType = + | 'acss_debit' + | 'afterpay_clearpay' + | 'alipay' + | 'au_becs_debit' + | 'bacs_debit' + | 'bancontact' + | 'card' + | 'customer_balance' + | 'eps' + | 'fpx' + | 'giropay' + | 'grabpay' + | 'ideal' + | 'klarna' + | 'link' + | 'oxxo' + | 'p24' + | 'paypal' + | 'sepa_debit' + | 'sofort' + | 'wechat_pay'; + + interface TransferData { + /** + * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + */ + amount?: number; + + /** + * ID of the Connected account receiving the transfer. + */ + destination: string; + } + } + } + + interface ShippingCost { + /** + * The ID of the shipping rate to use for this order. + */ + shipping_rate?: string; + + /** + * Parameters to create a new ad-hoc shipping rate for this order. + */ + shipping_rate_data?: ShippingCost.ShippingRateData; + } + + namespace ShippingCost { + interface ShippingRateData { + /** + * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + delivery_estimate?: ShippingRateData.DeliveryEstimate; + + /** + * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + */ + display_name: string; + + /** + * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + */ + fixed_amount?: ShippingRateData.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.MetadataParam; + + /** + * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + */ + tax_behavior?: ShippingRateData.TaxBehavior; + + /** + * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + */ + tax_code?: string; + + /** + * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + */ + type?: 'fixed_amount'; + } + + namespace ShippingRateData { + interface DeliveryEstimate { + /** + * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + */ + maximum?: DeliveryEstimate.Maximum; + + /** + * The lower bound of the estimated range. If empty, represents no lower bound. + */ + minimum?: DeliveryEstimate.Minimum; + } + + namespace DeliveryEstimate { + interface Maximum { + /** + * A unit of time. + */ + unit: Maximum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Maximum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + + interface Minimum { + /** + * A unit of time. + */ + unit: Minimum.Unit; + + /** + * Must be greater than 0. + */ + value: number; + } + + namespace Minimum { + type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; + } + } + + interface FixedAmount { + /** + * A non-negative integer in cents representing how much to charge. + */ + amount: 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; + + /** + * 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 ShippingDetails { + /** + * The shipping address for the order. + */ + address: Stripe.AddressParam; + + /** + * The name of the recipient of the order. + */ + name: string; + + /** + * The phone number (including extension) for the recipient of the order. + */ + phone?: string; + } + + interface TaxDetails { + /** + * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + */ + tax_exempt?: Stripe.Emptyable; + + /** + * The purchaser's tax IDs to be used for this order. + */ + tax_ids?: Array; + } + + namespace TaxDetails { + type TaxExempt = 'exempt' | 'none' | 'reverse'; + + interface TaxId { + /** + * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` + */ + type: TaxId.Type; + + /** + * Value of the tax ID. + */ + value: string; + } + + namespace TaxId { + type Type = + | 'ae_trn' + | 'au_abn' + | 'au_arn' + | 'bg_uic' + | 'br_cnpj' + | 'br_cpf' + | 'ca_bn' + | 'ca_gst_hst' + | 'ca_pst_bc' + | 'ca_pst_mb' + | 'ca_pst_sk' + | 'ca_qst' + | 'ch_vat' + | 'cl_tin' + | 'eg_tin' + | 'es_cif' + | 'eu_oss_vat' + | 'eu_vat' + | 'gb_vat' + | 'ge_vat' + | 'hk_br' + | 'hu_tin' + | 'id_npwp' + | 'il_vat' + | 'in_gst' + | 'is_vat' + | 'jp_cn' + | 'jp_rn' + | 'jp_trn' + | 'ke_pin' + | 'kr_brn' + | 'li_uid' + | 'mx_rfc' + | 'my_frp' + | 'my_itn' + | 'my_sst' + | 'no_vat' + | 'nz_gst' + | 'ph_tin' + | 'ru_inn' + | 'ru_kpp' + | 'sa_vat' + | 'sg_gst' + | 'sg_uen' + | 'si_tin' + | 'th_vat' + | 'tr_tin' + | 'tw_vat' + | 'ua_vat' + | 'us_ein' + | 'za_vat'; + } + } + } + + interface OrderListParams extends PaginationParams { + /** + * Only return orders for the given customer. + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderCancelParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderReopenParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface OrderSubmitParams { + /** + * `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. + */ + expected_total: number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class OrdersResource { + /** + * Creates a new open order object. + */ + create( + params: OrderCreateParams, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. + */ + retrieve( + id: string, + params?: OrderRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. + */ + update( + id: string, + params?: OrderUpdateParams, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. + */ + list( + params?: OrderListParams, + options?: RequestOptions + ): ApiListPromise; + list(options?: RequestOptions): ApiListPromise; + + /** + * Cancels the order as well as the payment intent if one is attached. + */ + cancel( + id: string, + params?: OrderCancelParams, + options?: RequestOptions + ): Promise>; + cancel( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: OrderListLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + + /** + * Reopens a submitted order. + */ + reopen( + id: string, + params?: OrderReopenParams, + options?: RequestOptions + ): Promise>; + reopen( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called. + */ + submit( + id: string, + params: OrderSubmitParams, + options?: RequestOptions + ): Promise>; + } + } +} diff --git a/types/PaymentIntents.d.ts b/types/PaymentIntents.d.ts index 079bac0a14..2af10ac10d 100644 --- a/types/PaymentIntents.d.ts +++ b/types/PaymentIntents.d.ts @@ -173,6 +173,11 @@ declare module 'stripe' { */ review: string | Stripe.Review | null; + /** + * Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + */ + secret_key_confirmation?: PaymentIntent.SecretKeyConfirmation; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -371,6 +376,8 @@ declare module 'stripe' { card_await_notification?: NextAction.CardAwaitNotification; + cashapp_handle_redirect_or_display_qr_code?: NextAction.CashappHandleRedirectOrDisplayQrCode; + display_bank_transfer_instructions?: NextAction.DisplayBankTransferInstructions; konbini_display_details?: NextAction.KonbiniDisplayDetails; @@ -461,6 +468,39 @@ declare module 'stripe' { customer_approval_required: boolean | null; } + interface CashappHandleRedirectOrDisplayQrCode { + /** + * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + */ + hosted_instructions_url?: string; + + /** + * The url for mobile redirect based auth + */ + mobile_auth_url?: string; + + qr_code?: CashappHandleRedirectOrDisplayQrCode.QrCode; + } + + namespace CashappHandleRedirectOrDisplayQrCode { + interface QrCode { + /** + * The date (unix timestamp) when the QR code expires. + */ + expires_at?: number; + + /** + * The image_url_png string used to render QR code + */ + image_url_png?: string; + + /** + * The image_url_svg string used to render QR code + */ + image_url_svg?: string; + } + } + interface DisplayBankTransferInstructions { /** * The remaining amount that needs to be transferred to complete the payment. @@ -940,6 +980,8 @@ declare module 'stripe' { card_present?: PaymentMethodOptions.CardPresent; + cashapp?: PaymentMethodOptions.Cashapp; + customer_balance?: PaymentMethodOptions.CustomerBalance; eps?: PaymentMethodOptions.Eps; @@ -966,6 +1008,8 @@ declare module 'stripe' { paynow?: PaymentMethodOptions.Paynow; + paypal?: PaymentMethodOptions.Paypal; + pix?: PaymentMethodOptions.Pix; promptpay?: PaymentMethodOptions.Promptpay; @@ -1345,6 +1389,26 @@ declare module 'stripe' { request_incremental_authorization_support: boolean | null; } + interface Cashapp { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + * + * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + */ + setup_future_usage?: Cashapp.SetupFutureUsage; + } + + namespace Cashapp { + type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; + } + interface CustomerBalance { bank_transfer?: CustomerBalance.BankTransfer; @@ -1583,6 +1647,23 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Paypal { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the PayPal checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + + /** + * A unique reference ID of the PayPal transaction. This must be a globally unique ID across all PayPal transactions or the transaction will fail. + */ + reference_id?: string | null; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. @@ -1762,6 +1843,8 @@ declare module 'stripe' { } } + type SecretKeyConfirmation = 'optional' | 'required'; + type SetupFutureUsage = 'off_session' | 'on_session'; interface Shipping { diff --git a/types/PaymentIntentsResource.d.ts b/types/PaymentIntentsResource.d.ts index 5547b061d2..c4938b1e39 100644 --- a/types/PaymentIntentsResource.d.ts +++ b/types/PaymentIntentsResource.d.ts @@ -2,1889 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A PaymentIntent guides you through the process of collecting a payment from your customer. - * We recommend that you create exactly one PaymentIntent for each order or - * customer session in your system. You can reference the PaymentIntent later to - * see the history of payment attempts for a particular session. - * - * A PaymentIntent transitions through - * [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) - * throughout its lifetime as it interfaces with Stripe.js to perform - * authentication flows and ultimately creates at most one successful charge. - * - * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). - */ - interface PaymentIntent { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'payment_intent'; - - /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount: number; - - /** - * Amount that can be captured from this PaymentIntent. - */ - amount_capturable: number; - - amount_details?: PaymentIntent.AmountDetails; - - /** - * Amount that was collected by this PaymentIntent. - */ - amount_received: number; - - /** - * ID of the Connect application that created the PaymentIntent. - */ - application: string | Stripe.Application | null; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - */ - application_fee_amount: number | null; - - /** - * Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) - */ - automatic_payment_methods: PaymentIntent.AutomaticPaymentMethods | null; - - /** - * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. - */ - canceled_at: number | null; - - /** - * Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). - */ - cancellation_reason: PaymentIntent.CancellationReason | null; - - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method: PaymentIntent.CaptureMethod; - - /** - * Charges that were created by this PaymentIntent, if any. - */ - charges?: ApiList; - - /** - * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. - * - * The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. - * - * Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. - */ - client_secret: string | null; - - confirmation_method: PaymentIntent.ConfirmationMethod; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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; - - /** - * ID of the Customer this PaymentIntent belongs to, if one exists. - * - * Payment methods attached to other Customers cannot be used with this PaymentIntent. - * - * If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description: string | null; - - /** - * ID of the invoice that created this PaymentIntent, if it exists. - */ - invoice: string | Stripe.Invoice | null; - - /** - * The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. - */ - last_payment_error: PaymentIntent.LastPaymentError | null; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. For more information, see the [documentation](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). - */ - metadata: Stripe.Metadata; - - /** - * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - */ - next_action: PaymentIntent.NextAction | null; - - /** - * The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * ID of the payment method used in this PaymentIntent. - */ - payment_method: string | Stripe.PaymentMethod | null; - - /** - * Payment-method-specific configuration for this PaymentIntent. - */ - payment_method_options: PaymentIntent.PaymentMethodOptions | null; - - /** - * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - */ - payment_method_types: Array; - - /** - * If present, this property tells you about the processing state of the payment. - */ - processing: PaymentIntent.Processing | null; - - /** - * Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - */ - receipt_email: string | null; - - /** - * ID of the review associated with this PaymentIntent, if any. - */ - review: string | Stripe.Review | null; - - /** - * Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. - */ - secret_key_confirmation?: PaymentIntent.SecretKeyConfirmation; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage: PaymentIntent.SetupFutureUsage | null; - - /** - * Shipping information for this PaymentIntent. - */ - shipping: PaymentIntent.Shipping | null; - - /** - * This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. - */ - source: - | string - | Stripe.CustomerSource - | Stripe.DeletedBankAccount - | Stripe.DeletedCard - | null; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor: string | null; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix: string | null; - - /** - * Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). - */ - status: PaymentIntent.Status; - - /** - * The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - transfer_data: PaymentIntent.TransferData | null; - - /** - * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - */ - transfer_group: string | null; - } - - namespace PaymentIntent { - interface AmountDetails { - tip?: AmountDetails.Tip; - } - - namespace AmountDetails { - interface Tip { - /** - * Portion of the amount that corresponds to a tip. - */ - amount?: number; - } - } - - interface AutomaticPaymentMethods { - /** - * Automatically calculates compatible payment methods - */ - enabled: boolean; - } - - type CancellationReason = - | 'abandoned' - | 'automatic' - | 'duplicate' - | 'failed_invoice' - | 'fraudulent' - | 'requested_by_customer' - | 'void_invoice'; - - type CaptureMethod = 'automatic' | 'manual'; - - type ConfirmationMethod = 'automatic' | 'manual'; - - interface LastPaymentError { - /** - * For card errors, the ID of the failed charge. - */ - charge?: string; - - /** - * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. - */ - code?: string; - - /** - * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. - */ - decline_code?: string; - - /** - * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. - */ - doc_url?: string; - - /** - * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. - */ - message?: string; - - /** - * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. - */ - param?: string; - - /** - * A PaymentIntent guides you through the process of collecting a payment from your customer. - * We recommend that you create exactly one PaymentIntent for each order or - * customer session in your system. You can reference the PaymentIntent later to - * see the history of payment attempts for a particular session. - * - * A PaymentIntent transitions through - * [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) - * throughout its lifetime as it interfaces with Stripe.js to perform - * authentication flows and ultimately creates at most one successful charge. - * - * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). - */ - payment_intent?: Stripe.PaymentIntent; - - /** - * PaymentMethod objects represent your customer's payment instruments. - * You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to - * Customer objects to store instrument details for future payments. - * - * Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). - */ - payment_method?: Stripe.PaymentMethod; - - /** - * If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. - */ - payment_method_type?: string; - - /** - * A URL to the request log entry in your dashboard. - */ - request_log_url?: string; - - /** - * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. - * For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - * Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. - * - * Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. - * Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. - * The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides - * you through the setup process. - * - * Successful SetupIntents result in payment credentials that are optimized for future payments. - * For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through - * [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection - * in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). - * If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, - * it will automatically attach the resulting payment method to that Customer. - * We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on - * PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. - * - * By using SetupIntents, you ensure that your customers experience the minimum set of required friction, - * even as regulations change over time. - * - * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). - */ - setup_intent?: Stripe.SetupIntent; - - source?: Stripe.CustomerSource; - - /** - * The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` - */ - type: LastPaymentError.Type; - } - - namespace LastPaymentError { - type Type = - | 'api_error' - | 'card_error' - | 'idempotency_error' - | 'invalid_request_error'; - } - - interface NextAction { - alipay_handle_redirect?: NextAction.AlipayHandleRedirect; - - boleto_display_details?: NextAction.BoletoDisplayDetails; - - card_await_notification?: NextAction.CardAwaitNotification; - - cashapp_handle_redirect_or_display_qr_code?: NextAction.CashappHandleRedirectOrDisplayQrCode; - - display_bank_transfer_instructions?: NextAction.DisplayBankTransferInstructions; - - konbini_display_details?: NextAction.KonbiniDisplayDetails; - - oxxo_display_details?: NextAction.OxxoDisplayDetails; - - paynow_display_qr_code?: NextAction.PaynowDisplayQrCode; - - pix_display_qr_code?: NextAction.PixDisplayQrCode; - - promptpay_display_qr_code?: NextAction.PromptpayDisplayQrCode; - - redirect_to_url?: NextAction.RedirectToUrl; - - /** - * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - */ - type: string; - - /** - * When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. - */ - use_stripe_sdk?: NextAction.UseStripeSdk; - - verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits; - - wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode; - - wechat_pay_redirect_to_android_app?: NextAction.WechatPayRedirectToAndroidApp; - - wechat_pay_redirect_to_ios_app?: NextAction.WechatPayRedirectToIosApp; - } - - namespace NextAction { - interface AlipayHandleRedirect { - /** - * The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. - */ - native_data: string | null; - - /** - * The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. - */ - native_url: string | null; - - /** - * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - */ - return_url: string | null; - - /** - * The URL you must redirect your customer to in order to authenticate the payment. - */ - url: string | null; - } - - interface BoletoDisplayDetails { - /** - * The timestamp after which the boleto expires. - */ - expires_at: number | null; - - /** - * The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. - */ - hosted_voucher_url: string | null; - - /** - * The boleto number. - */ - number: string | null; - - /** - * The URL to the downloadable boleto voucher PDF. - */ - pdf: string | null; - } - - interface CardAwaitNotification { - /** - * The time that payment will be attempted. If customer approval is required, they need to provide approval before this time. - */ - charge_attempt_at: number | null; - - /** - * For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required. - */ - customer_approval_required: boolean | null; - } - - interface CashappHandleRedirectOrDisplayQrCode { - /** - * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. - */ - hosted_instructions_url?: string; - - /** - * The url for mobile redirect based auth - */ - mobile_auth_url?: string; - - qr_code?: CashappHandleRedirectOrDisplayQrCode.QrCode; - } - - namespace CashappHandleRedirectOrDisplayQrCode { - interface QrCode { - /** - * The date (unix timestamp) when the QR code expires. - */ - expires_at?: number; - - /** - * The image_url_png string used to render QR code - */ - image_url_png?: string; - - /** - * The image_url_svg string used to render QR code - */ - image_url_svg?: string; - } - } - - interface DisplayBankTransferInstructions { - /** - * The remaining amount that needs to be transferred to complete the payment. - */ - amount_remaining: number | 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 | null; - - /** - * A list of financial addresses that can be used to fund the customer balance - */ - financial_addresses?: Array< - DisplayBankTransferInstructions.FinancialAddress - >; - - /** - * A link to a hosted page that guides your customer through completing the transfer. - */ - hosted_instructions_url: string | null; - - /** - * A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. - */ - reference: string | null; - - /** - * Type of bank transfer - */ - type: DisplayBankTransferInstructions.Type; - } - - namespace DisplayBankTransferInstructions { - interface FinancialAddress { - /** - * Iban Records contain E.U. bank account details per the SEPA format. - */ - iban?: FinancialAddress.Iban; - - /** - * Sort Code Records contain U.K. bank account details per the sort code format. - */ - sort_code?: FinancialAddress.SortCode; - - /** - * SPEI Records contain Mexico bank account details per the SPEI format. - */ - spei?: FinancialAddress.Spei; - - /** - * The payment networks supported by this FinancialAddress - */ - supported_networks?: Array; - - /** - * The type of financial address - */ - type: FinancialAddress.Type; - - /** - * Zengin Records contain Japan bank account details per the Zengin format. - */ - zengin?: FinancialAddress.Zengin; - } - - namespace FinancialAddress { - interface Iban { - /** - * The name of the person or business that owns the bank account - */ - account_holder_name: string; - - /** - * The BIC/SWIFT code of the account. - */ - bic: string; - - /** - * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - */ - country: string; - - /** - * The IBAN of the account. - */ - iban: string; - } - - interface SortCode { - /** - * The name of the person or business that owns the bank account - */ - account_holder_name: string; - - /** - * The account number - */ - account_number: string; - - /** - * The six-digit sort code - */ - sort_code: string; - } - - interface Spei { - /** - * The three-digit bank code - */ - bank_code: string; - - /** - * The short banking institution name - */ - bank_name: string; - - /** - * The CLABE number - */ - clabe: string; - } - - type SupportedNetwork = 'bacs' | 'fps' | 'sepa' | 'spei' | 'zengin'; - - type Type = 'iban' | 'sort_code' | 'spei' | 'zengin'; - - interface Zengin { - /** - * The account holder name - */ - account_holder_name: string | null; - - /** - * The account number - */ - account_number: string | null; - - /** - * The bank account type. In Japan, this can only be `futsu` or `toza`. - */ - account_type: string | null; - - /** - * The bank code of the account - */ - bank_code: string | null; - - /** - * The bank name of the account - */ - bank_name: string | null; - - /** - * The branch code of the account - */ - branch_code: string | null; - - /** - * The branch name of the account - */ - branch_name: string | null; - } - } - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - - interface KonbiniDisplayDetails { - /** - * The timestamp at which the pending Konbini payment expires. - */ - expires_at: number; - - /** - * The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. - */ - hosted_voucher_url: string | null; - - stores: KonbiniDisplayDetails.Stores; - } - - namespace KonbiniDisplayDetails { - interface Stores { - /** - * FamilyMart instruction details. - */ - familymart: Stores.Familymart | null; - - /** - * Lawson instruction details. - */ - lawson: Stores.Lawson | null; - - /** - * Ministop instruction details. - */ - ministop: Stores.Ministop | null; - - /** - * Seicomart instruction details. - */ - seicomart: Stores.Seicomart | null; - } - - namespace Stores { - interface Familymart { - /** - * The confirmation number. - */ - confirmation_number?: string; - - /** - * The payment code. - */ - payment_code: string; - } - - interface Lawson { - /** - * The confirmation number. - */ - confirmation_number?: string; - - /** - * The payment code. - */ - payment_code: string; - } - - interface Ministop { - /** - * The confirmation number. - */ - confirmation_number?: string; - - /** - * The payment code. - */ - payment_code: string; - } - - interface Seicomart { - /** - * The confirmation number. - */ - confirmation_number?: string; - - /** - * The payment code. - */ - payment_code: string; - } - } - } - - interface OxxoDisplayDetails { - /** - * The timestamp after which the OXXO voucher expires. - */ - expires_after: number | null; - - /** - * The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. - */ - hosted_voucher_url: string | null; - - /** - * OXXO reference number. - */ - number: string | null; - } - - interface PaynowDisplayQrCode { - /** - * The raw data string used to generate QR code, it should be used together with QR code library. - */ - data: string; - - /** - * The image_url_png string used to render QR code - */ - image_url_png: string; - - /** - * The image_url_svg string used to render QR code - */ - image_url_svg: string; - } - - interface PixDisplayQrCode { - /** - * The raw data string used to generate QR code, it should be used together with QR code library. - */ - data?: string; - - /** - * The date (unix timestamp) when the PIX expires. - */ - expires_at?: number; - - /** - * The URL to the hosted pix instructions page, which allows customers to view the pix QR code. - */ - hosted_instructions_url?: string; - - /** - * The image_url_png string used to render png QR code - */ - image_url_png?: string; - - /** - * The image_url_svg string used to render svg QR code - */ - image_url_svg?: string; - } - - interface PromptpayDisplayQrCode { - /** - * The raw data string used to generate QR code, it should be used together with QR code library. - */ - data: string; - - /** - * The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. - */ - hosted_instructions_url: string; - - /** - * The image_url_png string used to render QR code, can be used as - */ - image_url_png: string; - - /** - * The image_url_svg string used to render QR code, can be used as - */ - image_url_svg: string; - } - - interface RedirectToUrl { - /** - * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - */ - return_url: string | null; - - /** - * The URL you must redirect your customer to in order to authenticate the payment. - */ - url: string | null; - } - - interface UseStripeSdk {} - - interface VerifyWithMicrodeposits { - /** - * The timestamp when the microdeposits are expected to land. - */ - arrival_date: number; - - /** - * The URL for the hosted verification page, which allows customers to verify their bank account. - */ - hosted_verification_url: string; - - /** - * The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. - */ - microdeposit_type: VerifyWithMicrodeposits.MicrodepositType | null; - } - - namespace VerifyWithMicrodeposits { - type MicrodepositType = 'amounts' | 'descriptor_code'; - } - - interface WechatPayDisplayQrCode { - /** - * The data being used to generate QR code - */ - data: string; - - /** - * The base64 image data for a pre-generated QR code - */ - image_data_url: string; - - /** - * The image_url_png string used to render QR code - */ - image_url_png: string; - - /** - * The image_url_svg string used to render QR code - */ - image_url_svg: string; - } - - interface WechatPayRedirectToAndroidApp { - /** - * app_id is the APP ID registered on WeChat open platform - */ - app_id: string; - - /** - * nonce_str is a random string - */ - nonce_str: string; - - /** - * package is static value - */ - package: string; - - /** - * an unique merchant ID assigned by WeChat Pay - */ - partner_id: string; - - /** - * an unique trading ID assigned by WeChat Pay - */ - prepay_id: string; - - /** - * A signature - */ - sign: string; - - /** - * Specifies the current time in epoch format - */ - timestamp: string; - } - - interface WechatPayRedirectToIosApp { - /** - * An universal link that redirect to WeChat Pay app - */ - native_url: string; - } - } - - interface PaymentMethodOptions { - acss_debit?: PaymentMethodOptions.AcssDebit; - - affirm?: PaymentMethodOptions.Affirm; - - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - alipay?: PaymentMethodOptions.Alipay; - - au_becs_debit?: PaymentMethodOptions.AuBecsDebit; - - bacs_debit?: PaymentMethodOptions.BacsDebit; - - bancontact?: PaymentMethodOptions.Bancontact; - - blik?: PaymentMethodOptions.Blik; - - boleto?: PaymentMethodOptions.Boleto; - - card?: PaymentMethodOptions.Card; - - card_present?: PaymentMethodOptions.CardPresent; - - cashapp?: PaymentMethodOptions.Cashapp; - - customer_balance?: PaymentMethodOptions.CustomerBalance; - - eps?: PaymentMethodOptions.Eps; - - fpx?: PaymentMethodOptions.Fpx; - - giropay?: PaymentMethodOptions.Giropay; - - grabpay?: PaymentMethodOptions.Grabpay; - - ideal?: PaymentMethodOptions.Ideal; - - interac_present?: PaymentMethodOptions.InteracPresent; - - klarna?: PaymentMethodOptions.Klarna; - - konbini?: PaymentMethodOptions.Konbini; - - link?: PaymentMethodOptions.Link; - - oxxo?: PaymentMethodOptions.Oxxo; - - p24?: PaymentMethodOptions.P24; - - paynow?: PaymentMethodOptions.Paynow; - - paypal?: PaymentMethodOptions.Paypal; - - pix?: PaymentMethodOptions.Pix; - - promptpay?: PaymentMethodOptions.Promptpay; - - sepa_debit?: PaymentMethodOptions.SepaDebit; - - sofort?: PaymentMethodOptions.Sofort; - - us_bank_account?: PaymentMethodOptions.UsBankAccount; - - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: AcssDebit.SetupFutureUsage; - - /** - * Bank account verification method. - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text - */ - custom_mandate_url?: string; - - /** - * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description: string | null; - - /** - * Payment schedule for the mandate. - */ - payment_schedule: MandateOptions.PaymentSchedule | null; - - /** - * Transaction type of the mandate. - */ - transaction_type: MandateOptions.TransactionType | null; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Affirm { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Alipay.SetupFutureUsage; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface AuBecsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: AuBecsDebit.SetupFutureUsage; - } - - namespace AuBecsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface BacsDebit { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: BacsDebit.SetupFutureUsage; - } - - namespace BacsDebit { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Bancontact.SetupFutureUsage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Blik {} - - interface Boleto { - /** - * The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. - */ - expires_after_days: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Boleto.SetupFutureUsage; - } - - namespace Boleto { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Installment details for this payment (Mexico only). - * - * For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - */ - installments: Card.Installments | null; - - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options: Card.MandateOptions | null; - - /** - * Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. - */ - network: Card.Network | null; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure: Card.RequestThreeDSecure | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Card.SetupFutureUsage; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - */ - statement_descriptor_suffix_kana?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - */ - statement_descriptor_suffix_kanji?: string; - } - - namespace Card { - interface Installments { - /** - * Installment plans that may be selected for this PaymentIntent. - */ - available_plans: Array | null; - - /** - * Whether Installments are enabled for this PaymentIntent. - */ - enabled: boolean; - - /** - * Installment plan selected for this PaymentIntent. - */ - plan: Installments.Plan | null; - } - - namespace Installments { - interface AvailablePlan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number | null; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month' | null; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - - interface Plan { - /** - * For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - */ - count: number | null; - - /** - * For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - * One of `month`. - */ - interval: 'month' | null; - - /** - * Type of installment plan, one of `fixed_count`. - */ - type: 'fixed_count'; - } - } - - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description: string | null; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date: number | null; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count: number | null; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types: Array<'india'> | null; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CardPresent { - /** - * Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) - */ - request_extended_authorization: boolean | null; - - /** - * Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - */ - request_incremental_authorization_support: boolean | null; - } - - interface Cashapp { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Cashapp.SetupFutureUsage; - } - - namespace Cashapp { - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type: 'bank_transfer' | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array; - - /** - * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type | null; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: EuBankTransfer.Country; - } - - namespace EuBankTransfer { - type Country = 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Eps { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Fpx { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Giropay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Grabpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Ideal.SetupFutureUsage; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the Klarna checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Konbini { - /** - * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - */ - confirmation_number: string | null; - - /** - * The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - */ - expires_after_days: number | null; - - /** - * The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. - */ - expires_at: number | null; - - /** - * A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - */ - product_description: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Token used for persistent Link logins. - */ - persistent_token: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Link.SetupFutureUsage; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Paynow { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Paypal { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the PayPal checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - - /** - * A unique reference ID of the PayPal transaction. This must be a globally unique ID across all PayPal transactions or the transaction will fail. - */ - reference_id?: string | null; - } - - interface Pix { - /** - * The number of seconds (between 10 and 1209600) after which Pix payment will expire. - */ - expires_after_seconds: number | null; - - /** - * The timestamp at which the Pix expires. - */ - expires_at: number | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Promptpay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface SepaDebit { - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: SepaDebit.SetupFutureUsage; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Preferred language of the SOFORT authorization page that the customer is redirected to. - */ - preferred_language: Sofort.PreferredLanguage | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Sofort.SetupFutureUsage; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface UsBankAccount { - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: UsBankAccount.SetupFutureUsage; - - /** - * Bank account verification method. - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. The `payment_method` permission must be included. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id: string | null; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - interface Processing { - card?: Processing.Card; - - /** - * Type of the payment method for which payment is in `processing` state, one of `card`. - */ - type: 'card'; - } - - namespace Processing { - interface Card { - customer_notification?: Card.CustomerNotification; - } - - namespace Card { - interface CustomerNotification { - /** - * Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. - */ - approval_requested: boolean | null; - - /** - * If customer approval is required, they need to provide approval before this time. - */ - completes_at: number | null; - } - } - } - - type SecretKeyConfirmation = 'optional' | 'required'; - - type SetupFutureUsage = 'off_session' | 'on_session'; - - interface Shipping { - address?: Stripe.Address; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string | null; - - /** - * Recipient name. - */ - name?: string; - - /** - * Recipient phone (including extension). - */ - phone?: string | null; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string | null; - } - - type Status = - | 'canceled' - | 'processing' - | 'requires_action' - | 'requires_capture' - | 'requires_confirmation' - | 'requires_payment_method' - | 'succeeded'; - - interface TransferData { - /** - * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - */ - amount?: number; - - /** - * The account (if any) the payment will be attributed to for tax - * reporting, and where funds from the payment will be transferred to upon - * payment success. - */ - destination: string | Stripe.Account; - } - } - interface PaymentIntentCreateParams { /** * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). diff --git a/types/PaymentLinks.d.ts b/types/PaymentLinks.d.ts index 0553b3bea2..d36a26ae8e 100644 --- a/types/PaymentLinks.d.ts +++ b/types/PaymentLinks.d.ts @@ -263,6 +263,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/PaymentLinksResource.d.ts b/types/PaymentLinksResource.d.ts index 36c4cbd51d..712f1b4155 100644 --- a/types/PaymentLinksResource.d.ts +++ b/types/PaymentLinksResource.d.ts @@ -2,546 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. - * - * When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. - * - * Related guide: [Payment Links API](https://stripe.com/docs/payments/payment-links/api) - */ - interface PaymentLink { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'payment_link'; - - /** - * Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - */ - active: boolean; - - after_completion: PaymentLink.AfterCompletion; - - /** - * Whether user redeemable promotion codes are enabled. - */ - allow_promotion_codes: boolean; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount: number | null; - - /** - * This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. - */ - application_fee_percent: number | null; - - automatic_tax: PaymentLink.AutomaticTax; - - /** - * Configuration for collecting the customer's billing address. - */ - billing_address_collection: PaymentLink.BillingAddressCollection; - - /** - * When set, provides configuration to gather active consent from customers. - */ - consent_collection: PaymentLink.ConsentCollection | 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; - - /** - * Configuration for Customer creation during checkout. - */ - customer_creation: PaymentLink.CustomerCreation; - - /** - * The line items representing what is being sold. - */ - line_items?: ApiList; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * Indicates the parameters to be passed to PaymentIntent creation during checkout. - */ - payment_intent_data: PaymentLink.PaymentIntentData | null; - - /** - * Configuration for collecting a payment method during checkout. - */ - payment_method_collection: PaymentLink.PaymentMethodCollection; - - /** - * The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types: Array | null; - - phone_number_collection: PaymentLink.PhoneNumberCollection; - - /** - * Configuration for collecting the customer's shipping address. - */ - shipping_address_collection: PaymentLink.ShippingAddressCollection | null; - - /** - * The shipping rate options applied to the session. - */ - shipping_options: Array; - - /** - * Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. - */ - submit_type: PaymentLink.SubmitType; - - /** - * When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. - */ - subscription_data: PaymentLink.SubscriptionData | null; - - tax_id_collection: PaymentLink.TaxIdCollection; - - /** - * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - */ - transfer_data: PaymentLink.TransferData | null; - - /** - * The public URL that can be shared with customers. - */ - url: string; - } - - namespace PaymentLink { - interface AfterCompletion { - hosted_confirmation?: AfterCompletion.HostedConfirmation; - - redirect?: AfterCompletion.Redirect; - - /** - * The specified behavior after the purchase is complete. - */ - type: AfterCompletion.Type; - } - - namespace AfterCompletion { - interface HostedConfirmation { - /** - * The custom message that is displayed to the customer after the purchase is complete. - */ - custom_message: string | null; - } - - interface Redirect { - /** - * The URL the customer will be redirected to after the purchase is complete. - */ - url: string; - } - - type Type = 'hosted_confirmation' | 'redirect'; - } - - interface AutomaticTax { - /** - * If `true`, tax will be calculated automatically using the customer's location. - */ - enabled: boolean; - } - - type BillingAddressCollection = 'auto' | 'required'; - - interface ConsentCollection { - /** - * If set to `auto`, enables the collection of customer consent for promotional communications. - */ - promotions: ConsentCollection.Promotions | null; - - /** - * If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service. - */ - terms_of_service: ConsentCollection.TermsOfService | null; - } - - namespace ConsentCollection { - type Promotions = 'auto' | 'none'; - - type TermsOfService = 'none' | 'required'; - } - - type CustomerCreation = 'always' | 'if_required'; - - interface PaymentIntentData { - /** - * Indicates when the funds will be captured from the customer's account. - */ - capture_method: PaymentIntentData.CaptureMethod | null; - - /** - * Indicates that you intend to make future payments with the payment method collected during checkout. - */ - setup_future_usage: PaymentIntentData.SetupFutureUsage | null; - } - - namespace PaymentIntentData { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'off_session' | 'on_session'; - } - - type PaymentMethodCollection = 'always' | 'if_required'; - - type PaymentMethodType = - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'konbini' - | 'oxxo' - | 'p24' - | 'paynow' - | 'paypal' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - interface PhoneNumberCollection { - /** - * If `true`, a phone number will be collected during checkout. - */ - enabled: boolean; - } - - interface ShippingAddressCollection { - /** - * An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - */ - allowed_countries: Array; - } - - namespace ShippingAddressCollection { - type AllowedCountry = - | 'AC' - | 'AD' - | 'AE' - | 'AF' - | 'AG' - | 'AI' - | 'AL' - | 'AM' - | 'AO' - | 'AQ' - | 'AR' - | 'AT' - | 'AU' - | 'AW' - | 'AX' - | 'AZ' - | 'BA' - | 'BB' - | 'BD' - | 'BE' - | 'BF' - | 'BG' - | 'BH' - | 'BI' - | 'BJ' - | 'BL' - | 'BM' - | 'BN' - | 'BO' - | 'BQ' - | 'BR' - | 'BS' - | 'BT' - | 'BV' - | 'BW' - | 'BY' - | 'BZ' - | 'CA' - | 'CD' - | 'CF' - | 'CG' - | 'CH' - | 'CI' - | 'CK' - | 'CL' - | 'CM' - | 'CN' - | 'CO' - | 'CR' - | 'CV' - | 'CW' - | 'CY' - | 'CZ' - | 'DE' - | 'DJ' - | 'DK' - | 'DM' - | 'DO' - | 'DZ' - | 'EC' - | 'EE' - | 'EG' - | 'EH' - | 'ER' - | 'ES' - | 'ET' - | 'FI' - | 'FJ' - | 'FK' - | 'FO' - | 'FR' - | 'GA' - | 'GB' - | 'GD' - | 'GE' - | 'GF' - | 'GG' - | 'GH' - | 'GI' - | 'GL' - | 'GM' - | 'GN' - | 'GP' - | 'GQ' - | 'GR' - | 'GS' - | 'GT' - | 'GU' - | 'GW' - | 'GY' - | 'HK' - | 'HN' - | 'HR' - | 'HT' - | 'HU' - | 'ID' - | 'IE' - | 'IL' - | 'IM' - | 'IN' - | 'IO' - | 'IQ' - | 'IS' - | 'IT' - | 'JE' - | 'JM' - | 'JO' - | 'JP' - | 'KE' - | 'KG' - | 'KH' - | 'KI' - | 'KM' - | 'KN' - | 'KR' - | 'KW' - | 'KY' - | 'KZ' - | 'LA' - | 'LB' - | 'LC' - | 'LI' - | 'LK' - | 'LR' - | 'LS' - | 'LT' - | 'LU' - | 'LV' - | 'LY' - | 'MA' - | 'MC' - | 'MD' - | 'ME' - | 'MF' - | 'MG' - | 'MK' - | 'ML' - | 'MM' - | 'MN' - | 'MO' - | 'MQ' - | 'MR' - | 'MS' - | 'MT' - | 'MU' - | 'MV' - | 'MW' - | 'MX' - | 'MY' - | 'MZ' - | 'NA' - | 'NC' - | 'NE' - | 'NG' - | 'NI' - | 'NL' - | 'NO' - | 'NP' - | 'NR' - | 'NU' - | 'NZ' - | 'OM' - | 'PA' - | 'PE' - | 'PF' - | 'PG' - | 'PH' - | 'PK' - | 'PL' - | 'PM' - | 'PN' - | 'PR' - | 'PS' - | 'PT' - | 'PY' - | 'QA' - | 'RE' - | 'RO' - | 'RS' - | 'RU' - | 'RW' - | 'SA' - | 'SB' - | 'SC' - | 'SE' - | 'SG' - | 'SH' - | 'SI' - | 'SJ' - | 'SK' - | 'SL' - | 'SM' - | 'SN' - | 'SO' - | 'SR' - | 'SS' - | 'ST' - | 'SV' - | 'SX' - | 'SZ' - | 'TA' - | 'TC' - | 'TD' - | 'TF' - | 'TG' - | 'TH' - | 'TJ' - | 'TK' - | 'TL' - | 'TM' - | 'TN' - | 'TO' - | 'TR' - | 'TT' - | 'TV' - | 'TW' - | 'TZ' - | 'UA' - | 'UG' - | 'US' - | 'UY' - | 'UZ' - | 'VA' - | 'VC' - | 'VE' - | 'VG' - | 'VN' - | 'VU' - | 'WF' - | 'WS' - | 'XK' - | 'YE' - | 'YT' - | 'ZA' - | 'ZM' - | 'ZW' - | 'ZZ'; - } - - interface ShippingOption { - /** - * A non-negative integer in cents representing how much to charge. - */ - shipping_amount: number; - - /** - * The ID of the Shipping Rate to use for this shipping option. - */ - shipping_rate: string | Stripe.ShippingRate; - } - - type SubmitType = 'auto' | 'book' | 'donate' | 'pay'; - - interface SubscriptionData { - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description: string | null; - - /** - * Integer representing the number of trial period days before the customer is charged for the first time. - */ - trial_period_days: number | null; - } - - interface TaxIdCollection { - /** - * Indicates whether tax ID collection is enabled for the session. - */ - enabled: boolean; - } - - interface TransferData { - /** - * The amount in %s that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount: number | null; - - /** - * The connected account receiving the transfer. - */ - destination: string | Stripe.Account; - } - } - interface PaymentLinkCreateParams { /** * The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. @@ -588,6 +48,11 @@ declare module 'stripe' { */ currency?: string; + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkCreateParams.CustomText; + /** * 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). */ @@ -733,6 +198,34 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. @@ -758,12 +251,12 @@ declare module 'stripe' { enabled: boolean; /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. */ maximum?: number; /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + * The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. */ minimum?: number; } @@ -1160,6 +653,11 @@ declare module 'stripe' { */ billing_address_collection?: PaymentLinkUpdateParams.BillingAddressCollection; + /** + * Display additional text for your customers using custom text. + */ + custom_text?: PaymentLinkUpdateParams.CustomText; + /** * 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). */ @@ -1251,6 +749,34 @@ declare module 'stripe' { type CustomerCreation = 'always' | 'if_required'; + interface CustomText { + /** + * Custom text that should be displayed alongside shipping address collection. + */ + shipping_address?: Stripe.Emptyable; + + /** + * Custom text that should be displayed alongside the payment confirmation button. + */ + submit?: Stripe.Emptyable; + } + + namespace CustomText { + interface ShippingAddress { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + + interface Submit { + /** + * Text may be up to 500 characters in length. + */ + message: string; + } + } + interface LineItem { /** * When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. @@ -1276,12 +802,12 @@ declare module 'stripe' { enabled: boolean; /** - * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99. + * The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. */ maximum?: number; /** - * The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0. + * The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. */ minimum?: number; } diff --git a/types/PaymentMethods.d.ts b/types/PaymentMethods.d.ts index 580ca2de9d..779af63f75 100644 --- a/types/PaymentMethods.d.ts +++ b/types/PaymentMethods.d.ts @@ -44,6 +44,8 @@ declare module 'stripe' { card_present?: PaymentMethod.CardPresent; + cashapp?: PaymentMethod.Cashapp; + /** * Time at which the object was created. Measured in seconds since the Unix epoch. */ @@ -90,6 +92,8 @@ declare module 'stripe' { paynow?: PaymentMethod.Paynow; + paypal?: PaymentMethod.Paypal; + pix?: PaymentMethod.Pix; promptpay?: PaymentMethod.Promptpay; @@ -111,6 +115,8 @@ declare module 'stripe' { us_bank_account?: PaymentMethod.UsBankAccount; wechat_pay?: PaymentMethod.WechatPay; + + zip?: PaymentMethod.Zip; } namespace PaymentMethod { @@ -414,6 +420,8 @@ declare module 'stripe' { interface CardPresent {} + interface Cashapp {} + interface CustomerBalance {} interface Eps { @@ -625,6 +633,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -701,6 +711,7 @@ declare module 'stripe' { | 'boleto' | 'card' | 'card_present' + | 'cashapp' | 'customer_balance' | 'eps' | 'fpx' @@ -714,12 +725,14 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' | 'sofort' | 'us_bank_account' - | 'wechat_pay'; + | 'wechat_pay' + | 'zip'; interface UsBankAccount { /** @@ -786,6 +799,8 @@ declare module 'stripe' { } interface WechatPay {} + + interface Zip {} } } } diff --git a/types/PaymentMethodsResource.d.ts b/types/PaymentMethodsResource.d.ts index db65b1f623..a6326efc79 100644 --- a/types/PaymentMethodsResource.d.ts +++ b/types/PaymentMethodsResource.d.ts @@ -2,807 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * PaymentMethod objects represent your customer's payment instruments. - * You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to - * Customer objects to store instrument details for future payments. - * - * Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). - */ - interface PaymentMethod { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'payment_method'; - - acss_debit?: PaymentMethod.AcssDebit; - - affirm?: PaymentMethod.Affirm; - - afterpay_clearpay?: PaymentMethod.AfterpayClearpay; - - alipay?: PaymentMethod.Alipay; - - au_becs_debit?: PaymentMethod.AuBecsDebit; - - bacs_debit?: PaymentMethod.BacsDebit; - - bancontact?: PaymentMethod.Bancontact; - - billing_details: PaymentMethod.BillingDetails; - - blik?: PaymentMethod.Blik; - - boleto?: PaymentMethod.Boleto; - - card?: PaymentMethod.Card; - - card_present?: PaymentMethod.CardPresent; - - cashapp?: PaymentMethod.Cashapp; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. - */ - customer: string | Stripe.Customer | null; - - customer_balance?: PaymentMethod.CustomerBalance; - - eps?: PaymentMethod.Eps; - - fpx?: PaymentMethod.Fpx; - - giropay?: PaymentMethod.Giropay; - - grabpay?: PaymentMethod.Grabpay; - - ideal?: PaymentMethod.Ideal; - - interac_present?: PaymentMethod.InteracPresent; - - klarna?: PaymentMethod.Klarna; - - konbini?: PaymentMethod.Konbini; - - link?: PaymentMethod.Link; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata | null; - - oxxo?: PaymentMethod.Oxxo; - - p24?: PaymentMethod.P24; - - paynow?: PaymentMethod.Paynow; - - paypal?: PaymentMethod.Paypal; - - pix?: PaymentMethod.Pix; - - promptpay?: PaymentMethod.Promptpay; - - /** - * Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - */ - radar_options?: PaymentMethod.RadarOptions; - - sepa_debit?: PaymentMethod.SepaDebit; - - sofort?: PaymentMethod.Sofort; - - /** - * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - */ - type: PaymentMethod.Type; - - us_bank_account?: PaymentMethod.UsBankAccount; - - wechat_pay?: PaymentMethod.WechatPay; - - zip?: PaymentMethod.Zip; - } - - namespace PaymentMethod { - interface AcssDebit { - /** - * Name of the bank associated with the bank account. - */ - bank_name: string | null; - - /** - * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - */ - fingerprint: string | null; - - /** - * Institution number of the bank account. - */ - institution_number: string | null; - - /** - * Last four digits of the bank account number. - */ - last4: string | null; - - /** - * Transit number of the bank account. - */ - transit_number: string | null; - } - - interface Affirm {} - - interface AfterpayClearpay {} - - interface Alipay {} - - interface AuBecsDebit { - /** - * Six-digit number identifying bank and branch associated with this bank account. - */ - bsb_number: string | null; - - /** - * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - */ - fingerprint: string | null; - - /** - * Last four digits of the bank account number. - */ - last4: string | null; - } - - interface BacsDebit { - /** - * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - */ - fingerprint: string | null; - - /** - * Last four digits of the bank account number. - */ - last4: string | null; - - /** - * Sort code of the bank account. (e.g., `10-20-30`) - */ - sort_code: string | null; - } - - interface Bancontact {} - - interface BillingDetails { - /** - * Billing address. - */ - address: Stripe.Address | null; - - /** - * Email address. - */ - email: string | null; - - /** - * Full name. - */ - name: string | null; - - /** - * Billing phone number (including extension). - */ - phone: string | null; - } - - interface Blik {} - - interface Boleto { - /** - * Uniquely identifies the customer tax id (CNPJ or CPF) - */ - tax_id: string; - } - - interface Card { - /** - * Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - */ - brand: string; - - /** - * Checks on Card address and CVC if provided. - */ - checks: Card.Checks | null; - - /** - * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. - */ - country: string | null; - - /** - * A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) - */ - description?: string | null; - - /** - * Two-digit number representing the card's expiration month. - */ - exp_month: number; - - /** - * Four-digit number representing the card's expiration year. - */ - exp_year: number; - - /** - * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. - * - * *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.* - */ - fingerprint?: string | null; - - /** - * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. - */ - funding: string; - - /** - * Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) - */ - iin?: string | null; - - /** - * The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) - */ - issuer?: string | null; - - /** - * The last four digits of the card. - */ - last4: string; - - /** - * Contains information about card networks that can be used to process the payment. - */ - networks: Card.Networks | null; - - /** - * Contains details on how this Card maybe be used for 3D Secure authentication. - */ - three_d_secure_usage: Card.ThreeDSecureUsage | null; - - /** - * If this Card is part of a card wallet, this contains the details of the card wallet. - */ - wallet: Card.Wallet | null; - } - - namespace Card { - interface Checks { - /** - * If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - */ - address_line1_check: string | null; - - /** - * If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - */ - address_postal_code_check: string | null; - - /** - * If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - */ - cvc_check: string | null; - } - - interface Networks { - /** - * All available networks for the card. - */ - available: Array; - - /** - * The preferred network for the card. - */ - preferred: string | null; - } - - interface ThreeDSecureUsage { - /** - * Whether 3D Secure is supported on this card. - */ - supported: boolean; - } - - interface Wallet { - amex_express_checkout?: Wallet.AmexExpressCheckout; - - apple_pay?: Wallet.ApplePay; - - /** - * (For tokenized numbers only.) The last four digits of the device account number. - */ - dynamic_last4: string | null; - - google_pay?: Wallet.GooglePay; - - masterpass?: Wallet.Masterpass; - - samsung_pay?: Wallet.SamsungPay; - - /** - * The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. - */ - type: Wallet.Type; - - visa_checkout?: Wallet.VisaCheckout; - } - - namespace Wallet { - interface AmexExpressCheckout {} - - interface ApplePay {} - - interface GooglePay {} - - interface Masterpass { - /** - * Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - billing_address: Stripe.Address | null; - - /** - * Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - email: string | null; - - /** - * Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - name: string | null; - - /** - * Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - shipping_address: Stripe.Address | null; - } - - interface SamsungPay {} - - type Type = - | 'amex_express_checkout' - | 'apple_pay' - | 'google_pay' - | 'masterpass' - | 'samsung_pay' - | 'visa_checkout'; - - interface VisaCheckout { - /** - * Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - billing_address: Stripe.Address | null; - - /** - * Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - email: string | null; - - /** - * Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - name: string | null; - - /** - * Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. - */ - shipping_address: Stripe.Address | null; - } - } - } - - interface CardPresent {} - - interface Cashapp {} - - interface CustomerBalance {} - - interface Eps { - /** - * The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. - */ - bank: Eps.Bank | null; - } - - namespace Eps { - type Bank = - | 'arzte_und_apotheker_bank' - | 'austrian_anadi_bank_ag' - | 'bank_austria' - | 'bankhaus_carl_spangler' - | 'bankhaus_schelhammer_und_schattera_ag' - | 'bawag_psk_ag' - | 'bks_bank_ag' - | 'brull_kallmus_bank_ag' - | 'btv_vier_lander_bank' - | 'capital_bank_grawe_gruppe_ag' - | 'deutsche_bank_ag' - | 'dolomitenbank' - | 'easybank_ag' - | 'erste_bank_und_sparkassen' - | 'hypo_alpeadriabank_international_ag' - | 'hypo_bank_burgenland_aktiengesellschaft' - | 'hypo_noe_lb_fur_niederosterreich_u_wien' - | 'hypo_oberosterreich_salzburg_steiermark' - | 'hypo_tirol_bank_ag' - | 'hypo_vorarlberg_bank_ag' - | 'marchfelder_bank' - | 'oberbank_ag' - | 'raiffeisen_bankengruppe_osterreich' - | 'schoellerbank_ag' - | 'sparda_bank_wien' - | 'volksbank_gruppe' - | 'volkskreditbank_ag' - | 'vr_bank_braunau'; - } - - interface Fpx { - /** - * Account holder type, if provided. Can be one of `individual` or `company`. - */ - account_holder_type: Fpx.AccountHolderType | null; - - /** - * The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. - */ - bank: Fpx.Bank; - } - - namespace Fpx { - type AccountHolderType = 'company' | 'individual'; - - type Bank = - | 'affin_bank' - | 'agrobank' - | 'alliance_bank' - | 'ambank' - | 'bank_islam' - | 'bank_muamalat' - | 'bank_of_china' - | 'bank_rakyat' - | 'bsn' - | 'cimb' - | 'deutsche_bank' - | 'hong_leong_bank' - | 'hsbc' - | 'kfh' - | 'maybank2e' - | 'maybank2u' - | 'ocbc' - | 'pb_enterprise' - | 'public_bank' - | 'rhb' - | 'standard_chartered' - | 'uob'; - } - - interface Giropay {} - - interface Grabpay {} - - interface Ideal { - /** - * The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`. - */ - bank: Ideal.Bank | null; - - /** - * The Bank Identifier Code of the customer's bank, if the bank was provided. - */ - bic: Ideal.Bic | null; - } - - namespace Ideal { - type Bank = - | 'abn_amro' - | 'asn_bank' - | 'bunq' - | 'handelsbanken' - | 'ing' - | 'knab' - | 'moneyou' - | 'rabobank' - | 'regiobank' - | 'revolut' - | 'sns_bank' - | 'triodos_bank' - | 'van_lanschot'; - - type Bic = - | 'ABNANL2A' - | 'ASNBNL21' - | 'BUNQNL2A' - | 'FVLBNL22' - | 'HANDNL2A' - | 'INGBNL2A' - | 'KNABNL2H' - | 'MOYONL21' - | 'RABONL2U' - | 'RBRBNL21' - | 'REVOLT21' - | 'SNSBNL2A' - | 'TRIONL2U'; - } - - interface InteracPresent {} - - interface Klarna { - /** - * The customer's date of birth, if provided. - */ - dob: Klarna.Dob | null; - } - - namespace Klarna { - interface Dob { - /** - * The day of birth, between 1 and 31. - */ - day: number | null; - - /** - * The month of birth, between 1 and 12. - */ - month: number | null; - - /** - * The four-digit year of birth. - */ - year: number | null; - } - } - - interface Konbini {} - - interface Link { - /** - * Account owner's email address. - */ - email: string | null; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - } - - interface Oxxo {} - - interface P24 { - /** - * The customer's bank, if provided. - */ - bank: P24.Bank | null; - } - - namespace P24 { - type Bank = - | 'alior_bank' - | 'bank_millennium' - | 'bank_nowy_bfg_sa' - | 'bank_pekao_sa' - | 'banki_spbdzielcze' - | 'blik' - | 'bnp_paribas' - | 'boz' - | 'citi_handlowy' - | 'credit_agricole' - | 'envelobank' - | 'etransfer_pocztowy24' - | 'getin_bank' - | 'ideabank' - | 'ing' - | 'inteligo' - | 'mbank_mtransfer' - | 'nest_przelew' - | 'noble_pay' - | 'pbac_z_ipko' - | 'plus_bank' - | 'santander_przelew24' - | 'tmobile_usbugi_bankowe' - | 'toyota_bank' - | 'volkswagen_bank'; - } - - interface Paynow {} - - interface Paypal {} - - interface Pix {} - - interface Promptpay {} - - interface RadarOptions { - /** - * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - */ - session?: string; - } - - interface SepaDebit { - /** - * Bank code of bank associated with the bank account. - */ - bank_code: string | null; - - /** - * Branch code of bank associated with the bank account. - */ - branch_code: string | null; - - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: string | null; - - /** - * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - */ - fingerprint: string | null; - - /** - * Information about the object that generated this PaymentMethod. - */ - generated_from: SepaDebit.GeneratedFrom | null; - - /** - * Last four characters of the IBAN. - */ - last4: string | null; - } - - namespace SepaDebit { - interface GeneratedFrom { - /** - * The ID of the Charge that generated this PaymentMethod, if any. - */ - charge: string | Stripe.Charge | null; - - /** - * The ID of the SetupAttempt that generated this PaymentMethod, if any. - */ - setup_attempt: string | Stripe.SetupAttempt | null; - } - } - - interface Sofort { - /** - * Two-letter ISO code representing the country the bank account is located in. - */ - country: string | null; - } - - type Type = - | 'acss_debit' - | 'affirm' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'blik' - | 'boleto' - | 'card' - | 'card_present' - | 'cashapp' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'interac_present' - | 'klarna' - | 'konbini' - | 'link' - | 'oxxo' - | 'p24' - | 'paynow' - | 'paypal' - | 'pix' - | 'promptpay' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay' - | 'zip'; - - interface UsBankAccount { - /** - * Account holder type: individual or company. - */ - account_holder_type: UsBankAccount.AccountHolderType | null; - - /** - * Account type: checkings or savings. Defaults to checking if omitted. - */ - account_type: UsBankAccount.AccountType | null; - - /** - * The name of the bank. - */ - bank_name: string | null; - - /** - * The ID of the Financial Connections Account used to create the payment method. - */ - financial_connections_account?: string | null; - - /** - * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - */ - fingerprint: string | null; - - /** - * Last four digits of the bank account number. - */ - last4: string | null; - - /** - * Contains information about US bank account networks that can be used. - */ - networks: UsBankAccount.Networks | null; - - /** - * Routing number of the bank account. - */ - routing_number: string | null; - } - - namespace UsBankAccount { - type AccountHolderType = 'company' | 'individual'; - - type AccountType = 'checking' | 'savings'; - - interface Networks { - /** - * The preferred network. - */ - preferred: string | null; - - /** - * All supported networks. - */ - supported: Array; - } - - namespace Networks { - type Supported = 'ach' | 'us_domestic_wire'; - } - } - - interface WechatPay {} - - interface Zip {} - } - interface PaymentMethodCreateParams { /** * If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. diff --git a/types/Prices.d.ts b/types/Prices.d.ts index 62b1b36c36..ffcb0e727f 100644 --- a/types/Prices.d.ts +++ b/types/Prices.d.ts @@ -70,6 +70,11 @@ declare module 'stripe' { */ metadata: Stripe.Metadata; + /** + * Subscriptions using this price will be migrated to use the new referenced price. + */ + migrate_to?: Price.MigrateTo | null; + /** * A brief description of the price, hidden from customers. */ @@ -216,6 +221,23 @@ declare module 'stripe' { preset: number | null; } + interface MigrateTo { + /** + * The behavior controlling at what point in the subscription lifecycle to migrate the price + */ + behavior: 'at_cycle_end'; + + /** + * The unix timestamp after at which subscriptions will start to migrate to the new price. + */ + effective_after: number; + + /** + * The id of the price being migrated to + */ + price: string; + } + interface Recurring { /** * Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. diff --git a/types/PricesResource.d.ts b/types/PricesResource.d.ts index 4ad59f48aa..ab2b519ed2 100644 --- a/types/PricesResource.d.ts +++ b/types/PricesResource.d.ts @@ -2,351 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * 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. - * - * For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. - * - * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). - */ - interface Price { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'price'; - - /** - * Whether the price can be used for new purchases. - */ - active: boolean; - - /** - * Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - */ - billing_scheme: Price.BillingScheme; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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; - - /** - * 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. - */ - custom_unit_amount: Price.CustomUnitAmount | null; - - deleted?: void; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. - */ - lookup_key: string | null; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * Subscriptions using this price will be migrated to use the new referenced price. - */ - migrate_to?: Price.MigrateTo | null; - - /** - * A brief description of the price, hidden from customers. - */ - nickname: string | null; - - /** - * The ID of the product this price is associated with. - */ - product: string | Stripe.Product | Stripe.DeletedProduct; - - /** - * The recurring components of a price such as `interval` and `usage_type`. - */ - recurring: Price.Recurring | 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: Price.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; - - /** - * Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. - */ - tiers_mode: Price.TiersMode | null; - - /** - * Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. - */ - transform_quantity: Price.TransformQuantity | null; - - /** - * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - */ - type: Price.Type; - - /** - * 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 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. - */ - 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; - } - - interface MigrateTo { - /** - * The behavior controlling at what point in the subscription lifecycle to migrate the price - */ - behavior: 'at_cycle_end'; - - /** - * The unix timestamp after at which subscriptions will start to migrate to the new price. - */ - effective_after: number; - - /** - * The id of the price being migrated to - */ - price: string; - } - - interface Recurring { - /** - * Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. - */ - aggregate_usage: Recurring.AggregateUsage | null; - - /** - * The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. - */ - interval: Recurring.Interval; - - /** - * The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. - */ - interval_count: number; - - /** - * Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - */ - trial_period_days: number | null; - - /** - * Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. - */ - usage_type: Recurring.UsageType; - } - - namespace Recurring { - type AggregateUsage = - | 'last_during_period' - | 'last_ever' - | 'max' - | 'sum'; - - type Interval = 'day' | 'month' | 'week' | 'year'; - - type UsageType = 'licensed' | 'metered'; - } - - 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; - } - - type TiersMode = 'graduated' | 'volume'; - - interface TransformQuantity { - /** - * Divide usage by this number. - */ - divide_by: number; - - /** - * After division, either round the result `up` or `down`. - */ - round: TransformQuantity.Round; - } - - namespace TransformQuantity { - type Round = 'down' | 'up'; - } - - 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; - } - interface PriceCreateParams { /** * 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). diff --git a/types/Products.d.ts b/types/Products.d.ts index 8cd59db0ec..b4e4b3d96f 100644 --- a/types/Products.d.ts +++ b/types/Products.d.ts @@ -85,6 +85,11 @@ declare module 'stripe' { */ package_dimensions: Product.PackageDimensions | null; + /** + * Provisioning configuration for this product. + */ + provisioning?: Product.Provisioning | null; + /** * Whether this product is shipped (i.e., physical goods). */ @@ -144,6 +149,40 @@ declare module 'stripe' { width: number; } + interface Provisioning { + gift_card: Provisioning.GiftCard | null; + + /** + * The type of provisioning, only `gift_card` currently supported. + */ + type: 'gift_card'; + } + + namespace Provisioning { + interface GiftCard { + fixed_amount: GiftCard.FixedAmount | null; + + /** + * The specific type of gift_card provisioning, only `fixed_amount` currently supported. + */ + type: 'fixed_amount'; + } + + namespace GiftCard { + interface FixedAmount { + /** + * The initial amount with which the provisioned gift card will be created. + */ + amount: 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; + } + } + } + type Type = 'good' | 'service'; } diff --git a/types/ProductsResource.d.ts b/types/ProductsResource.d.ts index d780fefb01..4e651c0f1e 100644 --- a/types/ProductsResource.d.ts +++ b/types/ProductsResource.d.ts @@ -2,210 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * 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. - * They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. - * - * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), - * [share a Payment Link](https://stripe.com/docs/payments/payment-links/overview), - * [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), - * and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) - */ - interface Product { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'product'; - - /** - * Whether the product is currently available for purchase. - */ - active: boolean; - - /** - * A list of up to 5 attributes that each SKU can provide values for (e.g., `["color", "size"]`). - */ - attributes: Array | null; - - /** - * A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of `type=good`. - */ - caption?: string | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * An array of connect application identifiers that cannot purchase this product. Only applicable to products of `type=good`. - */ - deactivate_on?: Array; - - /** - * 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; - - /** - * 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. - */ - description: string | null; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images: Array; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions: Product.PackageDimensions | null; - - /** - * Provisioning configuration for this product. - */ - provisioning?: Product.Provisioning | null; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable: boolean | null; - - /** - * Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. - */ - statement_descriptor?: string | null; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code: string | Stripe.TaxCode | null; - - /** - * The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. - */ - type: Product.Type; - - /** - * A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. - */ - unit_label?: string | null; - - /** - * Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ - updated: number; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url: string | null; - } - - namespace Product { - interface PackageDimensions { - /** - * Height, in inches. - */ - height: number; - - /** - * Length, in inches. - */ - length: number; - - /** - * Weight, in ounces. - */ - weight: number; - - /** - * Width, in inches. - */ - width: number; - } - - interface Provisioning { - gift_card: Provisioning.GiftCard | null; - - /** - * The type of provisioning, only `gift_card` currently supported. - */ - type: 'gift_card'; - } - - namespace Provisioning { - interface GiftCard { - fixed_amount: GiftCard.FixedAmount | null; - - /** - * The specific type of gift_card provisioning, only `fixed_amount` currently supported. - */ - type: 'fixed_amount'; - } - - namespace GiftCard { - interface FixedAmount { - /** - * The initial amount with which the provisioned gift card will be created. - */ - amount: 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; - } - } - } - - 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; - } - interface ProductCreateParams { /** * The product's name, meant to be displayable to the customer. diff --git a/types/QuotePhases.d.ts b/types/QuotePhases.d.ts index a1d17c9208..7ee9c9db36 100644 --- a/types/QuotePhases.d.ts +++ b/types/QuotePhases.d.ts @@ -160,67 +160,5 @@ declare module 'stripe' { } } } - - interface QuotePhaseRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuotePhaseListParams extends PaginationParams { - /** - * The ID of the quote whose phases will be retrieved. - */ - quote: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface QuotePhaseListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class QuotePhasesResource { - /** - * Retrieves the quote phase with the given ID. - */ - retrieve( - id: string, - params?: QuotePhaseRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of quote phases. - */ - list( - params: QuotePhaseListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. - */ - listLineItems( - id: string, - params?: QuotePhaseListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - } } } diff --git a/types/QuotePhasesResource.d.ts b/types/QuotePhasesResource.d.ts new file mode 100644 index 0000000000..dcb1d7133c --- /dev/null +++ b/types/QuotePhasesResource.d.ts @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + interface QuotePhaseRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuotePhaseListParams extends PaginationParams { + /** + * The ID of the quote whose phases will be retrieved. + */ + quote: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface QuotePhaseListLineItemsParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class QuotePhasesResource { + /** + * Retrieves the quote phase with the given ID. + */ + retrieve( + id: string, + params?: QuotePhaseRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of quote phases. + */ + list( + params: QuotePhaseListParams, + options?: RequestOptions + ): ApiListPromise; + + /** + * When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. + */ + listLineItems( + id: string, + params?: QuotePhaseListLineItemsParams, + options?: RequestOptions + ): ApiListPromise; + listLineItems( + id: string, + options?: RequestOptions + ): ApiListPromise; + } + } +} diff --git a/types/Quotes.d.ts b/types/Quotes.d.ts index 68a659a110..f49358e70c 100644 --- a/types/Quotes.d.ts +++ b/types/Quotes.d.ts @@ -418,6 +418,16 @@ declare module 'stripe' { } interface SubscriptionData { + /** + * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time.`prorate_up_front` will bill for all phases within the current billing cycle up front. + */ + billing_behavior?: SubscriptionData.BillingBehavior; + + /** + * Whether the subscription will always start a new billing period when the quote is accepted. + */ + billing_cycle_anchor?: 'reset' | null; + /** * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. */ @@ -428,12 +438,52 @@ declare module 'stripe' { */ effective_date: number | null; + /** + * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. + */ + end_behavior?: SubscriptionData.EndBehavior | null; + + /** + * The id of the subscription schedule that will be updated when the quote is accepted. + */ + from_schedule?: string | Stripe.SubscriptionSchedule | null; + + /** + * The id of the subscription that will be updated when the quote is accepted. + */ + from_subscription?: string | Stripe.Subscription | null; + + /** + * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + */ + prebilling?: SubscriptionData.Prebilling | null; + + /** + * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + */ + proration_behavior?: SubscriptionData.ProrationBehavior; + /** * Integer representing the number of trial period days before the customer is charged for the first time. */ trial_period_days: number | null; } + namespace SubscriptionData { + type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front'; + + type EndBehavior = 'cancel' | 'release'; + + interface Prebilling { + iterations: number; + } + + type ProrationBehavior = + | 'always_invoice' + | 'create_prorations' + | 'none'; + } + interface TotalDetails { /** * This is the sum of all the discounts. diff --git a/types/QuotesResource.d.ts b/types/QuotesResource.d.ts index f7aa69ac88..b6836b3116 100644 --- a/types/QuotesResource.d.ts +++ b/types/QuotesResource.d.ts @@ -2,570 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A Quote is a way to model prices that you'd like to provide to a customer. - * Once accepted, it will automatically create an invoice, subscription or subscription schedule. - */ - interface Quote { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'quote'; - - /** - * Total before any discounts or taxes are applied. - */ - amount_subtotal: number; - - /** - * Total after discounts and taxes are applied. - */ - amount_total: number; - - /** - * ID of the Connect Application that created the quote. - */ - application: - | string - | Stripe.Application - | Stripe.DeletedApplication - | null; - - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. - */ - application_fee_amount: number | null; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. - */ - application_fee_percent: number | null; - - automatic_tax: Quote.AutomaticTax; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. - */ - collection_method: Quote.CollectionMethod; - - computed: Quote.Computed; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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 | null; - - /** - * The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - - /** - * The tax rates applied to this quote. - */ - default_tax_rates?: Array; - - /** - * A description that will be displayed on the quote PDF. - */ - description: string | null; - - /** - * The discounts applied to this quote. - */ - discounts: Array; - - /** - * The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. - */ - expires_at: number; - - /** - * A footer that will be displayed on the quote PDF. - */ - footer: string | null; - - /** - * Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. - */ - from_quote: Quote.FromQuote | null; - - /** - * A header that will be displayed on the quote PDF. - */ - header: string | null; - - /** - * The invoice that was created from this quote. - */ - invoice: string | Stripe.Invoice | Stripe.DeletedInvoice | null; - - /** - * All invoices will be billed using the specified settings. - */ - invoice_settings: Quote.InvoiceSettings | null; - - /** - * A list of items the customer is being quoted for. - */ - line_items?: ApiList; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). - */ - number: string | null; - - /** - * The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * The status of the quote. - */ - status: Quote.Status; - - status_transitions: Quote.StatusTransitions; - - /** - * The subscription that was created or updated from this quote. - */ - subscription: string | Stripe.Subscription | null; - - subscription_data: Quote.SubscriptionData; - - /** - * The subscription schedule that was created or updated from this quote. - */ - subscription_schedule: string | Stripe.SubscriptionSchedule | null; - - /** - * ID of the test clock this quote belongs to. - */ - test_clock: string | Stripe.TestHelpers.TestClock | null; - - total_details: Quote.TotalDetails; - - /** - * The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. - */ - transfer_data: Quote.TransferData | null; - } - - namespace Quote { - interface AutomaticTax { - /** - * Automatically calculate taxes - */ - enabled: boolean; - - /** - * The status of the most recent automated tax calculation for this quote. - */ - status: AutomaticTax.Status | null; - } - - namespace AutomaticTax { - type Status = 'complete' | 'failed' | 'requires_location_inputs'; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Computed { - /** - * The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices. - */ - recurring: Computed.Recurring | null; - - upfront: Computed.Upfront; - } - - namespace Computed { - interface Recurring { - /** - * Total before any discounts or taxes are applied. - */ - amount_subtotal: number; - - /** - * Total after discounts and taxes are applied. - */ - amount_total: number; - - /** - * The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. - */ - interval: Recurring.Interval; - - /** - * The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. - */ - interval_count: number; - - total_details: Recurring.TotalDetails; - } - - namespace Recurring { - type Interval = 'day' | 'month' | 'week' | 'year'; - - interface TotalDetails { - /** - * This is the sum of all the discounts. - */ - amount_discount: number; - - /** - * This is the sum of all the shipping amounts. - */ - amount_shipping: number | null; - - /** - * This is the sum of all the tax amounts. - */ - amount_tax: number; - - breakdown?: TotalDetails.Breakdown; - } - - namespace TotalDetails { - interface Breakdown { - /** - * The aggregated discounts. - */ - discounts: Array; - - /** - * The aggregated tax amounts by rate. - */ - taxes: Array; - } - - namespace Breakdown { - interface Discount { - /** - * The amount discounted. - */ - amount: number; - - /** - * 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). - */ - discount: Stripe.Discount; - } - - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - } - } - - interface Upfront { - /** - * Total before any discounts or taxes are applied. - */ - amount_subtotal: number; - - /** - * Total after discounts and taxes are applied. - */ - amount_total: number; - - /** - * The line items that will appear on the next invoice after this quote is accepted. This does not include pending invoice items that exist on the customer but may still be included in the next invoice. - */ - line_items?: ApiList; - - total_details: Upfront.TotalDetails; - } - - namespace Upfront { - interface TotalDetails { - /** - * This is the sum of all the discounts. - */ - amount_discount: number; - - /** - * This is the sum of all the shipping amounts. - */ - amount_shipping: number | null; - - /** - * This is the sum of all the tax amounts. - */ - amount_tax: number; - - breakdown?: TotalDetails.Breakdown; - } - - namespace TotalDetails { - interface Breakdown { - /** - * The aggregated discounts. - */ - discounts: Array; - - /** - * The aggregated tax amounts by rate. - */ - taxes: Array; - } - - namespace Breakdown { - interface Discount { - /** - * The amount discounted. - */ - amount: number; - - /** - * 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). - */ - discount: Stripe.Discount; - } - - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - } - } - } - - interface FromQuote { - /** - * Whether this quote is a revision of a different quote. - */ - is_revision: boolean; - - /** - * The quote that was cloned. - */ - quote: string | Stripe.Quote; - } - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. - */ - days_until_due: number | null; - } - - type Status = 'accepted' | 'canceled' | 'draft' | 'open'; - - interface StatusTransitions { - /** - * The time that the quote was accepted. Measured in seconds since Unix epoch. - */ - accepted_at: number | null; - - /** - * The time that the quote was canceled. Measured in seconds since Unix epoch. - */ - canceled_at: number | null; - - /** - * The time that the quote was finalized. Measured in seconds since Unix epoch. - */ - finalized_at: number | null; - } - - interface SubscriptionData { - /** - * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time.`prorate_up_front` will bill for all phases within the current billing cycle up front. - */ - billing_behavior?: SubscriptionData.BillingBehavior; - - /** - * Whether the subscription will always start a new billing period when the quote is accepted. - */ - billing_cycle_anchor?: 'reset' | null; - - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description: string | null; - - /** - * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. - */ - effective_date: number | null; - - /** - * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. - */ - end_behavior?: SubscriptionData.EndBehavior | null; - - /** - * The id of the subscription schedule that will be updated when the quote is accepted. - */ - from_schedule?: string | Stripe.SubscriptionSchedule | null; - - /** - * The id of the subscription that will be updated when the quote is accepted. - */ - from_subscription?: string | Stripe.Subscription | null; - - /** - * If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. - */ - prebilling?: SubscriptionData.Prebilling | null; - - /** - * Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. - */ - proration_behavior?: SubscriptionData.ProrationBehavior; - - /** - * Integer representing the number of trial period days before the customer is charged for the first time. - */ - trial_period_days: number | null; - } - - namespace SubscriptionData { - type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front'; - - type EndBehavior = 'cancel' | 'release'; - - interface Prebilling { - iterations: number; - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - } - - interface TotalDetails { - /** - * This is the sum of all the discounts. - */ - amount_discount: number; - - /** - * This is the sum of all the shipping amounts. - */ - amount_shipping: number | null; - - /** - * This is the sum of all the tax amounts. - */ - amount_tax: number; - - breakdown?: TotalDetails.Breakdown; - } - - namespace TotalDetails { - interface Breakdown { - /** - * The aggregated discounts. - */ - discounts: Array; - - /** - * The aggregated tax amounts by rate. - */ - taxes: Array; - } - - namespace Breakdown { - interface Discount { - /** - * The amount discounted. - */ - amount: number; - - /** - * 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). - */ - discount: Stripe.Discount; - } - - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - } - - interface TransferData { - /** - * The amount in %s that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. - */ - amount: number | null; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. - */ - amount_percent: number | null; - - /** - * The account where funds from the payment will be transferred to upon payment success. - */ - destination: string | Stripe.Account; - } - } - interface QuoteCreateParams { /** * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. diff --git a/types/SetupIntents.d.ts b/types/SetupIntents.d.ts index c4795c1881..7678a526da 100644 --- a/types/SetupIntents.d.ts +++ b/types/SetupIntents.d.ts @@ -269,6 +269,8 @@ declare module 'stripe' { } interface NextAction { + cashapp_handle_redirect_or_display_qr_code?: NextAction.CashappHandleRedirectOrDisplayQrCode; + redirect_to_url?: NextAction.RedirectToUrl; /** @@ -285,6 +287,39 @@ declare module 'stripe' { } namespace NextAction { + interface CashappHandleRedirectOrDisplayQrCode { + /** + * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + */ + hosted_instructions_url?: string; + + /** + * The url for mobile redirect based auth + */ + mobile_auth_url?: string; + + qr_code?: CashappHandleRedirectOrDisplayQrCode.QrCode; + } + + namespace CashappHandleRedirectOrDisplayQrCode { + interface QrCode { + /** + * The date (unix timestamp) when the QR code expires. + */ + expires_at?: number; + + /** + * The image_url_png string used to render QR code + */ + image_url_png?: string; + + /** + * The image_url_svg string used to render QR code + */ + image_url_svg?: string; + } + } + interface RedirectToUrl { /** * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. diff --git a/types/SetupIntentsResource.d.ts b/types/SetupIntentsResource.d.ts index 1090367402..1ad41374b6 100644 --- a/types/SetupIntentsResource.d.ts +++ b/types/SetupIntentsResource.d.ts @@ -2,629 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. - * For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - * Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. - * - * Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. - * Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. - * The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides - * you through the setup process. - * - * Successful SetupIntents result in payment credentials that are optimized for future payments. - * For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through - * [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection - * in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). - * If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, - * it will automatically attach the resulting payment method to that Customer. - * We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on - * PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. - * - * By using SetupIntents, you ensure that your customers experience the minimum set of required friction, - * even as regulations change over time. - * - * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). - */ - interface SetupIntent { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'setup_intent'; - - /** - * ID of the Connect application that created the SetupIntent. - */ - application: string | Stripe.Application | null; - - /** - * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - * - * It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - */ - attach_to_self?: boolean; - - /** - * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. - */ - cancellation_reason: SetupIntent.CancellationReason | null; - - /** - * The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. - * - * The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. - */ - client_secret: string | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * ID of the Customer this SetupIntent belongs to, if one exists. - * - * If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description: string | null; - - /** - * Indicates the directions of money movement for which this payment method is intended to be used. - * - * Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. - */ - flow_directions: Array | null; - - /** - * The error encountered in the previous SetupIntent confirmation. - */ - last_setup_error: SetupIntent.LastSetupError | null; - - /** - * The most recent SetupAttempt for this SetupIntent. - */ - latest_attempt: string | Stripe.SetupAttempt | null; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * ID of the multi use Mandate generated by the SetupIntent. - */ - mandate: string | Stripe.Mandate | null; - - /** - * 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. - */ - metadata: Stripe.Metadata | null; - - /** - * If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - */ - next_action: SetupIntent.NextAction | null; - - /** - * The account (if any) for which the setup is intended. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * ID of the payment method used with this SetupIntent. - */ - payment_method: string | Stripe.PaymentMethod | null; - - /** - * Payment-method-specific configuration for this SetupIntent. - */ - payment_method_options: SetupIntent.PaymentMethodOptions | null; - - /** - * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. - */ - payment_method_types: Array; - - /** - * ID of the single_use Mandate generated by the SetupIntent. - */ - single_use_mandate: string | Stripe.Mandate | null; - - /** - * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. - */ - status: SetupIntent.Status; - - /** - * Indicates how the payment method is intended to be used in the future. - * - * Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. - */ - usage: string; - } - - namespace SetupIntent { - type CancellationReason = - | 'abandoned' - | 'duplicate' - | 'requested_by_customer'; - - type FlowDirection = 'inbound' | 'outbound'; - - interface LastSetupError { - /** - * For card errors, the ID of the failed charge. - */ - charge?: string; - - /** - * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. - */ - code?: string; - - /** - * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. - */ - decline_code?: string; - - /** - * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. - */ - doc_url?: string; - - /** - * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. - */ - message?: string; - - /** - * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. - */ - param?: string; - - /** - * A PaymentIntent guides you through the process of collecting a payment from your customer. - * We recommend that you create exactly one PaymentIntent for each order or - * customer session in your system. You can reference the PaymentIntent later to - * see the history of payment attempts for a particular session. - * - * A PaymentIntent transitions through - * [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) - * throughout its lifetime as it interfaces with Stripe.js to perform - * authentication flows and ultimately creates at most one successful charge. - * - * Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). - */ - payment_intent?: Stripe.PaymentIntent; - - /** - * PaymentMethod objects represent your customer's payment instruments. - * You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to - * Customer objects to store instrument details for future payments. - * - * Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). - */ - payment_method?: Stripe.PaymentMethod; - - /** - * If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. - */ - payment_method_type?: string; - - /** - * A URL to the request log entry in your dashboard. - */ - request_log_url?: string; - - /** - * A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. - * For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - * Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. - * - * Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. - * Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. - * The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides - * you through the setup process. - * - * Successful SetupIntents result in payment credentials that are optimized for future payments. - * For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through - * [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection - * in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). - * If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, - * it will automatically attach the resulting payment method to that Customer. - * We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on - * PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. - * - * By using SetupIntents, you ensure that your customers experience the minimum set of required friction, - * even as regulations change over time. - * - * Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). - */ - setup_intent?: Stripe.SetupIntent; - - source?: Stripe.CustomerSource; - - /** - * The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` - */ - type: LastSetupError.Type; - } - - namespace LastSetupError { - type Type = - | 'api_error' - | 'card_error' - | 'idempotency_error' - | 'invalid_request_error'; - } - - interface NextAction { - cashapp_handle_redirect_or_display_qr_code?: NextAction.CashappHandleRedirectOrDisplayQrCode; - - redirect_to_url?: NextAction.RedirectToUrl; - - /** - * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - */ - type: string; - - /** - * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. - */ - use_stripe_sdk?: NextAction.UseStripeSdk; - - verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits; - } - - namespace NextAction { - interface CashappHandleRedirectOrDisplayQrCode { - /** - * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. - */ - hosted_instructions_url?: string; - - /** - * The url for mobile redirect based auth - */ - mobile_auth_url?: string; - - qr_code?: CashappHandleRedirectOrDisplayQrCode.QrCode; - } - - namespace CashappHandleRedirectOrDisplayQrCode { - interface QrCode { - /** - * The date (unix timestamp) when the QR code expires. - */ - expires_at?: number; - - /** - * The image_url_png string used to render QR code - */ - image_url_png?: string; - - /** - * The image_url_svg string used to render QR code - */ - image_url_svg?: string; - } - } - - interface RedirectToUrl { - /** - * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - */ - return_url: string | null; - - /** - * The URL you must redirect your customer to in order to authenticate. - */ - url: string | null; - } - - interface UseStripeSdk {} - - interface VerifyWithMicrodeposits { - /** - * The timestamp when the microdeposits are expected to land. - */ - arrival_date: number; - - /** - * The URL for the hosted verification page, which allows customers to verify their bank account. - */ - hosted_verification_url: string; - - /** - * The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. - */ - microdeposit_type: VerifyWithMicrodeposits.MicrodepositType | null; - } - - namespace VerifyWithMicrodeposits { - type MicrodepositType = 'amounts' | 'descriptor_code'; - } - } - - interface PaymentMethodOptions { - acss_debit?: PaymentMethodOptions.AcssDebit; - - blik?: PaymentMethodOptions.Blik; - - card?: PaymentMethodOptions.Card; - - link?: PaymentMethodOptions.Link; - - sepa_debit?: PaymentMethodOptions.SepaDebit; - - us_bank_account?: PaymentMethodOptions.UsBankAccount; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Currency supported by the bank account - */ - currency: AcssDebit.Currency | null; - - mandate_options?: AcssDebit.MandateOptions; - - /** - * Bank account verification method. - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - type Currency = 'cad' | 'usd'; - - interface MandateOptions { - /** - * A URL for custom mandate text - */ - custom_mandate_url?: string; - - /** - * List of Stripe products where this mandate can be selected automatically. - */ - default_for?: Array; - - /** - * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description: string | null; - - /** - * Payment schedule for the mandate. - */ - payment_schedule: MandateOptions.PaymentSchedule | null; - - /** - * Transaction type of the mandate. - */ - transaction_type: MandateOptions.TransactionType | null; - } - - namespace MandateOptions { - type DefaultFor = 'invoice' | 'subscription'; - - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Blik { - mandate_options?: Blik.MandateOptions; - } - - namespace Blik { - interface MandateOptions { - /** - * Date at which the mandate expires. - */ - expires_after: number | null; - - off_session?: MandateOptions.OffSession; - - /** - * Type of the mandate. - */ - type: MandateOptions.Type | null; - } - - namespace MandateOptions { - interface OffSession { - /** - * Amount of each recurring payment. - */ - amount: number | null; - - /** - * Currency of each recurring payment. - */ - currency: string | null; - - /** - * Frequency interval of each recurring payment. - */ - interval: OffSession.Interval | null; - - /** - * Frequency indicator of each recurring payment. - */ - interval_count: number | null; - } - - namespace OffSession { - type Interval = 'day' | 'month' | 'week' | 'year'; - } - - type Type = 'off_session' | 'on_session'; - } - } - - interface Card { - /** - * Configuration options for setting up an eMandate for cards issued in India. - */ - mandate_options: Card.MandateOptions | null; - - /** - * Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. - */ - network: Card.Network | null; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure: Card.RequestThreeDSecure | null; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType; - - /** - * 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; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description: string | null; - - /** - * End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. - */ - end_date: number | null; - - /** - * Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. - */ - interval: MandateOptions.Interval; - - /** - * The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. - */ - interval_count: number | null; - - /** - * Unique identifier for the mandate or subscription. - */ - reference: string; - - /** - * Start date of the mandate or subscription. Start date should not be lesser than yesterday. - */ - start_date: number; - - /** - * Specifies the type of mandates supported. Possible values are `india`. - */ - supported_types: Array<'india'> | null; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - - type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only'; - } - - interface Link { - /** - * Token used for persistent Link logins. - */ - persistent_token: string | null; - } - - interface SepaDebit { - mandate_options?: SepaDebit.MandateOptions; - } - - namespace SepaDebit { - interface MandateOptions {} - } - - interface UsBankAccount { - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Bank account verification method. - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. The `payment_method` permission must be included. - */ - permissions?: Array; - - /** - * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ - return_url?: string; - } - - namespace FinancialConnections { - type Permission = - | 'balances' - | 'ownership' - | 'payment_method' - | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type Status = - | 'canceled' - | 'processing' - | 'requires_action' - | 'requires_confirmation' - | 'requires_payment_method' - | 'succeeded'; - } - interface SetupIntentCreateParams { /** * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. diff --git a/types/SubscriptionItems.d.ts b/types/SubscriptionItems.d.ts index 4142d82946..67df585f35 100644 --- a/types/SubscriptionItems.d.ts +++ b/types/SubscriptionItems.d.ts @@ -29,6 +29,11 @@ declare module 'stripe' { deleted?: void; + /** + * The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + */ + discounts?: Array | null; + /** * 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. */ @@ -70,6 +75,11 @@ declare module 'stripe' { * The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. */ tax_rates: Array | null; + + /** + * Options that configure the trial on the subscription item. + */ + trial?: SubscriptionItem.Trial | null; } namespace SubscriptionItem { @@ -79,6 +89,19 @@ declare module 'stripe' { */ usage_gte: number | null; } + + interface Trial { + /** + * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + */ + converts_to?: Array | null; + + type: Trial.Type; + } + + namespace Trial { + type Type = 'free' | 'paid'; + } } /** diff --git a/types/SubscriptionItemsResource.d.ts b/types/SubscriptionItemsResource.d.ts index bd067fc11a..16d6db094f 100644 --- a/types/SubscriptionItemsResource.d.ts +++ b/types/SubscriptionItemsResource.d.ts @@ -2,128 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * Subscription items allow you to create customer subscriptions with more than - * one plan, making it easy to represent complex billing relationships. - */ - interface SubscriptionItem { - /** - * 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'; - - /** - * Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period - */ - billing_thresholds: SubscriptionItem.BillingThresholds | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - deleted?: void; - - /** - * The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. - */ - discounts?: Array | null; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * 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. - * - * Plans define the base price, currency, and billing cycle for recurring purchases of products. - * [Products](https://stripe.com/docs/api#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. - * - * For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. - * - * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). - */ - plan: Stripe.Plan; - - /** - * 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. - * - * For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. - * - * Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). - */ - price: Stripe.Price; - - /** - * The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. - */ - quantity?: number; - - /** - * The `subscription` this `subscription_item` belongs to. - */ - subscription: string; - - /** - * The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. - */ - tax_rates: Array | null; - - /** - * Options that configure the trial on the subscription item. - */ - trial?: SubscriptionItem.Trial | null; - } - - namespace SubscriptionItem { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to create an invoice - */ - usage_gte: number | null; - } - - interface Trial { - /** - * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. - */ - converts_to?: Array | null; - - type: Trial.Type; - } - - namespace Trial { - type Type = 'free' | 'paid'; - } - } - - /** - * 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; - } - interface SubscriptionItemCreateParams { /** * The identifier of the subscription to modify. @@ -539,6 +417,39 @@ declare module 'stripe' { type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; } + interface UsageRecordCreateParams { + /** + * The usage quantity for the specified timestamp. + */ + quantity: number; + + /** + * Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. + */ + action?: UsageRecordCreateParams.Action; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. + */ + timestamp?: 'now' | number; + } + + namespace UsageRecordCreateParams { + type Action = 'increment' | 'set'; + } + + interface UsageRecordSummaryListParams extends PaginationParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + class SubscriptionItemsResource { /** * Adds a new item to an existing subscription. No existing items will be changed or replaced. diff --git a/types/SubscriptionSchedules.d.ts b/types/SubscriptionSchedules.d.ts index e309b2bf9c..72b1ddbe99 100644 --- a/types/SubscriptionSchedules.d.ts +++ b/types/SubscriptionSchedules.d.ts @@ -27,6 +27,11 @@ declare module 'stripe' { | Stripe.DeletedApplication | null; + /** + * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time.`prorate_up_front` will bill for all phases within the current billing cycle up front. + */ + billing_behavior?: SubscriptionSchedule.BillingBehavior; + /** * Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. */ @@ -74,6 +79,11 @@ declare module 'stripe' { */ phases: Array; + /** + * Time period and invoice for a Subscription billed in advance. + */ + prebilling?: SubscriptionSchedule.Prebilling | null; + /** * Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. */ @@ -101,6 +111,8 @@ declare module 'stripe' { } namespace SubscriptionSchedule { + type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front'; + interface CurrentPhase { /** * The end of this phase of the subscription schedule. @@ -261,6 +273,11 @@ declare module 'stripe' { */ description: string | null; + /** + * The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + */ + discounts?: Array | null; + /** * The end of this phase of the subscription schedule. */ @@ -301,14 +318,29 @@ declare module 'stripe' { */ transfer_data: Phase.TransferData | null; + /** + * Specify behavior of the trial when crossing schedule phase boundaries + */ + trial_continuation?: Phase.TrialContinuation | null; + /** * When the trial ends within the phase. */ trial_end: number | null; + + /** + * Settings related to any trials on the subscription during this phase. + */ + trial_settings?: Phase.TrialSettings | null; } namespace Phase { interface AddInvoiceItem { + /** + * The stackable discounts that will be applied to the item. + */ + discounts?: Array | null; + /** * ID of the price used to generate the invoice item. */ @@ -325,6 +357,39 @@ declare module 'stripe' { tax_rates?: Array | null; } + namespace AddInvoiceItem { + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon: string | Stripe.Coupon | null; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount: string | Stripe.Discount | null; + + /** + * Details to determine how long the discount should be applied for. + */ + discount_end?: Discount.DiscountEnd | null; + } + + namespace Discount { + interface DiscountEnd { + /** + * The discount end timestamp + */ + timestamp: number | null; + + /** + * The discount end type + */ + type: 'timestamp'; + } + } + } + interface AutomaticTax { /** * Whether Stripe automatically computes tax on invoices created during this phase. @@ -348,6 +413,37 @@ declare module 'stripe' { type CollectionMethod = 'charge_automatically' | 'send_invoice'; + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon: string | Stripe.Coupon | null; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount: string | Stripe.Discount | null; + + /** + * Details to determine how long the discount should be applied for. + */ + discount_end?: Discount.DiscountEnd | null; + } + + namespace Discount { + interface DiscountEnd { + /** + * The discount end timestamp + */ + timestamp: number | null; + + /** + * The discount end type + */ + type: 'timestamp'; + } + } + interface InvoiceSettings { /** * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. @@ -361,6 +457,11 @@ declare module 'stripe' { */ billing_thresholds: Item.BillingThresholds | null; + /** + * The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + */ + discounts?: Array | null; + /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. */ @@ -385,6 +486,11 @@ declare module 'stripe' { * The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. */ tax_rates?: Array | null; + + /** + * Options that configure the trial on the subscription item. + */ + trial?: Item.Trial | null; } namespace Item { @@ -394,6 +500,50 @@ declare module 'stripe' { */ usage_gte: number | null; } + + interface Discount { + /** + * ID of the coupon to create a new discount for. + */ + coupon: string | Stripe.Coupon | null; + + /** + * ID of an existing discount on the object (or one of its ancestors) to reuse. + */ + discount: string | Stripe.Discount | null; + + /** + * Details to determine how long the discount should be applied for. + */ + discount_end?: Discount.DiscountEnd | null; + } + + namespace Discount { + interface DiscountEnd { + /** + * The discount end timestamp + */ + timestamp: number | null; + + /** + * The discount end type + */ + type: 'timestamp'; + } + } + + interface Trial { + /** + * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + */ + converts_to?: Array | null; + + type: Trial.Type; + } + + namespace Trial { + type Type = 'free' | 'paid'; + } } type ProrationBehavior = @@ -412,6 +562,45 @@ declare module 'stripe' { */ destination: string | Stripe.Account; } + + type TrialContinuation = 'continue' | 'none'; + + interface TrialSettings { + /** + * Defines how the subscription should behaves when a trial ensd. + */ + end_behavior: TrialSettings.EndBehavior | null; + } + + namespace TrialSettings { + interface EndBehavior { + /** + * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + */ + prorate_up_front: EndBehavior.ProrateUpFront | null; + } + + namespace EndBehavior { + type ProrateUpFront = 'defer' | 'include'; + } + } + } + + interface Prebilling { + /** + * ID of the prebilling invoice. + */ + invoice: string | Stripe.Invoice; + + /** + * The end of the last period for which the invoice pre-bills. + */ + period_end: number; + + /** + * The start of the first period for which the invoice pre-bills. + */ + period_start: number; } type Status = diff --git a/types/SubscriptionSchedulesResource.d.ts b/types/SubscriptionSchedulesResource.d.ts index 6f3a990c3a..69f0428e49 100644 --- a/types/SubscriptionSchedulesResource.d.ts +++ b/types/SubscriptionSchedulesResource.d.ts @@ -2,558 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. - * - * Related guide: [Subscription Schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). - */ - interface SubscriptionSchedule { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'subscription_schedule'; - - /** - * ID of the Connect Application that created the schedule. - */ - application: - | string - | Stripe.Application - | Stripe.DeletedApplication - | null; - - /** - * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time.`prorate_up_front` will bill for all phases within the current billing cycle up front. - */ - billing_behavior?: SubscriptionSchedule.BillingBehavior; - - /** - * Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. - */ - canceled_at: number | null; - - /** - * Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. - */ - completed_at: number | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. - */ - current_phase: SubscriptionSchedule.CurrentPhase | null; - - /** - * ID of the customer who owns the subscription schedule. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer; - - default_settings: SubscriptionSchedule.DefaultSettings; - - /** - * Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` and `cancel`. - */ - end_behavior: SubscriptionSchedule.EndBehavior; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata | null; - - /** - * Configuration for the subscription schedule's phases. - */ - phases: Array; - - /** - * Time period and invoice for a Subscription billed in advance. - */ - prebilling?: SubscriptionSchedule.Prebilling | null; - - /** - * Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. - */ - released_at: number | null; - - /** - * ID of the subscription once managed by the subscription schedule (if it is released). - */ - released_subscription: string | null; - - /** - * The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). - */ - status: SubscriptionSchedule.Status; - - /** - * ID of the subscription managed by the subscription schedule. - */ - subscription: string | Stripe.Subscription | null; - - /** - * ID of the test clock this subscription schedule belongs to. - */ - test_clock: string | Stripe.TestHelpers.TestClock | null; - } - - namespace SubscriptionSchedule { - type BillingBehavior = 'prorate_on_next_phase' | 'prorate_up_front'; - - interface CurrentPhase { - /** - * The end of this phase of the subscription schedule. - */ - end_date: number; - - /** - * The start of this phase of the subscription schedule. - */ - start_date: number; - } - - interface DefaultSettings { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account during this phase of the schedule. - */ - application_fee_percent: number | null; - - automatic_tax?: DefaultSettings.AutomaticTax; - - /** - * Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor: DefaultSettings.BillingCycleAnchor; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - */ - billing_thresholds: DefaultSettings.BillingThresholds | null; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - */ - collection_method: DefaultSettings.CollectionMethod | null; - - /** - * ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. - */ - default_payment_method: string | Stripe.PaymentMethod | null; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description: string | null; - - /** - * The subscription schedule's default invoice settings. - */ - invoice_settings: DefaultSettings.InvoiceSettings | null; - - /** - * The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - */ - transfer_data: DefaultSettings.TransferData | null; - } - - namespace DefaultSettings { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on invoices created during this phase. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to create an invoice - */ - amount_gte: number | null; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - */ - reset_billing_cycle_anchor: boolean | null; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due: number | null; - } - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent: number | null; - - /** - * The account where funds from the payment will be transferred to upon payment success. - */ - destination: string | Stripe.Account; - } - } - - type EndBehavior = 'cancel' | 'none' | 'release' | 'renew'; - - interface Phase { - /** - * A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - */ - add_invoice_items: Array; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account during this phase of the schedule. - */ - application_fee_percent: number | null; - - automatic_tax?: Phase.AutomaticTax; - - /** - * Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - */ - billing_cycle_anchor: Phase.BillingCycleAnchor | null; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - */ - billing_thresholds: Phase.BillingThresholds | null; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - */ - collection_method: Phase.CollectionMethod | null; - - /** - * ID of the coupon to use during this phase of the subscription schedule. - */ - 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. - */ - default_payment_method: string | Stripe.PaymentMethod | null; - - /** - * The default tax rates to apply to the subscription during this phase of the subscription schedule. - */ - default_tax_rates?: Array | null; - - /** - * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. - */ - description: string | null; - - /** - * The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. - */ - discounts?: Array | null; - - /** - * The end of this phase of the subscription schedule. - */ - end_date: number; - - /** - * The invoice settings applicable during this phase. - */ - invoice_settings: Phase.InvoiceSettings | null; - - /** - * Subscription items to configure the subscription to during this phase of the subscription schedule. - */ - items: Array; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. - */ - metadata: Stripe.Metadata | null; - - /** - * The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. - */ - proration_behavior: Phase.ProrationBehavior; - - /** - * The start of this phase of the subscription schedule. - */ - start_date: number; - - /** - * The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - */ - transfer_data: Phase.TransferData | null; - - /** - * Specify behavior of the trial when crossing schedule phase boundaries - */ - trial_continuation?: Phase.TrialContinuation | null; - - /** - * When the trial ends within the phase. - */ - trial_end: number | null; - - /** - * Settings related to any trials on the subscription during this phase. - */ - trial_settings?: Phase.TrialSettings | null; - } - - namespace Phase { - interface AddInvoiceItem { - /** - * The stackable discounts that will be applied to the item. - */ - discounts?: Array | null; - - /** - * ID of the price used to generate the invoice item. - */ - price: string | Stripe.Price | Stripe.DeletedPrice; - - /** - * The quantity of the invoice item. - */ - quantity: number | null; - - /** - * The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. - */ - tax_rates?: Array | null; - } - - namespace AddInvoiceItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon: string | Stripe.Coupon | null; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount: string | Stripe.Discount | null; - } - } - - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on invoices created during this phase. - */ - enabled: boolean; - } - - type BillingCycleAnchor = 'automatic' | 'phase_start'; - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to create an invoice - */ - amount_gte: number | null; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - */ - reset_billing_cycle_anchor: boolean | null; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon: string | Stripe.Coupon | null; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount: string | Stripe.Discount | null; - } - - interface InvoiceSettings { - /** - * Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. - */ - days_until_due: number | null; - } - - interface Item { - /** - * Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period - */ - billing_thresholds: Item.BillingThresholds | null; - - /** - * The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. - */ - discounts?: Array | null; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. - */ - metadata?: Stripe.Metadata | null; - - /** - * ID of the plan to which the customer should be subscribed. - */ - plan: string | Stripe.Plan | Stripe.DeletedPlan; - - /** - * ID of the price to which the customer should be subscribed. - */ - price: string | Stripe.Price | Stripe.DeletedPrice; - - /** - * Quantity of the plan to which the customer should be subscribed. - */ - quantity?: number; - - /** - * The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. - */ - tax_rates?: Array | null; - - /** - * Options that configure the trial on the subscription item. - */ - trial?: Item.Trial | null; - } - - namespace Item { - interface BillingThresholds { - /** - * Usage threshold that triggers the subscription to create an invoice - */ - usage_gte: number | null; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon: string | Stripe.Coupon | null; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount: string | Stripe.Discount | null; - } - - interface Trial { - /** - * List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. - */ - converts_to?: Array | null; - - type: Trial.Type; - } - - namespace Trial { - type Type = 'free' | 'paid'; - } - } - - type ProrationBehavior = - | 'always_invoice' - | 'create_prorations' - | 'none'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent: number | null; - - /** - * The account where funds from the payment will be transferred to upon payment success. - */ - destination: string | Stripe.Account; - } - - type TrialContinuation = 'continue' | 'none'; - - interface TrialSettings { - /** - * Defines how the subscription should behaves when a trial ensd. - */ - end_behavior: TrialSettings.EndBehavior | null; - } - - namespace TrialSettings { - interface EndBehavior { - /** - * Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. - */ - prorate_up_front: EndBehavior.ProrateUpFront | null; - } - - namespace EndBehavior { - type ProrateUpFront = 'defer' | 'include'; - } - } - } - - interface Prebilling { - /** - * ID of the prebilling invoice. - */ - invoice: string | Stripe.Invoice; - - /** - * The end of the last period for which the invoice pre-bills. - */ - period_end: number; - - /** - * The start of the first period for which the invoice pre-bills. - */ - period_start: number; - } - - type Status = - | 'active' - | 'canceled' - | 'completed' - | 'not_started' - | 'released'; - } - interface SubscriptionScheduleCreateParams { /** * Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time.`prorate_up_front` will bill for all phases within the current billing cycle up front. @@ -1872,6 +1320,12 @@ declare module 'stripe' { */ expand?: Array; + /** + * In cases where the amendment changes the currently active phase, + * specifies if and how to prorate at the time of the request. + */ + proration_behavior?: SubscriptionScheduleAmendParams.ProrationBehavior; + /** * Changes to apply to the subscription schedule. */ @@ -1905,6 +1359,11 @@ declare module 'stripe' { */ item_actions?: Array; + /** + * Instructions for how to modify phase metadata + */ + metadata_actions?: Array; + /** * Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`. */ @@ -2295,6 +1754,36 @@ declare module 'stripe' { type Type = 'add' | 'remove' | 'set'; } + interface MetadataAction { + /** + * Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata. + */ + add?: { + [key: string]: string; + }; + + /** + * Keys to remove from schedule phase metadata. + */ + remove?: Array; + + /** + * Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten. + */ + set?: Stripe.Emptyable<{ + [key: string]: string; + }>; + + /** + * Select one of three ways to update phase-level `metadata` on subscription schedules. + */ + type: MetadataAction.Type; + } + + namespace MetadataAction { + type Type = 'add' | 'remove' | 'set'; + } + type ProrationBehavior = | 'always_invoice' | 'create_prorations' @@ -2321,6 +1810,8 @@ declare module 'stripe' { } } + type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none'; + interface ScheduleSettings { /** * Configures how the subscription schedule behaves when it ends. diff --git a/types/Subscriptions.d.ts b/types/Subscriptions.d.ts index b0644e7d07..4217a9877d 100644 --- a/types/Subscriptions.d.ts +++ b/types/Subscriptions.d.ts @@ -119,6 +119,11 @@ declare module 'stripe' { */ discount: Stripe.Discount | null; + /** + * The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + */ + discounts?: Array | null; + /** * If the subscription has ended, the date the subscription ended. */ @@ -179,6 +184,11 @@ declare module 'stripe' { */ pending_update: Subscription.PendingUpdate | null; + /** + * Time period and invoice for a Subscription billed in advance. + */ + prebilling?: Subscription.Prebilling | null; + /** * The schedule attached to the subscription */ @@ -512,6 +522,11 @@ declare module 'stripe' { */ expires_at: number; + /** + * The number of iterations of prebilling to apply. + */ + prebilling_iterations?: number | null; + /** * List of subscription items, each with an attached plan, that will be set if the update is applied. */ @@ -528,6 +543,23 @@ declare module 'stripe' { trial_from_plan: boolean | null; } + interface Prebilling { + /** + * ID of the prebilling invoice. + */ + invoice: string | Stripe.Invoice; + + /** + * The end of the last period for which the invoice pre-bills. + */ + period_end: number; + + /** + * The start of the first period for which the invoice pre-bills. + */ + period_start: number; + } + type Status = | 'active' | 'canceled' diff --git a/types/SubscriptionsResource.d.ts b/types/SubscriptionsResource.d.ts index adb26db704..bbe9640a5f 100644 --- a/types/SubscriptionsResource.d.ts +++ b/types/SubscriptionsResource.d.ts @@ -2,586 +2,6 @@ declare module 'stripe' { namespace Stripe { - /** - * Subscriptions allow you to charge a customer on a recurring basis. - * - * Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). - */ - interface Subscription { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'subscription'; - - /** - * ID of the Connect Application that created the subscription. - */ - application: - | string - | Stripe.Application - | Stripe.DeletedApplication - | null; - - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. - */ - application_fee_percent: number | null; - - automatic_tax: Subscription.AutomaticTax; - - /** - * Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. - */ - billing_cycle_anchor: number; - - /** - * Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - */ - billing_thresholds: Subscription.BillingThresholds | null; - - /** - * A date in the future at which the subscription will automatically get canceled - */ - cancel_at: number | null; - - /** - * If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. - */ - cancel_at_period_end: boolean; - - /** - * If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - */ - canceled_at: number | null; - - /** - * Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - */ - collection_method: Subscription.CollectionMethod; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - 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. - */ - current_period_end: number; - - /** - * Start of the current period that the subscription has been invoiced for. - */ - current_period_start: number; - - /** - * ID of the customer who owns the subscription. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer; - - /** - * Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`. - */ - days_until_due: number | null; - - /** - * ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_payment_method: string | Stripe.PaymentMethod | null; - - /** - * ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - */ - default_source: string | Stripe.CustomerSource | null; - - /** - * The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. - */ - default_tax_rates?: Array | null; - - /** - * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - */ - description: string | null; - - /** - * Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. - */ - discount: Stripe.Discount | null; - - /** - * The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. - */ - discounts?: Array | null; - - /** - * If the subscription has ended, the date the subscription ended. - */ - ended_at: number | null; - - /** - * List of subscription items, each with an attached price. - */ - items: ApiList; - - /** - * The most recent invoice this subscription has generated. - */ - latest_invoice: string | Stripe.Invoice | null; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. - */ - next_pending_invoice_item_invoice: number | null; - - /** - * The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. - */ - on_behalf_of: string | Stripe.Account | null; - - /** - * If specified, payment collection for this subscription will be paused. - */ - pause_collection: Subscription.PauseCollection | null; - - /** - * Payment settings passed on to invoices created by the subscription. - */ - payment_settings: Subscription.PaymentSettings | null; - - /** - * Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - */ - pending_invoice_item_interval: Subscription.PendingInvoiceItemInterval | null; - - /** - * You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). - */ - pending_setup_intent: string | Stripe.SetupIntent | null; - - /** - * If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. - */ - pending_update: Subscription.PendingUpdate | null; - - /** - * Time period and invoice for a Subscription billed in advance. - */ - prebilling?: Subscription.Prebilling | null; - - /** - * The schedule attached to the subscription - */ - schedule: string | Stripe.SubscriptionSchedule | null; - - /** - * Date when the subscription was first created. The date might differ from the `created` date due to backdating. - */ - start_date: number; - - /** - * Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. - * - * For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal state, the open invoice will be voided and no further invoices will be generated. - * - * A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - * - * If subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts. - * - * If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. - */ - status: Subscription.Status; - - /** - * ID of the test clock this subscription belongs to. - */ - test_clock: string | Stripe.TestHelpers.TestClock | null; - - /** - * The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - */ - transfer_data: Subscription.TransferData | null; - - /** - * If the subscription has a trial, the end of that trial. - */ - trial_end: number | null; - - /** - * If the subscription has a trial, the beginning of that trial. - */ - trial_start: number | null; - } - - namespace Subscription { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this subscription. - */ - enabled: boolean; - } - - interface BillingThresholds { - /** - * Monetary threshold that triggers the subscription to create an invoice - */ - amount_gte: number | null; - - /** - * Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - */ - reset_billing_cycle_anchor: boolean | null; - } - - type CollectionMethod = 'charge_automatically' | 'send_invoice'; - - interface PauseCollection { - /** - * The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. - */ - behavior: PauseCollection.Behavior; - - /** - * The time after which the subscription will resume collecting payments. - */ - resumes_at: number | null; - } - - namespace PauseCollection { - type Behavior = 'keep_as_draft' | 'mark_uncollectible' | 'void'; - } - - interface PaymentSettings { - /** - * Payment-method-specific configuration to provide to invoices created by the subscription. - */ - payment_method_options: PaymentSettings.PaymentMethodOptions | null; - - /** - * The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - */ - payment_method_types: Array | null; - - /** - * Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - */ - save_default_payment_method: PaymentSettings.SaveDefaultPaymentMethod | null; - } - - namespace PaymentSettings { - interface PaymentMethodOptions { - /** - * This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. - */ - acss_debit: PaymentMethodOptions.AcssDebit | null; - - /** - * This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. - */ - bancontact: PaymentMethodOptions.Bancontact | null; - - /** - * This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. - */ - card: PaymentMethodOptions.Card | null; - - /** - * This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. - */ - customer_balance: PaymentMethodOptions.CustomerBalance | null; - - /** - * This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. - */ - konbini: PaymentMethodOptions.Konbini | null; - - /** - * This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. - */ - us_bank_account: PaymentMethodOptions.UsBankAccount | null; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - mandate_options?: AcssDebit.MandateOptions; - - /** - * Bank account verification method. - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * Transaction type of the mandate. - */ - transaction_type: MandateOptions.TransactionType | null; - } - - namespace MandateOptions { - type TransactionType = 'business' | 'personal'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language: Bancontact.PreferredLanguage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - } - - interface Card { - mandate_options?: Card.MandateOptions; - - /** - * Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. - */ - network: Card.Network | null; - - /** - * We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - */ - request_three_d_secure: Card.RequestThreeDSecure | null; - } - - namespace Card { - interface MandateOptions { - /** - * Amount to be charged for future payments. - */ - amount: number | null; - - /** - * One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. - */ - amount_type: MandateOptions.AmountType | null; - - /** - * A description of the mandate or subscription that is meant to be displayed to the customer. - */ - description: string | null; - } - - namespace MandateOptions { - type AmountType = 'fixed' | 'maximum'; - } - - type Network = - | 'amex' - | 'cartes_bancaires' - | 'diners' - | 'discover' - | 'interac' - | 'jcb' - | 'mastercard' - | 'unionpay' - | 'unknown' - | 'visa'; - - type RequestThreeDSecure = 'any' | 'automatic'; - } - - interface CustomerBalance { - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type: 'bank_transfer' | null; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: string | null; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: EuBankTransfer.Country; - } - - namespace EuBankTransfer { - type Country = 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; - } - } - } - - interface Konbini {} - - interface UsBankAccount { - financial_connections?: UsBankAccount.FinancialConnections; - - /** - * Bank account verification method. - */ - verification_method?: UsBankAccount.VerificationMethod; - } - - namespace UsBankAccount { - interface FinancialConnections { - /** - * The list of permissions to request. The `payment_method` permission must be included. - */ - permissions?: Array; - } - - namespace FinancialConnections { - type Permission = 'balances' | 'payment_method' | 'transactions'; - } - - type VerificationMethod = 'automatic' | 'instant' | 'microdeposits'; - } - } - - type PaymentMethodType = - | 'ach_credit_transfer' - | 'ach_debit' - | 'acss_debit' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'boleto' - | 'card' - | 'customer_balance' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'konbini' - | 'link' - | 'paynow' - | 'promptpay' - | 'sepa_credit_transfer' - | 'sepa_debit' - | 'sofort' - | 'us_bank_account' - | 'wechat_pay'; - - type SaveDefaultPaymentMethod = 'off' | 'on_subscription'; - } - - interface PendingInvoiceItemInterval { - /** - * Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. - */ - interval: PendingInvoiceItemInterval.Interval; - - /** - * The number of intervals between invoices. 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 PendingInvoiceItemInterval { - type Interval = 'day' | 'month' | 'week' | 'year'; - } - - interface PendingUpdate { - /** - * If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. - */ - billing_cycle_anchor: number | null; - - /** - * The point after which the changes reflected by this update will be discarded and no longer applied. - */ - expires_at: number; - - /** - * The number of iterations of prebilling to apply. - */ - prebilling_iterations?: number | null; - - /** - * List of subscription items, each with an attached plan, that will be set if the update is applied. - */ - subscription_items: Array | null; - - /** - * Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. - */ - trial_end: number | null; - - /** - * Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - */ - trial_from_plan: boolean | null; - } - - interface Prebilling { - /** - * ID of the prebilling invoice. - */ - invoice: string | Stripe.Invoice; - - /** - * The end of the last period for which the invoice pre-bills. - */ - period_end: number; - - /** - * The start of the first period for which the invoice pre-bills. - */ - period_start: number; - } - - type Status = - | 'active' - | 'canceled' - | 'incomplete' - | 'incomplete_expired' - | 'past_due' - | 'trialing' - | 'unpaid'; - - interface TransferData { - /** - * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. - */ - amount_percent: number | null; - - /** - * The account where funds from the payment will be transferred to upon payment success. - */ - destination: string | Stripe.Account; - } - } - interface SubscriptionCreateParams { /** * The identifier of the customer to subscribe. diff --git a/types/Terminal/Readers.d.ts b/types/Terminal/Readers.d.ts index a6924eedd9..4ae88bafc4 100644 --- a/types/Terminal/Readers.d.ts +++ b/types/Terminal/Readers.d.ts @@ -94,6 +94,11 @@ declare module 'stripe' { */ process_setup_intent?: Action.ProcessSetupIntent; + /** + * Represents a reader action to refund a payment + */ + refund_payment?: Action.RefundPayment; + /** * Represents a reader action to set the reader display */ @@ -158,6 +163,47 @@ declare module 'stripe' { setup_intent: string | Stripe.SetupIntent; } + interface RefundPayment { + /** + * The amount being refunded. + */ + amount?: number; + + /** + * Charge that is being refunded. + */ + charge?: string | Stripe.Charge; + + /** + * Payment intent that is being refunded. + */ + payment_intent?: string | Stripe.PaymentIntent; + + /** + * The reason for the refund. + */ + reason?: RefundPayment.Reason; + + /** + * Unique identifier for the refund object. + */ + refund?: string | Stripe.Refund; + + /** + * Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + */ + refund_application_fee?: boolean; + + /** + * Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + */ + reverse_transfer?: boolean; + } + + namespace RefundPayment { + type Reason = 'duplicate' | 'fraudulent' | 'requested_by_customer'; + } + interface SetReaderDisplay { /** * Cart object to be displayed by the reader. @@ -218,6 +264,7 @@ declare module 'stripe' { type Type = | 'process_payment_intent' | 'process_setup_intent' + | 'refund_payment' | 'set_reader_display'; } diff --git a/types/Terminal/ReadersResource.d.ts b/types/Terminal/ReadersResource.d.ts index 799ea9256d..a9f3385571 100644 --- a/types/Terminal/ReadersResource.d.ts +++ b/types/Terminal/ReadersResource.d.ts @@ -3,300 +3,6 @@ declare module 'stripe' { namespace Stripe { namespace Terminal { - /** - * A Reader represents a physical device for accepting payment details. - * - * Related guide: [Connecting to a Reader](https://stripe.com/docs/terminal/payments/connect-reader). - */ - interface Reader { - /** - * 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'; - - /** - * The most recent action performed by the reader. - */ - action: Reader.Action | null; - - deleted?: void; - - /** - * The current software version of the reader. - */ - device_sw_version: string | null; - - /** - * Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. - */ - device_type: Reader.DeviceType; - - /** - * The local IP address of the reader. - */ - ip_address: string | null; - - /** - * Custom label given to the reader for easier identification. - */ - label: string; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * The location identifier of the reader. - */ - location: string | Stripe.Terminal.Location | null; - - /** - * 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. - */ - metadata: Stripe.Metadata; - - /** - * Serial number of the reader. - */ - serial_number: string; - - /** - * The networking status of the reader. - */ - status: string | null; - } - - namespace Reader { - interface Action { - /** - * Failure code, only set if status is `failed`. - */ - failure_code: string | null; - - /** - * Detailed failure message, only set if status is `failed`. - */ - failure_message: string | null; - - /** - * Represents a reader action to process a payment intent - */ - process_payment_intent?: Action.ProcessPaymentIntent; - - /** - * Represents a reader action to process a setup intent - */ - process_setup_intent?: Action.ProcessSetupIntent; - - /** - * Represents a reader action to refund a payment - */ - refund_payment?: Action.RefundPayment; - - /** - * Represents a reader action to set the reader display - */ - set_reader_display?: Action.SetReaderDisplay; - - /** - * Status of the action performed by the reader. - */ - status: Action.Status; - - /** - * Type of action performed by the reader. - */ - type: Action.Type; - } - - namespace Action { - interface ProcessPaymentIntent { - /** - * Most recent PaymentIntent processed by the reader. - */ - payment_intent: string | Stripe.PaymentIntent; - - /** - * Represents a per-transaction override of a reader configuration - */ - process_config?: ProcessPaymentIntent.ProcessConfig; - } - - namespace ProcessPaymentIntent { - interface ProcessConfig { - /** - * Override showing a tipping selection screen on this transaction. - */ - skip_tipping?: boolean; - - /** - * Represents a per-transaction tipping configuration - */ - tipping?: ProcessConfig.Tipping; - } - - namespace ProcessConfig { - interface Tipping { - /** - * Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). - */ - amount_eligible?: number; - } - } - } - - interface ProcessSetupIntent { - /** - * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. - */ - generated_card?: string; - - /** - * Most recent SetupIntent processed by the reader. - */ - setup_intent: string | Stripe.SetupIntent; - } - - interface RefundPayment { - /** - * The amount being refunded. - */ - amount?: number; - - /** - * Charge that is being refunded. - */ - charge?: string | Stripe.Charge; - - /** - * Payment intent that is being refunded. - */ - payment_intent?: string | Stripe.PaymentIntent; - - /** - * The reason for the refund. - */ - reason?: RefundPayment.Reason; - - /** - * Unique identifier for the refund object. - */ - refund?: string | Stripe.Refund; - - /** - * Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. - */ - refund_application_fee?: boolean; - - /** - * Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. - */ - reverse_transfer?: boolean; - } - - namespace RefundPayment { - type Reason = 'duplicate' | 'fraudulent' | 'requested_by_customer'; - } - - interface SetReaderDisplay { - /** - * Cart object to be displayed by the reader. - */ - cart: SetReaderDisplay.Cart | null; - - /** - * Type of information to be displayed by the reader. - */ - type: 'cart'; - } - - namespace SetReaderDisplay { - interface Cart { - /** - * 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; - - /** - * List of line items in the cart. - */ - line_items: Array; - - /** - * Tax amount for the entire cart. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - */ - tax: number | null; - - /** - * Total amount for the entire cart, including tax. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - */ - total: number; - } - - namespace Cart { - interface LineItem { - /** - * The amount of the line item. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - */ - amount: number; - - /** - * Description of the line item. - */ - description: string; - - /** - * The quantity of the line item. - */ - quantity: number; - } - } - } - - type Status = 'failed' | 'in_progress' | 'succeeded'; - - type Type = - | 'process_payment_intent' - | 'process_setup_intent' - | 'refund_payment' - | 'set_reader_display'; - } - - type DeviceType = - | 'bbpos_chipper2x' - | 'bbpos_wisepad3' - | 'bbpos_wisepos_e' - | 'simulated_wisepos_e' - | '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; - } - interface ReaderCreateParams { /** * A code generated by the reader used for registering to an account. diff --git a/types/Treasury/OutboundTransfers.d.ts b/types/Treasury/OutboundTransfers.d.ts index b1764b4b62..f0c0d7c6ee 100644 --- a/types/Treasury/OutboundTransfers.d.ts +++ b/types/Treasury/OutboundTransfers.d.ts @@ -253,187 +253,6 @@ declare module 'stripe' { returned_at: number | null; } } - - interface OutboundTransferCreateParams { - /** - * Amount (in cents) to be transferred. - */ - amount: 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; - - /** - * The FinancialAccount to pull funds from. - */ - financial_account: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The PaymentMethod to use as the payment instrument for the OutboundTransfer. - */ - destination_payment_method?: string; - - /** - * Hash describing payment method configuration details. - */ - destination_payment_method_options?: OutboundTransferCreateParams.DestinationPaymentMethodOptions; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * 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.MetadataParam; - - /** - * Details about the network used for the OutboundTransfer. - */ - network_details?: OutboundTransferCreateParams.NetworkDetails; - - /** - * Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. - */ - statement_descriptor?: string; - } - - namespace OutboundTransferCreateParams { - interface DestinationPaymentMethodOptions { - /** - * Optional fields for `us_bank_account`. - */ - us_bank_account?: Stripe.Emptyable< - DestinationPaymentMethodOptions.UsBankAccount - >; - } - - namespace DestinationPaymentMethodOptions { - interface UsBankAccount { - /** - * Designate the OutboundTransfer as using a US bank account network configuration. - */ - network?: UsBankAccount.Network; - } - - namespace UsBankAccount { - type Network = 'ach' | 'us_domestic_wire'; - } - } - - interface NetworkDetails { - /** - * Optional fields for `ach`. - */ - ach?: NetworkDetails.Ach; - - /** - * The type of flow that originated the OutboundTransfer. - */ - type: 'ach'; - } - - namespace NetworkDetails { - interface Ach { - /** - * Addenda record data associated with this OutboundTransfer. - */ - addenda?: string; - } - } - } - - interface OutboundTransferRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OutboundTransferListParams extends PaginationParams { - /** - * Returns objects associated with this FinancialAccount. - */ - financial_account: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. - */ - status?: OutboundTransferListParams.Status; - } - - namespace OutboundTransferListParams { - type Status = - | 'canceled' - | 'failed' - | 'posted' - | 'processing' - | 'returned'; - } - - interface OutboundTransferCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class OutboundTransfersResource { - /** - * Creates an OutboundTransfer. - */ - create( - params: OutboundTransferCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. - */ - retrieve( - id: string, - params?: OutboundTransferRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of OutboundTransfers sent from the specified FinancialAccount. - */ - list( - params: OutboundTransferListParams, - options?: RequestOptions - ): ApiListPromise; - - /** - * An OutboundTransfer can be canceled if the funds have not yet been paid out. - */ - cancel( - id: string, - params?: OutboundTransferCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - } } } } diff --git a/types/Treasury/OutboundTransfersResource.d.ts b/types/Treasury/OutboundTransfersResource.d.ts index d0e9ce36b6..352b562bcf 100644 --- a/types/Treasury/OutboundTransfersResource.d.ts +++ b/types/Treasury/OutboundTransfersResource.d.ts @@ -44,6 +44,11 @@ declare module 'stripe' { */ metadata?: Stripe.MetadataParam; + /** + * Details about the network used for the OutboundTransfer. + */ + network_details?: OutboundTransferCreateParams.NetworkDetails; + /** * Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`. */ @@ -72,6 +77,27 @@ declare module 'stripe' { type Network = 'ach' | 'us_domestic_wire'; } } + + interface NetworkDetails { + /** + * Optional fields for `ach`. + */ + ach?: NetworkDetails.Ach; + + /** + * The type of flow that originated the OutboundTransfer. + */ + type: 'ach'; + } + + namespace NetworkDetails { + interface Ach { + /** + * Addenda record data associated with this OutboundTransfer. + */ + addenda?: string; + } + } } interface OutboundTransferRetrieveParams { diff --git a/types/index.d.ts b/types/index.d.ts index a1a0fea730..e899001b54 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -10,6 +10,7 @@ /// /// /// +/// /// /// /// @@ -28,6 +29,7 @@ /// /// /// +/// /// /// /// @@ -37,6 +39,7 @@ /// /// /// +/// /// /// /// @@ -55,9 +58,14 @@ /// /// /// +/// +/// +/// /// /// /// +/// +/// /// /// /// @@ -151,6 +159,7 @@ /// /// /// +/// /// /// /// @@ -244,6 +253,7 @@ declare module 'stripe' { invoices: Stripe.InvoicesResource; invoiceItems: Stripe.InvoiceItemsResource; mandates: Stripe.MandatesResource; + orders: Stripe.OrdersResource; paymentIntents: Stripe.PaymentIntentsResource; paymentLinks: Stripe.PaymentLinksResource; paymentMethods: Stripe.PaymentMethodsResource;