---
title: "Book two bank lines as a transfer between own bank accounts"
method: POST
path: "/bank-transactions/{id}/pair-transfer"
tags: ["Bank Imports"]
---

# Book two bank lines as a transfer between own bank accounts

`POST /bank-transactions/{id}/pair-transfer`

## Request

- Base URL: `https://api.lumabill.ch/v1`
- URL: `https://api.lumabill.ch/v1/bank-transactions/{id}/pair-transfer`
- Auth: HTTP bearer

Pairs an unbooked DEBIT on one of your bank accounts with an unbooked CREDIT on another (for example CHF account to EUR account) and posts one journal entry for both. In one currency both lines must show the same amount. Across currencies each leg keeps its own CHF value (the statement's CHF figure, else the ESTV/BAZG rate of its value date) and the difference is booked as realized FX. The import pairs such lines automatically when the counterparty IBAN names the other account; this route pairs the rest. Undo: set either line back to `UNMATCHED` (PUT /bank-transactions/{id}). Errors: 400 TRANSFER_DIRECTION, TRANSFER_SAME_ACCOUNT, TRANSFER_AMOUNT_MISMATCH, TRANSFER_LINE_BOOKED, INVALID_TRANSACTION_ID, FISCAL_YEAR_CLOSED, FX_RATE_UNAVAILABLE, FX_ACCOUNT_MISSING; 409 TRANSFER_LINE_BOOKED when a line was booked concurrently; 403 DOUBLE_ENTRY_REQUIRED.

## Request body

- object
  - `counterpartId` string, uuid, required: Bank transaction UUID of the other leg

## Response `200`

Transfer booked

- BankTransferResult
  - `message` string, required
  - `journalEntryId` string, uuid, required
  - `transfer` object, required
    - `sendingTransactionId` string, uuid
    - `receivingTransactionId` string, uuid
    - `sendingBase` number, double: CHF value of the sending leg
    - `receivingBase` number, double: CHF value of the receiving leg
    - `realizedFx` number, double: receivingBase minus sendingBase (positive = gain); 0 in one currency
    - `sendingRateSource` string
    - `receivingRateSource` string

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `403`: Subscription required or read-only key on a write endpoint
- `404`: Resource not found
- `409`: One of the lines was booked concurrently (TRANSFER_LINE_BOOKED)
- `500`: Internal server error

---

[API](https://skmtc.dev/lumabill/apis/lumabill-api.md) · [All operations](https://skmtc.dev/lumabill/apis/lumabill-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lumabill/apis/lumabill-api/revisions/e48e7099b545?raw)
