API
The Du3 API lets your own systems work with Du3: create invoices from your billing tool, mark invoices paid when money lands in your bank, or copy clients from your CRM. It’s part of the Business plan.
The API covers invoices, clients and contractors. Anything you do through it follows the same rules as the app, and shows in each invoice’s history under the token’s name, “through the API”.
Who can create tokens
Section titled “Who can create tokens”Only the owner of your company can create and revoke API tokens. See Team & roles.
Create a token
Section titled “Create a token”- On the web, go to Settings → API.
- Choose Create a token.
- Give it a name, like the system that will use it (“Accounting sync”).
- Pick the access:
- Read only — can look at invoices, clients and contractors, but not change anything.
- Read and write — can also create, change, send and delete.
- Copy the token and keep it somewhere safe. We show it only once. If you lose it, revoke it and create a new one.
Tokens start with du3_. You can have up to 10 active tokens at a time. The list in Settings → API shows the start of each token (like du3_k3x9q2m1), who created it and when it was last used, so you can tell them apart.
Revoke a token
Section titled “Revoke a token”In Settings → API, choose Revoke next to the token. It stops working straight away and can’t be turned back on.
A token also stops working by itself when:
- your plan changes to one without API access, or your plan ends;
- the person who created it is no longer the owner.
Base address and sign-in
Section titled “Base address and sign-in”Every request goes to:
https://api.usedu3.com/v1/apiSend your token in the Authorization header:
Authorization: Bearer du3_your_token_hereThe token already tells us which company you are, so there’s no company id in the address. Requests and replies are JSON.
Money, dates and quantities
Section titled “Money, dates and quantities”- Money is a whole number in the currency’s smallest unit: kobo for naira, cents for dollars. ₦150,000.00 is
15000000. $49.50 is4950. Never send decimals. - Currency is a three-letter code:
NGN,USD,GBP,EUR,GHS,KES,ZARorCAD. - Dates are
YYYY-MM-DD, like2026-11-15. - Quantities are text, like
"1"or"2.5"(up to 4 decimal places). - Tax is in basis points: 7.5% is
750.
Example: list your invoices
Section titled “Example: list your invoices”curl https://api.usedu3.com/v1/api/invoices?direction=outbound&status=open \ -H "Authorization: Bearer $DU3_TOKEN"The reply holds up to 50 invoices, newest first:
{ "items": [ { "id": "6f1c2d3e-…", "direction": "outbound", "number": "INV-2026-10-K7Q2", "status": "sent", "isOverdue": false, "daysOverdue": 0, "currency": "NGN", "totalMinor": 16125000, "issueDate": "2026-10-16", "dueDate": "2026-11-15", "source": "api", "createdBy": { "id": "…", "name": "Accounting sync" }, "createdAt": "2026-10-16T09:12:44.000Z", "paidAt": null, "deletedAt": null } ], "nextCursor": "eyJhdCI6…"}When nextCursor isn’t null, there are more. Ask for the next page with ?cursor=<nextCursor>.
Example: create and send an invoice
Section titled “Example: create and send an invoice”curl https://api.usedu3.com/v1/api/invoices \ -H "Authorization: Bearer $DU3_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "newClient": { "name": "Ada Obi", "email": "[email protected]", "company": "Obi Foods" }, "currency": "NGN", "items": [ { "description": "Brand design, October", "quantity": "1", "unitPriceMinor": 15000000 } ], "taxRateBp": 750, "dueDate": "2026-11-15", "notes": "Thank you for your business.", "send": true }'- Use
clientIdfor a saved client, ornewClientto add one (it’s saved for next time). Send one or the other, not both. send: falsesaves a draft instead. Send it later withPOST /invoices/:id/send.issueDateis optional (today if left out). The due date can’t be before it.
The reply is the full invoice: everything in the list, plus items, subtotalMinor, taxMinor, notes, publicUrl (the page your client sees), activity (its history) and allowedActions (what you can do with it right now, like send, remind or mark_paid).
Invoices
Section titled “Invoices”| Method | Path | What it does |
|---|---|---|
GET |
/invoices |
List invoices, newest first. |
POST |
/invoices |
Create an invoice to a client (outbound). |
GET |
/invoices/:id |
Get one invoice with its items and history. |
PATCH |
/invoices/:id |
Change an invoice. Send only the fields you want to change: clientId, currency, items (replaces all items), taxRateBp, issueDate, dueDate, notes. |
POST |
/invoices/:id/send |
Send a draft. On an invoice already sent, emails it again. |
POST |
/invoices/:id/remind |
Email the client a payment reminder. Answers 202. One reminder per invoice every 24 hours. |
POST |
/invoices/:id/mark-paid |
Mark paid. Send {}, or any of: paidOn (date), method (bank_transfer, card, cash, cheque, mobile_money or other), reference, note, notify (false skips telling the other side). |
POST |
/invoices/:id/reject |
Reject an invoice a contractor sent you. Body: { "reason": "…" }, which they’ll see. |
DELETE |
/invoices/:id |
Move to trash. Answers 204. Admins can restore it in the app for 30 days. |
Filters for GET /invoices:
| Parameter | Values |
|---|---|
direction |
outbound (you sent) or inbound (sent to you) |
status |
draft, pending_approval, sent, viewed, received, paid, rejected, withdrawn, or open / overdue |
overdue |
true or false |
party |
a client or contractor id |
currency |
a currency code |
from, to |
dates (YYYY-MM-DD) |
q |
search text |
limit |
1 to 100 (default 50) |
cursor |
the nextCursor from the last page |
Clients
Section titled “Clients”| Method | Path | What it does |
|---|---|---|
GET |
/clients |
List clients by name. q searches name, email and company; limit 1 to 100 (default 50). |
POST |
/clients |
Add a client. name and email are required; company, phone, address, taxId, defaultCurrency and notes are optional. |
GET |
/clients/:id |
Get one client. |
PATCH |
/clients/:id |
Change a client. Send only the fields you want to change. |
DELETE |
/clients/:id |
Delete a client. Answers 204. Their invoices stay. |
Contractors
Section titled “Contractors”| Method | Path | What it does |
|---|---|---|
GET |
/contractors |
List contractors by name. q searches name and email; limit 1 to 100 (default 50). |
POST |
/contractors |
Add a contractor. name is required; email is optional. |
GET |
/contractors/:id |
Get one contractor. |
PATCH |
/contractors/:id |
Change a contractor. |
DELETE |
/contractors/:id |
Delete a contractor. Answers 204. Their invoices stay. |
Contractors send you invoices through your invoice links. The API can’t create inbound invoices; read them with GET /invoices?direction=inbound.
Same rules as the app
Section titled “Same rules as the app”The API can do what an admin can do, and no more:
- invoices move through the same steps as in the app. You can’t mark a draft paid, or send an invoice that’s already paid;
- when your plan ends, the API stops answering (
402). Your company is still there, read-only, on the web and in the app; - billing, team and settings aren’t in the API.
Limits
Section titled “Limits”| Limit | |
|---|---|
| Per token | 120 requests a minute |
| Per company | 5,000 requests an hour, all tokens together |
| Wrong tokens | 10 tries from one address every 10 minutes |
Go over a limit and you get 429 with a Retry-After: 60 header. Wait that many seconds and try again.
Errors
Section titled “Errors”Errors always look like this:
{ "error": { "code": "VALIDATION_FAILED", "message": "Check the highlighted fields.", "fields": { "dueDate": "Use a valid date (YYYY-MM-DD)." } }}| Status | Code | What it means |
|---|---|---|
401 |
UNAUTHENTICATED |
The token is missing, wrong or revoked. |
402 |
FEATURE_NOT_IN_PLAN |
Your plan doesn’t include the API. |
402 |
SUBSCRIPTION_INACTIVE |
Your plan has ended. Pick a plan again to use the API. |
403 |
FORBIDDEN |
A read-only token tried to change something. |
404 |
NOT_FOUND |
There’s nothing with that id in your company. |
409 |
CONFLICT or INVALID_TRANSITION |
It can’t be done right now, like a second reminder within 24 hours, or marking a draft paid. |
422 |
VALIDATION_FAILED |
Something in the request isn’t right. fields says what. |
429 |
RATE_LIMITED |
Too many requests. Wait and try again. |
The message is written for people, so you can show it to your team as it is.
Keep your tokens safe
Section titled “Keep your tokens safe”A token works like a password for your company’s invoices.
- Use the API only from your own server. Never put a token in a website, a mobile app or anything that runs on someone else’s device.
- Keep tokens in your server’s secret settings, not in your code or in git.
- Give each system its own token, and pick Read only when it doesn’t need to change anything.
- If a token might have leaked, revoke it in Settings → API straight away and create a new one.