# API: Invoices

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/work/invoices` | Invoices or estimates, newest first | `invoices:read` |
| POST | `/v1/work/invoices` | Make a draft invoice or estimate: from the work that isn't billed yet (work), from lines of your own, or both. Nothing is sent | `invoices:write` |
| DELETE | `/v1/work/invoices/:id` | Remove a draft or a repeating invoice. Its time and expenses can be billed again | `invoices:write` |
| GET | `/v1/work/invoices/:id` | One invoice or estimate, with its lines, payments and emails | `invoices:read` |
| PATCH | `/v1/work/invoices/:id` | Change a draft. Lines, when given, replace all of them; taking one off lets its time be billed again | `invoices:write` |
| POST | `/v1/work/invoices/:id/approve` | Approve a draft so it can be sent. Without that permission, asks someone who has it (web app only) | `invoices:write` |
| GET | `/v1/work/invoices/:id/books` | Whether this invoice is in your QuickBooks Online or Xero books: not sent, waiting, sent, failed or voided | `invoices:read` |
| POST | `/v1/work/invoices/:id/books` | Send one sent invoice, with its payments, to your QuickBooks Online or Xero books now. Sending it again changes nothing unless it changed | `invoices:write` |
| POST | `/v1/work/invoices/:id/copy` | Make a new draft from this one: another invoice, or an invoice from an estimate. Time isn't copied twice | `invoices:write` |
| POST | `/v1/work/invoices/:id/correct` | Correct a sent invoice: it's cancelled, and a new draft has its lines, time and expenses | `invoices:write` |
| GET | `/v1/work/invoices/:id/e-invoice` | A sent invoice as a Peppol e-invoice file (UBL) | `invoices:read` |
| POST | `/v1/work/invoices/:id/link` | Make a new link for the client. The old one stops working | `invoices:write` |
| POST | `/v1/work/invoices/:id/payments` | Record a payment, all of what's owed unless you say how much. how: balance uses money the client paid ahead, credit lowers what they owe | `invoices:write` |
| DELETE | `/v1/work/invoices/:id/payments/:payment` | Remove a payment recorded by mistake | `invoices:write` |
| POST | `/v1/work/invoices/:id/payments/:payment/refund` | Give back part or all of an online payment, through Stripe (web app only) | `invoices:write` |
| POST | `/v1/work/invoices/:id/project` | Start a project from an accepted estimate, at its price | `invoices:write` |
| PUT | `/v1/work/invoices/:id/repeat` | Make an invoice again every week, month or year, as a draft to look at unless auto_send is on. On a repeating invoice, change or pause it | `invoices:write` |
| POST | `/v1/work/invoices/:id/send` | Send it by email, or (with nobody to write to) mark it as sent. From then on it never changes | `messages:send` |
| POST | `/v1/work/invoices/:id/status` | Cancel a sent invoice, write it off or bring it back, or mark an estimate accepted or declined | `invoices:write` |
| GET | `/v1/work/invoices/accounts.csv` | Invoices sent between two days, as the file Xero or QuickBooks Online reads, or the payments received | `invoices:read` |
| GET | `/v1/work/invoices/books` | Your link to QuickBooks Online or Xero: which company it writes to, whether invoices go across by themselves, what's waiting and the last failure | `invoices:read` |
| PUT | `/v1/work/invoices/books` | Turn sending invoices across by themselves on or off (only invoices sent from then on), choose the Xero organisation, set the account and tax names, or try failed ones again | `invoices:write` |
| POST | `/v1/work/invoices/connect` | Connect your own Stripe account: answers with Stripe's page to open (web app only) | `invoices:write` |
| DELETE | `/v1/work/invoices/logo` | Take the logo off new invoices | `invoices:write` |
| GET | `/v1/work/invoices/logo` | The logo on new invoices | `invoices:read` |
| PUT | `/v1/work/invoices/logo` | Put a logo on new invoices: send the JPEG itself, up to 500 KB | `invoices:write` |
| GET | `/v1/work/invoices/packages` | Hours clients paid for ahead, and how much of them is used | `invoices:read` |
| POST | `/v1/work/invoices/packages` | Sell a client hours ahead. With a price it makes a draft invoice for them, and they count once that's sent. Later invoices take them off | `invoices:write` |
| DELETE | `/v1/work/invoices/packages/:id` | Stop using hours paid ahead. Invoices that used some stay as they are | `invoices:write` |
| GET | `/v1/work/invoices/senders` | Other names you invoice under, each with its own numbers | `invoices:read` |
| POST | `/v1/work/invoices/senders` | Add another name to invoice under, like a second company | `invoices:write` |
| PATCH | `/v1/work/invoices/senders/:id` | Change a name you invoice under, or archive it. Sent invoices stay as they are | `invoices:write` |
| GET | `/v1/work/invoices/settings` | What invoices say, and how clients pay them | `invoices:read` |
| PUT | `/v1/work/invoices/settings` | Change what new invoices say, and what's sent by itself. Sent invoices stay as they are | `invoices:write` |
| GET | `/v1/work/invoices/unbilled` | Time, fixed prices and expenses that aren't on an invoice yet, by client and project, and what's owed | `invoices:read` |

## Examples

### GET /v1/work/invoices

Invoices or estimates, newest first

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices

Make a draft invoice or estimate: from the work that isn't billed yet (work), from lines of your own, or both. Nothing is sent

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/invoices/$ID

Remove a draft or a repeating invoice. Its time and expenses can be billed again

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/invoices/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/invoices/$ID

One invoice or estimate, with its lines, payments and emails

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/work/invoices/$ID

Change a draft. Lines, when given, replace all of them; taking one off lets its time be billed again

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/invoices/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/$ID/books

Whether this invoice is in your QuickBooks Online or Xero books: not sent, waiting, sent, failed or voided

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/$ID/books" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/books`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/books

