Log an expense
pricing defaults to amount, which requires amount. pricing unit requires quantity and unitRate, and amount is stored as their product rounded to cents. billable defaults to true. An empty clientId or projectId is allowed. A project the caller can read may be a teammate's shared project. When that project belongs to a client and clientId is omitted, the expense takes the project's client. A clientId that disagrees with the project's client is rejected.
View as MarkdownAuthorization
bearer In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/expenses" \ -H "Content-Type: application/json" \ -d '{ "spentOn": "2019-08-24", "type": "string" }'{ "expense": { "id": "string", "clientId": "string", "clientName": "string", "projectId": "string", "projectName": "string", "projectColor": "string", "spentOn": "2019-08-24", "pricing": "amount", "amount": 0, "quantity": 0, "unitRate": 0, "type": "string", "billable": true, "note": "string", "hasReceipt": true, "receipt": { "contentType": "string", "sizeBytes": 0, "filename": "string", "url": "string" }, "created": "2019-08-24T14:15:22Z" }}List expenses
The caller's own expenses, newest first, at most 500. from and to are inclusive calendar dates (YYYY-MM-DD) on spentOn. Sharing a project never adds a teammate's expenses.
Update an expense
Owner-scoped. Omitted fields stay as they are. clientId or projectId of "" clears that link. Sending pricing, amount, quantity, or unitRate recomputes the total from the merged values.