Saltar al contenido principal

kobana finance financial-transactions

Comandos de kobana finance financial-transactions. Toda opción global (Opciones globales) vale aquí.

ComandoHTTPDescripción
financial-transactions aggregatesGET /v1/financial-transactions/aggregatesSumar totales de transacciones
financial-transactions idsGET /v1/financial-transactions/idsListar IDs de transacciones
financial-transactions listGET /v1/financial-transactionsListar transacciones
financial-transactions createPOST /v1/financial-transactionsCrear transacción
financial-transactions getGET /v1/financial-transactions/{id}Obtener transacción por ID
financial-transactions updatePATCH /v1/financial-transactions/{id}Actualizar transacción
financial-transactions deleteDELETE /v1/financial-transactions/{id}Eliminar transacción

financial-transactions aggregates​

Sumar totales de transacciones

kobana finance financial-transactions aggregates [OPCIONES]

GET /v1/financial-transactions/aggregates

Sums realised transactions for the workspace tied to the token (forecasts excluded): count, credit, debit, net. Requires scope finance/transactions with access level read. Filter by company_id and a period; omit all filters for all-time.

Parámetros de consulta

NombreTipoObligatorioDescripción
company_idstringnoScope to one company. Omit to aggregate across the whole tenant.
monthintegernoCalendar month (1–12). Requires year. Mutually exclusive with start_date/end_date.
yearinteger,nullnoCalendar year. Requires month.
start_datestringnoWindow start (ISO 8601). Requires end_date. Mutually exclusive with month/year.
end_datestringnoWindow end (ISO 8601). Requires start_date.

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Respuestas

HTTPDescripción
200Transaction totals for the scope.
400Malformed query (unknown param, bad pairing, invalid date/uuid).

financial-transactions ids​

Listar IDs de transacciones

kobana finance financial-transactions ids [OPCIONES]

GET /v1/financial-transactions/ids

Every financial transaction id the token can see. Requires scope finance/transactions with access level read. Pairs with ?updated_at[gte]= on the listing. The delta reports what changed; this reports what still exists. A delta can never report a disappearance — the row it would have to describe is gone — so an id that stops appearing here is the only signal that something left. Diff this set against your mirror and drop what is missing. Takes no filters: the sweep must cover exactly what the listing shows, and a filter applied here but not to your mirror would read as mass deletion. This is the largest resource in the API, which is what makes the pairing worth the trouble: re-paging the full history to find a handful of removals is exactly the cost the delta exists to avoid.

Parámetros de consulta

NombreTipoObligatorioDescripción
limitstringnoPage size. Default 1000, max 10000 — far above the listing's 100, because a row here is one UUID.
cursorstringnoOpaque cursor from the previous page's meta.next_cursor.

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Respuestas

HTTPDescripción
200Live financial transaction ids.
400Malformed query. This endpoint takes no filters or sort — passing one is a 400.

financial-transactions list​

Listar transacciones

kobana finance financial-transactions list [OPCIONES]

GET /v1/financial-transactions

Returns a cursor-paginated page of transactions for the workspace tied to the token's sub claim. Requires scope finance/transactions with access level read.

Parámetros de consulta

