Documentation menu
These are pre-release docs from the main branch.

API reference

9 operations in ticket-costs. Raw spec: openapi.json.

GET/api/v1/invoice-candidates

GET /api/invoice-candidates — every billable, not-yet-billed cost line and expense in the org, oldest first. The invoicing run consumes rows by writing `invoice_line_id` through the costs module's marker.

Responses

StatusDescription
200

Security: bearer

GET/api/v1/tickets/{id}/cost-lines

GET /api/tickets/{id}/cost-lines

Parameters

NameInTypeRequiredDescription
idpathstringYes

Responses

StatusDescription
200

Security: bearer

POST/api/v1/tickets/{id}/cost-lines

POST /api/tickets/{id}/cost-lines — add a money line (parts/flat/other).

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

CreateCostLineRequest

Responses

StatusDescription
200
404ticket not found in scope
409idempotency key reused
422invalid quantity/currency

Security: bearer

PATCH/api/v1/tickets/{id}/cost-lines/{line_id}

PATCH /api/tickets/{id}/cost-lines/{line_id} — edit an unbilled line.

Parameters

NameInTypeRequiredDescription
idpathstringYes
line_idpathstringYes

Request body

UpdateCostLineRequest

Responses

StatusDescription
200
404line not found in scope
409already billed, version conflict, or idempotency key reused

Security: bearer

DELETE/api/v1/tickets/{id}/cost-lines/{line_id}

DELETE /api/tickets/{id}/cost-lines/{line_id} — remove an unbilled line.

Parameters

NameInTypeRequiredDescription
idpathstringYes
line_idpathstringYes

Responses

StatusDescription
200
404line not found in scope
409already billed

Security: bearer

GET/api/v1/tickets/{id}/expenses

GET /api/tickets/{id}/expenses — the ticket's expense entries.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Responses

StatusDescription
200

Security: bearer

POST/api/v1/tickets/{id}/expenses

POST /api/tickets/{id}/expenses — record an expense entry.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

CreateExpenseRequest

Responses

StatusDescription
200
404ticket not found in scope
409idempotency key reused
422invalid amount/currency

Security: bearer

PATCH/api/v1/tickets/{id}/expenses/{expense_id}

PATCH /api/tickets/{id}/expenses/{expense_id} — edit an unbilled expense.

Parameters

NameInTypeRequiredDescription
idpathstringYes
expense_idpathstringYes

Request body

UpdateExpenseRequest

Responses

StatusDescription
200
404expense not found in scope
409already billed, version conflict, or idempotency key reused

Security: bearer

DELETE/api/v1/tickets/{id}/expenses/{expense_id}

DELETE /api/tickets/{id}/expenses/{expense_id} — remove an unbilled expense.

Parameters

NameInTypeRequiredDescription
idpathstringYes
expense_idpathstringYes

Responses

StatusDescription
200
404expense not found in scope
409already billed

Security: bearer