Skip to main content

kobana billing tax-rules

Commands of kobana billing tax-rules. Every global option (Global options) applies here.

CommandHTTPDescription
tax-rules listGET /v1/tax_rulesList tax rules
tax-rules createPOST /v1/tax_rulesCreate tax rule
tax-rules updatePUT /v1/tax_rulesUpsert tax rule
tax-rules getGET /v1/tax_rules/{id}Get tax rule
tax-rules deleteDELETE /v1/tax_rules/{id}Delete tax rule

tax-rules list​

List tax rules

kobana billing tax-rules list [OPTIONS]

GET /v1/tax_rules

Returns a paginated list of the current organization's tax rules. Use the scope, company_id, service_item_id, billing_account_id and is_active filters to narrow the result.

Query parameters

NameTypeRequiredDescription
pageintegernoPage (starts at 1). Default: 1.
per_pageintegernoItems per page. Default: 20. Maximum: 100.
sort_bystringnoSort field. Default depends on the resource.
sort_orderstringnoSort direction. Default: desc. Values: asc, desc.
scopestringnoFilter by scope: global, organization, company, service, customer or municipality. Values: global, organization, company, service, customer, municipality.
company_idstringnoFilter by rules of a specific company.
service_item_idstringnoFilter by rules of a specific service item.
billing_account_idstringnoFilter by rules of a specific billing account.
is_activestringnoWhen true, returns only active rules; when false, only inactive ones. Values: true, false.
searchstringnoText search across name and description.
customer_tax_typestringnoFilter by customer tax type: pessoa_fisica, pessoa_juridica, mei, simples_optante or entidade_publica.
operation_typestringnoFilter by operation type: interno (same municipality) or externo (different municipality).
municipalitystringnoFilter by IBGE municipality code (7 digits).
priority_frominteger,nullnoMinimum priority (inclusive) to filter rules.
priority_tointeger,nullnoMaximum priority (inclusive) to filter rules.
effective_from_fromstringnoReturns rules whose effective-from date is on or after this value (ISO 8601).
effective_from_tostringnoReturns rules whose effective-from date is on or before this value (ISO 8601).
effective_to_fromstringnoReturns rules whose effective-to date is on or after this value (ISO 8601).
effective_to_tostringnoReturns rules whose effective-to date is on or before this value (ISO 8601).
created_afterstringnoStart of creation date range (YYYY-MM-DD).
created_beforestringnoEnd of creation date range (YYYY-MM-DD).

Responses

HTTPDescription
200Paginated list of tax rules.
404Resource not found in the current organization.

tax-rules create​

Create tax rule

kobana billing tax-rules create [OPTIONS]

POST /v1/tax_rules

Creates a new tax rule along with its items (per-tax rates). The scope defines the applicability level and priority defines precedence — higher priority overrides lower. At least one entry in items is required.

Request body

NameTypeRequiredDescription
namestringyesHuman-readable rule name.
scopestringyesRule scope: global, organization, company, service, customer or municipality. Values: global, organization, company, service, customer, municipality.
itemsarray<object>yesList of items (per-tax rates). At least 1 item is required.
descriptionstringnoOptional rule description.
priorityintegernoRule priority. Higher value overrides lower-priority rules. Default: 0.
company_idstring (uuid)noCompany UUID when scope = company. The company must belong to the current organization.
service_item_idstring (uuid)noService item UUID when scope = service. The item must belong to the current organization.
billing_account_idstring (uuid)noBilling account UUID when scope = customer. The account must belong to the current organization.
customer_tax_typestringnoCustomer tax type: pessoa_fisica, pessoa_juridica, mei, simples_optante or entidade_publica. Values: pessoa_fisica, pessoa_juridica, mei, simples_optante, entidade_publica.
municipalitystringnoIBGE municipality code (7 digits) when scope = municipality.
operation_typestringnoOperation type: interno (same municipality) or externo (different municipality). Values: interno, externo.
effective_fromstring (date-time)noISO 8601 date/time when the rule becomes effective.
effective_tostring (date-time)noISO 8601 date/time when the rule stops being effective. null means open-ended.
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).

More fields and nested objects: kobana schema billing.tax-rules.create.

Responses

HTTPDescription
201Tax rule created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

tax-rules update​

Upsert tax rule

kobana billing tax-rules update [OPTIONS]

PUT /v1/tax_rules

Takes the same body as POST, plus id and public_id, and dedups on id, public_id, external_id and the resource's natural keys, in that order, stopping at the first key that finds a record. A match is updated and returns 200; otherwise the record is created and returns 201. The POST's required fields are required only when no record is found, and updates are partial: absent fields keep their stored value.

Request body

NameTypeRequiredDescription
namestringnoHuman-readable rule name.
descriptionstringnoOptional rule description.
scopestringnoRule scope: global, organization, company, service, customer or municipality. Values: global, organization, company, service, customer, municipality.
priorityintegernoRule priority. Higher value overrides lower-priority rules. Default: 0.
company_idstring (uuid)noCompany UUID when scope = company. The company must belong to the current organization.
service_item_idstring (uuid)noService item UUID when scope = service. The item must belong to the current organization.
billing_account_idstring (uuid)noBilling account UUID when scope = customer. The account must belong to the current organization.
customer_tax_typestringnoCustomer tax type: pessoa_fisica, pessoa_juridica, mei, simples_optante or entidade_publica. Values: pessoa_fisica, pessoa_juridica, mei, simples_optante, entidade_publica.
municipalitystringnoIBGE municipality code (7 digits) when scope = municipality.
operation_typestringnoOperation type: interno (same municipality) or externo (different municipality). Values: interno, externo.
effective_fromstring (date-time)noISO 8601 date/time when the rule becomes effective.
effective_tostring (date-time)noISO 8601 date/time when the rule stops being effective. null means open-ended.
itemsarray<object>noList of items (per-tax rates). At least 1 item is required.
external_idstringnoIdentifier in your external system, for idempotency/sync.
custom_metadataobjectnoArbitrary client-defined metadata (key/value).
idstring (uuid)noRecord UUID. Used only to locate it — never written.
public_idstring (uuid)noPublic UUID of the record, used to locate it.

More fields and nested objects: kobana schema billing.tax-rules.update.

Responses

HTTPDescription
200Record updated.
201Record created.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

tax-rules get​

Get tax rule

kobana billing tax-rules get [ID] [OPTIONS]

GET /v1/tax_rules/{id}

Path arguments: id

Responses

HTTPDescription
200Tax rule detail.
404Resource not found in the current organization.

tax-rules delete​

Delete tax rule

kobana billing tax-rules delete [ID] [OPTIONS]

DELETE /v1/tax_rules/{id}

Path arguments: id

Responses

HTTPDescription
200Tax rule removed.
404Resource not found in the current organization.