---
title: "Zaktualizuj klienta"
description: "Zakres: `api:invoices:write`. Zwraca `403` z `limit: cant_update_client`, gdy plan nie pozwala na edycję."
---

> 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 › Klienci

`PUT /clients/{id}.json`

Zakres: `api:invoices:write`. Zwraca `403` z `limit: cant_update_client`, gdy plan nie pozwala na edycję.

## Authentication

Requires one of the following:

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

## Path parameters

- `id` (`Clients_update.path.id`; string, required) — Liczbowe `id` albo `uuid` rekordu.

## Request body

_Required._

- `client` (`Clients_update.client`; object, required) — Zmieniane są tylko wysłane pola. Nieznany kod `country` jest ignorowany. Do wynikowego klienta stosują się zasady `business_activity_kind` z tworzenia.
  - `company_name` (`Clients_update.client.company_name`; string, optional)
  - `street` (`Clients_update.client.street`; string, optional)
  - `street_number` (`Clients_update.client.street_number`; string, optional)
  - `flat_number` (`Clients_update.client.flat_number`; string, optional)
  - `city` (`Clients_update.client.city`; string, optional)
  - `country` (`Clients_update.client.country`; string, optional) — Dwuliterowy kod kraju jak `alpha_2` w `GET /countries.json`: ISO 3166-1 alpha-2, z wyjątkiem `EL` dla Grecji (`GR` nie jest rozpoznawany) i `XI` dla Irlandii Północnej.
    - pattern `^[A-Z]{2}$`
  - `postal_code` (`Clients_update.client.postal_code`; string, optional)
  - `nip` (`Clients_update.client.nip`; string, optional) — Numer identyfikacji podatkowej (NIP); dozwolone myślniki.
  - `phone_number` (`Clients_update.client.phone_number`; string, optional)
  - `web_site` (`Clients_update.client.web_site`; string, optional)
  - `email` (`Clients_update.client.email`; string, optional) — Do 5 adresów oddzielonych przecinkami.
  - `note` (`Clients_update.client.note`; string, optional)
  - `receiver` (`Clients_update.client.receiver`; string, optional)
  - `mailing_company_name` (`Clients_update.client.mailing_company_name`; string, optional)
  - `mailing_street` (`Clients_update.client.mailing_street`; string, optional)
  - `mailing_city` (`Clients_update.client.mailing_city`; string, optional)
  - `mailing_postal_code` (`Clients_update.client.mailing_postal_code`; string, optional)
  - `days_to_payment` (`Clients_update.client.days_to_payment`; integer, optional)
    - format `int32`; min 0; max 364
  - `payment_method` (`Clients_update.client.payment_method`; string, optional) — Metoda płatności.
    - one of `"transfer"`, `"cash"`, `"card"`, `"barter"`, `"check"`, `"delivery"`, `"other"`, `"compensation"`, `"accredited"`, `"paypal"`, `"payu"`, `"bill_of_sale"`, `"subscription"`, `"instalment_sale"`, `"tpay"`, `"przelewy24"`, `"dotpay"`
  - `invoice_note` (`Clients_update.client.invoice_note`; string, optional)
  - `same_forward_address` (`Clients_update.client.same_forward_address`; boolean, optional) — `true` czyści adres korespondencyjny.
  - `first_name` (`Clients_update.client.first_name`; string, optional)
  - `last_name` (`Clients_update.client.last_name`; string, optional)
  - `business_activity_kind` (`Clients_update.client.business_activity_kind`; string, optional) — Forma prawna klienta.
    - one of `"private_person"`, `"self_employed"`, `"other_business"`

## Example requests

### Zmiana numeru telefonu

```json
{
  "client": {
    "phone_number": "600200300"
  }
}
```

### Błąd walidacji

```json
{
  "client": {
    "city": ""
  }
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url https://api.sandbox-infakt.pl/v3/clients/1003.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "client": {
    "phone_number": "600200300"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/clients/1003.json';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({client: {phone_number: '600200300'}})
};

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/clients/1003.json"

payload = { "client": { "phone_number": "600200300" } }
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": 1003,
  "uuid": "aae6796c-30a9-4bc6-ae55-6b2f08a8a0f6",
  "company_name": "Pierwsza Testowa Spółka sp z o.o.",
  "street": "Lwowska",
  "street_number": "10",
  "flat_number": "17",
  "city": "Kraków",
  "country": "PL",
  "country_full_name": "Polska",
  "postal_code": "31-202",
  "nip": "222-22-22-222",
  "phone_number": "600200300",
  "web_site": "",
  "email": "biuro@example.com",
  "note": "",
  "receiver": "",
  "mailing_company_name": "",
  "mailing_street": "",
  "mailing_city": "",
  "mailing_postal_code": "",
  "days_to_payment": "",
  "payment_method": "",
  "invoice_note": "",
  "same_forward_address": true,
  "first_name": null,
  "last_name": null,
  "business_activity_kind": "other_business",
  "is_vindicable": false,
  "vindicable_invoices_count": 0
}
```

- `id` (`Clients_update.response.200.id`; integer, required)
  - format `int64`
