> ## Documentation Index
> Fetch the complete documentation index at: https://docs.triqai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with Triqai in under 5 minutes

This guide will walk you through making your first transaction enrichment request with the Triqai API.

## Prerequisites

Before you begin, you'll need:

1. A Triqai account ([sign up for free](https://www.triqai.com/register))
2. An API key from your [dashboard](https://www.triqai.com/dashboard)

<Note>
  Don't have an account yet? You can test the API in our
  [Playground](https://www.triqai.com/playground) without signing up.
</Note>

## Step 1: Get Your API Key

<Steps>
  <Step title="Create an account">
    Sign up at [triqai.com/register](https://www.triqai.com/register). No credit
    card required for the free tier.
  </Step>

  <Step title="Access your dashboard">
    Navigate to your [dashboard](https://www.triqai.com/dashboard) after signing
    in.
  </Step>

  <Step title="Copy your API key">
    Your API key is displayed in the dashboard. It starts with `triq_`.
  </Step>
</Steps>

<Warning>
  Keep your API key secure. Never expose it in client-side code or public
  repositories.
</Warning>

## Step 2: Install the SDK (Recommended)

The fastest way to get started is with the official [Node.js / TypeScript SDK](https://www.npmjs.com/package/triqai):

<CodeGroup>
  ```bash npm theme={null}
  npm install triqai
  ```

  ```bash yarn theme={null}
  yarn add triqai
  ```

  ```bash pnpm theme={null}
  pnpm add triqai
  ```
</CodeGroup>

## Step 3: Make Your First Request

The core operation is enriching a transaction. Here's how to use it:

<CodeGroup>
  ```typescript Node.js theme={null}
  import Triqai from "triqai";

  const triqai = new Triqai("YOUR_API_KEY");

  const result = await triqai.transactions.enrich({
    title: "PP* #56789 MK:678321 LELLO, PORTO Ref:hwjk2-23123 PAGAMENTO",
    country: "BR",
    type: "expense",
  });

  console.log(result.data.transaction.category.primary.name);
  console.log(result.data.entities);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.triqai.com/v1/transactions/enrich \
    -H "Content-Type: application/json" \
    -H "X-API-Key: YOUR_API_KEY" \
    -d '{
      "title": "PP* #56789 MK:678321 LELLO, PORTO Ref:hwjk2-23123 PAGAMENTO",
      "country": "BR",
      "type": "expense"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.triqai.com/v1/transactions/enrich',
      headers={
          'Content-Type': 'application/json',
          'X-API-Key': 'YOUR_API_KEY'
      },
      json={
          'title': 'PP* #56789 MK:678321 LELLO, PORTO Ref:hwjk2-23123 PAGAMENTO',
          'country': 'BR',
          'type': 'expense'
      }
  )

  print(response.json())
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      payload := map[string]string{
          "title":   "PP* #56789 MK:678321 LELLO, PORTO Ref:hwjk2-23123 PAGAMENTO",
          "country": "BR",
          "type":    "expense",
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", "https://api.triqai.com/v1/transactions/enrich", bytes.NewBuffer(jsonData))
      req.Header.Set("Content-Type", "application/json")
      req.Header.Set("X-API-Key", "YOUR_API_KEY")

      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Println(result)
  }
  ```
</CodeGroup>

## Step 4: Understand the Response

A successful enrichment returns comprehensive data about the transaction. The response uses an **entities array**, only identified entities are included:

```json Response theme={null}
{
  "success": true,
  "partial": false,
  "data": {
    "transaction": {
      "category": {
        "primary": {
          "name": "Books",
          "code": {
            "mcc": 5942,
            "sic": 5942,
            "naics": 451211
          }
        },
        "secondary": {
          "name": "Entertainment",
          "code": {
            "mcc": 7832,
            "sic": 7832,
            "naics": 713110
          }
        },
        "tertiary": null,
        "confidence": { "value": 100, "reasons": ["merchant_category_match"] }
      },
      "confidence": { "value": 100, "reasons": [] }
    },
    "entities": [
      {
        "type": "merchant",
        "role": "organization",
        "confidence": {
          "value": 100,
          "reasons": ["name_closely_matched", "results_consensus"]
        },
        "data": {
          "id": "f3c35551-1eb0-460f-a6bf-ce24c64e941b",
          "name": "Livraria Lello",
          "alias": ["Livraria Mais Bonita do Mundo"],
          "keywords": ["books", "literature", "culture"],
          "icon": "https://logos.triqai.com/images/livrarialellopt",
          "description": "Historic bookstore and cultural institution in Porto, Portugal",
          "color": "#002B82",
          "website": "https://livrarialello.pt",
          "domain": "livrarialello.pt"
        }
      },
      {
        "type": "location",
        "role": "store_location",
        "confidence": {
          "value": 80,
          "reasons": ["city_match", "single_result_match"]
        },
        "data": {
          "id": "9eda058e-174a-4b9a-8777-4b4d8717c5a3",
          "name": "Porto",
          "formatted": "R. das Carmelitas 144, 4050-161 Porto",
          "phoneNumber": "22 200 2037",
          "structured": {
            "city": "Porto",
            "state": "",
            "street": "R. das Carmelitas 144",
            "country": "PT",
            "timezone": "Europe/Lisbon",
            "postalCode": "4050-161",
            "coordinates": {
              "latitude": 41.1468104,
              "longitude": -8.6148718
            },
            "countryName": "Portugal"
          }
        }
      },
      {
        "type": "intermediary",
        "role": "p2p",
        "confidence": { "value": 100, "reasons": ["known_processor_match"] },
        "data": {
          "id": "b9a3152a-d735-4b8c-8bd2-e525a6b3d903",
          "name": "PayPal",
          "icon": "https://logos.triqai.com/images/paypalcom",
          "description": null,
          "color": "#002991",
          "website": "https://paypal.com",
          "domain": "paypal.com"
        }
      }
    ]
  },
  "meta": {
    "generatedAt": "2026-01-14T09:16:09.430Z",
    "requestId": "019c1da3-5541-7b4c-b20e-bb03363b3333",
    "version": "1.3.13",
    "categoryVersion": "triqai-2026.01"
  }
}
```

### Key Response Fields

| Field                         | Description                                                             |
| ----------------------------- | ----------------------------------------------------------------------- |
| `success`                     | Whether the request completed successfully                              |
| `partial`                     | `true` if some enrichers failed but others succeeded                    |
| `data.transaction.category`   | Hierarchical category classification with confidence                    |
| `data.transaction.confidence` | Overall enrichment confidence with reason tags                          |
| `data.entities[]`             | Array of identified entities (merchant, location, intermediary, person) |
| `data.entities[].type`        | Entity type: `merchant`, `location`, `intermediary`, or `person`        |
| `data.entities[].role`        | Entity role in the transaction context                                  |
| `data.entities[].confidence`  | Per-entity confidence `{ value, reasons }`                              |

## Step 5: Try Different Transactions

Test with various transaction types to see how Triqai handles different scenarios:

<Tabs>
  <Tab title="P2P Transfer">
    ```typescript theme={null}
    const result = await triqai.transactions.enrich({
      title: "VENMO PAYMENT TO JOHN DOE",
      country: "US",
      type: "expense",
    });
    // Returns an intermediary entity (Venmo, role "p2p")
    // and a person entity (John Doe, role "recipient")
    ```
  </Tab>

  <Tab title="Payment Processor">
    ```typescript theme={null}
    const result = await triqai.transactions.enrich({
      title: "STRIPE* ACME CORP",
      country: "US",
      type: "expense",
    });
    // Returns an intermediary entity (Stripe, role "processor")
    // and a merchant entity (Acme Corp)
    ```
  </Tab>

  <Tab title="Recurring digital service payment">
    ```typescript theme={null}
    const result = await triqai.transactions.enrich({
      title: "NETFLIX.COM",
      country: "US",
      type: "expense",
    });
    // Returns merchant and category classification
    // result.data.transaction.category.primary.name
    ```
  </Tab>

  <Tab title="In-Store">
    ```typescript theme={null}
    const result = await triqai.transactions.enrich({
      title: "STARBUCKS STORE 4532 NEW YORK NY",
      country: "US",
      type: "expense",
    });
    // Returns a merchant entity and a location entity
    // with store-level precision
    ```
  </Tab>
</Tabs>

## Next Steps

Now that you've made your first enrichment request, explore these resources:

<CardGroup cols={2}>
  <Card title="Node.js / TypeScript SDK" icon="npm" href="/sdk/overview">
    Use the official SDK for type-safe access with built-in retries and
    pagination
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn about API key management and security best practices
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/enrichment">
    Understand how transaction enrichment works in detail
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all available endpoints and parameters
  </Card>
</CardGroup>
