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

# Quickstart: reconcile your first record

> Create two data streams, push records over the End Close API, add a matching rule and run your first reconciliation in about ten minutes.

This quickstart takes you from an empty environment to a matched pair of records using only the End Close API. You create two data streams, connect them with a reconciliation and a rule, push one record into each stream, and run the reconciliation.

## Prerequisites

* An End Close account. Every request is scoped to one environment, so use a test environment if you have one.
* An API key for that environment from **Settings** in the [End Close dashboard](https://app.endclose.com). See [Authentication](https://endclose.com/docs/api-reference/authentication.md).
* `curl` and `jq`, or any HTTP client.

```bash Set your key theme={"dark"}
export ENDCLOSE_API_KEY="your-api-key"
```

## Steps

**1. Create two data streams**

A [data stream](https://endclose.com/docs/concepts/data-streams.md) holds the records from one system. Create one for Stripe payouts and one for your bank account. The `key` is yours to choose and can't be changed later.

```bash cURL theme={"dark"}
curl -X POST https://api.endclose.com/v1/data_streams \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "stripe_payouts", "name": "Stripe payouts"}'

curl -X POST https://api.endclose.com/v1/data_streams \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "operating_account", "name": "Operating account"}'
```

Each response includes the stream's `id`. Keep both: the reconciliation refers to streams by `id`.

**2. Create a reconciliation**

A [reconciliation](https://endclose.com/docs/concepts/reconciliations.md) says which streams should agree. Put payouts on Side A and the bank on Side B. A `batch` reconciliation matches when you run it; a `continuous` one matches each record as it arrives.

```bash cURL theme={"dark"}
curl -X POST https://api.endclose.com/v1/reconciliations \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Stripe payouts to bank",
    "run_type": "batch",
    "side_a_stream_ids": ["STRIPE_STREAM_ID"],
    "side_b_stream_ids": ["BANK_STREAM_ID"]
  }'
```

**3. Add a matching rule**

A [rule](https://endclose.com/docs/concepts/rules-and-matches.md) decides when two records match. This one pairs records with the same amount and currency whose dates are at most two days apart.

```bash cURL theme={"dark"}
curl -X POST https://api.endclose.com/v1/reconciliation_rules \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reconciliation_id": "RECONCILIATION_ID",
    "description": "Same amount and currency, within two days",
    "filters": {
      "operand": "and",
      "rules": [
        { "key": "amount", "operand": "eq", "value": "amount" },
        { "key": "currency", "operand": "eq", "value": "currency" },
        { "key": "date", "operand": "eq", "value": "date", "tolerance_amount": 2, "tolerance_unit": "day" }
      ]
    }
  }'
```

> [!NOTE]
>
> A one-to-one rule needs an `amount` condition and at least two exact `eq` conditions (a condition with a tolerance doesn't count). End Close skips rules that are looser than that, because they would match records too broadly.

**4. Push one record into each stream**

A [record](https://endclose.com/docs/concepts/records.md) is a single transaction. Send the payout and the bank deposit it became.

```bash cURL theme={"dark"}
curl -X POST https://api.endclose.com/v1/records \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data_stream_key": "stripe_payouts",
    "date": "2026-11-09",
    "amount": 125000,
    "direction": "credit",
    "currency": "USD",
    "external_id": "po_1QxR8a"
  }'

curl -X POST https://api.endclose.com/v1/records \
  -H "X-API-Key: $ENDCLOSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data_stream_key": "operating_account",
    "date": "2026-11-10",
    "amount": 125000,
    "direction": "credit",
    "currency": "USD",
    "description": "STRIPE TRANSFER"
  }'
```

Amounts are integers in the currency's minor unit, so `125000` is \$1,250.00. Both records start unmatched.

**5. Run the reconciliation**

Start a batch run. It works in the background and returns `202` straight away.

```bash cURL theme={"dark"}
curl -X POST https://api.endclose.com/v1/reconciliations/RECONCILIATION_ID/run \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

Poll `GET /reconciliations/{id}`: `current_run` is the run while it is pending or running, and `last_run` holds it once it has finished.

**6. Check the match**

Once the run completes, list the reconciliation's matched records. Both records appear.

```bash cURL theme={"dark"}
curl "https://api.endclose.com/v1/records?reconciliation_id=RECONCILIATION_ID&status=matched" \
  -H "X-API-Key: $ENDCLOSE_API_KEY"
```

## What to do next

> [card] [How End Close works](https://endclose.com/docs/how-it-works.md)
>
> Ingest, match, flag and resolve: the four steps behind every reconciliation.

> [card] [Write matching rules](https://endclose.com/docs/guides/matching-rules.md)
>
> Tolerances, transforms, priorities and many-to-one rules.

> [card] [Connect an integration](https://endclose.com/docs/integrations.md)
>
> Sync Stripe, your banks, your ledger or your warehouse instead of pushing records.

> [card] [API reference](https://endclose.com/docs/api-reference/overview.md)
>
> Every endpoint, with request and response examples.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.