Developers
The AnyInvoices API
Create invoices from your own website, shop or back-office system, send your customer to a hosted page to view and pay, and have your server told when the invoice is paid. It is plain HTTPS and JSON, so it works from any language and any platform.
Quick start
- Get a key. Create an account, then open Developers in the app and create an API key. Only an owner or administrator of the business can do this.
- Create an invoice from your server with the request below.
- Send your customer to
invoice.url. That page shows the invoice and, when the business has a connected payment account, takes payment by card or bank transfer. - Listen for
invoice.paidwith a webhook, and mark the order paid.
curl https://www.anyinvoices.com/api/inv/v1/invoices \
-H "Authorization: Bearer $ANYINVOICES_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001" \
-d '{
"customer": { "name": "Northside Bakery", "email": "ap@example.com" },
"lines": [
{ "description": "Storefront sign", "quantity": 1, "unitPrice": "850.00" },
{ "description": "Installation, per hour", "quantity": 6, "unitPrice": "95.00" }
],
"taxRate": "7.5",
"terms": "net30",
"poNumber": "order-1001"
}'Authentication
Every request carries a key in the Authorization header: Authorization: Bearer aik_…. The base address is https://www.anyinvoices.com/api/inv/v1.
- A key belongs to one business and can read and write that business’s customers and invoices. It cannot change settings, the team or the payment account, and it cannot record a payment as received.
- A key is a secret for your server. Do not put it in a web page, a mobile app or a public repository. The API does not answer cross-origin requests from browsers.
- The key is shown once when you create it. We keep only a hash of it, so we cannot show it again. A business can have five working keys, and revoking one takes effect at once.
Repeating a request safely
Send an Idempotency-Key header on a POST that creates something, with a value of your own such as your order number. If the same request is sent again with the same key, for example after a timeout, you get the first answer back and no second invoice is made.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /me | The business the key belongs to. Use it to check a key works. |
| POST | /customers | Create a customer: name, and optionally contact, email, phone, address, notes. |
| GET | /customers | List the business’s customers. |
| POST | /invoices | Create an invoice and issue it. Send "draft": true to leave it as a draft, or "send": true to email it to the customer as well. |
| GET | /invoices | List invoices, newest first. Optional: status (draft, open, paid, void, overdue) and limit (up to 200). |
| GET | /invoices/{id} | One invoice, with its lines, its payments and its url. |
| POST | /invoices/{id}/issue | Issue a draft: it gets its number and its url. |
| POST | /invoices/{id}/send | Email the invoice to the customer, or to the address in "to". |
| POST | /invoices/{id}/void | Void an unpaid invoice. Its url stops working. |
Creating an invoice
customer:nameis required;email,contactandaddress(street1,street2,city,state,postalCode) are optional. Or sendcustomerIdfor a customer you created earlier.lines: up to 100, each with adescription, aquantityand aunitPricein dollars. Send prices as strings such as"850.00"so nothing is lost to rounding.taxabledefaults to true.- Optional:
taxRate(a percentage, such as"7.5"),discount({ "type": "percent" | "amount", "value": "10" }),shipping,terms(receipt,net7,net15,net30,net45,net60, orcustomwith adueDate),issueDate,poNumber,notes,termsText. - Totals are always worked out by AnyInvoices, in whole cents. Any total you send is ignored. Amounts are in US dollars.
The invoice
Creating or fetching an invoice returns it in this form. Amounts ending in Cents are whole cents.
{
"invoice": {
"id": "inv_Qm3v0c1yTn8Zr2Lk",
"status": "open",
"standing": "open",
"number": "INV-0142",
"issueDate": "2026-03-02",
"dueDate": "2026-04-01",
"poNumber": "order-1001",
"currency": "USD",
"customer": { "name": "Northside Bakery", "email": "ap@example.com" },
"lines": [
{ "description": "Storefront sign", "quantity": "1", "unitPrice": "850.00", "taxable": true, "amountCents": 85000 }
],
"totals": { "subtotalCents": 85000, "discountCents": 0, "taxCents": 6375, "shippingCents": 0, "totalCents": 91375 },
"paidCents": 0,
"pendingCents": 0,
"balanceCents": 91375,
"url": "https://www.anyinvoices.com/i/…",
"payableOnline": true,
"payments": []
}
}statusisdraft,open,paidorvoid.standingaddsoverdue,partialandpendingfor an open invoice.urlis the private page for this invoice. Anyone with the address can view the invoice, so give it only to the customer it is for.payableOnlinesays whether that page offers online payment now. It is true only when the business has a connected payment account with Helcim, our payment processor. Otherwise the page shows the invoice and the customer pays another way.pendingCentsis a bank payment that has started and not cleared. Treat an invoice as paid only whenstatusispaid.
Webhooks
Add an address on your server in Developers in the app, and AnyInvoices sends it an HTTPS POST when something happens. A business can have three addresses. Each must be a public https:// address.
| Event | When |
|---|---|
| invoice.issued | An invoice was issued, from the app or the API. |
| invoice.paid | Nothing is left to pay on the invoice. |
| invoice.voided | An invoice was voided. |
| payment.succeeded | A payment was received: a card was approved, a bank payment cleared, or a payment was recorded by hand. |
| payment.pending | A bank payment was started and has not cleared. It is not money received yet. |
| payment.failed | A payment was declined, or a bank payment was returned. |
{
"id": "evt_9bK2mD4xQ7aP1sVn",
"type": "invoice.paid",
"createdAt": 1767225600000,
"data": {
"invoice": { "id": "inv_Qm3v0c1yTn8Zr2Lk", "status": "paid", "number": "INV-0142", "poNumber": "order-1001", "balanceCents": 0, "…": "…" },
"payment": { "id": "…", "invoiceId": "inv_Qm3v0c1yTn8Zr2Lk", "amountCents": 91375, "method": "card", "status": "succeeded" }
}
}Checking the signature
Each address has its own signing secret, shown once when you add it. Every event carries an AnyInvoices-Signature header. Check it before you trust the event, and refuse an event whose time is more than five minutes from now.
# The signature header looks like this:
AnyInvoices-Signature: t=1767225600,v1=5f2b…(64 hex characters)
# v1 is HMAC-SHA256, keyed with your signing secret, of:
# <t> + "." + <the request body exactly as received>What to expect
- Answer with any 2xx status within four seconds. Do slow work after you have answered.
- Each event is sent once. If your server does not answer, the delivery is listed as failed in Developers, where you can send it again. Events are not retried automatically.
- Because a delivery can be missed or repeated, use an event as a prompt: fetch the invoice with
GET /invoices/{id}and act on what it says. Use the event’sidto ignore one you have already handled. - Redirects are not followed.
Errors and limits
An error has an HTTP status and a body of the form { "error": { "code": "…", "message": "…" } }. The message is written to be read by a person.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid-argument | Something in the request is missing or wrong. The message says what. |
| 401 | unauthenticated | No key, or a key that is not valid or was revoked. |
| 403 | permission-denied | The key is not allowed to do that. |
| 404 | not-found | No such address, or no such record in this business. |
| 409 | failed-precondition | The record is not in a state that allows it, such as voiding a paid invoice. |
| 429 | resource-exhausted | Too many requests. A key may make 600 requests an hour. |
| 500 | internal | Something went wrong on our side. The request can be repeated with the same Idempotency-Key. |
What is not built yet
- A test mode with test keys. Today a key works on your real business, so try it with a draft invoice (
"draft": true) or void what you create. - Automatic retries of webhook deliveries.
- Recording a payment, refunding, or changing an issued invoice through the API. These are done in the app.
- Paging through more than 200 invoices in one list.
- Client libraries. The examples on this page are complete; no library is needed.
Questions about an integration: support@anyinvoices.com.