Don’t truncate or pre-process the transaction title. Include everything from
the bank statement: ✓ "POS 4392 STARBUCKS STORE #1234 NEW YORK NY 10001" ✗ "STARBUCKS" The full string contains valuable signals (store numbers,
locations, dates) that improve accuracy.
Preserve original formatting
Keep the original case, spacing, and punctuation: ✓ "AMAZON.COM*2K4X9T3H2 AMZN.COM/BILL WA" ✗ "Amazon"
Include all available metadata
If your transaction source provides additional description fields,
concatenate them: javascript const title = [ transaction.description, transaction.merchantName, transaction.locationInfo ].filter(Boolean).join(' ');
// Valid country codes"US"; // United States"NL"; // Netherlands"GB"; // United Kingdom"DE"; // Germany"FR"; // France
If you’re unsure of the country, use the account holder’s primary country.
Transaction strings often contain location hints that Triqai can use for more
accurate matching.
For multiple transactions, make individual requests. Retries and rate limits are handled automatically:
import Triqai from "triqai";const triqai = new Triqai(process.env.TRIQAI_API_KEY!);async function enrichTransactions( transactions: Array<{ description: string; country: string; amount: number }>,) { const results = []; for (const tx of transactions) { const result = await triqai.transactions.enrich({ title: tx.description, country: tx.country, type: tx.amount < 0 ? "expense" : "income", }); results.push(result); } return results;}
Transient errors (429, 500, 503) are automatically retried with exponential
backoff, so you don’t need to implement retry or rate-limit logic yourself.