Skip to main content

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

MicroSkills Reference

Reconcile Payments

finance.reconcile_payments

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send payments and open invoices; we propose which payment settles which invoice and show why. Matching runs in order — exact reference and amount first, then reference under the normalization you chose, then amount inside your date window, then combinations when you enable them, and finally part payments when you allow them — and anything an earlier pass used is unavailable to the later ones. Full settlement is always tried before anything settles for less. Every match names the pass and the rule behind it. We propose only: nothing is posted, settled or written anywhere.

Matching by "closest amount" gives a different answer depending on which row a spreadsheet happened to read first, and nobody can tell afterwards why a payment landed where it did. Here the passes are published, the ordering is by date and id, and every match tells you which rule produced it — so your controller can check the proposal instead of trusting it.

Reliability

Two identical requests produce identical output, and re-ordering the arrays changes nothing: payments are sorted by date then id, invoices by due date then id, before any matching starts. Passes run in order and never reuse a payment: 1 exact reference and exact amount, 2 reference under your normalization with amounts inside your tolerance, 3 amount inside your tolerance and date window, 4 combinations of 2 to maxCombinationSize payments that settle the invoice, 5 a single part payment when allowPartial is on. The order is part of the answer, so it is published rather than left to be discovered: pass 5 is last because a payment spent as a partial is gone, and two payments that together settle an invoice should be reported as that rather than as one partial plus an orphan. Passes 1 to 4 never accept an underpayment beyond your tolerance, so allowPartial can only add matches, never move them. The search is bounded at 250,000 candidate comparisons, so a book too large to match is refused rather than left running. Unknown top-level request properties are refused rather than ignored, so a misspelled rules or payments never looks like one we honoured. RECONCILE_INPUT_INVALID — trigger: an empty payment or invoice list, a missing or blank id, an amount or date we cannot read, an amount finer than the currency's minor units, or an entry carrying a property we do not define; retryable: no, the same payload always fails; next: check the entry position we name in the details, dates as YYYY-MM-DD and amounts as plain decimal strings. CURRENCY_UNKNOWN — trigger: the batch shares one currency code but it is not one we support; retryable: no; next: send a supported ISO 4217 code — the same code this pack's other skills accept. RECONCILE_ID_DUPLICATE — trigger: two payments or two invoices share an id, so a match could not be attributed to one of them; retryable: no; next: make ids unique within the call — we name the field and the position, never the id itself. RECONCILE_CURRENCY_MIXED — trigger: the batch carries more than one currency code and we never convert; retryable: no; next: split the batch per currency, converting with finance.fx_rate_apply first if you need to. RECONCILE_RULES_INVALID — trigger: an unknown rule name, a strategy or referenceMatch outside the accepted values, a negative tolerance, a date window outside 0 to 365, or a combination size outside 2 to 4; retryable: no; next: correct the rule we name and call again. RECONCILE_LIMIT_EXCEEDED — trigger: more than 5,000 payments or 5,000 invoices in one call, whether you overshoot by one row or by a thousand — the limit is ours and it is the rule you are told you broke, with your actual count in the details; retryable: no; next: reconcile in batches, by period or by customer. RECONCILE_SEARCH_LIMIT_EXCEEDED — trigger: the rules you set need more than 250,000 candidate comparisons, which usually means combinations over a large book; retryable: no, the same rules always cost the same; next: reconcile in smaller batches, narrow the date window, or turn combinations off.

Context footprint

Returns one row per match plus the unmatched ids, so a 500-line statement is a long but flat answer. A successful call costs 1 execution credit.

When to use it

When you have a batch of payments and open invoices in one currency and you want a reproducible proposal you can review before posting.

When references need fuzzy comparison, when the batch spans currencies, or when you want the platform to post the settlement for you.

Scope

Note
Deterministic payment-to-invoice matching in published passes, with a reason behind every proposed match.

