Mayson Monorepo Documentation
    Preparing search index...
    Index

    Constructors

    Methods

    • 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.

      Parameters

      Returns Promise<Response<DeletedInvoice>>

    • 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.

      Parameters

      Returns Promise<Response<DeletedInvoice>>

    • Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.

      For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited to the invoice, increasing its amount_paid. When the invoice is fully paid, the invoice's status becomes paid.

      If the PaymentIntent's status is already succeeded when it's attached, it's credited to the invoice immediately.

      See: Partial payments to learn more.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.

      For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited to the invoice, increasing its amount_paid. When the invoice is fully paid, the invoice's status becomes paid.

      If the PaymentIntent's status is already succeeded when it's attached, it's credited to the invoice immediately.

      See: Partial payments to learn more.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.

      You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.

      The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.

      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.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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.

      You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.

      The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.

      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.

      Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. Learn more

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. 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.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. 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.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Stripe will automatically send invoices to customers according to your subscriptions settings. 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.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Stripe will automatically send invoices to customers according to your subscriptions settings. 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.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized.

      Parameters

      Returns Promise<Response<Stripe.InvoiceLineItem>>

    • Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized.

      Parameters

      Returns Promise<Response<Stripe.InvoiceLineItem>>

    • Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>

    • Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.

      Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to issue another invoice or credit note instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

      Parameters

      Returns Promise<Response<Stripe.Invoice>>