SDK QUICKSTART

POST YOUR
FIRST MATCH.

Send a three-way-match request to Truss from Python or Node.js with a bearer token, a JSON body, and no SDK package to install. Get a key from /developers, then compare this page with the full POST /api/agents API reference or use the API error reference when a response is unsuccessful.

02

SDK EXAMPLES

Choose a language, export your key, and run the complete authenticated request as-is.

Install the commonly available requests library once, export your key, and run the script as-is.

python -m pip install requests

three_way_match.py

import json
import os
import sys

import requests

API_URL = "https://api.truss.polsia.app/api/agents"
api_key = os.environ["TRUSS_API_KEY"]
webhook_url = os.getenv("TRUSS_WEBHOOK_URL")

payload = {
    "mode": "three_way_match",
    "po": {
        "po_number": "PO-001",
        "amount": 100.00,
        "vendor_name": "Acme Software Ltd",
        "date": "2026-08-29",
    },
    "invoice": {
        "amount": 100.00,
        "vendor_name": "Acme Software Ltd",
        "date": "2026-08-29",
    },
    "receipt": {
        "amount": 100.00,
        "vendor_name": "Acme Software Ltd",
        "date": "2026-08-29",
    },
}

if webhook_url:
    payload["webhook_url"] = webhook_url

response = requests.post(
    API_URL,
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json=payload,
    timeout=30,
)

if not response.ok:
    print(f"Truss returned HTTP {response.status_code}: {response.text}", file=sys.stderr)
    response.raise_for_status()

print(json.dumps(response.json(), indent=2))
05

WEBHOOK NOTES

webhook_url accepts a credential-free http:// or https:// URL and is persisted per API key. Omit it on later requests to reuse the stored callback. To clear the stored callback deliberately, send "webhook_url": null; the examples omit the field when TRUSS_WEBHOOK_URL is not configured so they do not accidentally clear or overwrite an existing callback.

See the full API reference for accepted authentication alternatives, callback signatures, retry behavior, and the complete request field list. For the exact error bodies and corrective actions, see the API error reference.