Create Package Config
Create a matching package config: a group of matching configs keyed by document type, with per-type presence rules and a package-level pass/fail criteria.
Package matching is a mode of Talonic's Matching family: it scores a bundle of documents of different types (for example an invoice, a delivery note, and a contract) against reference data in one governed run. A package config groups one matching config per document type, sets how strictly each type must be present, and defines the criteria that turn the per-type results into a single package verdict.
Within the Matching family, this sits one layer above the simpler single-document matching under /v1/matching. There, one config matches one document type against one reference dataset. A package config orchestrates several of those configs at once and produces a package-level passed, failed, or review outcome across the whole bundle.
Each entry in document_type_configs names a document_type, the matching_config_id that scores documents of that type, and a presence of required, expected, or optional. The pass_criteria block then aggregates: all_required_matched enforces that every required type reached a full match, min_confidence sets the confidence floor a required type must clear, and allow_review_on_expected decides whether a review-grade result on a supplied expected document drops the package to review instead of failing it.
The presence tiers behave asymmetrically at run time, so choose them deliberately. A missing or unmatched required type fails the package outright, as does a required type whose confidence falls below min_confidence. An expected type that is missing from the input never fails the package — it flags the run for review. An expected type that was supplied but did not match fails the package, and one that matched at review grade fails unless allow_review_on_expected is true. optional types are skipped when absent and never fail the package.
/v1/matching/packages/configsBody parameters
Response
Response fields
curl
curl -X POST https://api.talonic.com/v1/matching/packages/configs \
-H "Authorization: Bearer tlnc_your_api_key" \
-H "Content-Type: application/json" \
-d @package-config.jsonRequest body (package-config.json)
{
"name": "Shipment bundle",
"document_type_configs": [
{
"document_type": "invoice",
"matching_config_id": "1a2b3c4d-5e6f-4781-92a3-b4c5d6e7f809",
"presence": "required"
},
{
"document_type": "delivery_note",
"matching_config_id": "2b3c4d5e-6f70-4192-a3b4-c5d6e7f8091a",
"presence": "expected"
},
{
"document_type": "contract",
"matching_config_id": "3c4d5e6f-7081-42a3-b4c5-d6e7f8091a2b",
"presence": "optional"
}
],
"pass_criteria": {
"all_required_matched": true,
"min_confidence": 0.8,
"allow_review_on_expected": true
}
}Response
{
"id": "4f2a9c1e-8b3d-47e6-9a05-c7d1e2f3a4b5",
"name": "Shipment bundle",
"document_type_configs": [
{ "document_type": "invoice", "matching_config_id": "1a2b3c4d-5e6f-4781-92a3-b4c5d6e7f809", "presence": "required" },
{ "document_type": "delivery_note", "matching_config_id": "2b3c4d5e-6f70-4192-a3b4-c5d6e7f8091a", "presence": "expected" },
{ "document_type": "contract", "matching_config_id": "3c4d5e6f-7081-42a3-b4c5-d6e7f8091a2b", "presence": "optional" }
],
"pass_criteria": {
"all_required_matched": true,
"min_confidence": 0.8,
"allow_review_on_expected": true
},
"created_at": "2024-09-14T10:32:00.000Z",
"updated_at": "2024-09-14T10:32:00.000Z",
"links": {
"self": "/v1/matching/packages/configs/4f2a9c1e-8b3d-47e6-9a05-c7d1e2f3a4b5",
"runs": "/v1/matching/packages/runs?package_config_id=4f2a9c1e-8b3d-47e6-9a05-c7d1e2f3a4b5"
}
}Errors
Error responses