---
title: "Zaktualizuj dane zwrotu (Pełna edycja / Podmiana danych)"
method: PUT
path: "/returns/{id}"
tags: ["Zwroty"]
---

# Zaktualizuj dane zwrotu (Pełna edycja / Podmiana danych)

`PUT /returns/{id}`

## Request

- Base URL: `https://demo.sellasist.pl/api/v1`
- URL: `https://demo.sellasist.pl/api/v1/returns/{id}`
- Auth: API key in header `apiKey`

Umożliwia pełną edycję dokumentu zwrotu, w tym zmianę statusu, danych adresowych, kwot oraz listy pozycji.
**Wskazówka:** Możesz wkleić tutaj 1:1 cały obiekt JSON pobrany wcześniej z `GET /returns/{id}`.

## Path parameters

- `id` integer, required

## Request body

- ReturnRequestPayload
  - `order_number` integer: ID powiązanego zamówienia w Sellasist (z GET /orders)
  - `status_id` integer: ID statusu zwrotu (z GET /returns_statuses)
  - `status` string: Alternatywnie: typ lub nazwa statusu
  - `source_id` integer: ID źródła zwrotu (z GET /returns_sources)
  - `source` string: Alternatywnie: nazwa źródła zwrotu
  - `return_number` string: Własny numer zwrotu. Jeśli puste, system wygeneruje automatyczny numer RMZ.
  - `external_return_number` string
  - `date` string: Data zwrotu (Y-m-d H:i:s). W przypadku braku zostanie wstawiona data bieżąca.
  - `user_email` string, email
  - `bankaccount` string: Numer konta bankowego do zwrotu środków
  - `description` string
  - `refund_value` number, float: Łączna kwota do zwrotu klientowi
  - `refund_date` string, date
  - `refund_currency` string
  - `payment_id` integer: ID kanału płatności (z GET /payments)
  - `tracking_number` string: Numer listu przewozowego przesyłki zwrotnej
  - `additional_tracking_numbers` string
  - `allegro_order_id` string
  - `term` string: Termin na rozpatrzenie zwrotu (format YYYY-MM-DD lub YYYY-MM-DD HH:MM:SS). Jeśli go nie podasz, system ustawi termin 14 dni od daty zwrotu.
  - `accept_date` string: Data przyjęcia zgłoszenia zwrotu (format YYYY-MM-DD HH:MM:SS)
  - `close_date` string: Data ostatecznego zamknięcia zwrotu (format YYYY-MM-DD HH:MM:SS)
  - `weight` number, float
  - `shipment_price` number, float
  - `shipment_price_returned` number, float
  - `completed` integer
  - `additional_fields` object
    - `field1` string
    - `field2` string
    - `field3` string
    - `field4` string
  - `sale_doc_data` ReturnAddressPayload
    - `name` string, required
    - `surname` string, required
    - `company_name` string, nullable
    - `company_nip` string, nullable
    - `city` string, required
    - `street` string
    - `home_number` string
    - `flat_number` string, nullable
    - `description` string, nullable
    - `postcode` string, required
    - `phone` string
    - `country` string: Kod ISO-2 (np. PL), ISO-3 (np. POL) lub wewnętrzne ID kraju w Sellasist (np. 170)
    - `state` string, nullable
  - `returned_products` ReturnProductInput[]: Lista pozycji produktów zwracanych w ramach tego dokumentu
    - `cart_id` integer, nullable: ID pozycji w koszyku zamówienia (z GET /orders/{id} -> carts[].id). Jeśli podasz cart_id, system sam uzupełni product_id, variant_id, nazwę i cenę!
    - `product_id` integer, nullable: ID produktu w Sellasist (opcjonalne jeśli podano cart_id)
    - `variant_id` integer, nullable: ID wariantu w Sellasist (opcjonalne jeśli podano cart_id)
    - `name` string: Nazwa zwracanego produktu
    - `quantity` integer
    - `quantity_returned` integer
    - `quantity_accepted` integer
    - `unit_price` number, float
    - `return_value` number, float
    - `value_returned` number, float
    - `status_id` integer, nullable: ID statusu pozycji zwrotu (z GET /returns_statuses)
    - `topic` string
    - `description` string
    - `note` string

## Response `200`

Pomyślnie zaktualizowano zwrot. Zwraca odświeżony obiekt.

