---
title: "Payment files | Docs | Treasury by R&D Copilot"
description: "Export approved payments as one table and read it again."
canonical: "https://banking.rdcopilot.com/docs/api-reference/payment-batches/"
language: en
updated: 2026-11-22
---

# Payment files

Export approved payments as one table and read it again.

## List payment files

GET `/banking/v1/payment-batches`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `accountId` | query | `string (uuid)` | Yesrequired | The bank account whose records you want. |
| `limit` | query | `integer` | Nooptional | Records per page, from 1 to 500. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of payment files, newest first. | `PaymentBatchPage` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `404` | The bank account does not exist in your account. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | Treasury cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/banking/v1/payment-batches?accountId=258f8664-ff43-4e53-b688-ad5a4a97ede6&limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/payment-batches?accountId=258f8664-ff43-4e53-b688-ad5a4a97ede6&limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/banking/v1/payment-batches?accountId=258f8664-ff43-4e53-b688-ad5a4a97ede6&limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/payment-batches?accountId=258f8664-ff43-4e53-b688-ad5a4a97ede6&limit=20');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$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.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/payment-batches?accountId=258f8664-ff43-4e53-b688-ad5a4a97ede6&limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "items": [
    {
      "id": "45c5fc66-0d7b-4707-bccd-473915866774",
      "number": "BT-2026-017",
      "accountId": "258f8664-ff43-4e53-b688-ad5a4a97ede6",
      "paymentIds": [
        "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
      ],
      "exportedAt": "2026-11-23T07:12:00Z",
      "executeOn": "2026-12-04",
      "rows": [
        [
          "payment",
          "beneficiary",
          "account",
          "amount",
          "currency",
          "execution_date",
          "reference"
        ],
        [
          "PP-1006",
          "Ambalaje Carpatin SRL",
          "RO** **** **** **** **** 0000",
          "4120.75",
          "RON",
          "2026-12-04",
          "AC-2026-0761 PP-1006"
        ]
      ]
    },
    {
      "id": "00c36023-1b61-400c-80e1-c3a6cc1fec82",
      "number": "BT-2026-016",
      "accountId": "258f8664-ff43-4e53-b688-ad5a4a97ede6",
      "paymentIds": [
        "cef8de13-2bf6-45ea-954f-036e324a40d5"
      ],
      "exportedAt": "2026-11-17T09:41:00Z",
      "executeOn": "2026-11-18",
      "rows": [
        [
          "payment",
          "beneficiary",
          "account",
          "amount",
          "currency",
          "execution_date",
          "reference"
        ],
        [
          "PP-1002",
          "Moara Vadului SRL",
          "RO** **** **** **** **** 0000",
          "24102.50",
          "RON",
          "2026-11-18",
          "MV-2026-1187 PP-1002"
        ]
      ]
    },
    {
      "id": "0dedbcf0-2a38-4cfd-a229-d2c1fe966ca0",
      "number": "BT-2026-014",
      "accountId": "258f8664-ff43-4e53-b688-ad5a4a97ede6",
      "paymentIds": [
        "01a7228f-1852-4781-9178-56b66877edf7"
      ],
      "exportedAt": "2026-11-04T08:20:00Z",
      "executeOn": "2026-11-05",
      "rows": [
        [
          "payment",
          "beneficiary",
          "account",
          "amount",
          "currency",
          "execution_date",
          "reference"
        ],
        [
          "PP-1001",
          "Ambalaje Carpatin SRL",
          "RO** **** **** **** **** 0000",
          "5938.40",
          "RON",
          "2026-11-05",
          "AC-2026-0733 PP-1001"
        ]
      ]
    }
  ],
  "nextCursor": null
}
```

## Export payments

POST `/banking/v1/payment-batches`

Makes one table of approved payments of one account, moves the payments to `exported` and gives the file one execution day: the earliest scheduled day of the payments, each moved back to a working day of the account. Every payment of the file then has that day as its `executeOn`.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `paymentIds` | `string (uuid)[]` | Yesrequired | The approved payments, of one account. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `404` | The payment proposal does not exist. | `Error` |
| `409` | The `operationId` was already used with a different request. | `Error` |
| `422` | `invalid_payment_status`: The payment proposal is not in a status that allows this. `batch_empty`: The export names no payment. `mixed_accounts`: The payments belong to more than one account. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | Treasury cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/banking/v1/payment-batches" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "6625838e-1435-4abc-ae36-b1202043b86f",
  "paymentIds": [
    "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/payment-batches`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "6625838e-1435-4abc-ae36-b1202043b86f",
    "paymentIds": [
      "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/banking/v1/payment-batches',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '6625838e-1435-4abc-ae36-b1202043b86f',
        'paymentIds': [
            'cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe',
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "6625838e-1435-4abc-ae36-b1202043b86f",
  "paymentIds": [
    "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/payment-batches');
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/payment-batches");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "6625838e-1435-4abc-ae36-b1202043b86f",
  "paymentIds": [
    "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "6625838e-1435-4abc-ae36-b1202043b86f",
  "status": "accepted",
  "aggregateId": "45c5fc66-0d7b-4707-bccd-473915866774",
  "aggregateRevision": 1
}
```

## Get a payment file

GET `/banking/v1/payment-batches/{batchId}`

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `batchId` | path | `string (uuid)` | Yesrequired | The payment file. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The file: its payments and its rows, header first. | `PaymentBatch` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this company or operation. | `Error` |
| `404` | The payment file does not exist. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | Treasury cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/banking/v1/payment-batches/45c5fc66-0d7b-4707-bccd-473915866774" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/payment-batches/45c5fc66-0d7b-4707-bccd-473915866774`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/banking/v1/payment-batches/45c5fc66-0d7b-4707-bccd-473915866774',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/payment-batches/45c5fc66-0d7b-4707-bccd-473915866774');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$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.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/payment-batches/45c5fc66-0d7b-4707-bccd-473915866774");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "id": "45c5fc66-0d7b-4707-bccd-473915866774",
  "number": "BT-2026-017",
  "accountId": "258f8664-ff43-4e53-b688-ad5a4a97ede6",
  "paymentIds": [
    "cda6be32-1d33-4c24-91e7-e1bbbbbf9cfe"
  ],
  "exportedAt": "2026-11-23T07:12:00Z",
  "executeOn": "2026-12-04",
  "rows": [
    [
      "payment",
      "beneficiary",
      "account",
      "amount",
      "currency",
      "execution_date",
      "reference"
    ],
    [
      "PP-1006",
      "Ambalaje Carpatin SRL",
      "RO** **** **** **** **** 0000",
      "4120.75",
      "RON",
      "2026-12-04",
      "AC-2026-0761 PP-1006"
    ]
  ]
}
```