NombreTipoObligatorioDescripción
company_idstringnoFilter by company UUID. Accepts [in]=uuid1,uuid2 for OR matching.
typestringnodebit (money out) or credit (money in). Accepts [in]=debit,credit. Valores: debit, credit.
financial_account_idstringnoFilter by financial account UUID. Accepts [in].
person_idstringnoFilter by person UUID. Accepts [in].
category_idstringnoFilter by category UUID. Accepts [in].
classification_center_idstringnoFilter by classification-center UUID. Accepts [in].
occurred_atstringnoISO date filter on the movement date. Range operators supported: [gte], [lte], [gt], [lt]. Example: ?occurred_at[gte]=2026-01-01&occurred_at[lte]=2026-12-31.
updated_atstringnoISO timestamp filter on the last write. Range operators supported. This is the incremental-sync window: poll ?updated_at[gte]=<end of your last poll>&sort_by=updated_at to fetch only what changed. Deletions do NOT appear here — a deleted transaction has no row to return; reconcile them against GET /v1/financial-transactions/ids.
amountstringnoDecimal filter on amount (BRL). Range operators supported: [gte], [lte], [gt], [lt]. A query parameter is always text, unlike the JSON body and the response, where money is a number.
sort_bystringnoField to order by. Default: sort_by=occurred_at&sort_order=desc. Valores: amount, created_at, occurred_at, updated_at.
sort_orderstringnoOrder direction. Defaults to asc; ignored without sort_by. Valores: asc, desc.
limitintegernoPage size. Default 25, max 100.
cursorstringnoOpaque cursor for the next page. Round-trip meta.next_cursor from the previous response.
fieldsstringnoComma-separated top-level fields to return, e.g. fields=description,amount,due_date. Omit for every field. id is always included; naming an object field returns it whole. An unknown name is a 400 whose details lists unknown and available.

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Respuestas

HTTPDescripción
200Page of transactions plus pagination metadata.
400Malformed query (unknown filter / operator, invalid limit, bad cursor).

financial-transactions create​

Crear transacción

kobana finance financial-transactions create [OPCIONES]

POST /v1/financial-transactions

Creates a single transaction. Requires scope finance/transactions with access level write. workspace_id is always taken from the token, never from the body. auto_created and transfer_id are always server-controlled — values in the request are ignored. {name} accepted as alternative to {id} inside the nested person / category / classification_center object, for CSV-importer ergonomics; sending both inside the same object returns 400. Send classification_centers[] to split the amount across classification centers (rateio): effective amounts must sum to amount (1-cent tolerance) and each center's polarity must match type (both matches either). When present it supersedes the single classification_center field (which then mirrors rows[0]); the full split rides back on every read as classification_center_allocations[]. categories[] splits it across categories the same way (no polarity check) and rides back as category_allocations[]; it supersedes the single category field, which mirrors rows[0]. Pass an X-Idempotency-Key header on retries to avoid duplicate inserts.

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Cuerpo de la solicitud

NombreTipoObligatorioDescripción
company_idstring (uuid)síOwning company UUID. Must belong to the tenant and match the account's company_id (or the account must be workspace-level).
financial_account_idstring (uuid)síSettlement account UUID. Must belong to the tenant.
descriptionstringsí
amountnumbersíA number in BRL (up to 13 integer digits, 2 decimals). Always positive — direction is carried by type.
occurred_atstring (date-time)síWhen the movement hit the account (ISO 8601).
typestringsídebit = money out, credit = money in. Drives the polarity for find-or-create on {name} fallbacks. Valores: debit, credit.
bank_descriptionstringno
documentstringno
document_datestring (date-time)noIssue date of the source document (ISO 8601). Pass null (PATCH) to clear.
competence_datestring (date-time)noAccounting period this movement belongs to. Defaults to occurred_at when omitted.
categoryobjectno{id} for an existing category, or {name} to find-or-create one scoped to (workspace, company) with polarity derived from type. Sending both id and name returns 400. On update, sent without categories it replaces a category rateio with this single category.
personobjectno{id} for an existing person, or {name} to find-or-create one with customer polarity for credits / supplier for debits. Never both.
classification_centerobjectno{id} for an existing classification center, or {name} to find-or-create one with revenue polarity for credits / cost for debits — a center typed both matches either; creates with the narrow polarity when no match. Never both.
classification_centersarray<object>noRateio (split) across classification centers. Replace-all: the array becomes the row's set; an empty array clears it; omit to leave it alone. Effective amounts must sum to amount (1-cent tolerance). Each center's polarity must match the transaction type (both matches either). When present, the single classification_center field is ignored and the legacy FK mirrors rows[0].
categoriesarray<object>noCategory rateio. Replace-all set; an empty array clears it (and category); omit to leave it alone. Effective amounts must sum to amount (tolerance: the larger of 0.01 and 0.005 per row). When present, category is ignored and becomes rows[0]; every category must be of type the transaction's type (422 otherwise). The cents a percentage leaves go to the last slice sent without an amount.
custom_classificationsarray<object>noCustom-classifier assignments. Replace-all: the array becomes the row's set; an empty array clears it; omit to leave it alone. One value per dimension for native single-select.
payment_method_kindstringnoValores: bank_billet, ted, pix, credit_card, debit_card, cash, check, direct_debit, other, none, null.
classifiedbooleannoDefaults to false. Setting true marks the row as already-categorised in the UI.
notesstringno
is_pendingbooleannoDefaults to false. When true, the row is treated as a forecast — excluded from realised-balance and dashboard income/expense aggregates.
custom_metadataobjectnoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.