- ReturnDetails: Pełny obiekt szczegółów zwrotu. Można go od razu wysłać w PUT.
  - `id` integer
  - `date` string
  - `status` string, nullable
  - `status_id` integer, nullable
  - `return_number` string
  - `external_return_number` string, nullable
  - `order_number` integer, nullable: ID powiązanego zamówienia w Sellasist
  - `source` string, nullable
  - `source_id` integer, nullable
  - `description` string
  - `bankaccount` string
  - `shipment_price` number, float, nullable
  - `refund_value` number, float
  - `refund_date` string, nullable
  - `refund_currency` string
  - `payment_id` integer, nullable
  - `tracking_number` string, nullable
  - `additional_tracking_numbers` string, nullable
  - `allegro_order_id` string, nullable
  - `term` string, nullable: Termin na rozpatrzenie zwrotu
  - `accept_date` string, nullable: Data przyjęcia / zaakceptowania zwrotu
  - `close_date` string, nullable: Data zamknięcia zgłoszenia zwrotu
  - `completed` integer
  - `dispatch_date` string, nullable: Data nadania przesyłki zwrotnej przez kupującego
  - `dispatch_term_date` string, nullable: Termin nadania przesyłki zwrotnej
  - `courier` string, nullable: Nazwa kuriera / sposobu wysyłki zwrotu, tak jak w panelu
  - `courier_id` integer, nullable: ID sposobu wysyłki w Sellasist; puste, gdy sposób wysyłki zapisano tylko nazwą (np. zgłoszenie z formularza lub z Allegro)
  - `last_payment_status` 'NEW' | 'WAITING' | 'IN_PROGRESS' | 'SUCCESS' | 'CANCELLED' | 'CANCELED' | 'PARTIAL', nullable: Kod statusu ostatniego zwrotu płatności (obecnie dla zamówień z Allegro)
  - `last_payment_status_text` string, nullable: Status ostatniego zwrotu płatności opisowo
  - `returned_value` number, float: Całkowita zwrócona kwota (produkty i koszt dostawy). Koszt dostawy dotyczy całego zamówienia — nie sumuj tej kwoty między zwrotami jednego zamówienia
  - `additional_fields` object
    - `field1` string
    - `field2` string
    - `field3` string
    - `field4` string
  - `sale_doc_data` object: Dane adresowe kupującego
    - `name` string
    - `surname` string
    - `street` string
    - `home_number` string
    - `flat_number` string, nullable
    - `description` string, nullable
    - `postcode` string
    - `city` string
    - `phone` string
    - `country` integer, nullable: ID państwa w Sellasist (np. 170 dla Polski)
    - `country_code` string, nullable: Dwuliterowy kod ISO-2 państwa
    - `company_name` string, nullable
    - `company_nip` string, nullable
    - `state` string, nullable
  - `returned_products` ReturnProductItem[]: Lista zwracanych produktów
    - `id` integer: ID pozycji zwrotu
    - `cart_id` integer, nullable: ID pozycji z koszyka zamówienia (carts.id z GET /orders)
    - `product_id` integer, nullable: ID produktu głównego w Sellasist
    - `variant_id` integer, nullable: ID wariantu w Sellasist
    - `topic` string
    - `name` string
    - `quantity` integer
    - `quantity_returned` integer
    - `quantity_accepted` integer
    - `unit_price` number, float
    - `price_total` number, float
    - `vat` number, nullable
    - `return_value` number, float
    - `value_returned` number, float
    - `returned_products_value` number, float
    - `status` string, nullable
    - `status_id` integer, nullable
    - `description` string
    - `note` string
  - `payment_log` object[]: Płatności zamówienia, do którego należy zwrot, od najnowszej, w tym zwroty płatności (tylko w GET /returns/{id}). Pusta lista, gdy zwrot nie ma zamówienia
    - `id` integer: ID wpisu płatności
    - `date` string, nullable: Data płatności
    - `payment_data` string, nullable: Identyfikator transakcji w systemie płatności
    - `name` string, nullable: Nazwa metody płatności
    - `payment_id` integer, nullable: ID metody płatności
    - `amount` number, float: Kwota płatności
    - `currency` string, nullable: Waluta (kod ISO 4217)
    - `completed` boolean: Czy płatność została zrealizowana
    - `outgoing` boolean: Czy to płatność wychodząca (zwrot pieniędzy). Zwroty płatności z Allegro mają tu false — rozpoznasz je po `return_id` i `refund_status`
    - `refund_status` 'NEW' | 'WAITING' | 'IN_PROGRESS' | 'SUCCESS' | 'CANCELLED' | 'CANCELED' | 'PARTIAL', nullable: Kod statusu zwrotu płatności
    - `refund_status_text` string, nullable: Status zwrotu płatności opisowo
    - `return_id` integer, nullable: ID zwrotu, którego dotyczy płatność. Lista obejmuje płatności wszystkich zwrotów zamówienia — płatności tego zwrotu mają tu wartość równą jego `id`
  - `shipping` object: Sposób wysyłki zamówienia i status przesyłki zwrotnej (tylko w GET /returns/{id}). Kuriera przesyłki zwrotnej znajdziesz w polach `courier` i `courier_id`
    - `shipment_method` string, nullable: Nazwa sposobu wysyłki zamówienia
    - `shipment_method_id` integer, nullable: ID sposobu wysyłki zamówienia
    - `return_shipment_status` 'PENDING' | 'IN_TRANSIT' | 'RELEASED_FOR_DELIVERY' | 'AVAILABLE_FOR_PICKUP' | 'NOTICE_LEFT' | 'ISSUE' | 'DELIVERED' | 'RETURNED', nullable: Kod statusu przesyłki zwrotnej
    - `return_shipment_status_text` string, nullable: Status przesyłki zwrotnej opisowo

## Other responses

- `400`: Nieprawidłowe żądanie (błędna struktura JSON lub niepoprawny format zapytania).
- `401`: Błąd autoryzacji
- `404`: Nie znaleziono żądanego zasobu.
- `422`: Błąd walidacji danych wejściowych (przesłane wartości nie spełniają wymagań biznesowych).
- `500`: Wewnętrzny błąd serwera. Zwraca unikalny identyfikator incydentu (error_id) do przekazania do działu wsparcia technicznego.

## Changes

- **2026-10-13** `bcd78d4d0fc2`: 1 breaking, 9 info
  - the response property `tracking_number` became nullable for the status `200`
  - added the optional property `courier` to the response with the `200` status
  - added the optional property `courier_id` to the response with the `200` status
  - added the optional property `dispatch_date` to the response with the `200` status
  - …6 more
- **2026-10-11** `400197636ecd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sellasist/apis/sellasist-api/changes/returns/:id/put.md)

---

[API](https://skmtc.dev/sellasist/apis/sellasist-api.md) - [All operations](https://skmtc.dev/sellasist/apis/sellasist-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sellasist/apis/sellasist-api/revisions/58415a41c446?raw)
