> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Transactions

> Create, store, and link transactions with structured metadata for expense reconciliation.

## Overview

A **transaction** represents an expense event — for example, a card payment, bank transfer, or cash withdrawal. Transactions serve as the core entity for tracking business spending. They can be created directly by your system or imported from external sources such as accounting software or banking feeds.

Transactions can optionally be linked to receipts, which provide supporting documentation for auditing and reconciliation purposes.

## Create a transaction

To manually create a new transaction, call `POST /transactions`:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/transactions' \
  -H 'accept: application/json' \
  -H 'X-Monite-Version: 2024-05-25' \
  -H 'X-Monite-Entity-Id: ENTITY_ID' \
  -d '{
    "amount": 4599,
    "currency": "EUR",
    "description": "Coffee machines order #7845",
    "entity_user_id": "b79cb3ba-745e-5d9a-8903-4a02327a7e09",
    "external_id": "txn-ext-7845",
    "merchant_amount": 4599,
    "merchant_currency": "EUR",
    "merchant_location": "Berlin, DE",
    "merchant_name": "Kaffeehaus GmbH",
    "partner_metadata": {
      "order_id": "ORD-7845-DE",
      "cost_center": "BER-OFFICE"
    },
    "payment_method": {
      "details": {
        "brand": "Visa",
        "card_type": "credit",
        "expiry_month": 12,
        "expiry_year": 2027,
        "last4": "4821"
      }
    },
    "started_at": "2025-08-19T14:11:11.842Z",
    "status": "created",
    "type": "capture"
  }'

```

The successful `201` response returns the created transaction:

```json
{
  "id": "trn_c9d1a6b4-9d2f-4b83-bf21-67d9c3e1a8f5",
  "amount": 4599,
  "currency": "EUR",
  "description": "Coffee machines order #7845",
  "entity_id": "b79cb3ba-745e-5d9a-8903-4a02327a7e09",
  "entity_user_id": "fb3463a0-7d6e-54a3-bcd8-1b93388c648d",
  "external_id": "txn-ext-7845",
  "merchant_amount": 4599,
  "merchant_currency": "EUR",
  "merchant_location": "Berlin, DE",
  "merchant_name": "Kaffeehaus GmbH",
  "partner_metadata": {
    "order_id": "ORD-7845-DE",
    "cost_center": "BER-OFFICE"
  },
  "payment_method": {
    "details": {
      "brand": "Visa",
      "card_type": "credit",
      "expiry_month": 12,
      "expiry_year": 2027,
      "last4": "4821"
    }
  },
  "started_at": "2025-08-19T14:11:11.843Z",
  "status": "created",
  "type": "capture"
}

```

### Create multiple transactions

You can create multiple transactions at once by calling `POST /transactions/bulk`.
This endpoint is designed for high-volume inserts and supports up to 5000 records per request.

Each request must include a `data` array of transaction objects. The order of records in the request will be preserved in the response, so each result corresponds to the same index in the input.

If a transaction is successfully saved, the response will include its `id`. If a record fails validation or is ignored as a duplicate, the corresponding `id` will be `null`. A duplicate is defined as an identical pair of `entity_id + external_id` (where `external_id` is not `null`); in that case, the second duplicate will be skipped.

The response also contains counters showing how many records were successfully saved and how many failed:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/transactions/bulk' \
  -H 'accept: application/json' \
  -H 'X-Monite-Version: 2024-05-25' \
  -H 'X-Monite-Entity-Id: ENTITY_ID' \
  -d '{
  "data": [
    {
      "amount": 4599,
      "currency": "EUR",
      "description": "Coffee machines order #7845",
      "entity_id": "fb3463a0-7d6e-54a3-bcd8-1b93388c648d",
      "entity_user_id": "efe7eedd-89c5-56f5-984c-0712ee41a2eb",
      "external_id": "txn-ext-7845",
      "merchant_amount": 4599,
      "merchant_currency": "EUR",
      "merchant_location": "Berlin, DE",
      "merchant_name": "Kaffeehaus GmbH",
      "partner_metadata": {
        "order_id": "ORD-7845-DE",
        "cost_center": "BER-OFFICE"
      },
      "payment_method": {
        "details": {
          "brand": "Visa",
          "card_type": "credit",
          "expiry_month": 12,
          "expiry_year": 2027,
          "last4": "4821"
        }
      },
      "started_at": "2025-08-19T14:11:11.843Z",
      "status": "created",
      "type": "capture"
    },
    {
      "amount": 12900,
      "currency": "EUR",
      "description": "Office furniture invoice #9921",
      "entity_id": "c40b683b-ac7b-5d6b-b0eb-549cb20169b9",
      "entity_user_id": "440c0655-0bf6-51b6-a1fa-527f475a6fbc",
      "external_id": "txn-ext-9921",
      "merchant_amount": 12900,
      "merchant_currency": "EUR",
      "merchant_location": "Munich, DE",
      "merchant_name": "BüroDesign AG",
      "partner_metadata": {
        "invoice_ref": "INV-9921-DE",
        "department": "HQ-MUNICH"
      },
      "payment_method": {
        "details": {
          "brand": "Mastercard",
          "card_type": "debit",
          "expiry_month": 6,
          "expiry_year": 2028,
          "last4": "9375"
        }
      },
      "started_at": "2025-08-19T15:05:42.113Z",
      "status": "created",
      "type": "capture"
    }
  ]
}'
```

## Match a receipt to a transaction

To match a receipt to a transaction, send a `PATCH` request to the `/receipts/{receipt_id}` endpoint with the request body containing the `transaction_id` associated with the recepit:

```sh
curl -X PATCH 'https://api.sandbox.monite.com/v1/receipts/{receipt_id}' \
     -H 'X-Monite-Version: 2024-05-25' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "transaction_id": "fb3463a0-7d6e-54a3-bcd8-1b93388c648d"
     }'
```

### AI Receipt-to-transaction matching \[#receipt-to-transaction]

Receipts can be automatically matched to transactions by an **AI-driven matching engine** once the OCR is completed. The system evaluates only **unmatched items** with the same `entity_id`, a timestamp difference of ≤1 day, and either the same `(amount + currency)` or `(merchant_amount + currency)` (with ≤1% allowed difference).

The AI logic applies a two-step approach:

1. **Equal match** - Exact merchant name match (case-insensitive, trimmed).
2. **Semantic match** - If no exact match, merchant name + location are embedded and compared using fuzzy semantic similarity (≥0.8).

#### Considerations

* The matching process runs only when receipts and transactions share the same `entity_id` and satisfy the required timestamp and amount conditions.
* When an exact merchant name match is found, the receipt is immediately linked to the transaction.
* If there is no exact match but the semantic similarity between merchant name and location is at least 0.8, the system also links the receipt automatically.
* If neither condition is met, the receipt remains unmatched.
* To ensure data consistency, each receipt can only ever be linked to one transaction.

## List all transactions

To get information about all transactions associated with the specified entity, call `GET /transactions`.

## Retrieve a transaction

To get information about a specific transaction, call `GET /transactions/{transaction_id}`.

## Edit a transaction

To edit an existing transaction, call `PATCH /transactions/{transaction_id}`.

## Delete a transaction

To delete a specific transaction, call `DELETE /transactions/{transaction_id}`.