API reference
API: Expenses
| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | /v1/work/expenses | The latest expenses, or those between two days: your own, and others' if you may see them | expenses:read |
| POST | /v1/work/expenses | Add an expense to a project | expenses:write |
| DELETE | /v1/work/expenses/:id | Remove an expense and its receipt | expenses:write |
| PATCH | /v1/work/expenses/:id | Correct an expense, or mark the person paid back | expenses:write |
| DELETE | /v1/work/expenses/:id/receipt | Take off an expense's receipt | expenses:write |
| GET | /v1/work/expenses/:id/receipt | An expense's receipt | expenses:read |
| POST | /v1/work/expenses/:id/receipt | Add or replace an expense's receipt: send the photo or PDF itself, up to 8 MB | expenses:write |
| GET | /v1/work/expenses/categories | Kinds of expense | expenses:read |
| POST | /v1/work/expenses/categories | Add a kind of expense | expenses:write |
| PATCH | /v1/work/expenses/categories/:id | Change a kind of expense, archive it or bring it back. Expenses already added stay as they are | expenses:write |
Examples
GET /v1/work/expenses
The latest expenses, or those between two days: your own, and others' if you may see them
curl -s "https://api.hourfinch.com/v1/work/expenses" \
-H "Authorization: Bearer $TK_API_KEY"const res = await fetch(`https://api.hourfinch.com/v1/work/expenses`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();POST /v1/work/expenses
Add an expense to a project
curl -s -X POST "https://api.hourfinch.com/v1/work/expenses" \
-H "Authorization: Bearer $TK_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://api.hourfinch.com/v1/work/expenses`, {
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/expenses/$ID
Remove an expense and its receipt
curl -s -X DELETE "https://api.hourfinch.com/v1/work/expenses/$ID" \
-H "Authorization: Bearer $TK_API_KEY"const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/${id}`, {
method: "DELETE",
headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();PATCH /v1/work/expenses/$ID
Correct an expense, or mark the person paid back
curl -s -X PATCH "https://api.hourfinch.com/v1/work/expenses/$ID" \
-H "Authorization: Bearer $TK_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/${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();DELETE /v1/work/expenses/$ID/receipt
Take off an expense's receipt
curl -s -X DELETE "https://api.hourfinch.com/v1/work/expenses/$ID/receipt" \
-H "Authorization: Bearer $TK_API_KEY"const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/${id}/receipt`, {
method: "DELETE",
headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();GET /v1/work/expenses/$ID/receipt
An expense's receipt
curl -s "https://api.hourfinch.com/v1/work/expenses/$ID/receipt" \
-H "Authorization: Bearer $TK_API_KEY"const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/${id}/receipt`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();POST /v1/work/expenses/$ID/receipt
Add or replace an expense's receipt: send the photo or PDF itself, up to 8 MB
curl -s -X POST "https://api.hourfinch.com/v1/work/expenses/$ID/receipt" \
-H "Authorization: Bearer $TK_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/${id}/receipt`, {
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/expenses/categories
Kinds of expense
curl -s "https://api.hourfinch.com/v1/work/expenses/categories" \
-H "Authorization: Bearer $TK_API_KEY"const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/categories`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();POST /v1/work/expenses/categories
Add a kind of expense
curl -s -X POST "https://api.hourfinch.com/v1/work/expenses/categories" \
-H "Authorization: Bearer $TK_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/categories`, {
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/expenses/categories/$ID
Change a kind of expense, archive it or bring it back. Expenses already added stay as they are
curl -s -X PATCH "https://api.hourfinch.com/v1/work/expenses/categories/$ID" \
-H "Authorization: Bearer $TK_API_KEY" \
-H "content-type: application/json" \
-d '{}'const res = await fetch(`https://api.hourfinch.com/v1/work/expenses/categories/${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();Request and response schemas: https://www.hourfinch.com/openapi.json. All resources: API reference.