---
title: "Transactions and statuses | Docs | Treasury by R&D Copilot"
description: "The statement and the rules an import must meet, the transaction object, its status and kind, and what each refusal of an import means."
canonical: "https://banking.rdcopilot.com/docs/concepts/transactions-and-statuses/"
language: en
updated: 2026-11-22
---

# Transactions and statuses

The statement and the rules an import must meet, the transaction object, its status and kind, and what each refusal of an import means.

A statement holds the lines your bank booked for one account over one period. You send those lines with `importStatement`, and every line becomes a transaction. The statement keeps the chain of balances; the transaction keeps the line and the state of its match.

## The statement and its chain

| Field | Meaning |
| --- | --- |
| `from` | The first day of the period. `to` is the last day. |
| `openingBalance` | The balance at the start of the period. |
| `closingBalance` | The balance at the end of the period. |
| `lineCount` | How many lines the statement holds. |
| `importedAt` | When the statement was imported. |

Every statement of an account must fit the one before it. Four rules hold, and an import that breaks one is refused and stores nothing.

1.  The opening balance is the closing balance of the previous statement of the account.
2.  The opening balance plus the lines that are not pending is the closing balance.
3.  Every line is booked inside the period, from `from` to `to`.
4.  Every `bankReference` appears once for the account.

curl

