Library

Transaction enrichment library for Go

Use TxnKit as a transaction enrichment API from Go. This page shows the safe request shape, a short code snippet, and the boundary for keeping sensitive data out of the integration.

Target intent

Go backend services enriching transaction descriptors with a bounded HTTP call.

TxnKit does not add live merchant research, crawling, or logo-provider calls to your service.

Raw descriptor

SQ *JOES COFFEE 0421 TORONTO

Short Go API snippet

payload := strings.NewReader(`{"raw_description":"SQ *JOES COFFEE 0421 TORONTO","country":"CA"}`)
request, _ := http.NewRequest("POST", "https://api.txnkit.dev/v1/enrich", payload)
request.Header.Set("Authorization", "Bearer "+os.Getenv("TXNKIT_API_KEY"))
request.Header.Set("Content-Type", "application/json")

client := &http.Client{Timeout: time.Second}
response, err := client.Do(request)

Keep API keys out of browser bundles. For frontend stacks, call a backend route or serverless function that owns the TxnKit request.

API-shaped output

{
  "normalized_merchant": "joes coffee",
  "display_name": "Joes Coffee",
  "category": null,
  "subcategory": null,
  "website": null,
  "logos": {
    "preferred": null,
    "variants": [],
    "warnings": [
      "no_verified_logo_for_local_merchant"
    ]
  },
  "confidence": 0.56,
  "recurring_hint": false,
  "processor_hint": "square",
  "location_hint": {
    "city": "Toronto",
    "country": "CA"
  },
  "signals": [
    "applied_processor_square_sq_star",
    "removed_reference_tokens"
  ],
  "warnings": [
    "local_merchant_identity_not_verified"
  ]
}

Low-confidence results should keep fallback labels and warnings visible instead of forcing a guessed logo or website.

When to use

  • You are building in Go and need one-descriptor merchant cleanup through an HTTP API.
  • Your app can keep the TxnKit API key on the server side or inside a trusted serverless function.
  • You need merchant display names, categories, confidence, signals, warnings, and logo-ready metadata.

When not to use

  • TxnKit does not add live merchant research, crawling, or logo-provider calls to your service.
  • Do not use TxnKit to process card numbers, account numbers, full statements, bank credentials, emails, phone numbers, addresses, customer names, or customer PII.
  • Do not use TxnKit when the product requirement is guaranteed merchant identity, every-merchant resolution, or contracted uptime terms.

Proof surfaces

The public contract is POST /v1/enrich, backed by the OpenAPI file, benchmark examples, privacy rules, and deterministic request-path tests.

OpenAPI · Benchmark · Security · Pricing

Related pages