ingestions.statement_matches

Suggest matches between a retained structured statement and current claims. Matches are review candidates, not proof of payment; no allocation or financial entry is created.

What it does

Prepare read-only review candidates for complete retained structured statement JSON. Exact extraction text and statement_or_remittance classification are required. Source: {type:‘statement’,currency:ISO,decimals: integer 0–18,rows:[{id,date:YYYY-MM-DD,direction:‘in’|‘out’,amountMinor:positive integer string,party:exact known name,reference?:exact economic sourceFactId}],totals:{in,out}:nonnegative integer strings}. Up to 500 rows / 64 KiB text, 2000 current-model claim components, 20 displayed candidates per row.

All rows and reconciled direction totals are returned; candidate counts/truncation are explicit. Matches are current priced-right commercial claims, with exact party/currency/scale/direction, no future origin date and original or outstanding amount. Reference narrows exact sourceFactId; a settled claim (zero outstanding) is a candidate only for a row whose reference names its sourceFactId, so an unreferenced duplicate payment reads unmatched. Unique candidates are matched suggestions, never confirmation of payment. Native amounts only; no fee/FX/net settlement or legacy claim interpretation.

Unsupported free text returns missing information. Requires whole source/context reads. Result is transient; no durable receipt, proposal/history or financial write, and no payment command.

Before you send it

An authorized OAuth connection may call it, including a headless client. Effective membership, application grant and token permissions still apply. Describe ingestions.statement_matches through GET /v1/catalog/commands/{name} before acting.

This command does not accept source_document_id in its envelope. Any input evidence requirements remain as documented below.

Inputs

Put these fields inside the envelope’s input object. The outer envelope names the command, a stable idempotency_key and effective_at; request and recovery rules explain those separately. Use exact minor-unit integer strings for monetary fields. Take existing IDs from prior reads or command results; choose a new identity only where the command asks for one.

Required means required within its containing object; an optional parent can be omitted.

FieldTypeRequiredMeaning and accepted values
ingestionIdstringYes
statementTextstringYes

After acceptance

When the command emits events, its documented effects and receipt are recorded in the command transaction. The response returns commandId, replayed, the command-specific result below and emitted events with their IDs and CIDs. A command is not automatically a cash movement or revenue recognition: use the behavior above to determine what this command records.

Inspect result and the affected records or reports before continuing. Save returned identifiers for later calls. Fetch GET /v1/commands/{id} with commandId to recover the accepted receipt; retry the same intent with the same idempotency key if the response was lost. Some commands can succeed with events: [] and return a transient result and commandId without persisting a receipt. A lookup of that ID can return null; retain the returned result and verify the affected record. Retrying can re-evaluate the current state rather than replay a stored result. A domain no_change is a separate success outcome with no persisted receipt.

Result fields

Required means required within its containing object; an optional parent can be omitted.

FieldTypeRequiredMeaning and accepted values
dispositionstringYesChoose "review", "needs_information".
missingarrayYesItems: string.
sourceobjectYes
source.documentIdstringYes
source.cidstringYes
source.textCidstringYes
source.provenancestringYesChoose "registered_bytes", "caller_supplied_unverified".
currencystringNo
decimalsintegerNoMinimum: 0. Maximum: 18.
totalsobjectNo
totals.instringYesPattern: "^(0|[1-9][0-9]{0,18})$".
totals.outstringYesPattern: "^(0|[1-9][0-9]{0,18})$".
rowsarrayYesItems: object. Maximum items: 500.
rows[].indexintegerYesMinimum: 0. Maximum: 499.
rows[].sourcePointerstringYes
rows[].idstringYes
rows[].datestringYesFormat: date.
rows[].directionstringYesChoose "in", "out".
rows[].amountMinorstringYesPattern: "^(0|[1-9][0-9]{0,18})$".
rows[].partystringYes
rows[].referencestringNo
rows[].dispositionstringYesChoose "matched", "unmatched", "ambiguous", "needs_information".
rows[].candidateCountinteger or nullYesMinimum: 0.
rows[].candidatesTruncatedbooleanYes
rows[].candidatesarrayYesItems: object. Maximum items: 20.
rows[].candidates[].claimIdstringYes
rows[].candidates[].componentobjectYes
rows[].candidates[].component.originLedgerIdstringYes
rows[].candidates[].component.accountCodeintegerYes
rows[].candidates[].partyIdstringYes
rows[].candidates[].originalstringYesPattern: "^(0|[1-9][0-9]{0,18})$".
rows[].candidates[].outstandingstringYesPattern: "^(0|[1-9][0-9]{0,18})$".
rows[].candidates[].statusstringYesChoose "open", "settled", "converted", "cancelled".
rows[].candidates[].sourceFactIdstringYes

