Pular para o conteúdo principal

kobana finance taxes

Comandos de kobana finance taxes. Toda opção global (Opções globais) vale aqui.

ComandoHTTPDescrição
taxes listGET /v1/taxesListar impostos
taxes createPOST /v1/taxesCriar imposto
taxes getGET /v1/taxes/{id}Obter imposto por ID
taxes updatePATCH /v1/taxes/{id}Atualizar imposto
taxes deleteDELETE /v1/taxes/{id}Excluir imposto

taxes list​

Listar impostos

kobana finance taxes list [OPÇÕES]

GET /v1/taxes

Returns a cursor-paginated page of tax kinds for the workspace tied to the token's sub claim. Requires scope finance/taxes with access level read. Catalogal entity — defaults to alphabetical sort by name.

Parâmetros de consulta

NomeTipoObrigatórioDescrição
activestringnãoFilter by active flag. true returns only active (default UX preference); omit to return both. Valores: true, false.
default_withholdingstringnãoFilter by default_withholding flag (whether new charges default to imposto retido). Valores: true, false.
namestringnãoFilter by exact name (unique per workspace). Accepts [in]=IRRF,INSS for OR matching.
sort_bystringnãoField to order by. Default: sort_by=name&sort_order=asc. Valores: created_at, name.
sort_orderstringnãoOrder direction. Defaults to asc; ignored without sort_by. Valores: asc, desc.
limitintegernãoPage size. Default 25, max 100.
cursorstringnãoOpaque cursor for the next page. Round-trip meta.next_cursor from the previous response.
fieldsstringnãoComma-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.

Cabeçalhos

NomeTipoObrigatórioDescrição
X-Workspace-IdstringsimWorkspace 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).

Respostas

HTTPDescrição
200Page of tax kinds plus pagination metadata.
400Malformed query (unknown filter / operator, invalid limit, bad cursor).

taxes create​

Criar imposto

kobana finance taxes create [OPÇÕES]

POST /v1/taxes

Creates a tax kind. Requires scope finance/taxes with access level write. Workspace-scoped (no company). name is unique per workspace (duplicate → 409). default_rate is a percent string (0–100). Pass an X-Idempotency-Key header on retries.

Cabeçalhos

NomeTipoObrigatórioDescrição
X-Workspace-IdstringsimWorkspace 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).

Corpo da requisição

NomeTipoObrigatórioDescrição
namestringsimTax label. Unique per workspace.
default_ratenumbernãoSuggested default rate as a percent (0–100, up to 2 decimals). null/omitted = no default.
default_withholdingbooleannãoDefaults to true (imposto retido).
activebooleannãoDefaults to true.
custom_metadataobjectnãoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.

Outros campos e objetos aninhados: kobana schema finance.taxes.create.

Respostas

HTTPDescrição
201Tax created. The Location header points at the new row.
400Malformed JSON body.
409A tax with the same name already exists, or X-Idempotency-Key reuse with a different body.
422Schema validation failure, or default_rate out of the 0–100 range.

taxes get​

Obter imposto por ID

kobana finance taxes get [ID] [OPÇÕES]

GET /v1/taxes/{id}

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

Argumentos do caminho: id

Parâmetros de consulta

NomeTipoObrigatórioDescrição
fieldsstringnãoComma-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.

Cabeçalhos

NomeTipoObrigatórioDescrição
X-Workspace-IdstringsimWorkspace 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).

Respostas

HTTPDescrição
200Get a tax kind by id
404Tax not found within the tenant.

taxes update​

Atualizar imposto

kobana finance taxes update [ID] [OPÇÕES]

PATCH /v1/taxes/{id}

Partial update of name, default_rate, default_withholding, active. Requires scope finance/taxes with access level write. Send default_rate: null to clear it, or active: false to soft-deactivate.

Argumentos do caminho: id

Cabeçalhos

NomeTipoObrigatórioDescrição
X-Workspace-IdstringsimWorkspace 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).

Corpo da requisição

NomeTipoObrigatórioDescrição
namestringnãoTax label. Unique per workspace.
default_ratenumbernãoSuggested default rate as a percent (0–100, up to 2 decimals). null/omitted = no default.
default_withholdingbooleannãoDefaults to true (imposto retido).
activebooleannãoDefaults to true.
custom_metadataobjectnãoMetadados do usuário: objeto JSON livre. Envie null para limpar. Máx. 64 KB serializado, 16 níveis.

Outros campos e objetos aninhados: kobana schema finance.taxes.update.

Respostas

HTTPDescrição
200Updated tax.
400Malformed JSON body.
404Tax not found within the tenant.
409A tax with the same name already exists.
422Schema validation failure, or default_rate out of range.

taxes delete​

Excluir imposto

kobana finance taxes delete [ID] [OPÇÕES]

DELETE /v1/taxes/{id}

Deletes a tax. Requires scope finance/taxes with access level delete. Returns 422 (reason: in_use, with the referencing payable/receivable ids) when the tax still has charges — soft-deactivate via PATCH { active: false } instead. Calling DELETE twice returns 200 then 404.

Argumentos do caminho: id

Cabeçalhos

NomeTipoObrigatórioDescrição
X-Workspace-IdstringsimWorkspace 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).

Respostas

HTTPDescrição
200Tax deleted.
404Tax not found within the tenant.
422The tax has charges (reason: in_use).