Automate Your Team Invoicing
Stop creating invoices manually. Learn how to use the Ponkan API to automate invoice generation, delivery, and tracking for your entire team.
Sarah Chen
March 17, 2026

Manually creating invoices every month is tedious. If your team bills multiple clients for recurring services, the repetitive work adds up fast — creating drafts, adding line items, sending payment links, chasing overdue invoices.
With the Ponkan API, you can automate the entire invoicing workflow. This guide shows you how to build a script that creates, finalizes, and tracks invoices for your whole team.
How invoicing works in Ponkan
Every invoice follows a lifecycle:
- Draft — You're still building the invoice. Line items and amounts can be edited. The customer can't see it yet.
- Open — The invoice is finalized and locked. A payment link is generated for the customer.
- Paid — The customer has paid (or you've marked it as paid manually).
- Void — The invoice was cancelled.
This state machine is enforced by the API. You can't edit an open invoice or finalize a paid one. This keeps your financial records clean and auditable.
Setting up
You'll need an API token with write permissions. Create one in Settings > API in your Ponkan dashboard.
For this guide, we'll use simple curl commands. In production, you'd wrap these in your language of choice — the example storefront in our repo shows how to do this with TypeScript.
Step 1: Create your customers
Before you can invoice someone, they need to exist as a customer:
Do this once per client. Save the returned id — you'll use it for every invoice.
Step 2: Create a draft invoice
Create an invoice with line items in a single request:
The invoice is created in draft status with an auto-generated invoice number (e.g., INV-0043). The total is calculated automatically from line items — in this case, $3,600.00.
Mixing products and freeform items
Line items can reference existing products from your catalog or be freeform descriptions. This is useful when you bill for both products and services:
Step 3: Review and edit
While the invoice is still a draft, you can update anything — line items, due date, memo, even the customer:
When you pass items, the entire line item list is replaced. This keeps things simple — no need to track individual item IDs.
Step 4: Finalize and send
When you're happy with the invoice, finalize it:
This does three things:
- Locks the invoice — no more edits allowed
- Sets
issued_atto the current timestamp - Generates a
payment_tokenfor the payment link
The payment link follows this pattern:
Share this link with your customer via email, Slack, or however your team communicates with clients. The customer clicks the link, sees the invoice details, and pays online.
Step 5: Track payment status
Check individual invoices
The status field tells you exactly where things stand: draft, open, paid, void, or overdue.
Find overdue invoices
Filter your invoice list to surface overdue invoices that need follow-up:
Mark as paid manually
If a client pays via bank transfer, check, or cash, mark it manually:
Automating the whole thing
Here's a simple bash script that creates and finalizes invoices for multiple clients at the start of each month:
Run this with a cron job on the 1st of each month and your invoicing is fully automated.
Voiding invoices
Made a mistake? Void an open invoice before the customer pays:
The payment link immediately stops working. You can then create a corrected invoice.
Building it into your workflow
The API makes it straightforward to integrate invoicing into whatever tools your team already uses:
- Cron jobs — Generate monthly invoices automatically
- Slack bots — Get notified when invoices are paid or go overdue
- Project management tools — Create invoices when milestones are completed
- Accounting software — Sync invoice data for bookkeeping
What's next
Now that your invoicing is automated, explore checkout links for one-off product sales, or learn how to build a full storefront with the Ponkan API.
More Articles
Continue reading from our blog.

Getting Started with Checkout Links
Learn how to create shareable payment pages and start accepting payments in minutes using Ponkan's checkout links.
Daniel Moreno
March 18, 2026

Building a Simple E-Commerce App with the Ponkan API
Build a fully functional storefront with product listing, shopping cart, and checkout using the Ponkan API and Next.js.
Daniel Moreno
March 16, 2026