Stripe Payments

Accept card payments from your clients using Stripe Checkout.

Last updated : April 19, 2026

Overview

BilloraX uses Stripe Checkout (hosted payment page) to collect payments. When a client clicks "Pay now" on an unpaid invoice, they are redirected to Stripe.

After a successful payment, the webhook marks the invoice as PAID, records the transaction, and advances the service renewal date.

Setup

Add your Stripe keys to .env:

STRIPE_SECRET_KEY="sk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_..."
πŸ’‘
Use sk_test_ / pk_test_ keys during development.

Webhook

Register the webhook endpoint in your Stripe Dashboard β†’ Developers β†’ Webhooks. The endpoint URL is:

  • Event to listen: checkout.session.completed
  • Copy the webhook signing secret into STRIPE_WEBHOOK_SECRET
https://your-domain.com/api/webhooks/stripe

Pay button

The "Pay now" button appears automatically on invoice detail pages when the invoice status is UNPAID or OVERDUE.

It submits a server action that creates a Stripe Checkout session and redirects the client.

Success page

After a successful payment, Stripe redirects to /portal/pay/success?invoice={id}. This page shows a confirmation and links back to the invoice.

πŸ’‘
The webhook fires independently and is the authoritative source of truth β€” do not rely on the success redirect to mark invoices paid.