```bash
curl -X POST "$RDC_BASE_URL/banking/v1/accounts/258f8664-ff43-4e53-b688-ad5a4a97ede6/statements" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "80cd1346-fac0-457b-9c65-741c7d8c82f1",
  "periodFrom": "2026-11-20",
  "periodTo": "2026-11-22",
  "openingBalance": "154289.67",
  "closingBalance": "180250.47",
  "lines": [
    {
      "bankReference": "BK26112001",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Moara Vadului SRL",
      "reference": "RETUR MV-2026-1187 PP-1002",
      "amount": "24102.50",
      "kind": "transfer",
      "status": "returned",
      "returnOf": "BK26111802",
      "returnReason": "Beneficiary account closed"
    },
    {
      "bankReference": "BK26111902",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Silozurile Zănești SRL",
      "reference": "TRANSFER",
      "amount": "1873.30",
      "kind": "transfer",
      "status": "booked"
    },
    {
      "bankReference": "BK26112002",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Bank fee",
      "reference": "COMISION OPERATIUNE RETUR",
      "amount": "-15.00",
      "kind": "fee",
      "status": "booked"
    }
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/accounts/258f8664-ff43-4e53-b688-ad5a4a97ede6/statements`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "80cd1346-fac0-457b-9c65-741c7d8c82f1",
    "periodFrom": "2026-11-20",
    "periodTo": "2026-11-22",
    "openingBalance": "154289.67",
    "closingBalance": "180250.47",
    "lines": [
      {
        "bankReference": "BK26112001",
        "bookedOn": "2026-11-20",
        "valueOn": "2026-11-20",
        "counterparty": "Moara Vadului SRL",
        "reference": "RETUR MV-2026-1187 PP-1002",
        "amount": "24102.50",
        "kind": "transfer",
        "status": "returned",
        "returnOf": "BK26111802",
        "returnReason": "Beneficiary account closed"
      },
      {
        "bankReference": "BK26111902",
        "bookedOn": "2026-11-20",
        "valueOn": "2026-11-20",
        "counterparty": "Silozurile Zănești SRL",
        "reference": "TRANSFER",
        "amount": "1873.30",
        "kind": "transfer",
        "status": "booked"
      },
      {
        "bankReference": "BK26112002",
        "bookedOn": "2026-11-20",
        "valueOn": "2026-11-20",
        "counterparty": "Bank fee",
        "reference": "COMISION OPERATIUNE RETUR",
        "amount": "-15.00",
        "kind": "fee",
        "status": "booked"
      }
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/banking/v1/accounts/258f8664-ff43-4e53-b688-ad5a4a97ede6/statements',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '80cd1346-fac0-457b-9c65-741c7d8c82f1',
        'periodFrom': '2026-11-20',
        'periodTo': '2026-11-22',
        'openingBalance': '154289.67',
        'closingBalance': '180250.47',
        'lines': [
            {
                'bankReference': 'BK26112001',
                'bookedOn': '2026-11-20',
                'valueOn': '2026-11-20',
                'counterparty': 'Moara Vadului SRL',
                'reference': 'RETUR MV-2026-1187 PP-1002',
                'amount': '24102.50',
                'kind': 'transfer',
                'status': 'returned',
                'returnOf': 'BK26111802',
                'returnReason': 'Beneficiary account closed',
            },
            {
                'bankReference': 'BK26111902',
                'bookedOn': '2026-11-20',
                'valueOn': '2026-11-20',
                'counterparty': 'Silozurile Zănești SRL',
                'reference': 'TRANSFER',
                'amount': '1873.30',
                'kind': 'transfer',
                'status': 'booked',
            },
            {
                'bankReference': 'BK26112002',
                'bookedOn': '2026-11-20',
                'valueOn': '2026-11-20',
                'counterparty': 'Bank fee',
                'reference': 'COMISION OPERATIUNE RETUR',
                'amount': '-15.00',
                'kind': 'fee',
                'status': 'booked',
            },
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "80cd1346-fac0-457b-9c65-741c7d8c82f1",
  "periodFrom": "2026-11-20",
  "periodTo": "2026-11-22",
  "openingBalance": "154289.67",
  "closingBalance": "180250.47",
  "lines": [
    {
      "bankReference": "BK26112001",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Moara Vadului SRL",
      "reference": "RETUR MV-2026-1187 PP-1002",
      "amount": "24102.50",
      "kind": "transfer",
      "status": "returned",
      "returnOf": "BK26111802",
      "returnReason": "Beneficiary account closed"
    },
    {
      "bankReference": "BK26111902",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Silozurile Zănești SRL",
      "reference": "TRANSFER",
      "amount": "1873.30",
      "kind": "transfer",
      "status": "booked"
    },
    {
      "bankReference": "BK26112002",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Bank fee",
      "reference": "COMISION OPERATIUNE RETUR",
      "amount": "-15.00",
      "kind": "fee",
      "status": "booked"
    }
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/accounts/258f8664-ff43-4e53-b688-ad5a4a97ede6/statements');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/accounts/258f8664-ff43-4e53-b688-ad5a4a97ede6/statements");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "80cd1346-fac0-457b-9c65-741c7d8c82f1",
  "periodFrom": "2026-11-20",
  "periodTo": "2026-11-22",
  "openingBalance": "154289.67",
  "closingBalance": "180250.47",
  "lines": [
    {
      "bankReference": "BK26112001",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Moara Vadului SRL",
      "reference": "RETUR MV-2026-1187 PP-1002",
      "amount": "24102.50",
      "kind": "transfer",
      "status": "returned",
      "returnOf": "BK26111802",
      "returnReason": "Beneficiary account closed"
    },
    {
      "bankReference": "BK26111902",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Silozurile Zănești SRL",
      "reference": "TRANSFER",
      "amount": "1873.30",
      "kind": "transfer",
      "status": "booked"
    },
    {
      "bankReference": "BK26112002",
      "bookedOn": "2026-11-20",
      "valueOn": "2026-11-20",
      "counterparty": "Bank fee",
      "reference": "COMISION OPERATIUNE RETUR",
      "amount": "-15.00",
      "kind": "fee",
      "status": "booked"
    }
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "80cd1346-fac0-457b-9c65-741c7d8c82f1",
  "status": "accepted",
  "aggregateId": "f5b1321e-fbb0-4771-8393-9e4090091108",
  "aggregateRevision": 1
}
```

## The transaction object

| Field | Meaning |
| --- | --- |
| `id` | Identifier of the transaction. It stays the same when a pending line is booked. |
| `accountId` | The account of the transaction. |
| `statementId` | The statement that holds the transaction. |
| `bookedOn` | The day the bank booked the transaction. `valueOn` is the value date. |
| `counterparty` | The other party, as the bank prints it. |
| `reference` | The details of the payment, as the bank prints them. |
| `amount` | Positive for a credit, negative for a debit. `currency` is `RON`. |
| `kind` | `transfer`, `card`, `direct_debit` or `fee`. |
| `status` | `pending`, `booked` or `returned`. |
| `bankReference` | The reference the bank gives the line. It is unique for the account. |
| `returnOf` | For a line that returns a payment, the transaction it returns, else `null`. In the file you import, it is the `bankReference` of that line. |
| `returnReason` | The reason the bank gave, as written, else `null`. |
| `attachments` | Names of the files attached to the transaction. |
| `matchState` | The state of its match. `matchId` is the match. |
| `revision` | Grows with every change. Send it as `expectedRevision` when you change the match. |

## Status

| Status | Meaning |
| --- | --- |
| Pending `pending` | The bank has not booked the line yet. It has no match and nothing can be done with it until a later statement books it. A pending debit lowers `availableBalance`. |
| Booked `booked` | The bank booked the line. It counts in the closing balance, and a match is proposed for it. |
| Returned `returned` | The line returns a payment, or it is the payment line that the bank returned. `returnOf` and `returnReason` tell which and why. |

## Kind

| Kind | Word | Meaning |
| --- | --- | --- |
| `transfer` | Transfer | A transfer in or out. It is matched to an invoice, a bill, or the opposite line of another account of yours. |
| `card` | Card | A card payment, or the settlement of a day’s card takings. |
| `direct_debit` | Direct debit | A direct debit. A rule of your company can book it to an entry. |
| `fee` | Fee | A fee charged by the bank. It is proposed for the entry `bank_fee`. |

## A pending line that the bank books

A pending line is not part of the closing balance. When a later statement carries the same `bankReference` as a booked line, the stored transaction is updated, not added: it keeps its `id`, its `status` becomes `booked`, it moves to the new statement, and a match is proposed for it. The earlier statement no longer counts it.

Every change on a pending transaction is refused with `transaction_pending`.

## A returned line

When the bank returns a payment, the statement carries a line with status `returned`, `returnOf` set to the `bankReference` of the payment line, and `returnReason` with the bank’s own words. The import marks the payment line `returned` too, and the payment proposal behind it moves to `rejected_by_bank`. The returned line gets a suggested match that reverses the payment; see [Match methods and reasons](https://banking.rdcopilot.com/docs/concepts/match-methods-and-reasons/#returns).

## What an import refuses

The checks run in this order, and the first one that fails answers.

| Code | HTTP | What it means | What you do |
| --- | --- | --- | --- |
| `statement_duplicate` | `422` | A statement of this account for the same period is already imported. | Nothing to do: read the statement that is stored. |
| `statement_gap` | `422` | The opening balance of the file is not the closing balance of the last statement of the account. | Import the statement that comes before it first. |
| `statement_out_of_period` | `422` | A line is dated outside the period of the statement. | Export the statement again for the period you mean. |
| `statement_duplicate_line` | `422` | A bank reference appears twice in the file or is already stored for the account. | Remove the repeated line or import only the days that are new. |
| `statement_unbalanced` | `422` | The opening balance plus the booked lines is not the closing balance of the file. | Check that the file is complete and export it again from your bank. |

See [Import a statement](https://banking.rdcopilot.com/docs/guides/import-a-statement/) for the steps and [Error codes](https://banking.rdcopilot.com/docs/reference/error-codes/) for every code.
