---
title: "Zaktualizuj konto bankowe"
description: "Zakres: `api:sensitive:bank_accounts:write`. Właściciel konta dostaje powiadomienie e-mailem."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.niebieskiorzel.pl/llms.txt
> Use this file to discover all available pages before exploring further.

Path: inFakt API › Konta bankowe

`PUT /bank_accounts/{id}.json`

Zakres: `api:sensitive:bank_accounts:write`. Właściciel konta dostaje powiadomienie e-mailem.

## Authentication

Requires one of the following:

- `ApiKey`, apiKey, in header, header `X-inFakt-ApiKey`
- `Token`, apiKey, in header, header `X-Token`

## Path parameters

- `id` (`BankAccounts_update.path.id`; integer, required)
  - format `int64`

## Request body

_Required._

- `bank_account` (`BankAccounts_update.bank_account`; object, required) — Zmieniane są tylko wysłane pola.
  - `bank_name` (`BankAccounts_update.bank_account.bank_name`; string, optional)
  - `account_number` (`BankAccounts_update.bank_account.account_number`; string, optional) — Polski NRB lub IBAN; sprawdzany sumą kontrolną.
  - `swift` (`BankAccounts_update.bank_account.swift`; string, optional)
  - `default` (`BankAccounts_update.bank_account.default`; boolean, optional)
  - `currency` (`BankAccounts_update.bank_account.currency`; string, optional) — Kod waluty ISO 4217.
  - `custom_name` (`BankAccounts_update.bank_account.custom_name`; string, optional) — Musi być unikalna w obrębie konta użytkownika.

## Example requests

### Własna nazwa

```json
{
  "bank_account": {
    "custom_name": "Konto główne"
  }
}
```

### Brak nazwy banku

```json
{
  "bank_account": {
    "bank_name": ""
  }
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url https://api.sandbox-infakt.pl/v3/bank_accounts/1001.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "bank_account": {
    "custom_name": "Konto główne"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/bank_accounts/1001.json';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({bank_account: {custom_name: 'Konto główne'}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sandbox-infakt.pl/v3/bank_accounts/1001.json"

payload = { "bank_account": { "custom_name": "Konto główne" } }
headers = {
    "Content-Type": "application/json",
    "X-inFakt-ApiKey": "<X-inFakt-ApiKey>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "id": 1001,
  "bank_name": "Santander Bank Polska",
  "account_number": "61109010140000071219812874",
  "swift": "WBKPPLPP",
  "default": true,
  "currency": "PLN",
  "custom_name": "Konto główne"
}
```

- `id` (`BankAccounts_update.response.200.id`; integer, required)
  - format `int64`
- `bank_name` (`BankAccounts_update.response.200.bank_name`; string, required)
- `account_number` (`BankAccounts_update.response.200.account_number`; string, required) — Numer konta bez spacji; dla kont zagranicznych IBAN.
- `swift` (`BankAccounts_update.response.200.swift`; any of, required) — `""`, gdy nie ustawiono.
  - any of: `string`, `null`
- `default` (`BankAccounts_update.response.200.default`; boolean, required) — Konto drukowane domyślnie na fakturach. Pierwsze dodane konto staje się domyślne.
- `currency` (`BankAccounts_update.response.200.currency`; any of, required) — Kod waluty ISO 4217.
  - any of: `string`, `null`
- `custom_name` (`BankAccounts_update.response.200.custom_name`; any of, required) — Nazwa unikalna w obrębie konta użytkownika.
  - any of: `string`, `null`

### 401

Brak klucza API, nieprawidłowy klucz albo klucz bez wymaganego zakresu uprawnień.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.401.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.401.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.401.url`; string, optional)
- `action_url` (`BankAccounts_update.response.401.action_url`; string, optional)

### 402

API niedostępne w obecnym planie (`limit: plan_upgrade_needed`) albo osiągnięty limit dokumentów.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.402.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.402.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.402.url`; string, optional)
- `action_url` (`BankAccounts_update.response.402.action_url`; string, optional)

### 403

Brak uprawnień, limit planu dla tej akcji (`limit`) albo zawieszone konto.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.403.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.403.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.403.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.403.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.403.url`; string, optional)
- `action_url` (`BankAccounts_update.response.403.action_url`; string, optional)

### 404

Nie znaleziono zasobu.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.404.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.404.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.404.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.404.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.404.url`; string, optional)
- `action_url` (`BankAccounts_update.response.404.action_url`; string, optional)

### 406

Ścieżka nie kończy się na `.json`.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.406.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.406.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.406.url`; string, optional)
- `action_url` (`BankAccounts_update.response.406.action_url`; string, optional)

### 422

Walidacja nie powiodła się; szczegóły w `errors`.

#### Example

```json
{
  "error": "Wadliwy zasób. Popraw błędy i spróbuj ponownie.",
  "errors": {
    "bank_name": [
      "Pole nazwa banku nie może być puste."
    ]
  }
}
```

- `error` (`BankAccounts_update.response.422.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.422.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.422.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.422.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.422.url`; string, optional)
- `action_url` (`BankAccounts_update.response.422.action_url`; string, optional)

### 423

Niepotwierdzony adres e-mail albo wymagana weryfikacja tożsamości.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.423.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.423.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.423.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.423.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.423.url`; string, optional)
- `action_url` (`BankAccounts_update.response.423.action_url`; string, optional)

### 429

Przekroczony limit zapytań. Komunikat jest po angielsku, np. `API rate limit exceeded. Try again in 60 seconds.`

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`BankAccounts_update.response.429.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`BankAccounts_update.response.429.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`BankAccounts_update.response.429.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`BankAccounts_update.response.429.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`BankAccounts_update.response.429.url`; string, optional)
- `action_url` (`BankAccounts_update.response.429.action_url`; string, optional)


Source: https://docs.niebieskiorzel.pl/api/bank-accounts-update/index.md