Non-goals

  • Does not post, settle, reverse or write anything anywhere
  • Does not do fuzzy or phonetic reference matching, only the normalizations you pick
  • Does not convert currencies — one currency per call
  • Does not learn from past reconciliations or remember this one

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysismath

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input1 MB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

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 may contain submitted or transformed 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
paymentsarrayYesFrom 1 through 5,000 closed payments sharing one ISO 4217 currency, each with id, amount, date, and optional reference.
invoicesarrayYesFrom 1 through 5,000 closed open invoices sharing the same currency, each with id, remaining amount, and optional due date plus reference.
rulesobjectNoOptional matching policy for strategy, reference normalization, amount tolerance, date window, partials, and combinations; omit it for every published default.

Output schema

FieldTypeRequiredDescription
matchesarrayYesOne row per settled invoice with paymentIds, matchedAmount, residual, matchedBy, and pass, ordered by date then id.
unmatchedPaymentsarrayYesPayments no invoice could take, each with id and NO_MATCHING_INVOICE, ordered by date then id.
unmatchedInvoicesarrayYesInvoices still fully open, each with id and NO_MATCHING_PAYMENT; partials appear in matches with a residual instead.
summaryobjectYesHeadline counts and the total amount applied, so an all-or-nothing close can check that unmatched counts are zero.
rulesobjectYesMatching policy actually applied, with every default filled in, so a stored proposal explains which passes and tolerances produced it.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"finance.reconcile_payments","input":{"payments":[{"id":"PAY-1","amount":"1200.00","date":"2026-07-10","reference":"INV-2026-001","currency":"EUR"}],"invoices":[{"id":"INV-1","amount":"1200.00","dueDate":"2026-07-15","reference":"INV-2026-001","currency":"EUR"}],"rules":{"strategy":"REFERENCE_THEN_AMOUNT","referenceMatch":"EXACT"}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("finance.reconcile_payments", {"invoices":[{"id":"INV-1","amount":"1200.00","dueDate":"2026-07-15","reference":"INV-2026-001","currency":"EUR"},{"id":"INV-2","amount":"500.00","dueDate":"2026-07-20","currency":"EUR"}],"payments":[{"id":"PAY-1","amount":"1200.00","date":"2026-07-10","reference":"INV-2026-001","currency":"EUR"},{"id":"PAY-2","amount":"500.00","date":"2026-07-12","currency":"EUR"}]});

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.
RECONCILE_INPUT_INVALID400NoThe request payload failed this skill's input validation.
RECONCILE_ID_DUPLICATE400NoThe request payload failed this skill's input validation.
RECONCILE_CURRENCY_MIXED400NoThe request payload failed this skill's input validation.
CURRENCY_UNKNOWN400NoThe request payload failed this skill's input validation.
RECONCILE_RULES_INVALID400NoThe request payload failed this skill's input validation.
RECONCILE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
RECONCILE_SEARCH_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not post, settle, reverse or write anything anywhere
  • Does not do fuzzy or phonetic reference matching, only the normalizations you pick
  • Does not convert currencies — one currency per call
  • Does not learn from past reconciliations or remember this one
  • Books larger than 5,000 payments or invoices in one call
  • Mixed-currency statements that still need conversion
  • Matching on near-miss references that differ by spelling

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "finance.reconcile_payments",
  "input": {
    "invoices": [
      {
        "id": "INV-1",
        "amount": "1200.00",
        "dueDate": "2026-07-15",
        "reference": "INV-2026-001",
        "currency": "EUR"
      },
      {
        "id": "INV-2",
        "amount": "500.00",
        "dueDate": "2026-07-20",
        "currency": "EUR"
      }
    ],
    "payments": [
      {
        "id": "PAY-1",
        "amount": "1200.00",
        "date": "2026-07-10",
        "reference": "INV-2026-001",
        "currency": "EUR"
      },
      {
        "id": "PAY-2",
        "amount": "500.00",
        "date": "2026-07-12",
        "currency": "EUR"
      }
    ]
  }
}

