SDK v2: TypeScript, Python, and Go Clients
SDK v2 ships typed clients for TypeScript, Python, and Go. Breaking change: reconciliation jobs now use the jobs.create() API. See migration guide below.
What Changed
SDK v2 ships typed clients for TypeScript, Python, and Go with a simplified, consistent API surface.
TypeScript
npm install @settler/sdk@^2import { SettlerClient } from "@settler/sdk";
const client = new SettlerClient({ apiKey: process.env.SETTLER_API_KEY });
const job = await client.jobs.create({
name: "Stripe ↔ QuickBooks",
sources: [
{ id: "stripe", adapter: "stripe", config: { apiKey: "..." } },
{ id: "qb", adapter: "quickbooks", config: { ... } },
],
rules: { matching: [{ field: "amount", tolerance: 0.01 }] },
});
const run = await client.jobs.run(job.id);
const mismatches = await client.runs.getMismatches(run.id);Python
pip install settler-sdk>=2from settler import SettlerClient
client = SettlerClient(api_key=os.environ["SETTLER_API_KEY"])
job = client.jobs.create(name="Stripe ↔ QuickBooks", ...)
run = client.jobs.run(job.id)
mismatches = client.runs.get_mismatches(run.id)Go
go get github.com/Hardonian/settler-go@v2client := settler.NewClient(os.Getenv("SETTLER_API_KEY"))
job, _ := client.Jobs.Create(ctx, settler.CreateJobRequest{...})
run, _ := client.Jobs.Run(ctx, job.ID)Breaking Changes
v1 → v2 Migration
| v1 | v2 |
|---|---|
| client.reconciliations.create() | client.jobs.create() |
| client.reconciliations.getMismatches() | client.runs.getMismatches() |
| client.runs.replay() | client.runs.replay() (unchanged) |
The v1 reconciliations namespace is deprecated and will be removed in v3. It remains functional in v2 for backward compatibility.
New in v2
SettlerError and a code fieldclient.runs.streamMismatches() for large result setsclient.runs.downloadEvidence(runId) returns the full evidence bundlesettler.webhooks.verify(payload, signature, secret) validates signed webhook events