Sparky Expenses API
Read expense claims. Approving and reimbursing stay in the app.
- Address
- https://expenses.sparkyli.com/api/v1
- Plan
- Plus and Max, with API access switched on for the organization
- Specification
- https://expenses.sparkyli.com/api/v1/openapi.yaml
Endpoints
GET /expenses
Expenses, newest first.
Your own claims, unless your role can approve (then the organization's).
Inputs
| Name | Type | What it is |
|---|---|---|
| status | logged, submitted, approved, rejected or reimbursed | Only expenses in this state. |
| project_id, client_id | text | Only this project or client. |
| from, to | date, YYYY-MM-DD | Earliest and latest expense date. |
| limit, offset | whole numbers | Paging: limit 1 to 100 (default 50); offset from next_offset. |
Answer: expenses (a list) and next_offset
| Name | Type | What it is |
|---|---|---|
| id, user_id | text | The expense and who claimed it. |
| expense_number | text or null | Like EXP-0012. |
| client_id, project_id | text or null | |
| category | text | For example travel or meals; an organization can add its own. |
| amount | whole number, minor units | The gross total paid. |
| currency | 3 letters | |
| expense_date | date | |
| description | text or null | |
| is_billable | 0 or 1 | 1 when it can be billed to a client. |
| status | logged, submitted, approved, rejected or reimbursed | |
| submitted_at, approved_at, reimbursed_at | text or null | UTC time. |
| created_at, updated_at | text | UTC time. |
GET /expenses/{id}
One expense. The receipt file stays in the app.
Inputs
| Name | Type | What it is |
|---|---|---|
| id* | text | The expense's id. |
Answer: expense
| Name | Type | What it is |
|---|---|---|
| (all the list fields, and these) | ||
| tag | text or null | A free-text label, like a trip name. |
| tax_rate | number or null | Percent, where tax was captured. |
| taxable_value, tax_amount | whole number or null, minor units | |
| rejection_note | text or null | Why it was rejected. |
| receipt_filename | text or null | The name of the attached receipt. The file itself is never returned. |
Errors (besides the common ones)
- 404 not_found: No such expense, or it is not yours to see.
Example
curl -s -H "authorization: Bearer $TOKEN" "https://expenses.sparkyli.com/api/v1/expenses?status=submitted" New here? Start with the three things first, then sign in. Errors are explained under errors and limits.