Examples

A remittance reference settles one invoice, an amount settles the other

Inputjson
{
  "invoices": [
    {
      "id": "INV-1",
      "amount": "1200.00",
      "dueDate": "2026-07-15",
      "reference": "INV-2026-001",
      "currency": "EUR"
    },
    {
      "id": "INV-2",
      "amount": "500.00",
      "dueDate": "2026-07-20",
      "currency": "EUR"
    }
  ],
  "payments": [
    {
      "id": "PAY-1",
      "amount": "1200.00",
      "date": "2026-07-10",
      "reference": "INV-2026-001",
      "currency": "EUR"
    },
    {
      "id": "PAY-2",
      "amount": "500.00",
      "date": "2026-07-12",
      "currency": "EUR"
    }
  ]
}
Expected outputjson
{
  "rules": {
    "strategy": "REFERENCE_THEN_AMOUNT",
    "referenceMatch": "EXACT",
    "amountTolerance": "0",
    "allowPartial": false,
    "allowCombination": false,
    "maxCombinationSize": 2
  },
  "unmatchedPayments": [],
  "summary": {
    "matchedCount": 2,
    "matchedAmount": "1700.00",
    "unmatchedPaymentCount": 0,
    "unmatchedInvoiceCount": 0
  },
  "matches": [
    {
      "invoiceId": "INV-1",
      "paymentIds": [
        "PAY-1"
      ],
      "matchedAmount": "1200.00",
      "residual": "0.00",
      "matchedBy": "REFERENCE_AND_EXACT_AMOUNT",
      "pass": 1
    },
    {
      "invoiceId": "INV-2",
      "paymentIds": [
        "PAY-2"
      ],
      "matchedAmount": "500.00",
      "residual": "0.00",
      "matchedBy": "AMOUNT_IN_TOLERANCE",
      "pass": 3
    }
  ],
  "unmatchedInvoices": []
}

A part payment leaves a residual and one payment finds no invoice

Inputjson
{
  "rules": {
    "allowPartial": true
  },
  "payments": [
    {
      "id": "PAY-9",
      "amount": "400.00",
      "date": "2026-07-05",
      "currency": "EUR"
    },
    {
      "id": "PAY-10",
      "amount": "5000.00",
      "date": "2026-07-06",
      "currency": "EUR"
    }
  ],
  "invoices": [
    {
      "id": "INV-7",
      "amount": "1000.00",
      "dueDate": "2026-07-31",
      "currency": "EUR"
    }
  ]
}
Expected outputjson
{
  "rules": {
    "strategy": "REFERENCE_THEN_AMOUNT",
    "referenceMatch": "EXACT",
    "amountTolerance": "0",
    "allowPartial": true,
    "allowCombination": false,
    "maxCombinationSize": 2
  },
  "unmatchedPayments": [
    {
      "id": "PAY-10",
      "reasonCode": "NO_MATCHING_INVOICE"
    }
  ],
  "summary": {
    "matchedCount": 1,
    "matchedAmount": "400.00",
    "unmatchedPaymentCount": 1,
    "unmatchedInvoiceCount": 0
  },
  "matches": [
    {
      "invoiceId": "INV-7",
      "paymentIds": [
        "PAY-9"
      ],
      "matchedAmount": "400.00",
      "residual": "600.00",
      "matchedBy": "AMOUNT_PARTIAL",
      "pass": 5
    }
  ],
  "unmatchedInvoices": []
}
  • Propose cash application for a bank statement against open receivables
  • Find which invoices a batch of remittances covers, with an audit trail
  • Test how a tolerance or a date window would change last month's matching

Avoid for

  • Books larger than 5,000 payments or invoices in one call
  • Mixed-currency statements that still need conversion
  • Matching on near-miss references that differ by spelling

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

reconciliationanalysiscurrencyfinancevalidation