Otros campos y objetos anidados: kobana schema finance.financial-transactions.create.

Respuestas

HTTPDescripción
201Transaction created. The Location header points at the new row. X-Idempotent-Replay: true indicates a cached response from a previous identical request.
400Malformed JSON body, or id and name sent together inside the same nested entity reference.
409X-Idempotency-Key was reused with a different request body.
422Schema validation failure, or domain consistency violation (company / account not in tenant, account does not match company, FK out of scope).

financial-transactions get​

Obtener transacción por ID

kobana finance financial-transactions get [ID] [OPCIONES]

GET /v1/financial-transactions/{id}

Returns the same shape as the rows from the list endpoint. Requires scope finance/transactions with access level read. 404 covers both "doesn't exist" and "not in the tenant" — the API does not distinguish.

Argumentos de la ruta: id

Parámetros de consulta

NombreTipoObligatorioDescripción
fieldsstringnoComma-separated top-level fields to return, e.g. fields=description,amount,due_date. Omit for every field. id is always included; naming an object field returns it whole. An unknown name is a 400 whose details lists unknown and available.

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Respuestas

HTTPDescripción
200Get a transaction by id
404Transaction not found within the tenant.

financial-transactions update​

Actualizar transacción

kobana finance financial-transactions update [ID] [OPCIONES]

PATCH /v1/financial-transactions/{id}

Partial update. Only fields present in the body are written. Requires scope finance/transactions with access level write. Read-only fields in the body (id, workspace_id, company_id, financial_account_id, auto_created, transfer_id, created_at) are silently dropped — the response is the new persisted state.

Argumentos de la ruta: id

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Cuerpo de la solicitud

NombreTipoObligatorioDescripción
dataobjectsíRequest body to update a financial transaction: send only the fields to change.

Otros campos y objetos anidados: kobana schema finance.financial-transactions.update.

Respuestas

HTTPDescripción
200Updated transaction.
400Malformed JSON body, or id and name sent together inside the same nested entity reference.
404Transaction not found within the tenant.
409X-Idempotency-Key reused with a different body.
422Schema validation failure or FK out of scope.

financial-transactions delete​

Eliminar transacción

kobana finance financial-transactions delete [ID] [OPCIONES]

DELETE /v1/financial-transactions/{id}

Hard-deletes the row. Requires scope finance/transactions with access level delete. Deleting an auto-created row (one generated by paying / receiving a payable / receivable) returns 422 — cancel the source billing instead. Calling DELETE twice on the same id returns 200 then 404 (Stripe-style).

Argumentos de la ruta: id

Encabezados

NombreTipoObligatorioDescripción
X-Workspace-IdstringsíWorkspace to act on, as a UUID. The token identifies the organization; this header picks which of its workspaces the request reads or writes. It is checked against the token's organization, so a workspace owned by anyone else answers UNKNOWN_WORKSPACE — the same code as one that does not exist. Omitting it answers WORKSPACE_REQUIRED (400).

Respuestas

HTTPDescripción
200Transaction deleted.
404Transaction not found within the tenant.
422Auto-created transaction — cancel the parent payable / receivable instead.