Overview

The Invoify REST API lets you read, create, update, and delete invoices and clients from any backend, no SDK required. All responses are JSON. All requests are authenticated with a bearer token.

Base URLhttps://www.invoify.co.uk/api/v1
Version1.2.0
AuthBearer token (Authorization: Bearer inv_...)
Rate limit1,000 requests / hour / key
Content typeapplication/json

Everything the API returns is also available in the OpenAPI spec at /api/v1/openapi.json. Import it into Postman, Zapier, Make, or any HTTP tool that speaks OpenAPI 3.0.

Authentication

Create an API key under Settings → API Keys. The full key is displayed once at creation — copy it immediately and store it somewhere safe (a password manager, your deploy secrets). We only store a SHA-256 hash; if you lose the key, you have to revoke and create a new one.

Keys look like:

inv_7Zq8xP3kR9mA2vL5nY6bQ4tC1dE0hF8jG

Send the key as a bearer token on every request:

curl https://www.invoify.co.uk/api/v1/invoices \
  -H "Authorization: Bearer inv_7Zq8xP3kR9mA2vL5nY6bQ4tC1dE0hF8jG"

Scopes

Each key has one or both of these scopes:

readEvery GET on invoices and clients. Default for new keys.
writePOST, PATCH, DELETE on invoices and clients. Required for any mutation.

Tick Allow write operations when creating a key to enable the write scope. Read-only is the default and recommended for anything that only needs to pull data.

Rate limits

Every key is capped at 1,000 requests per hour. Buckets are fixed-window and reset on the hour (minute 0 UTC).

Every response includes:

X-RateLimit-LimitThe hourly limit (1000)
X-RateLimit-RemainingRequests left in this window
X-RateLimit-ResetUnix epoch seconds at next window reset

Exceed the limit and the request returns 429 Too Many Requests:

HTTP/1.1 429 Too Many Requests
{
  "error": "Rate limit exceeded (1,000 requests/hour per key). Try again after the window resets.",
  "limit": 1000,
  "reset_at": "2026-10-23T15:00:00.000Z"
}

Live usage per key is in Settings → API Keys — click the activity icon on any key for current-hour counts and a 7-day bar chart.

Idempotency

Every write endpoint (POST, PATCH, DELETE) accepts an Idempotency-Key header. Send a unique string per logical operation (a UUID is easiest). We cache the response and return it on any retry with the same key.

POST /api/v1/invoices
Authorization: Bearer inv_...
Idempotency-Key: 7c3a1e02-9f4b-4c01-a7b7-3b2a9e1c0d84
Content-Type: application/json

{ "invoice_number": "INV-042", ... }
First callRuns normally. Response is cached alongside the key.
Retry (same body)Returns the cached response verbatim with Idempotency-Replayed: true header. No DB writes, no webhooks re-fired.
Retry (different body)Returns 409 Conflict. Use a fresh key.
RetentionKeys expire ~24 hours after first use.

This matches Stripe and Shopify semantics — if your client times out mid-request, retry with the same Idempotency-Key and you can't accidentally create two invoices.

Errors

Every error response has this shape:

{ "error": "Human-readable description" }
400 Bad RequestInvalid JSON body or missing required field
401 UnauthorizedMissing or invalid API key
403 ForbiddenKey lacks the required scope (e.g. write)
404 Not FoundRow doesn't exist or isn't yours
409 ConflictIdempotency-Key reused with a different body
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorSomething broke on our end — retry

Invoices

GET/invoices

List invoices

Query params

statusdraft, sent, viewed, partial, paid, overdue, cancelled
client_idFilter to one client (UUID)
searchilike match on invoice_number, to_name, to_company
limitMax 100 (default 25)
offsetPagination offset
curl https://www.invoify.co.uk/api/v1/invoices?status=overdue \
  -H "Authorization: Bearer inv_..."
POST/invoiceswrite scope

Create a draft invoice with line items

Totals (subtotal / tax_total / total) are computed server-side from items. Status defaults to draft.

Request body

{
  "invoice_number": "INV-042",
  "issue_date": "2026-10-23",
  "due_date": "2026-11-22",
  "currency": "GBP",
  "client_id": "...",
  "to": {
    "name": "Rivertech Inc.",
    "email": "billing@rivertech.co",
    "address": "..."
  },
  "items": [
    { "description": "Brand design", "quantity": 1, "unit_price": 1800, "tax_rate": 20 }
  ]
}
curl -X POST https://www.invoify.co.uk/api/v1/invoices \
  -H "Authorization: Bearer inv_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @invoice.json
GET/invoices/{id}

Fetch an invoice with items, payments, credit notes, and balance

