# Introduction

The Sail API lets you pull expense data from your users' cards and merchant accounts, classify which expenses qualify as tax-deductible healthcare spending under IRS [Section 213(d)](https://www.law.cornell.edu/uscode/text/26/213), and connect to Health Savings Account (HSA) and Flexible Spending Account (FSA) accounts.

Sail offers three independent integration paths. Most integrations use one path. You can adopt additional paths over time as your product needs grow.

By the end of this guide, you’ll understand how each integration path works and when to use it.

## Three integration paths

Each integration path has its own endpoints, key scopes, connection types, and webhook events.

<CardGroup cols={2}>
  <Card title="Expenses" href="#expenses" icon="fa6-solid:receipt">
    Connect merchant and card accounts to get item-level
    expense data from your users' purchase history.
  </Card>

  <Card title="Classification" href="#classification" icon="fa6-solid:circle-check">
    Push your own transactions and find out which ones
    qualify as tax-deductible healthcare expenses.
  </Card>
</CardGroup>
  <Card title="Account connection" href="#account-connection" icon="fa6-solid:building-columns">
    Connect HSA/FSA administrator accounts to read balances,
    contribution summaries, account activity, and deposit
    credentials.
  </Card>

## Expenses

Connect your users to merchant accounts (Amazon, Walgreens, Target, and others) or bank cards through the [Connect Account Widget](/docs/concepts/connect-widget), a secure Sail-hosted UI that you embed in your app where users enter their login credentials. Sail pulls order history and returns item-level expenses with product names, merchant, and category data.

For example, a "\$49.00 at Walgreens" transaction becomes three separate expenses: bandages (\$8.99), shampoo (\$12.99), and thermometer (\$27.02).

**Choose this path if:**

- You want to turn flat card transactions into item-level purchase data.
- You need product-level detail for budgeting, categorization, or receipt matching.

To get started with this path, see [Enrich transactions with item-level data](/docs/guides/enrich-transactions-with-item-level-data).

## Classification

Push transaction data you already have (from Plaid, your own aggregator, or manual entry) to Sail. Sail classifies each transaction for healthcare tax-deductibility under IRS Section 213(d) and returns one of four results: `eligible`, `ineligible`, `itemization_required`, or `lmn_required`. Results come back via webhooks.

This is a server-to-server integration. Your users don't interact with Sail directly.

**Choose this path if:**

- You already have transaction data and want to automate healthcare expense classification.
- Your integration is entirely server-to-server with no user-facing Sail UI.

To get started with this path, see [Classify your own transactions](/docs/guides/classify-your-own-transactions).

<Callout type="info">
  **Combine with expenses later**

  You can add store connections later to get item-level detail for merchants in your transaction feed.
</Callout>

## Account connection

Connect your users to their HSA/FSA administrator through the [Connect Account Widget](/docs/concepts/connect-widget). Sail returns account balances, contribution progress, account activity, and deposit credentials.

**Choose this path if:**

- You want to show your users their HSA/FSA balances, contributions, and account activity.
- You need to read HSA/FSA deposit account and routing numbers.
- You build a healthcare benefits, personal finance, or tax planning product.

To get started with this path, see [Connect HSA/FSA accounts](/docs/guides/connect-hsa-fsa-accounts).

## Get started

These three steps apply to all integration paths, follow them below to get started:

<CardGroup cols={2}>
  <Card
    title="Get an API key"
    href="/docs/get-started/get-started-overview/api-key"
    icon="fa6-solid:key"
  >
    Get your API keys from the Sail team and learn how
    scopes control access to endpoints.
  </Card>

  <Card title="Create a user" href="/docs/get-started/get-started-overview/create-a-user" icon="fa6-solid:user">
    Map your internal users to Sail users. All data is scoped
    to a user.
  </Card>

</CardGroup>
  <Card title="Set up webhooks" href="/docs/get-started/get-started-overview/webhooks" icon="fa6-solid:bolt">
    Register your endpoint and start receiving events as Sail
    processes data.
  </Card>