API & webhooks
Send invoices and payments into NexaPilot from your own system, and get notified the moment something happens. Available on the Business plan and during the free trial.
Authentication
Create a key in Settings → Developers. Keys are shown once; we only store a hash. Send it as a bearer token:
curl https://hynulduftdkfukmviljj.supabase.co/functions/v1/api/invoices \ -H "Authorization: Bearer np_live_…"
Endpoints
GET /customers— list customersPOST /customers—{ name, company?, email?, phone?, notes? }GET /invoices?status=overdue— invoices with paid amount, balance and status (open,partial,overdue,paid,cancelled)POST /invoices—{ customer_id, number, due_date, amount, issue_date?, currency?, notes?, payment_link? }POST /payments—{ invoice_id, amount, paid_at?, method?, note? }GET /promises— payment promises and their status
Dates are YYYY-MM-DD; currencies are USD, EUR or TRY. Responses are JSON: { "data": … } or { "error": "…" }.
curl -X POST https://hynulduftdkfukmviljj.supabase.co/functions/v1/api/payments \
-H "Authorization: Bearer np_live_…" \
-H "Content-Type: application/json" \
-d '{"invoice_id":"…","amount":250.00,"method":"Bank transfer"}'Webhooks
Add an HTTPS endpoint in Settings → Developers and choose events:payment.created, invoice.paid, invoice.disputed,promise.created, promise.broken, reminder.sent. Each request is a JSON POST:
{ "event": "invoice.paid", "created_at": "2026-11-14T09:30:00Z", "data": { … } }Verify the X-NexaPilot-Signature header: it is sha256= followed by the hex HMAC-SHA256 of the raw request body, keyed with the webhook's signing secret.
// Node.js
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers["x-nexapilot-signature"]));Zapier and Make
Use Webhooks by Zapier → Catch Hook (or Make's Custom webhook) as the endpoint URL to start a zap when an invoice is paid or a customer makes a promise, and their HTTP actions with your API key to create invoices or record payments from any other app.
Limits
- Lists return up to 1,000 rows.
- Plan limits (active invoices) apply to invoices created through the API.
- Up to 10 active keys and 10 webhooks per workspace.