provider POST /v1/invoices/{invoice}/pay
@utdk/stripe /v1/invoices/{invoice}/pay
Pay an invoice
<p>Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your <a href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>. 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.</p>
invoice path required
string

Try it

Authentication
Configure credentials for Stripe API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postinvoicesinvoicepay
POST/v1/invoices/{invoice}/pay
<p>Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your <a href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>. 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.</p>

Parameters

required

Input

Specifies which fields in the response should be expanded.

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

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.

Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).

Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.

A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.

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.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import stripe from '@utdk/stripe';

await stripe.postinvoicesinvoicepay()