Send one sent invoice, with its payments, to your QuickBooks Online or Xero books now. Sending it again changes nothing unless it changed

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/books" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/books`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/copy

Make a new draft from this one: another invoice, or an invoice from an estimate. Time isn't copied twice

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/copy" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/copy`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/correct

Correct a sent invoice: it's cancelled, and a new draft has its lines, time and expenses

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/correct" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/correct`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/$ID/e-invoice

A sent invoice as a Peppol e-invoice file (UBL)

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/$ID/e-invoice" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/e-invoice`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/link

Make a new link for the client. The old one stops working

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/link" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/link`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/payments

Record a payment, all of what's owed unless you say how much. how: balance uses money the client paid ahead, credit lowers what they owe

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/payments" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/payments`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/invoices/$ID/payments/$PAYMENT

Remove a payment recorded by mistake

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/invoices/$ID/payments/$PAYMENT" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/payments/${payment}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/project

Start a project from an accepted estimate, at its price

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/project" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/project`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### PUT /v1/work/invoices/$ID/repeat

Make an invoice again every week, month or year, as a draft to look at unless auto_send is on. On a repeating invoice, change or pause it

```bash
curl -s -X PUT "https://api.hourfinch.com/v1/work/invoices/$ID/repeat" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/repeat`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/send

Send it by email, or (with nobody to write to) mark it as sent. From then on it never changes

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/send" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/send`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/invoices/$ID/status

Cancel a sent invoice, write it off or bring it back, or mark an estimate accepted or declined

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/$ID/status" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/${id}/status`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/accounts.csv

Invoices sent between two days, as the file Xero or QuickBooks Online reads, or the payments received

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/accounts.csv" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/accounts.csv`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/invoices/books

Your link to QuickBooks Online or Xero: which company it writes to, whether invoices go across by themselves, what's waiting and the last failure

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/books" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/books`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/work/invoices/books

Turn sending invoices across by themselves on or off (only invoices sent from then on), choose the Xero organisation, set the account and tax names, or try failed ones again

```bash
curl -s -X PUT "https://api.hourfinch.com/v1/work/invoices/books" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/books`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/invoices/logo

Take the logo off new invoices

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/invoices/logo" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/logo`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/invoices/logo

The logo on new invoices

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/logo" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/logo`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/work/invoices/logo

Put a logo on new invoices: send the JPEG itself, up to 500 KB

```bash
curl -s -X PUT "https://api.hourfinch.com/v1/work/invoices/logo" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/logo`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/packages

Hours clients paid for ahead, and how much of them is used

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/packages" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/packages`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices/packages

Sell a client hours ahead. With a price it makes a draft invoice for them, and they count once that's sent. Later invoices take them off

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/packages" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/packages`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/invoices/packages/$ID

Stop using hours paid ahead. Invoices that used some stay as they are

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/invoices/packages/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/packages/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/invoices/senders

Other names you invoice under, each with its own numbers

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/senders" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/senders`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/invoices/senders

Add another name to invoice under, like a second company

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/invoices/senders" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/senders`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### PATCH /v1/work/invoices/senders/$ID

Change a name you invoice under, or archive it. Sent invoices stay as they are

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/invoices/senders/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/senders/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/settings

What invoices say, and how clients pay them

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/settings" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/settings`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/work/invoices/settings

Change what new invoices say, and what's sent by itself. Sent invoices stay as they are

```bash
curl -s -X PUT "https://api.hourfinch.com/v1/work/invoices/settings" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/settings`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/invoices/unbilled

Time, fixed prices and expenses that aren't on an invoice yet, by client and project, and what's owed

```bash
curl -s "https://api.hourfinch.com/v1/work/invoices/unbilled" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/invoices/unbilled`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.hourfinch.com/openapi.json](https://www.hourfinch.com/openapi.json). All resources: [API reference](https://www.hourfinch.com/docs/api).
