Skip to main content

kobana billing late-fee-policies

Commands of kobana billing late-fee-policies. Every global option (Global options) applies here.

CommandHTTPDescription
late-fee-policies listGET /v1/late_fee_policiesList late fee policies
late-fee-policies createPOST /v1/late_fee_policiesCreate a late fee policy
late-fee-policies simulatePOST /v1/late_fee_policies/simulateSimulate late charges
late-fee-policies getGET /v1/late_fee_policies/{id}Get a late fee policy
late-fee-policies updatePATCH /v1/late_fee_policies/{id}Update a late fee policy
late-fee-policies deleteDELETE /v1/late_fee_policies/{id}Delete a late fee policy
late-fee-policies defaultPOST /v1/late_fee_policies/{id}/defaultSet as the default policy

late-fee-policies list​

List late fee policies

kobana billing late-fee-policies list [OPTIONS]

GET /v1/late_fee_policies

Returns the organization late fee policies. The policy that applies to an invoice is resolved in cascade: invoice → subscription → billing account → organization default. A null level means inherit, never "no charges" — charging nothing is an explicit policy with both modes set to none.

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.
include_deletedstringnoIncludes soft-deleted policies. Values: true, false.

Responses

HTTPDescription
200Paginated list of late fee policies.
404Resource not found in the current organization.

late-fee-policies create​

Create a late fee policy

kobana billing late-fee-policies create [OPTIONS]

POST /v1/late_fee_policies

Creates a policy. Fine and interest above the legal ceilings (2% fine and 1% monthly interest, Brazilian Consumer Code art. 52) are refused unless enforce_legal_caps is false — which is audited separately, being a legal-risk decision.

Request body

NameTypeRequiredDescription
namestringyesPolicy name, unique within the organization.
is_defaultbooleannoWhether this is the organization default policy.
fine_modestringnoHow the fine is computed. Charged once. percentage uses fine_percent, fixed uses fine_amount. Values: none, percentage, fixed.
fine_percentnumbernoFine as a percentage of the outstanding balance, 0 to 100. Populated only when fine_mode is percentage.
fine_amountnumbernoFlat fine amount, in BRL. Populated only when fine_mode is fixed.
fine_daysintegernoDays past the due date when the fine starts applying. Default is 1 — the day after the due date.
interest_modestringnoHow interest accrues. The percentage modes use interest_percent; daily_amount uses interest_amount. Interest is charged on the principal alone, never on principal plus fine. Values: none, daily_amount, daily_percentage, monthly_percentage, yearly_percentage.
interest_percentnumbernoInterest percentage per day, month or year, per interest_mode. The monthly rate is divided pro rata die by 30; the yearly one by 360.
interest_amountnumbernoFlat interest amount per day, in BRL. Populated only when interest_mode is daily_amount.
interest_daysintegernoDays past the due date when interest starts accruing. Default is 1.
day_countstringnoDay-count basis for the delay. Only calendar is accepted for now: the local accrual has no holiday calendar yet, and counting business days without one would overstate the charge against what the bank collects. Values: calendar, business.
max_interest_monthsintegernoCeiling on accumulated months of interest. Null means uncapped.
max_total_charge_percentnumbernoCeiling on the total charge (fine plus interest) as a percentage of the outstanding balance. The fine is kept whole and the interest is trimmed when the cap bites.
enforce_legal_capsbooleannoWhen true, refuses a fine above 2% and interest above 1% per month. Turning it off is a deliberate choice for contracts outside consumer relations, and is audited.
partial_allocationstringnoImputation order when a payment covers neither principal nor charges. charges_first follows art. 354 of the Brazilian Civil Code: interest before capital. Values: charges_first, principal_first.
register_on_chargebooleannoRegisters the fine and interest instruction with the bank when issuing a bank slip or Pix, so the charge itself collects them after the due date.
apply_on_dynamic_chargebooleannoRecomputes the charged amount on card charges and re-issues, where no bank instruction can collect the charge.
charge_instructionsstringnoFree text printed in the bank slip instructions.

More fields and nested objects: kobana schema billing.late-fee-policies.create.

Responses

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

late-fee-policies simulate​

Simulate late charges

kobana billing late-fee-policies simulate [OPTIONS]

POST /v1/late_fee_policies/simulate

Computes what an outstanding balance owes in fine and interest on a given date, creating nothing. Pass either policy_id or an inline policy. Use it to reconcile the arithmetic before an invoice actually goes late.

Request body

