Saltar al contenido

expenses

Módulo Finance · 6 operaciones

List expense rows

GET/expenses

An expense. One expense posts to exactly one budget line; the submitter cannot approve it. Returns a cursor page of expense rows the caller may see. The default order is `created_at` ascending. Supports sparse fieldsets and the filter grammar.

Create an expense

POST/expenses

An expense. One expense posts to exactly one budget line; the submitter cannot approve it. Creates an expense. Requires `Idempotency-Key`; a replay returns the original response. The organization is derived from the credential or the parent row, never from the body.

Get an expense

GET/expenses/{id}

An expense. One expense posts to exactly one budget line; the submitter cannot approve it. Returns one expense with its `ETag`. A expense the caller may not see returns 404.

Update an expense

PATCH/expenses/{id}

An expense. One expense posts to exactly one budget line; the submitter cannot approve it. Updates the fields sent; omitted fields are unchanged. Requires `If-Match` with the current `ETag`: a stale tag returns 412 and a missing tag returns 428.

Submit an expense

POST/expenses/{id}/submit

Submits the expense for approval. A closed production refuses new expenses. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

Approve a expense

POST/expenses/{id}/approve

Records an approval decision on the expense. The submitter cannot approve it. Spend authority and separation of duties are enforced in the approval RPC; a refusal returns 422 and names the rule. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.