Skip to content

Commit c80509a

Browse files
marcinjendrzejewskijessetrinity
authored andcommitted
Add sendInvoice signature for Stripe invoices. (DefinitelyTyped#37223)
* Add sendInvoice signature for Stripe invoices. * Include response and HeaderOptions in signature.
1 parent aa76e03 commit c80509a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

types/stripe/index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9239,6 +9239,20 @@ declare namespace Stripe {
92399239
list(data: invoices.IInvoiceListOptions, options: HeaderOptions, response?: IResponseFn<IList<invoices.IInvoice>>): IListPromise<invoices.IInvoice>;
92409240
list(data: invoices.IInvoiceListOptions, response?: IResponseFn<IList<invoices.IInvoice>>): IListPromise<invoices.IInvoice>;
92419241
list(response?: IResponseFn<IList<invoices.IInvoice>>): IListPromise<invoices.IInvoice>;
9242+
9243+
/**
9244+
* Stripe will automatically send invoices to customers according to your subscriptions settings.
9245+
* However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so.
9246+
* When sending invoices that have already been paid, there will be no reference to the payment in the email.
9247+
*
9248+
* Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
9249+
*
9250+
* @returns Returns the invoice object
9251+
*
9252+
* @param invoice The ID of the invoice to send
9253+
*/
9254+
sendInvoice(id: string, options: HeaderOptions, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
9255+
sendInvoice(id: string, response?: IResponseFn<invoices.IInvoice>): Promise<invoices.IInvoice>;
92429256
}
92439257

92449258
class InvoiceItems extends StripeResource {

types/stripe/stripe-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,10 @@ stripe.invoices.retrieve("in_15fvyXEe31JkLCeQH7QbgZZb", { expand: ["subscription
14071407
invoice.subscription;
14081408
});
14091409

1410+
stripe.invoices.sendInvoice('in_15fvyXEe31JkLCeQH7QbgZZb').then(invoice => {
1411+
// asynchronously called
1412+
});
1413+
14101414
//#endregion
14111415

14121416
//#region Invoice Items tests

0 commit comments

Comments
 (0)