All commands · Operation and errors · Reusable schemas

Keep credentials out of prompts; rehearse writes only in a disposable sandbox.

Exact request schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "const": "ingestions.statement_matches"
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ingestionId": {
          "type": "string"
        },
        "statementText": {
          "type": "string"
        }
      },
      "required": [
        "ingestionId",
        "statementText"
      ]
    },
    "idempotency_key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "effective_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "name",
    "input",
    "idempotency_key",
    "effective_at"
  ],
  "additionalProperties": false
}

Accepted command receipt

{
  "type": "object",
  "required": [
    "commandId",
    "replayed",
    "result",
    "events"
  ],
  "properties": {
    "commandId": {
      "type": "string"
    },
    "replayed": {
      "type": "boolean"
    },
    "imported": {
      "const": true,
      "description": "The command's events are history from before the business joined Economico, recorded as an import: free of monthly events."
    },
    "result": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "disposition": {
          "enum": [
            "review",
            "needs_information"
          ]
        },
        "missing": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "source": {
          "type": "object",
          "properties": {
            "documentId": {
              "type": "string"
            },
            "cid": {
              "type": "string"
            },
            "textCid": {
              "type": "string"
            },
            "provenance": {
              "enum": [
                "registered_bytes",
                "caller_supplied_unverified"
              ]
            }
          },
          "required": [
            "documentId",
            "cid",
            "textCid",
            "provenance"
          ]
        },
        "currency": {
          "type": "string"
        },
        "decimals": {
          "type": "integer",
          "minimum": 0,
          "maximum": 18
        },
        "totals": {
          "type": "object",
          "properties": {
            "in": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,18})$"
            },
            "out": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,18})$"
            }
          },
          "required": [
            "in",
            "out"
          ]
        },
        "rows": {
          "type": "array",
          "maxItems": 500,
          "items": {
            "type": "object",
            "properties": {
              "index": {
                "type": "integer",
                "minimum": 0,
                "maximum": 499
              },
              "sourcePointer": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "format": "date"
              },
              "direction": {
                "enum": [
                  "in",
                  "out"
                ]
              },
              "amountMinor": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]{0,18})$"
              },
              "party": {
                "type": "string"
              },
              "reference": {
                "type": "string"
              },
              "disposition": {
                "enum": [
                  "matched",
                  "unmatched",
                  "ambiguous",
                  "needs_information"
                ]
              },
              "candidateCount": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "candidatesTruncated": {
                "type": "boolean"
              },
              "candidates": {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "type": "object",
                  "properties": {
                    "claimId": {
                      "type": "string"
                    },
                    "component": {
                      "type": "object",
                      "properties": {
                        "originLedgerId": {
                          "type": "string"
                        },
                        "accountCode": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "originLedgerId",
                        "accountCode"
                      ]
                    },
                    "partyId": {
                      "type": "string"
                    },
                    "original": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]{0,18})$"
                    },
                    "outstanding": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]{0,18})$"
                    },
                    "status": {
                      "enum": [
                        "open",
                        "settled",
                        "converted",
                        "cancelled"
                      ]
                    },
                    "sourceFactId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "claimId",
                    "component",
                    "partyId",
                    "original",
                    "outstanding",
                    "status",
                    "sourceFactId"
                  ]
                }
              }
            },
            "required": [
              "index",
              "sourcePointer",
              "id",
              "date",
              "direction",
              "amountMinor",
              "party",
              "disposition",
              "candidateCount",
              "candidatesTruncated",
              "candidates"
            ]
          }
        }
      },
      "required": [
        "disposition",
        "missing",
        "source",
        "rows"
      ]
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "cid": {
            "type": "string"
          }
        }
      }
    }
  }
}
Navigate documentation