Pay invoices

A customer pays a subscription invoice through its pay link.

An invoice is paid through its pay link, and only through it. Checkout sessions are for one-time payments and new subscriptions. A request for a session with mode invoice is not accepted.

A renewal invoice opens at the period end and is due daysToPay days later. See Renewals and days to pay.

Retrieve the invoice. While the invoice is open, it has a payLink. Send the customer to it. Treat the link as a secret: anyone who has it can open the invoice's payment page. payLink is only in the response to a retrieve of one invoice, not in a list.

An invoice that credit has covered in full is paid at once and has no pay link. See Customer credit.

What the customer sees

  • The page shows what is owed now. If the invoice is repriced while it is open, the next open of the page shows the new amount. A payment the customer has already approved on their phone keeps the amount it was started with.
  • The invoice has one checkout session for its whole life. Opening the link again, on any device, returns it. After the invoice is paid, the link keeps showing the paid view.
  • If a prompt fails or expires, the customer can start a new one at once. There is no limit on the number of tries. One prompt waits on the phone at a time.

If a prompt that looked lost is approved after the customer started another, the invoice can be paid twice. The second payment becomes the customer's refundable credit and you get invoice.overpaid.

Follow the invoice

A pay link session sends no checkout.session.* events. Follow the invoice instead:

EventWhen
invoice.paidThe invoice was paid.
invoice.payment_mismatchedA payment did not match the amount due.
invoice.overpaidA payment arrived on an invoice that was already paid.
invoice.voidedThe invoice was voided.

The full list is in Webhooks.

Amounts on the invoice

Read creditApplied for the credit the invoice used and amountRemaining for what the customer still has to pay for one period. lines lists the parts of an upgrade invoice: remaining_time and unused_time. Credit is not a line.

On this page