NameTypeRequiredDescription
principalnumberyesOutstanding balance to accrue the charges on, in BRL.
due_datestring (date-time)yesDue date the delay is counted from.
reference_datestring (date-time)noDate to accrue at. Defaults to now. Days are counted on the civil date in America/Sao_Paulo.
policy_idstring (uuid)noExisting policy to use. Alternative to policy.
policyobjectno

More fields and nested objects: kobana schema billing.late-fee-policies.simulate.

Responses

HTTPDescription
200Charges accrued at the given date.
400Request body failed validation.
404Resource not found in the current organization.
422Request body failed validation.

late-fee-policies get​

Get a late fee policy

kobana billing late-fee-policies get [ID] [OPTIONS]

GET /v1/late_fee_policies/{id}

Path arguments: id

Responses

HTTPDescription
200Policy found.
404Resource not found in the current organization.

late-fee-policies update​

Update a late fee policy

kobana billing late-fee-policies update [ID] [OPTIONS]

PATCH /v1/late_fee_policies/{id}

Updates the policy. Invoices already finalized are unaffected: each invoice freezes the policy in force at finalization, so a renegotiation cannot retroactively change what was already issued.

Path arguments: id

Request body

NameTypeRequiredDescription
namestringnoPolicy name, unique within the organization.
is_defaultbooleannoWhether this is the organization default policy.
fine_modestringnoHow the fine is computed. Charged once. percentage uses fine_percent, fixed uses fine_amount. Values: none, percentage, fixed.
fine_percentnumbernoFine as a percentage of the outstanding balance, 0 to 100. Populated only when fine_mode is percentage.
fine_amountnumbernoFlat fine amount, in BRL. Populated only when fine_mode is fixed.
fine_daysintegernoDays past the due date when the fine starts applying. Default is 1 — the day after the due date.
interest_modestringnoHow interest accrues. The percentage modes use interest_percent; daily_amount uses interest_amount. Interest is charged on the principal alone, never on principal plus fine. Values: none, daily_amount, daily_percentage, monthly_percentage, yearly_percentage.
interest_percentnumbernoInterest percentage per day, month or year, per interest_mode. The monthly rate is divided pro rata die by 30; the yearly one by 360.
interest_amountnumbernoFlat interest amount per day, in BRL. Populated only when interest_mode is daily_amount.
interest_daysintegernoDays past the due date when interest starts accruing. Default is 1.
day_countstringnoDay-count basis for the delay. Only calendar is accepted for now: the local accrual has no holiday calendar yet, and counting business days without one would overstate the charge against what the bank collects. Values: calendar, business.
max_interest_monthsintegernoCeiling on accumulated months of interest. Null means uncapped.
max_total_charge_percentnumbernoCeiling on the total charge (fine plus interest) as a percentage of the outstanding balance. The fine is kept whole and the interest is trimmed when the cap bites.
enforce_legal_capsbooleannoWhen true, refuses a fine above 2% and interest above 1% per month. Turning it off is a deliberate choice for contracts outside consumer relations, and is audited.
partial_allocationstringnoImputation order when a payment covers neither principal nor charges. charges_first follows art. 354 of the Brazilian Civil Code: interest before capital. Values: charges_first, principal_first.
register_on_chargebooleannoRegisters the fine and interest instruction with the bank when issuing a bank slip or Pix, so the charge itself collects them after the due date.
apply_on_dynamic_chargebooleannoRecomputes the charged amount on card charges and re-issues, where no bank instruction can collect the charge.
charge_instructionsstringnoFree text printed in the bank slip instructions.

More fields and nested objects: kobana schema billing.late-fee-policies.update.

Responses

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

late-fee-policies delete​

Delete a late fee policy

kobana billing late-fee-policies delete [ID] [OPTIONS]

DELETE /v1/late_fee_policies/{id}

Soft delete. Invoices already issued keep working from the snapshot they carry. The default policy cannot be deleted — set another as default first.

Path arguments: id

Responses

HTTPDescription
200Policy deleted.
404Resource not found in the current organization.
422Request body failed validation.

late-fee-policies default​

Set as the default policy

kobana billing late-fee-policies default [ID] [OPTIONS]

POST /v1/late_fee_policies/{id}/default

Makes this the organization default — what an invoice inherits when neither it, its subscription nor its billing account names one. Exactly one policy holds the flag.

Path arguments: id

Responses

HTTPDescription
200Policy set as default.
404Resource not found in the current organization.