Skip to main content

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

MicroSkills Reference

Calculate Linear Expense Accrual

accounting.linear_expense_accrual

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

Perform bounded exact-decimal linear expense accrual 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.linear_expense_accrual.

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.linear_expense_accrual.

Context footprint

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

When to use it

When a total expense must be recognized linearly over elapsed versus total basis days.

When the expense is already a cash payment, or the basis days are still a calendar to infer.

Scope

Note
Perform bounded exact-decimal linear expense accrual and return the calculation with an audit receipt

Non-goals

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

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
totalExpensestringNoTotal expense to accrue; omit when sending items[].
elapsedBasisstringNoElapsed allocation basis; omit when sending items[].
totalBasisstringNoPositive total allocation basis; 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
accruedExpensestringNoExact accrued expense.
remainingExpensestringNoTotal expense less accrued expense.
elapsedBasisstringNoNormalized elapsed basis.
totalBasisstringNoNormalized total basis.
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.linear_expense_accrual","input":{"totalExpense":"1200","elapsedBasis":"3","totalBasis":"12"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("accounting.linear_expense_accrual", {"totalExpense":"1200","elapsedBasis":"3","totalBasis":"12"});

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.
BASIS_INVALID400NoThe request payload failed this skill's input validation.
ZERO_DENOMINATOR400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

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

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "accounting.linear_expense_accrual",
  "input": {
    "totalExpense": "1200",
    "elapsedBasis": "3",
    "totalBasis": "12"
  }
}

Examples

Verified calculation

Inputjson
{
  "totalExpense": "1200",
  "elapsedBasis": "3",
  "totalBasis": "12"
}
Expected outputjson
{
  "totalBasis": "12",
  "accruedExpense": "300",
  "remainingExpense": "900",
  "elapsedBasis": "3"
}
Tip
Returns the primary exact W04 contract vector.

Alternative bounded calculation

Inputjson
{
  "items": [
    {
      "itemId": "record-2",
      "totalExpense": "90",
      "elapsedBasis": "2",
      "totalBasis": "3"
    }
  ]
}
Expected outputjson
{
  "results": [
    {
      "itemId": "record-2",
      "accruedExpense": "60",
      "remainingExpense": "30",
      "elapsedBasis": "2",
      "totalBasis": "3"
    }
  ],
  "count": 1
}
Tip
Returns a materially different exact W04 vector.
  • Auditable bounded linear expense accrual
  • Exact-decimal fund-accounting controls for accounting.linear_expense_accrual.

Avoid for

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

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