Subscription billing
Recurring billing that runs itself, on the gateways you already use
Plans, trials, renewals, dunning, proration, usage billing, entitlements, invoices, quotes and a customer billing page. PaymentHooks charges every renewal through Stripe, Razorpay, PayPal, PhonePe, Cashfree or CCAvenue, and takes one-time payments on all 38 gateways it supports.
- Test mode before you connect a gateway
- 155 pricing currencies
- Prices shown in the customer's currency
import { PaymentHooks } from "@paymenthooks/sdk";
const ph = new PaymentHooks({ apiKey: process.env.PAYMENTHOOKS_SECRET_KEY! });
const session = await ph.checkoutSessions.create({
mode: "subscription",
itemLocalCurrency: "USD",
lineItems: [{
description: "Pro plan",
quantity: 1,
unitPrice: 2900, // $29.00
recurring: { interval: "month" },
}],
customerEmail: "[email protected]",
successUrl: "https://example.com/welcome",
cancelUrl: "https://example.com/pricing",
});
// Send the customer to session.url. After the first payment
// PaymentHooks renews the subscription every month.From first payment to every renewal
- 1
Connect a gateway
Add your Stripe, Razorpay, PayPal or other account keys. Test mode works before you connect anything.
- 2
Create a plan
Add a product, the features it includes and a recurring price, or send the price inline from your own system.
- 3
Share a checkout
Create a checkout session or a payment link. The first payment starts the subscription.
- 4
PaymentHooks bills
Renewals, retries, invoices, emails and webhooks run on their own, for as long as the subscription lasts.
Billing
The whole subscription lifecycle
Everything between a customer's first payment and their last renewal, handled for you.
Plans and pricing
Products with recurring prices in any of 155 currencies, monthly, yearly or any interval, free trials, tags, and add-ons a customer can stack on a plan.
Features and entitlements
List what each plan includes, set limits and overage terms, and check a customer's access from your code. Checkout and subscription emails show it as What's included.
Hosted checkout
One link takes the first payment and starts the subscription. Several billing cycles in one checkout, delayed starts, coupons and tax, on your own domain and brand.
Automatic renewals
PaymentHooks charges every renewal itself through the customer's saved card, UPI AutoPay or bank mandate, and sends the pre-debit notice Indian card and UPI mandates require before each debit.
Dunning and recovery
Failed renewals are retried on a schedule you set, the customer is emailed a link to pay or update their method, and the subscription moves to past due, then cancels.
Upgrades, pauses and proration
Change plans mid-cycle with exact proration, pause and resume, cancel now or at period end, and schedule future changes. Unused time becomes customer credit.
Usage-based billing
Meter API calls, seats or anything else. Metered and overage prices are counted into each period's invoice, alongside one-time charges you add.
Invoices and credit notes
Every renewal raises an invoice with a PDF. Issue credit notes and refunds, and keep a credit balance per customer that later invoices draw down.
Quotes
Send a quote by email; the customer accepts or declines it online, and an accepted quote becomes an invoice with exactly the quoted lines.
Coupons and promo codes
Percentage or fixed discounts, once, for a number of months or forever, with redemption limits and expiry dates. Customers enter the code at checkout.
Tax
Tax rates by country and state, inclusive or exclusive prices, product tax codes, customer tax IDs, and the tax agreed at checkout kept for every renewal.
Customer billing page
A hosted page where each customer sees invoices and payments, changes plan, and manages their subscription, without you building it.
Payments
Not tied to one gateway
Bill worldwide through the gateways that work best in each market, and keep every payment in one place.
38 gateways, one integration
Connect the gateways you already use and let customers pay with the one that suits them. Route each payment by currency, country, amount or method.
Priced in yours, paid in theirs
Customers see and pay in their own region's currency where the gateway supports it, at the live rate; every amount is also kept in USD for one consistent report.
Payment links and pay pages
Share a link or QR code for a fixed price, or one pay page where customers enter any amount. No code needed.
External transactions
Record payments taken elsewhere, such as bank transfers, cash or another service, so revenue, customer spend, reports and invoices stay complete.
Webhooks you can rely on
Signed, Stripe-shaped events for every billing step, retried with backoff and replayable from the dashboard, with a simulator for testing.
Built for developers
A REST API with an OpenAPI spec, a typed Node SDK, a CLI, and a browser SDK for embedded checkout. Test mode for everything.
38 payment gateways
Take one-time payments on any of them. Gateways marked Renewals can also be charged automatically for subscriptions.
- StripeRenewals
- RazorpayRenewals
- PayPalRenewals
- Square
- Braintree
- Adyen
- Checkout.com
- Mollie
- Klarna
- Afterpay
- Coinbase Commerce
- BitPay
- GoCardless
- Wise
- Paytm
- PhonePeRenewals
- Mercado Pago
- Flutterwave
- Paystack
- 2Checkout
- WorldPay
- BlueSnap
- EaseBuzz
- Forte
- Novalnet
- CashfreeRenewals
- PayU India
- BillDesk
- CCAvenueRenewals
- Instamojo
- Juspay
- dLocal
- Amazon Pay
- Airwallex
- Xendit
- Revolut Pay
- PlayTo Pay
Route payments between gateways by currency, country, amount or payment method.
Start billing your first subscriber
Create an account, try everything in test mode, and connect a gateway when you are ready to take real payments.