Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Build Straight-Line Amortization

accounting.straight_line_amortization

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

Perform bounded exact-decimal straight line amortization and return the calculation with an audit receipt. Closed inputs, fixed precision, deterministic ordering, and typed failures apply.

You receive exact totals and a compact audit receipt for accounting.straight_line_amortization.

Reliability

Closed shapes and precision bounds fail before expensive work. DECIMAL_INVALID means a malformed or over-limit decimal; correct it. CONTROL_INVALID means duplicate or malformed rows; correct their ids and shape. CURRENCY_MISMATCH means the currency is unsupported or inconsistent; use one supported currency. TOLERANCE_INVALID means tolerance is negative or malformed; provide a non-negative decimal. ALLOCATION_INVALID means weights are negative, duplicated, or unusable; correct them. ZERO_DENOMINATOR means the weight sum or divisor is zero; provide a positive divisor. ROUNDING_INVALID means mode, scale, or quantization is invalid; use a published mode and scale. BASIS_INVALID means elapsed and total basis are inconsistent; keep elapsed in range. PERIOD_INVALID means the count is outside 1 through 1,200; correct it. ITEM_LIMIT_EXCEEDED means a bounded count was exceeded; split the request. This guidance applies to accounting.straight_line_amortization.

Context footprint

The result replaces repeated prompt arithmetic with one reproducible receipt for accounting.straight_line_amortization. A successful call costs 1 execution credit.

When to use it

When a capitalized amount must be spread in equal periods under a straight-line schedule.

When the pattern is usage-based rather than equal periods, or the period count is missing.

Scope

Note
Perform bounded exact-decimal straight line amortization and return the calculation with an audit receipt

Non-goals

  • Does not infer currency conversion, calendar basis, accounting policy, or materiality for accounting.straight_line_amortization.
  • Does not mutate a ledger, read files, or process unbounded rows for accounting.straight_line_amortization.

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

mathvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
amountstringNoAmount to amortize as a plain decimal; omit when sending items[].
periodCountintegerNoNumber of amortization periods. The skill refuses more than 1,200 with ITEM_LIMIT_EXCEEDED. Omit when sending items[].
roundingobjectNoClosed object with required mode and scale properties for final-stage decimal rounding. Omit when sending items[].
itemsarrayNoFrom 1 through 10,000 closed objects with unique itemId and every operation-specific property. Omit when sending a scalar calculation.

Output schema

FieldTypeRequiredDescription
periodAmountsarrayNoArray of 1 to 1,200 scaled plain-decimal string items in ascending period order.
exactPerPeriodstringNoExact amount divided by period count.
residualBeforeFinalstringNoAmount minus rounded base amount times period count.
roundingobjectNoClosed receipt object with required mode, scale, and point properties for final-stage rounding.
resultsarrayNoFrom 1 through 10,000 closed result objects with itemId and every operation-specific result property.
countintegerNoNumber of input items and output results.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"accounting.straight_line_amortization","input":{"amount":"100","periodCount":3,"rounding":{"mode":"HALF_UP","scale":2}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("accounting.straight_line_amortization", {"rounding":{"mode":"HALF_UP","scale":2},"periodCount":3,"amount":"100"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DECIMAL_INVALID400NoThe request payload failed this skill's input validation.
PERIOD_INVALID400NoThe request payload failed this skill's input validation.
ROUNDING_INVALID400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not infer currency conversion, calendar basis, accounting policy, or materiality for accounting.straight_line_amortization.
  • Does not mutate a ledger, read files, or process unbounded rows for accounting.straight_line_amortization.
  • Inferred policy, conversion, posting, or schedules outside the closed input
  • Inputs above the declared bounds for accounting.straight_line_amortization.

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "accounting.straight_line_amortization",
  "input": {
    "rounding": {
      "mode": "HALF_UP",
      "scale": 2
    },
    "periodCount": 3,
    "amount": "100"
  }
}

Examples

Verified calculation

Inputjson
{
  "rounding": {
    "mode": "HALF_UP",
    "scale": 2
  },
  "periodCount": 3,
  "amount": "100"
}
Expected outputjson
{
  "rounding": {
    "mode": "HALF_UP",
    "scale": 2,
    "point": "final"
  },
  "exactPerPeriod": "33.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333",
  "periodAmounts": [
    "33.33",
    "33.33",
    "33.34"
  ],
  "residualBeforeFinal": "0.01"
}
Tip
Returns the primary exact W04 contract vector.

Alternative bounded calculation

Inputjson
{
  "items": [
    {
      "itemId": "record-2",
      "amount": "10",
      "periodCount": 4,
      "rounding": {
        "mode": "HALF_EVEN",
        "scale": 2
      }
    }
  ]
}
Expected outputjson
{
  "results": [
    {
      "itemId": "record-2",
      "periodAmounts": [
        "2.50",
        "2.50",
        "2.50",
        "2.50"
      ],
      "exactPerPeriod": "2.5",
      "residualBeforeFinal": "0",
      "rounding": {
        "mode": "HALF_EVEN",
        "scale": 2,
        "point": "final"
      }
    }
  ],
  "count": 1
}
Tip
Returns a materially different exact W04 vector.
  • Auditable bounded straight line amortization
  • Exact-decimal fund-accounting controls for accounting.straight_line_amortization.

Avoid for

  • Inferred policy, conversion, posting, or schedules outside the closed input
  • Inputs above the declared bounds for accounting.straight_line_amortization.

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

accountingmathvalidationfinance