Skip to content
Loading keys…

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

MethodPathDescription
POST/invoicesCreate an invoice
GET/invoicesList 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}/sendE-mail the invoice to the customer
POST/invoices/{id}/mark-paidMark the invoice as paid (full or partial)
POST/invoices/{id}/cancelCancel an invoice
POST/invoices/{id}/stop-recurringStop 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.

EventTrigger
invoice.createdA new invoice was created: once, with its lines and totals
invoice.updatedThe invoice changed through the API (once per PUT, none for a PUT that changes nothing), or was viewed or paid online
invoice.payment_succeededA payment made on the invoice's page succeeded, instalments included
invoice.paidThe invoice is settled in full
invoice.deletedThe 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.

What did you think of this content?