- `uuid` (`Clients_update.response.200.uuid`; string, required)
  - format `uuid`
- `company_name` (`Clients_update.response.200.company_name`; any of, required) — `null`, gdy `business_activity_kind` to `private_person`.
  - any of: `string`, `null`
- `street` (`Clients_update.response.200.street`; any of, required)
  - any of: `string`, `null`
- `street_number` (`Clients_update.response.200.street_number`; any of, required)
  - any of: `string`, `null`
- `flat_number` (`Clients_update.response.200.flat_number`; any of, required)
  - any of: `string`, `null`
- `city` (`Clients_update.response.200.city`; string, required)
- `country` (`Clients_update.response.200.country`; string, required) — Dwuliterowy kod kraju jak `alpha_2` w `GET /countries.json`: ISO 3166-1 alpha-2, z wyjątkiem `EL` dla Grecji (`GR` nie jest rozpoznawany) i `XI` dla Irlandii Północnej.
  - pattern `^[A-Z]{2}$`
- `country_full_name` (`Clients_update.response.200.country_full_name`; string, required) — Nazwa kraju po polsku.
- `postal_code` (`Clients_update.response.200.postal_code`; any of, required)
  - any of: `string`, `null`
- `nip` (`Clients_update.response.200.nip`; any of, required)
  - any of: `Nip`, `null`
- `phone_number` (`Clients_update.response.200.phone_number`; any of, required)
  - any of: `string`, `null`
- `web_site` (`Clients_update.response.200.web_site`; string, required)
- `email` (`Clients_update.response.200.email`; any of, required) — Do 5 adresów oddzielonych przecinkami.
  - any of: `string`, `null`
- `note` (`Clients_update.response.200.note`; string, required)
- `receiver` (`Clients_update.response.200.receiver`; string, required) — Osoba upoważniona do odbioru dokumentów.
- `mailing_company_name` (`Clients_update.response.200.mailing_company_name`; any of, required) — Pola adresu korespondencyjnego są `""`, gdy `same_forward_address` to `true`.
  - any of: `string`, `null`
- `mailing_street` (`Clients_update.response.200.mailing_street`; any of, required)
  - any of: `string`, `null`
- `mailing_city` (`Clients_update.response.200.mailing_city`; any of, required)
  - any of: `string`, `null`
- `mailing_postal_code` (`Clients_update.response.200.mailing_postal_code`; any of, required)
  - any of: `string`, `null`
- `days_to_payment` (`Clients_update.response.200.days_to_payment`; any of, required) — Domyślny termin płatności w dniach dla tego klienta; `""`, gdy nie ustawiono.
  - any of: `integer`, `string`
- `payment_method` (`Clients_update.response.200.payment_method`; any of, required) — Domyślna metoda płatności; `""`, gdy nie ustawiono.
  - any of: `PaymentMethod`, `string`
- `invoice_note` (`Clients_update.response.200.invoice_note`; string, required) — Domyślne uwagi do faktur klienta.
- `same_forward_address` (`Clients_update.response.200.same_forward_address`; boolean, required) — Adres korespondencyjny taki sam jak adres firmowy.
- `first_name` (`Clients_update.response.200.first_name`; any of, required)
  - any of: `string`, `null`
- `last_name` (`Clients_update.response.200.last_name`; any of, required)
  - any of: `string`, `null`
- `business_activity_kind` (`Clients_update.response.200.business_activity_kind`; any of, required)
  - any of: `BusinessActivityKind`, `null`
- `is_vindicable` (`Clients_update.response.200.is_vindicable`; boolean, required) — Klient ma przeterminowane faktury, które można skierować do windykacji.
- `vindicable_invoices_count` (`Clients_update.response.200.vindicable_invoices_count`; integer, required)
  - format `int32`

### 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` (`Clients_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` (`Clients_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` (`Clients_update.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.401.url`; string, optional)
- `action_url` (`Clients_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` (`Clients_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` (`Clients_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` (`Clients_update.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.402.url`; string, optional)
- `action_url` (`Clients_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` (`Clients_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` (`Clients_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` (`Clients_update.response.403.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.403.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.403.url`; string, optional)
- `action_url` (`Clients_update.response.403.action_url`; string, optional)

### 404

Nie znaleziono zasobu.

#### Example

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

- `error` (`Clients_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` (`Clients_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` (`Clients_update.response.404.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.404.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.404.url`; string, optional)
- `action_url` (`Clients_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` (`Clients_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` (`Clients_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` (`Clients_update.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.406.url`; string, optional)
- `action_url` (`Clients_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": {
    "city": [
      "nie może być puste"
    ]
  }
}
```

- `error` (`Clients_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` (`Clients_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` (`Clients_update.response.422.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.422.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.422.url`; string, optional)
- `action_url` (`Clients_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` (`Clients_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` (`Clients_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` (`Clients_update.response.423.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.423.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.423.url`; string, optional)
- `action_url` (`Clients_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` (`Clients_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` (`Clients_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` (`Clients_update.response.429.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Clients_update.response.429.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Clients_update.response.429.url`; string, optional)
- `action_url` (`Clients_update.response.429.action_url`; string, optional)


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