Skip to content

zerolooplabs/peppol-invoice-nextjs-starter

Repository files navigation

Peppol Invoice Starter (Next.js)

Send your first Peppol e-invoice in under 2 minutes.

Deploy with Vercel

Prerequisites

You need a getpeppr account with a sandbox API key:

  1. Sign up at console.getpeppr.dev
  2. Create an organization
  3. Go to API Keys and create a sandbox key (sk_sandbox_...)

Quick Start

git clone https://github.com/zerolooplabs/peppol-invoice-nextjs-starter.git
cd peppol-invoice-nextjs-starter
cp .env.example .env.local   # Paste your API key
npm install && npm run dev

Open http://localhost:3000 and click Send Demo Invoice.

What Happens

  1. Click the button — a real Peppol invoice is sent to the sandbox network
  2. You get back an invoice ID and status
  3. Click the console link to see your invoice arrive in the getpeppr dashboard

This is not a mock. The invoice goes through the actual Peppol infrastructure.

Webhooks (Optional)

Get notified when your invoice status changes (sent, accepted, refused, error, registered, received, paid):

  1. Go to Webhooks in the getpeppr Console
  2. Add your endpoint URL: https://your-app.com/api/webhooks
  3. Copy the signing secret (whsec_...)
  4. Add to .env.local:
    GETPEPPR_WEBHOOK_SECRET=whsec_your_secret_here
    

The webhook handler at app/api/webhooks/route.ts verifies signatures using the SDK and logs events. Customize the switch statement to handle events in your app.

For local development, use a tunnel like ngrok to expose your localhost.

Project Structure

lib/peppr.ts                       — SDK client
app/api/send-invoice/route.ts      — Send endpoint
app/api/webhooks/route.ts          — Webhook handler
app/page.tsx                       — UI

Going to Production

See docs/production.md for the sandbox-to-production guide.

Links

License

MIT

About

Send your first Peppol e-invoice in under 2 minutes. Next.js + @getpeppr/sdk starter template.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors