---
title: "Zaktualizuj produkt"
description: "Zakres: `api:invoices:write`."
---

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

`PUT /products/{id}.json`

Zakres: `api:invoices:write`.

## Authentication

Requires one of the following:

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

## Path parameters

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

## Request body

_Required._

- `product` (`Products_update.product`; object, required) — Zmieniane są tylko wysłane pola, z wyjątkiem `discount`: gdy go nie wysłano, wraca do `0`. Zgodność cen jest sprawdzana na wynikowym produkcie.
  - `name` (`Products_update.product.name`; string, optional)
  - `pkwiu` (`Products_update.product.pkwiu`; string, optional)
    - maxLength 50; pattern `^[.\d]+$`
  - `cn` (`Products_update.product.cn`; string, optional)
    - maxLength 50; pattern `^[\d ]+$`
  - `pkob` (`Products_update.product.pkob`; string, optional)
    - maxLength 50; pattern `^\d+$`
  - `gtin` (`Products_update.product.gtin`; string, optional)
    - maxLength 20; pattern `^\d+$`
  - `symbol` (`Products_update.product.symbol`; string, optional) — Ignorowane, gdy wysłano `pkwiu`, `cn` lub `pkob`.
  - `unit` (`Products_update.product.unit`; string, optional)
  - `tax_symbol` (`Products_update.product.tax_symbol`; string, optional) — Symbol stawki VAT. Zobacz `GET /vat_rates.json`.
  - `flat_rate_tax_symbol` (`Products_update.product.flat_rate_tax_symbol`; string, optional)
  - `quantity` (`Products_update.product.quantity`; number, optional) — Domyślnie `1`.
    - format `double`
  - `net_price` (`Products_update.product.net_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `tax_price` (`Products_update.product.tax_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `gross_price` (`Products_update.product.gross_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `unit_net_price` (`Products_update.product.unit_net_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `purchase_unit_net_price` (`Products_update.product.purchase_unit_net_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `purchase_unit_gross_price` (`Products_update.product.purchase_unit_gross_price`; integer, optional) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `discount` (`Products_update.product.discount`; number, optional) — Rabat w procentach; domyślnie `0`.
    - format `double`; min 0
  - `unit_net_price_before_discount` (`Products_update.product.unit_net_price_before_discount`; integer, optional) — Domyślnie `unit_net_price`.
    - format `int64`
  - `vat_exemption_reason` (`Products_update.product.vat_exemption_reason`; integer, optional)
    - format `int64`
  - `gtu_id` (`Products_update.product.gtu_id`; integer, optional)
    - format `int64`

## Example requests

### Zmiana nazwy

```json
{
  "product": {
    "name": "Macbook Pro 14"
  }
}
```

### Niezgodna kwota brutto

```json
{
  "product": {
    "gross_price": 500000
  }
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url https://api.sandbox-infakt.pl/v3/products/1007.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "product": {
    "name": "Macbook Pro 14"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/products/1007.json';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({product: {name: 'Macbook Pro 14'}})
};

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/products/1007.json"

payload = { "product": { "name": "Macbook Pro 14" } }
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": 1007,
  "uuid": "c41f7a2d-9b3e-4d58-a6c1-0e7b2f9d3a85",
  "name": "Macbook Pro 14",
  "symbol": "234 / - / -",
  "pkwiu": "234",
  "cn": null,
  "pkob": null,
  "gtin": null,
  "unit": "szt.",
  "tax_symbol": "23",
  "flat_rate_tax_symbol": "",
  "quantity": 1,
  "net_price": 406423,
  "tax_price": 93477,
  "gross_price": 499900,
  "unit_net_price": 406423,
  "purchase_unit_net_price": 350000,
  "purchase_unit_gross_price": 430500,
  "discount": "0.0",
  "unit_net_price_before_discount": 406423,
  "vat_exemption_reason": null,
  "gtu_id": null
}
```

- `id` (`Products_update.response.200.id`; integer, required)
  - format `int64`
- `uuid` (`Products_update.response.200.uuid`; string, required)
  - format `uuid`
- `name` (`Products_update.response.200.name`; string, required)
- `symbol` (`Products_update.response.200.symbol`; any of, required) — Klasyfikacja drukowana na dokumentach. Gdy ustawiono `pkwiu`, `cn` lub `pkob`, ma postać `pkwiu / cn / pkob` z `-` w miejscu każdego brakującego kodu, np. `234 / - / -`.
  - any of: `string`, `null`
- `pkwiu` (`Products_update.response.200.pkwiu`; any of, required) — Kod PKWiU dla KSeF.
  - any of: `string`, `null`
- `cn` (`Products_update.response.200.cn`; any of, required) — Kod CN dla KSeF.
  - any of: `string`, `null`
- `pkob` (`Products_update.response.200.pkob`; any of, required) — Kod PKOB dla KSeF.
  - any of: `string`, `null`
- `gtin` (`Products_update.response.200.gtin`; any of, required)
  - any of: `string`, `null`
- `unit` (`Products_update.response.200.unit`; any of, required) — Jednostka miary, np. `szt.`.
  - any of: `string`, `null`
- `tax_symbol` (`Products_update.response.200.tax_symbol`; string, required) — Symbol stawki VAT, np. `23`, `8`, `zw`. Zobacz `GET /vat_rates.json`.
- `flat_rate_tax_symbol` (`Products_update.response.200.flat_rate_tax_symbol`; string, required) — Symbol stawki ryczałtu; `""`, gdy nie ustawiono.
- `quantity` (`Products_update.response.200.quantity`; number, required)
  - format `double`
- `net_price` (`Products_update.response.200.net_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `tax_price` (`Products_update.response.200.tax_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `gross_price` (`Products_update.response.200.gross_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `unit_net_price` (`Products_update.response.200.unit_net_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `purchase_unit_net_price` (`Products_update.response.200.purchase_unit_net_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `purchase_unit_gross_price` (`Products_update.response.200.purchase_unit_gross_price`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `discount` (`Products_update.response.200.discount`; string, required) — Rabat w procentach.
  - pattern `^-?\d+(\.\d+)?$`
- `unit_net_price_before_discount` (`Products_update.response.200.unit_net_price_before_discount`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
  - format `int64`
- `vat_exemption_reason` (`Products_update.response.200.vat_exemption_reason`; any of, required) — Id podstawy zwolnienia z VAT. Zobacz `GET /vat_exemptions.json`.
  - any of: `integer`, `null`
- `gtu_id` (`Products_update.response.200.gtu_id`; any of, required) — Id kodu GTU. Zobacz `GET /gtus.json`.
  - any of: `integer`, `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` (`Products_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` (`Products_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` (`Products_update.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Products_update.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Products_update.response.401.url`; string, optional)
- `action_url` (`Products_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` (`Products_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` (`Products_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` (`Products_update.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Products_update.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Products_update.response.402.url`; string, optional)
- `action_url` (`Products_update.response.402.action_url`; string, optional)

### 404

Nie znaleziono zasobu.

#### Example

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

- `error` (`Products_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` (`Products_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` (`Products_update.response.404.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Products_update.response.404.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Products_update.response.404.url`; string, optional)
- `action_url` (`Products_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` (`Products_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` (`Products_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` (`Products_update.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Products_update.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Products_update.response.406.url`; string, optional)
- `action_url` (`Products_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": {
    "gross": [
      "Wartość brutto jest nieprawidłowa."
    ]
  }
}
```

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


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