> For the complete documentation index, see [llms.txt](https://docs.hyperswitch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperswitch.io/other-features/payments-modules/reconciliation-product/api-key-guide.md).

# API Key Guide

This guide shows you how to connect your systems to Hyperswitch Recon using an API key.

You can do two things with the API:

| I want to…                                                      | Use this                     |
| --------------------------------------------------------------- | ---------------------------- |
| Send a record to Recon (an order, a payment, a settlement line) | `POST /staging_entries/v2`   |
| Check whether my transactions reconciled                        | `POST /transactions/v2/list` |

That's the whole API. Setting things up (accounts, rules, schemas and API keys) happens in the Recon dashboard.

### How reconciliation works

Reconciliation compares two sides of the same payment. For example: what your order system says, and what your payment processor says.

Each record you send plays one of two roles:

| Role                                      | What it does                                                                                   | Type           |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------- | -------------- |
| **First side: creates an expectation**    | Opens a new transaction and tells Recon "a matching record should arrive from the other side". | `transaction`  |
| **Second side: confirms the expectation** | Finds the waiting transaction and is compared against it.                                      | `confirmation` |

So the flow is:

1. **You send the first side (expectation creation).** Recon creates a transaction and marks it `expected`. It is now waiting for the other side.
2. **You send the second side (confirmation).** Recon finds the expectation and compares the two.
3. **You check the result.** If both sides agree, the transaction is `matched`. If not, the status tells you what is different.

```mermaid
sequenceDiagram
    autonumber
    participant You as Your system
    participant Recon as Recon API
    participant Engine as Recon engine

    You->>Recon: Send first side, transaction type (POST /staging_entries/v2)
    Recon-->>You: 201 Created
    Engine->>Engine: Creates a transaction with an expectation
    Note over Engine: Status: expected

    You->>Recon: Send second side, confirmation type (POST /staging_entries/v2)
    Recon-->>You: 201 Created
    Engine->>Engine: Finds the expectation and compares both sides
    Note over Engine: Status: matched

    You->>Recon: Check status (POST /transactions/v2/list)
    Recon-->>You: 200 OK with your transactions
```

{% hint style="info" %}
**Recon works in the background.** When you send a record, we store it right away and process it shortly after. Give it a moment, then check the status.
{% endhint %}

### Base URL

| Environment | Base URL                                                  |
| ----------- | --------------------------------------------------------- |
| Sandbox     | `https://sandbox.hyperswitch.io/hyperswitch-recon-engine` |

Add the endpoint path to the base URL. For example:

```
https://sandbox.hyperswitch.io/hyperswitch-recon-engine/transactions/v2/list
```

{% hint style="info" %}
Not sure which URL to use, or ready for production? Reach out to your Hyperswitch point of contact (SPOC). They will confirm the base URL for your account.
{% endhint %}

### What you need

Have these values ready. You will find all of them in the Recon dashboard. If anything is missing, your Hyperswitch SPOC can help.

| Value              | Looks like                | What it is                                                                                                      |
| ------------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------- |
| API key            | `sbx_` plus 64 characters | Your secret key. See below for how to create one.                                                               |
| Profile ID         | `pro_…`                   | The business profile you reconcile under.                                                                       |
| Account ID         | `account_…`               | One for each side, for example one for your order system and one for your processor.                            |
| Transformation ID  | `tran_conf_…`             | A data source set up on an account. An account can have several.                                                |
| Metadata schema ID | `meta_sch_…`              | Describes the fields in the records for one transformation, and sets its type: `transaction` or `confirmation`. |

#### Pick the right transformation: transaction or confirmation

This is the part to get right. **One endpoint sends both sides. The transformation and schema you choose decide which role the record plays.**

Every transformation has one metadata schema, and that schema has a type:

| Type           | Use it when                         | What Recon does with the record                              |
| -------------- | ----------------------------------- | ------------------------------------------------------------ |
| `transaction`  | You are sending the **first side**  | Creates a transaction and an expectation for the other side. |
| `confirmation` | You are sending the **second side** | Looks for a waiting expectation and confirms it.             |

An account can have more than one transformation, and they can be of different types. So for each record, choose the transformation by what you want the record to do:

* **To create an expectation**, use a `transaction` type transformation and its schema.
* **To satisfy an expectation**, use a `confirmation` type transformation and its schema. A `transaction` type one will not satisfy it; it will open a new transaction instead.

```mermaid
flowchart LR
    R["Your record"] --> Q{"Type of the transformation<br/>and schema you send it with"}
    Q -- transaction --> T["Creates a transaction<br/>Status: expected"]
    Q -- confirmation --> C["Finds the waiting expectation<br/>and compares"]
    C --> M["Status: matched<br/>or a mismatch status"]
```

A few rules of thumb:

* Always send the `transformation_id` and `metadata_schema_id` as a pair. They belong together, and to the same account.
* You can confirm what happened: the response to `POST /staging_entries/v2` includes `processing_mode`, which is `transaction` or `confirmation`.
* A `confirmation` record needs an expectation to be waiting. If there is none, the record goes to manual review.

{% hint style="info" %}
Not sure which transformation on an account is which type? Open the transformation in the dashboard, or ask your Hyperswitch SPOC.
{% endhint %}

#### Create your API key

1. Open **API Keys** in the Recon dashboard.
2. Click **Create API Key**. Give it a name, and optionally a description and an expiry date.
3. **Copy the key and store it somewhere safe.** We show it only once.

{% hint style="info" %}
You need the **Recon Merchant Admin** role to create keys. Don't have it? Ask your organisation admin to invite you with that role.
{% endhint %}

A few helpful things to know:

* One key works for all profiles of your merchant account.
* Sandbox keys start with `sbx_` and work only in sandbox. Production keys start with `prd_`.
* If you don't set an expiry date, the key never expires. You can't change the expiry date later.
* You can revoke a key at any time. It stops working immediately, and this can't be undone.
* Want to rotate a key? Create a new one, switch over, then revoke the old one.

### Authentication

Add these three headers to every request:

| Header          | Value                    |
| --------------- | ------------------------ |
| `Authorization` | `api-key=<YOUR_API_KEY>` |
| `x-profile-id`  | `<YOUR_PROFILE_ID>`      |
| `Content-Type`  | `application/json`       |

{% hint style="warning" %}
Write the header exactly as `api-key=<YOUR_API_KEY>`, in lowercase and with no space before the `=`. Don't use `Bearer`.
{% endhint %}

**Getting a `401`?** The API gives the same answer for every sign-in problem, so run through this list:

* Does the `Authorization` header start with `api-key=`?
* Is the key still active (not revoked, not expired)?
* Did you send the `x-profile-id` header?
* Does the profile belong to the same merchant account that created the key?
* Are you calling the right environment for this key?

***

### Quickstart

Let's reconcile one payment end to end. In this example, your order management system (OMS) is the first side and creates the expectation. Your payment processor is the second side and confirms it.

Replace the values in `<angle brackets>` with your own.

#### Step 1: Send the first side (create the expectation)

Use a `transaction` type transformation and its schema.

```bash
curl --location 'https://sandbox.hyperswitch.io/hyperswitch-recon-engine/staging_entries/v2' \
  --header 'Authorization: api-key=<YOUR_API_KEY>' \
  --header 'x-profile-id: <YOUR_PROFILE_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "account_id": "<OMS_ACCOUNT_ID>",
    "metadata_schema_id": "<OMS_METADATA_SCHEMA_ID>",
    "transformation_id": "<OMS_TRANSFORMATION_ID>",
    "raw_data": {
      "currency": "USD",
      "amount": "100.00",
      "occurred_at": "2026-11-13 12:00:00",
      "type": "PAYMENT",
      "oms_reference": "order_1001",
      "processor": "STRIPE",
      "processor_reference": "pi_1001",
      "settlement_id": "settlement_1001"
    }
  }'
```

You get a `201 Created` with `"processing_mode": "transaction"`. The transaction is now **`expected`**.

#### Step 2: Send the second side (confirm the expectation)

Same endpoint, but this time use a `confirmation` type transformation and its schema.

```bash
curl --location 'https://sandbox.hyperswitch.io/hyperswitch-recon-engine/staging_entries/v2' \
  --header 'Authorization: api-key=<YOUR_API_KEY>' \
  --header 'x-profile-id: <YOUR_PROFILE_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "account_id": "<PROCESSOR_ACCOUNT_ID>",
    "metadata_schema_id": "<PROCESSOR_METADATA_SCHEMA_ID>",
    "transformation_id": "<PROCESSOR_TRANSFORMATION_ID>",
    "raw_data": {
      "currency": "USD",
      "amount": "100.00",
      "occurred_at": "2026-11-13 12:00:00",
      "type": "PAYMENT",
      "record_id": "row_1001",
      "processor_reference": "pi_1001",
      "oms_reference": "order_1001",
      "settlement_id": "settlement_1001"
    }
  }'
```

You get another `201 Created`, this time with `"processing_mode": "confirmation"`. Once Recon has compared both sides, the transaction becomes **`matched`**.

#### Step 3: Check the status

```bash
curl --location 'https://sandbox.hyperswitch.io/hyperswitch-recon-engine/transactions/v2/list' \
  --header 'Authorization: api-key=<YOUR_API_KEY>' \
  --header 'x-profile-id: <YOUR_PROFILE_ID>' \
  --header 'Content-Type: application/json' \
  --data '{
    "filters": { "order_id": "order_1001" },
    "cursor_payload": {
      "limit": 10,
      "sort_by": { "sort_field": "id" }
    }
  }'
```

Look at `status` in the response:

| When         | Status you should see |
| ------------ | --------------------- |
| After step 1 | `expected`            |
| After step 2 | `matched`             |

That's it! The rest of this guide explains each endpoint in detail.

***

### Send a record

`POST /staging_entries/v2`

Sends one record to Recon. Each request sends exactly one record. (In responses, a record you sent is called a *staging entry*.)

#### What to send

| Parameter                   | Type   | Required | Description                                                                                                                      |
| --------------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`                | string | Yes      | The account this record belongs to.                                                                                              |
| `transformation_id`         | string | Yes      | The transformation to use. Choose a `transaction` type one to create an expectation, or a `confirmation` type one to satisfy it. |
| `metadata_schema_id`        | string | Yes      | The schema that belongs to that transformation. It describes this record's fields.                                               |
| `raw_data`                  | object | Yes      | Your record, as field names and values. See below.                                                                               |
| `transformation_history_id` | string | No       | You can leave this out.                                                                                                          |

The account and schema must belong to the profile in your `x-profile-id` header.

{% hint style="info" %}
This endpoint sends both sides. See Pick the right transformation to choose between creating an expectation and confirming one.
{% endhint %}

#### Filling in `raw_data`

`raw_data` is your record. **The field names are yours**: they are the ones defined in your metadata schema, so they will be different from the example in this guide.

Three simple rules:

1. **Send every value as text, in quotes.** Write `"100.00"`, not `100.00`. You can also send `null` for an empty value.
2. **Use the field names from your schema.** Fields the schema doesn't know are ignored.
3. **Include the five essentials.** Recon needs to find these in every record:

| Essential       | How to send it                                                                                                                         |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Amount          | A positive number, such as `"100.00"`. Your schema decides whether amounts are in major units (`"100.00"`) or minor units (`"10000"`). |
| Currency        | A three-letter code in capitals, such as `"USD"`.                                                                                      |
| Debit or credit | One of the values your schema lists for debit or credit.                                                                               |
| Date            | In the date format your schema defines, such as `"2026-11-13 12:00:00"`.                                                               |
| Order ID        | Up to 64 characters.                                                                                                                   |

{% hint style="info" %}
Not sure what your schema expects? Open the metadata schema in the dashboard to see its field names and formats, or ask your Hyperswitch SPOC.
{% endhint %}

#### What you get back

`201 Created`

```json
{
  "id": "stag_ent_a3D9k2MP8xQ4r7V9w2z5",
  "staging_entry_id": "stag_ent_main_Zk81LmQp02XyTr6BvN4c",
  "account": {
    "account_id": "account_9vZBFaOMFt3mg3sIMXg9",
    "account_name": "OMS"
  },
  "entry_type": "debit",
  "amount": { "value": 100.0, "currency": "USD" },
  "status": "pending",
  "detailed_status": { "status": "pending" },
  "processing_mode": "transaction",
  "effective_at": "2026-11-13T12:00:00.000Z",
  "metadata": {
    "processor": "STRIPE",
    "processor_reference": "pi_1001",
    "settlement_id": "settlement_1001"
  },
  "exposed_metadata": {
    "processor_reference": "pi_1001"
  },
  "searchable_metadata": {
    "settlement_id": "settlement_1001"
  },
  "transformation_id": "tran_conf_J6HF4NbN1ZkqDXGndlqn",
  "transformation_config": {
    "transformation_config_id": "tran_conf_J6HF4NbN1ZkqDXGndlqn",
    "transformation_config_name": "OMS API feed"
  },
  "transformation_history_id": null,
  "data": { "status": "pending", "pending_type": "new" },
  "version": 1,
  "discarded_at": null,
  "discarded_status": null,
  "detailed_discarded_status": null,
  "discarded_data": null,
  "order_id": "order_1001",
  "modified_by": null
}
```

The fields you will use most:

| Field          | Description                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------- |
| `id`           | The ID of the record you just sent. You will see it again on the transaction, as the entry's `staging_entry_id`. |
| `status`       | `pending` right after you send it. It means the record is stored and waiting to be processed.                    |
| `order_id`     | The order ID Recon read from your record. **Keep this**: you will use it to look up the transaction.             |
| `entry_type`   | `debit` or `credit`, as read from your record.                                                                   |
| `amount`       | The amount (`value`, as a decimal) and `currency`.                                                               |
| `effective_at` | The date of your record, in UTC.                                                                                 |

<details>

<summary>All response fields</summary>

| Field                                                                             | Type           | Description                                                                                                            |
| --------------------------------------------------------------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `id`                                                                              | string         | ID of this version of the record.                                                                                      |
| `staging_entry_id`                                                                | string         | ID of the record. Stays the same over time.                                                                            |
| `account`                                                                         | object         | `account_id` and `account_name`.                                                                                       |
| `entry_type`                                                                      | string         | `debit` or `credit`.                                                                                                   |
| `amount`                                                                          | object         | `value` (decimal, in major units) and `currency`.                                                                      |
| `status`                                                                          | string         | `pending`, `processed`, `needs_manual_review` or `void`.                                                               |
| `detailed_status`                                                                 | object         | `status`, plus a `sub_status` giving the reason when a record needs manual review.                                     |
| `processing_mode`                                                                 | string         | `transaction` if the record creates an expectation, `confirmation` if it confirms one. Comes from the schema you sent. |
| `effective_at`                                                                    | string         | The record's date in UTC, as `YYYY-MM-DDTHH:MM:SS.mmmZ`.                                                               |
| `metadata`                                                                        | object         | The extra fields your schema keeps from the record.                                                                    |
| `exposed_metadata`                                                                | object         | The metadata fields your schema marks as visible.                                                                      |
| `searchable_metadata`                                                             | object         | The metadata fields you can filter transactions by.                                                                    |
| `transformation_id`                                                               | string         | The transformation ID you sent.                                                                                        |
| `transformation_config`                                                           | object         | ID and name of that setup.                                                                                             |
| `transformation_history_id`                                                       | string or null | The value you sent, if any.                                                                                            |
| `data`                                                                            | object         | Extra detail about the current status.                                                                                 |
| `version`                                                                         | integer        | `1` for a new record.                                                                                                  |
| `order_id`                                                                        | string         | The order ID read from your record.                                                                                    |
| `modified_by`                                                                     | object or null | Always `null` for records sent with an API key.                                                                        |
| `discarded_at`, `discarded_status`, `detailed_discarded_status`, `discarded_data` | null           | Always `null` for a new record.                                                                                        |

</details>

#### What happens to your record next

| Status                | Meaning                                                                        |
| --------------------- | ------------------------------------------------------------------------------ |
| `pending`             | Stored and waiting to be processed.                                            |
| `processed`           | Done. It created a transaction or completed one.                               |
| `needs_manual_review` | Recon couldn't process it automatically. You can sort it out in the dashboard. |
| `void`                | Cancelled.                                                                     |

A record usually needs manual review for one of these reasons: no reconciliation rule applies to it, it is a duplicate of an earlier record, or it is a second side with no first side to match.

{% hint style="info" %}
You can't read a record back with an API key. To follow it, look up its transaction by `order_id` using the endpoint below.
{% endhint %}

***

### Check transaction status

`POST /transactions/v2/list`

Returns your transactions and their reconciliation status. Use it to check a single order or to go through all your transactions.

#### What to send

| Parameter                  | Type    | Required | Default | Description                                                                 |
| -------------------------- | ------- | -------- | ------- | --------------------------------------------------------------------------- |
| `cursor_payload`           | object  | Yes      |         | Paging and sorting options.                                                 |
| `cursor_payload.sort_by`   | object  | Yes      |         | How to sort the results.                                                    |
| `cursor_payload.limit`     | integer | No       | `10`    | **How many transactions you get per page. Up to `50`.**                     |
| `cursor_payload.order`     | string  | No       | `desc`  | `desc` or `asc`. When sorting by date, `desc` shows the latest dates first. |
| `cursor_payload.direction` | string  | No       | `next`  | `next` to move forward, `previous` to move back.                            |
| `filters`                  | object  | No       |         | Narrows down the results. Leave it out to get everything.                   |

The smallest valid request looks like this:

```json
{
  "cursor_payload": {
    "sort_by": { "sort_field": "id" }
  }
}
```

#### How many transactions do I get?

You control this with **`cursor_payload.limit`**.

| If you send               | You get                |
| ------------------------- | ---------------------- |
| No `limit`                | 10 transactions        |
| A number from `1` to `50` | That many transactions |
| A number above `50`       | 50 transactions        |
| `0`                       | 1 transaction          |

`limit` must be a whole number. A negative number or a decimal returns a `400`.

Need more than 50? Ask for the next page. See Getting more results.

#### Sorting

`sort_by` is always required. Pick one:

| To sort by                     | Send                               |
| ------------------------------ | ---------------------------------- |
| Transaction date (recommended) | `{ "sort_field": "effective_at" }` |
| Transaction ID                 | `{ "sort_field": "id" }`           |

Sorting by date gives you transactions in time order. Sorting by ID gives a stable order that is handy for paging, but it is not in time order.

#### Filters

All filters are optional. If you use more than one, you get the transactions that match all of them.

| Filter           | Type   | Description                                                                                                        |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
| `order_id`       | string | Finds transactions that contain a record with this order ID. This is the easiest way to look up a record you sent. |
| `transaction_id` | string | Finds one transaction by its `transaction_id`.                                                                     |
| `status`         | list   | Finds transactions in any of the statuses you list. See Filtering by status.                                       |
| `time_range`     | object | Finds transactions by their date (`effective_at`). See the fields below.                                           |
| `rule_id`        | string | Finds transactions created by one reconciliation rule.                                                             |
| `metadata`       | list   | Finds transactions by your own fields. Works for fields marked as searchable in your schema. See the fields below. |

Fields inside `time_range` and `metadata`:

| Field                   | Type   | Required                     | Description                                                               |
| ----------------------- | ------ | ---------------------------- | ------------------------------------------------------------------------- |
| `time_range.start_time` | string | Yes, if you use `time_range` | Start of the range. Transactions dated exactly at this time are included. |
| `time_range.end_time`   | string | No                           | End of the range, also included. Leave it out for no end date.            |
| `metadata[].key`        | string | Yes, for each item           | The name of your field.                                                   |
| `metadata[].value`      | string | Yes, for each item           | The value to look for. It must match exactly.                             |

Write dates like this: `2026-11-01T00:00:00Z`.

Here is an example that finds everything still waiting in November:

```json
{
  "filters": {
    "status": ["expected", "missing"],
    "time_range": {
      "start_time": "2026-11-01T00:00:00Z",
      "end_time": "2026-11-30T23:59:59Z"
    }
  },
  "cursor_payload": {
    "limit": 50,
    "sort_by": { "sort_field": "effective_at" }
  }
}
```

#### What you get back

`200 OK`. Here is a transaction where both sides arrived and agree:

```json
{
  "items": [
    {
      "id": "txn_8Hq2LmZx04PvTr6BvN4c",
      "transaction_id": "txn_main_77b1Kd93LmQp02XyTr6B",
      "created_at": "2026-11-13T12:00:07.412Z",
      "effective_at": "2026-11-13T12:00:00.000Z",
      "status": "matched",
      "sub_status": "auto",
      "version": 2,
      "profile_id": "pro_EEljUeJ1JEM0GlFTHBPQ",
      "credit_amount": { "value": 100.0, "currency": "USD" },
      "debit_amount": { "value": 100.0, "currency": "USD" },
      "rule": {
        "rule_id": "rule_4Tg8KsHd3FgJ7aBn5RtY",
        "rule_name": "OMS to Stripe"
      },
      "entries": [
        {
          "entry_id": "entry_3aF1Lm92XyTr6BvN4cQp",
          "entry_type": "debit",
          "status": "matched",
          "amount": { "value": 100.0, "currency": "USD" },
          "account": {
            "account_id": "account_9vZBFaOMFt3mg3sIMXg9",
            "account_name": "OMS"
          },
          "order_id": "order_1001",
          "staging_entry_id": "stag_ent_a3D9k2MP8xQ4r7V9w2z5",
          "mismatch": null
        },
        {
          "entry_id": "entry_9cD4Rs15YzUv8CxM3dWk",
          "entry_type": "credit",
          "status": "matched",
          "amount": { "value": 100.0, "currency": "USD" },
          "account": {
            "account_id": "account_vBHlbot3XqMvLmA5wdtY",
            "account_name": "Stripe"
          },
          "order_id": "order_1001",
          "staging_entry_id": "stag_ent_Qw72NpRs15YzUv8CxM3d",
          "mismatch": null
        }
      ],
      "has_more_entries": false,
      "discarded_status": null,
      "data": { "status": "matched", "matched_data_type": "auto" },
      "discarded_data": null,
      "discarded_at": null,
      "modified_by": null
    }
  ],
  "next_cursor": null,
  "prev_cursor": null
}
```

The fields you will use most:

| Field                    | Description                                                                 |
| ------------------------ | --------------------------------------------------------------------------- |
| `items`                  | Your transactions.                                                          |
| `items[].status`         | The reconciliation status. See What the statuses mean.                      |
| `items[].sub_status`     | Extra detail for some statuses, such as `auto` for an automatic match.      |
| `items[].transaction_id` | The ID of the transaction. It stays the same over time.                     |
| `items[].entries`        | The two sides of the transaction, each with its account, amount and status. |
| `next_cursor`            | Use this to get the next page. `null` means you have everything.            |

<details>

<summary>All response fields</summary>

**Top level**

| Field         | Type           | Description                                                                 |
| ------------- | -------------- | --------------------------------------------------------------------------- |
| `items`       | list           | The transactions on this page.                                              |
| `next_cursor` | object or null | Send this as `sort_by` to get the next page. `null` when there are no more. |
| `prev_cursor` | object or null | Send this as `sort_by` with `"direction": "previous"` to go back.           |

**Each transaction**

| Field                                                | Type                   | Description                                                                        |
| ---------------------------------------------------- | ---------------------- | ---------------------------------------------------------------------------------- |
| `id`                                                 | string                 | ID of this version of the transaction. It changes when the transaction is updated. |
| `transaction_id`                                     | string                 | ID of the transaction. Stays the same over time.                                   |
| `status`                                             | string                 | The reconciliation status.                                                         |
| `sub_status`                                         | string                 | Present for some statuses only.                                                    |
| `version`                                            | integer                | Goes up each time the transaction changes.                                         |
| `created_at`                                         | string                 | When this version was created (UTC).                                               |
| `effective_at`                                       | string                 | The date of the transaction (UTC).                                                 |
| `profile_id`                                         | string                 | The profile the transaction belongs to.                                            |
| `credit_amount`, `debit_amount`                      | object                 | The total for each side: `value` (decimal, in major units) and `currency`.         |
| `rule`                                               | object                 | `rule_id` and `rule_name` of the reconciliation rule used.                         |
| `entries`                                            | list                   | Up to 5 entries of the transaction.                                                |
| `has_more_entries`                                   | boolean                | `true` if the transaction has more than 5 entries.                                 |
| `data`                                               | object                 | Extra detail about the status, such as which fields differ.                        |
| `modified_by`                                        | object or null         | The dashboard user who last changed the transaction, if any.                       |
| `discarded_status`, `discarded_data`, `discarded_at` | object, string or null | Normally `null`.                                                                   |

**Each entry**

| Field              | Type           | Description                                                                                                                                       |
| ------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `entry_id`         | string         | ID of the entry.                                                                                                                                  |
| `entry_type`       | string         | `debit` or `credit`.                                                                                                                              |
| `status`           | string         | `expected`, `posted`, `matched`, `mismatched`, `pending` or `void`.                                                                               |
| `amount`           | object         | `value` and `currency`.                                                                                                                           |
| `account`          | object         | `account_id` and `account_name`.                                                                                                                  |
| `order_id`         | string         | The order ID of the record.                                                                                                                       |
| `staging_entry_id` | string or null | The record you sent that created this entry. It matches the `id` you got back when you sent the record. `null` while the entry is still expected. |
| `mismatch`         | object or null | For a `mismatched` entry: what is different (`mismatch_type` and `mismatch_data`).                                                                |

</details>

#### What the statuses mean

```mermaid
stateDiagram-v2
    direction LR
    state "a mismatch status" as mm
    [*] --> expected: First side sent
    expected --> matched: Second side agrees
    expected --> mm: Second side differs
    expected --> missing: Second side is late
    missing --> matched: Second side arrives and agrees
    missing --> mm: Second side arrives and differs
    mm --> matched: Fixed in dashboard
    matched --> [*]
```

| `status`               | `sub_status`             | In plain words                                                                                                   |
| ---------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `expected`             |                          | We have one side and are waiting for the other.                                                                  |
| `missing`              |                          | We are still waiting, and it has been longer than your rule allows. Only used if your rule sets a waiting limit. |
| `matched`              | `auto`                   | Both sides agree. All good.                                                                                      |
| `matched`              | `with_tolerance`         | Both sides agree, within the tolerance you allow.                                                                |
| `matched`              | `manual` or `force`      | Someone matched it in the dashboard.                                                                             |
| `posted`               | `manual`                 | Someone posted it in the dashboard.                                                                              |
| `over_amount`          | `mismatch` or `expected` | We received more than expected.                                                                                  |
| `under_amount`         | `mismatch` or `expected` | We received less than expected.                                                                                  |
| `data_mismatch`        |                          | The amounts agree, but another field is different.                                                               |
| `currency_mismatch`    |                          | The two sides are in different currencies.                                                                       |
| `split_mismatch`       |                          | The parts of a split payment don't add up.                                                                       |
| `partially_reconciled` |                          | Partly fixed by hand, with something still open.                                                                 |
| `void`                 |                          | Cancelled.                                                                                                       |

The mismatch statuses are `over_amount`, `under_amount`, `data_mismatch`, `currency_mismatch` and `split_mismatch`.

{% hint style="info" %}
**`missing` doesn't mean lost.** It is a nudge that the second side is overdue. As soon as it arrives, the transaction is reconciled as usual.
{% endhint %}

#### Filtering by status

In the `status` filter, the status and its detail are joined into one word:

| To find                     | Use this filter value                            |
| --------------------------- | ------------------------------------------------ |
| Waiting for the second side | `expected`                                       |
| Overdue                     | `missing`                                        |
| Matched automatically       | `matched_auto`                                   |
| Matched within tolerance    | `matched_with_tolerance`                         |
| Matched in the dashboard    | `matched_manual`, `matched_force`                |
| Posted in the dashboard     | `posted_manual`                                  |
| Received too much           | `over_amount_mismatch`, `over_amount_expected`   |
| Received too little         | `under_amount_mismatch`, `under_amount_expected` |
| A field is different        | `data_mismatch`                                  |
| Different currencies        | `currency_mismatch`                              |
| Split doesn't add up        | `split_mismatch`                                 |
| Partly fixed                | `partially_reconciled`                           |
| Cancelled                   | `void`                                           |

For example, to find everything that needs your attention:

```json
{
  "filters": {
    "status": [
      "missing",
      "over_amount_mismatch",
      "under_amount_mismatch",
      "data_mismatch",
      "currency_mismatch"
    ]
  },
  "cursor_payload": {
    "limit": 50,
    "sort_by": { "sort_field": "effective_at" }
  }
}
```

#### Getting more results

Results come in pages of up to 50. Every response includes a `next_cursor` that points to the next page.

```mermaid
flowchart LR
    A["Ask for the first page"] --> B["Get transactions<br/>and next_cursor"]
    B --> C{"Is next_cursor<br/>null?"}
    C -- No --> D["Ask again with<br/>sort_by = next_cursor"]
    D --> B
    C -- Yes --> E["You have everything"]
```

**1. Ask for the first page.**

```json
{
  "cursor_payload": {
    "limit": 50,
    "sort_by": { "sort_field": "effective_at" }
  }
}
```

**2. Find `next_cursor` in the response.**

```json
{
  "items": ["…50 transactions…"],
  "next_cursor": {
    "sort_field": "effective_at",
    "cursor_value": {
      "effective_at": "2026-11-10T08:15:30.123456Z",
      "id": "txn_8Hq2LmZx04PvTr6BvN4c"
    }
  },
  "prev_cursor": null
}
```

**3. Send it back as `sort_by`.**

```json
{
  "cursor_payload": {
    "limit": 50,
    "sort_by": {
      "sort_field": "effective_at",
      "cursor_value": {
        "effective_at": "2026-11-10T08:15:30.123456Z",
        "id": "txn_8Hq2LmZx04PvTr6BvN4c"
      }
    }
  }
}
```

**4. Repeat until `next_cursor` is `null`.**

If you sort by ID, the cursor is shorter but works the same way:

```json
{ "sort_field": "id", "id": "txn_8Hq2LmZx04PvTr6BvN4c" }
```

Three tips:

* Copy `next_cursor` exactly as you received it.
* Keep the same `filters`, `order` and `limit` on every page.
* The response has no total count. You have reached the end when `next_cursor` is `null`.

***

### When something goes wrong

Errors come back with a standard HTTP status code and a short explanation:

```json
{
  "error": {
    "type": "invalid_request",
    "message": "Authentication required",
    "code": "RE_07"
  }
}
```

| Status | Code               | What it means                                                                                      | How to fix it                                                                                                                                                                                                                                     |
| ------ | ------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    |                    | The request body couldn't be read. The reply is plain text starting with `Json deserialize error`. | Check for a missing field or a value of the wrong type. The message names the field.                                                                                                                                                              |
| 400    | `RE_409`           | A value in `raw_data` doesn't fit your schema.                                                     | The message names the field and the reason. Fix that value.                                                                                                                                                                                       |
| 400    | `RE_609`           | `start_time` is after `end_time`.                                                                  | Fix the `time_range` filter.                                                                                                                                                                                                                      |
| 401    | `RE_07`            | We couldn't verify your key.                                                                       | Run through the authentication checklist.                                                                                                                                                                                                         |
| 401    | `RE_08`            | You sent `Bearer` instead of `api-key=`.                                                           | Change the `Authorization` header to `api-key=<YOUR_API_KEY>`.                                                                                                                                                                                    |
| 404    | `RE_403`           | Account not found.                                                                                 | Check the `account_id` and that it belongs to your profile.                                                                                                                                                                                       |
| 404    | `RE_408`           | Metadata schema not found.                                                                         | Check the `metadata_schema_id` and that it belongs to your profile.                                                                                                                                                                               |
| 404    | `RE_02`            | Unknown URL.                                                                                       | Check the base URL and the path.                                                                                                                                                                                                                  |
| 405    | `RE_03`            | Wrong HTTP method.                                                                                 | Both endpoints use `POST`.                                                                                                                                                                                                                        |
| 500    | `RE_400`, `RE_600` | Something went wrong on our side.                                                                  | When sending a record, first check your `transformation_id`: a wrong one causes this error, and the record may already be stored. Look it up by `order_id` before you send it again. If the error keeps happening, contact your Hyperswitch SPOC. |

Here is what a schema error looks like:

```
Metadata schema validation failed: amount: Missing Required Field
```

{% hint style="info" %}
Every response has an `x-request-id` header. Share it with your Hyperswitch SPOC when you ask for help, so we can find your request quickly.
{% endhint %}

### Limits

| What                          | Limit                                              |
| ----------------------------- | -------------------------------------------------- |
| Transactions per page         | 10 by default, 50 at most                          |
| Entries shown per transaction | 5 (`has_more_entries` tells you if there are more) |
| Records per request           | 1                                                  |
| Order ID                      | 64 characters                                      |
| API key name                  | 64 characters                                      |
| API key description           | 256 characters                                     |
| Requests per second (sandbox) | 50                                                 |

### Tips

* **Send the first side before the second.** If the confirmation arrives first, it has no expectation to confirm and goes to manual review.
* **Use a `confirmation` type transformation to satisfy an expectation.** An account can have several transformations. Sending the second side with a `transaction` type one opens a new transaction instead of matching.
* **Don't send the same record twice.** The second copy is flagged as a duplicate. If a request fails and you are not sure it went through, look up the `order_id` before sending it again.
* **Use IDs that belong together.** The account, schema and transformation IDs for one side all come as a set. Copy them from the dashboard.
* **Amounts come back as decimals.** USD 100 is returned as `100.0`, whatever format you sent.
* **Need something else?** Looking up a single record, or managing accounts, rules and keys, is done in the dashboard.

### Need help?

Reach out to your Hyperswitch point of contact (SPOC). To help us help you faster, include:

* the `x-request-id` from the response,
* the endpoint you called, and
* the time of the request.

Please never share your full API key.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hyperswitch.io/other-features/payments-modules/reconciliation-product/api-key-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