{
  "invoice": { ... },
  "items": [ ... ],
  "payments": [ ... ],
  "credit_notes": [ ... ],
  "balance": { "total": 2450, "paid": 1000, "credited": 0, "amount_due": 1450 }
}
PATCH/invoices/{id}write scope

Update invoice metadata (not line items)

Line-item editing is not in v1 — delete and recreate the invoice if you need to change items.

Request body

{
  "status": "sent",
  "due_date": "2026-11-30",
  "notes": "Updated terms"
}
DELETE/invoices/{id}write scope

Hard delete; cascades to items, payments, credit notes

No undo. The matching invoice.cancelled webhook is NOT fired on delete; only on status change.

Clients

GET/clients

List clients

Query params

searchilike match on name, company, email
limitMax 100 (default 25)
offsetPagination offset
curl https://www.invoify.co.uk/api/v1/clients?search=rivertech \
  -H "Authorization: Bearer inv_..."
POST/clientswrite scope

Create a client

Fires the client.created webhook on success.

Request body

{
  "name": "Rivertech Inc.",
  "email": "billing@rivertech.co",
  "currency": "GBP",
  "peppol_endpoint_scheme": "0088",
  "peppol_endpoint_id": "5790000435968"
}
HTTP/1.1 201 Created
{ "client": { "id": "...", "name": "Rivertech Inc.", ... } }
GET/clients/{id}

Fetch a client with rollup stats

{
  "client": { ... },
  "stats": { "invoice_count": 7, "total_invoiced": 17500, "outstanding": 2450 }
}
PATCH/clients/{id}write scope

Update any subset of client fields

Request body

{ "phone": "+44 20 7946 0012" }
DELETE/clients/{id}write scope

Hard delete the client row

Existing invoices keep their denormalized to_name / to_company / to_email snapshot and continue to render correctly.

Webhooks

Invoify POSTs an event to any URL you register under Settings → Webhooks. Each endpoint gets a one-time signing secret shown at creation — use it to verify the X-Invoify-Signature header before trusting the body.

Event types

invoice.sentFired after a successful email send via /api/invoices/[id]/send.
invoice.paidFired when a payment lands and the invoice balance reaches zero.
invoice.partially_paidFired when a payment lands but the invoice still has a balance.
invoice.cancelledReserved — not yet emitted. Status changes to 'cancelled' via PATCH won't fire this today.
client.createdFired by POST /api/v1/clients only (not dashboard UI creates).

Request shape

MethodPOST
Content-Typeapplication/json
X-Invoify-EventThe event type
X-Invoify-Event-IdUUID per emission — recipients dedupe on this
X-Invoify-Signaturesha256=<hex> — HMAC-SHA256 of raw body with your signing secret
Timeout10 seconds

Body

{
  "type": "invoice.paid",
  "id": "e9a8b7c6-d5f4-...",
  "user_id": "...",
  "created_at": "2026-10-23T14:12:03.000Z",
  "data": {
    "invoice": {
      "id": "...",
      "invoice_number": "INV-042",
      "status": "paid",
      "currency": "GBP",
      "total": "2450.00",
      "balance_due": 0,
      "amount_paid": 2450,
      "amount_credited": 0,
      "due_date": "2026-10-01",
      "to_email": "billing@rivertech.co",
      "to_name": "Rivertech Inc.",
      "public_token": "..."
    }
  }
}

Verifying the signature (Node)

const crypto = require("node:crypto");

function verify(rawBody, signatureHeader, secret) {
  const [, hex] = signatureHeader.split("sha256=");
  const expected = crypto
    .createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex");
  return crypto.timingSafeEqual(Buffer.from(hex), Buffer.from(expected));
}

Delivery semantics

SuccessAny 2xx response code.
FailureNon-2xx, timeout, or connection error. Bumps the consecutive-failure counter.
Circuit breaker10 consecutive failures auto-disables the endpoint. Re-enable from the UI (resets the counter).
RetriesNone in v1 — a failed delivery is dropped. Follow-up planned.
Delivery logLast 50 attempts per endpoint are in Settings → Webhooks → History icon on each endpoint.

Changelog

We don't version endpoint URLs — every path stays on /api/v1until there's a genuine breaking change. Additive changes (new endpoints, new optional fields) are shipped without bumping.

v1.2.0
  • Added Idempotency-Key header support on all write endpoints.
  • Added Idempotency-Replayed response header on cached replays.
v1.1.0
  • Write endpoints: POST/PATCH/DELETE on invoices and clients.
  • Outbound webhooks for invoice.sent, invoice.paid, invoice.partially_paid, client.created.
  • Per-key rate limiting (1,000 req/hr) with X-RateLimit headers.
v1.0.0
  • Read-only endpoints on invoices and clients.