Invoices
Create, send, and track one-shot or recurring invoices.
An invoice bills a customer for a fixed amount, once or on a recurring cycle. See Billing → Invoice for the full product guide.
Server side, live only
Call the invoice endpoints from your server, with your private key (sk.). They are only
available in the live environment: there is no sandbox invoicing.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /invoices | Create an invoice |
GET | /invoices | List invoices |
GET | /invoices/{id} | Retrieve an invoice |
PUT | /invoices/{id} | Update an invoice (only if editable) |
DELETE | /invoices/{id} | Delete an invoice (only if editable) |
POST | /invoices/{id}/send | E-mail the invoice to the customer |
POST | /invoices/{id}/mark-paid | Mark the invoice as paid (full or partial) |
POST | /invoices/{id}/cancel | Cancel an invoice |
POST | /invoices/{id}/stop-recurring | Stop a recurring invoice, whatever its status |
Recurring invoices
Set is_recurring: true and a recurring_interval on creation to have Wajub generate the next
invoice at each cycle, as a draft you still send. Only an invoice can recur: a quote, an estimate
or a generated copy answers 422. The first one is due one interval after
invoice_date, and next_invoice_date on the invoice says when the next one is. A generated copy
carries the id of its recurring invoice in recurring_parent.
POST /invoices/{id}/stop-recurring ends the series at any point, paid invoice included; the
copies already generated stay. See Billing → Recurring invoices for
the full workflow.
Events
A status change made through the API (sent, viewed, paid, cancelled, refunded) is delivered as
invoice.updated: check data.status to see which one occurred. Two changes send nothing: an
invoice turning overdue (updated once a day), and anything done in the Dashboard.
Poll GET /invoices?status=overdue to see the first. See the
full event catalog.
| Event | Trigger |
|---|---|
invoice.created | A new invoice was created: once, with its lines and totals |
invoice.updated | The invoice changed through the API (once per PUT, none for a PUT that changes nothing), or was viewed or paid online |
invoice.payment_succeeded | A payment made on the invoice's page succeeded, instalments included |
invoice.paid | The invoice is settled in full |
invoice.deleted | The invoice was deleted |
The PDF
GET https://api.wajub.com/i/{id}/pdf returns the invoice as a PDF, without a key, once it has been
sent (a draft answers 404). It is written in the invoice's language; ?locale=fr or
?locale=en asks for the other. See the invoice guide.