Build Paddle billing history with AI
Give each signed-in customer a paginated transaction history in Next.js, with correct currency amounts and a short-lived invoice link created when they request it.
Build Paddle billing history with AI when you want invoices to sit inside your application’s account area. The paddle-billing-history skill guides a Next.js server action that resolves the signed-in user’s customer mapping and retrieves one page of that customer’s transactions. The browser never chooses which customer’s history is returned.
A displayed total should match what the customer was charged after credits. The guide also covers currencies without minor units and invoice availability across transaction states. Fetching a PDF is a separate action with its own ownership check, so the app does not request a fresh link for every row on every visit.
What it does
- Add dates, amounts and statuses to an account view.
- Show the final charged amount after credits.
- Load the next page without fetching the entire history.
- Check transaction ownership before issuing an invoice link.
- Handle empty histories and transactions without a PDF.
Install and use
- Install the skill in your coding agent. Use a Next.js App Router project, the official Paddle Node SDK, a server-side transaction-read key, authenticated sessions and a maintained customer mapping. The example uses Supabase.
- Ask, “Implement billing history with one page at a time and invoice links on request. Use our existing account lookup.”
- Test with two sandbox customers, a credited purchase and a zero-value transaction. Check formatting and ownership on the list and invoice actions.
FAQ
Source
Made by Paddle. Original skill: paddle-billing-history, published on GitHub under the Apache-2.0 licence.
View on GitHub