{"openapi": "3.0.3", "info": {"title": "Niezbędnik Sprzedawcy Public API", "version": "1.20.0", "description": "## Wprowadzenie\n\nGłówne publiczne API platformy Niezbędnik Sprzedawcy. Udostępnia integratorom wersjonowane zasoby i operacje związane z obsługą sprzedaży e-commerce i będzie rozszerzane o kolejne funkcje platformy.\n\n## Uwierzytelnianie\n\nAPI używa kluczy Bearer, które działają do ręcznego unieważnienia lub utraty uprawnień konta. W [ustawieniach API](https://niezbedniksprzedawcy.pl/app/ustawienia/api/), w sekcji „Klucze API”, właściciel firmy tworzy klucz i wybiera jego scope’y. Klucz pozostaje przypisany do tej samej firmy, również po przełączeniu firmy w panelu. Pełny sekret jest pokazywany tylko podczas tworzenia; utracony klucz należy zastąpić nowym. Istniejące klucze nie otrzymują nowych scope’ów automatycznie.\n\nKlucz należy przekazywać w nagłówku `Authorization: Bearer <api_key>`.\n\n```bash\ncurl 'https://api.niezbedniksprzedawcy.pl/v1/me' \\\n  --header 'Authorization: Bearer <api_key>'\n```\n\n## Uprawnienia klucza\n\n`GET /v1/me` wymaga ważnego klucza, bez dodatkowego scope’u. Zwraca uprawnienia klucza oraz wersję kontraktu. Pole `limits` jest obecnie pustą listą i nie oznacza braku limitów żądań.\n\n| Scope | Dostęp |\n| --- | --- |\n| `connections:read` | Lista połączeń firmy |\n| `orders:write` | Tworzenie zamówień we własnych źródłach API |\n| `message_channels.inbound_messages:write` | Wiadomości i upload załączników własnych kanałów |\n| `allegro_ads.reports:read` | Odczyt połączeń raportowych, historii pobrań i wyników Allegro Ads |\n| `allegro_ads.reports:write` | Zlecanie raportów Allegro Ads oraz odczyt historii i wyników |\n| `allegro_ads.campaigns:read` | Odczyt kampanii, grup reklam i ofert Allegro Ads |\n| `allegro_ads.campaigns:write` | Odczyt i zarządzanie kampaniami, grupami, ofertami, CPC/CPM i budżetami |\n| `allegro_ads.schedules:read` | Odczyt harmonogramów Allegro Ads |\n| `allegro_ads.schedules:write` | Odczyt, tworzenie, edycja i wyłączanie harmonogramów Allegro Ads |\n| `offers_scanner.history:read` | Odczyt historii oferty w Skanerze Ofert Allegro |\n| `repricer.listings:read` | Odczyt ofert i reguł Repricera |\n| `repricer.listings:write` | Odczyt i zmiana reguł Repricera |\n| `repricer.competitor_reports:write` | Zlecanie raportów konkurencji, odczyt wyników i eksport |\n\n`GET /v1/repricer/usage` jest dostępny z dowolnym z trzech scope’ów Repricera. Przy tworzeniu klucza w panelu żadne uprawnienie nie jest zaznaczone domyślnie; wybierz co najmniej jeden scope z tabeli powyżej.\n\n## Limity\n\nLimity ruchu są wspólne dla **jednego publicznego adresu IP**. Sumują żądania wszystkich klientów, firm i kluczy API korzystających z tego adresu, także za wspólnym NAT-em. Nie jest to osobna pula dla każdego endpointu ani klucza.\n\n| Zakres | Limit stałego ruchu |\n| --- | --- |\n| Ogólny limit API: kontekst, połączenia, zamówienia, wiadomości, oferty, zbiorcze zmiany ustawień i ich status, saldo, tworzenie raportów, historia skanera ofert i wszystkie operacje Menedżera Ads Allegro | **20 żądań/s na IP**, łącznie |\n| Odczyt statusu i stron wyników raportów konkurencji oraz pobieranie eksportów ZIP | **60 żądań/min na IP** (średnio 1/s), wspólnie dla wszystkich raportów i eksportów; wliczają się także do ogólnego limitu 20/s |\n| Upload załączników: `POST /v1/message-channels/{channel_id}/attachment-uploads` | **60 żądań/min na IP** (średnio 1/s), osobna pula dla wszystkich kanałów, poza ogólnym licznikiem 20/s |\n\nDodatkowo obowiązuje wspólny limit **20 równoległych żądań na IP**. Dotyczy również uploadów, raportów i eksportów; przekroczenie zwraca `429`.\n\nDopuszczalne są krótkie serie ponad tempo stałe: do 100 nadmiarowych żądań w puli ogólnej, 5 w puli odczytów raportów i 20 w puli uploadów. Przyjęte żądania nie są opóźniane przez limiter. Taka seria zużywa chwilowy zapas i nie zwiększa limitu ciągłego ruchu; nadal obowiązuje limit równoległości. Rozkładaj wywołania w czasie zamiast wysyłać całą paczkę jednocześnie.\n\nPo przekroczeniu limitu otrzymasz `429` z `error.code=rate_limit_exceeded`, `Cache-Control: no-store` i identyfikatorem w `X-Request-ID` oraz `request_id`. `Retry-After` podaje minimalną przerwę w sekundach: **5** na ścieżkach odczytów raportów konkurencji i ich eksportów, **1** na pozostałych ścieżkach, w tym uploadów. Na tych ścieżkach wartość 5 dotyczy również przekroczenia ogólnego limitu lub równoległości. Respektuj wartość z konkretnej odpowiedzi, również gdy aplikacja zwróci inny czas. Rozłóż ponowienia w czasie i zmniejsz tempo klienta; dla ponawianego `POST` zachowaj payload i `Idempotency-Key`. Status raportu konkurencji odpytuj domyślnie co 5 sekund; przy wielu raportach konkurencji ich odczyty, strony wyników i eksporty muszą mieścić się we wspólnej puli 60/min.\n\n| Dane | Maksymalny rozmiar |\n| --- | --- |\n| Body żądania JSON | 512 KiB |\n| Jeden plik / całe żądanie multipart | 10 MiB / 11 MiB |\n| Załączniki jednej wiadomości | 10 plików, łącznie 25 MiB |\n| Paczka raportu konkurencji | 10 000 unikalnych EAN-ów |\n| Paczka zbiorczej zmiany ustawień | 1000 unikalnych ofert; nadal obowiązuje 512 KiB |\n| Strona ofert, wyników raportu konkurencji lub zbiorczych zmian | 100 pozycji |\n| Historia oferty w Skanerze Ofert Allegro | 90 dni łącznie z bieżącym dniem |\n| Strona połączeń raportowych, prób pobrania lub wyników Menedżera Ads Allegro | 50 pozycji |\n| Strona połączeń zarządzania, kampanii, grup, ofert lub harmonogramów Menedżera Ads Allegro | 100 pozycji |\n\nLimity liczby żądań są niezależne od płatnej puli sprawdzeń konkurencji. Raport rezerwuje jedno sprawdzenie na EAN; stan puli zwraca `GET /v1/repricer/usage`. Odczyty i eksporty nie zużywają kolejnych sprawdzeń. Pole `limits: []` w `GET /v1/me` nie prezentuje limitów infrastruktury i nie oznacza braku limitów.\n\n## Format żądań i błędów\n\nWywołuj endpointy przez HTTPS, z prefiksem `/v1/`, bez końcowego ukośnika. Dla żądań z JSON ustaw `Content-Type: application/json`. Upload załącznika używa `multipart/form-data`. Limit body JSON wynosi 512 KiB; ograniczenia plików opisano w dziale Komunikator.\n\nOdpowiedzi `/v1/` mają `Cache-Control: no-store` i nagłówek `X-Request-ID`. Przy błędzie ten sam identyfikator jest dostępny w polu `request_id`.\n\nWiększe odpowiedzi JSON mogą być kompresowane przez gzip. Wyślij `Accept-Encoding: gzip` i włącz automatyczną dekompresję w kliencie; dla cURL użyj `--compressed`. Serwer oznacza skompresowaną odpowiedź nagłówkiem `Content-Encoding: gzip` i dodaje `Vary: Accept-Encoding`. Małe odpowiedzi mogą pozostać bez kompresji. Eksport ZIP jest już skompresowany i nie otrzymuje dodatkowego gzip.\n\nPrzykład błędu walidacji:\n\n```json\n{\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"The request payload is invalid.\"\n  },\n  \"request_id\": \"example-request-42\"\n}\n```\n\nObsługuj błędy według statusu HTTP i `error.code`, a nie treści `message`. Błędy walidacji mogą zawierać `error.details`.\n\n| Status HTTP | Znaczenie |\n| --- | --- |\n| `400` | Nieprawidłowe żądanie lub błąd walidacji danych |\n| `401` | Brak lub nieważny klucz API |\n| `403` | Brak wymaganych uprawnień |\n| `405` | Niedozwolona metoda HTTP |\n| `413` | Przekroczony rozmiar żądania |\n| `415` | Nieobsługiwany Content-Type |\n| `429` | Przekroczony limit żądań |\n| `500` | Nieoczekiwany błąd serwera |\n| `503` | Usługa chwilowo niedostępna |\n\nPozostałe odpowiedzi i błędy biznesowe opisano przy operacjach. Przy `429` lub `503` odczekaj co najmniej czas wskazany w `Retry-After` (sekundy).\n\n## Ponawianie żądań i idempotencja\n\nWszystkie operacje `POST` wymagają `Idempotency-Key`: 8–128 znaków z zestawu `A-Z`, `a-z`, `0-9`, `.`, `_`, `:`, `-`. Dla nowej operacji nadaj nowy klucz. Po utracie połączenia lub odpowiedzi ponów to samo żądanie z tym samym kluczem. Zakończona operacja zwróci zapisaną odpowiedź z `Idempotency-Replayed: true`, bez ponownego utworzenia zasobu ani naliczenia kosztu.\n\nKlucz idempotencji jest rozpatrywany w obrębie firmy, metody HTTP i ścieżki zasobu, niezależnie od konkretnego klucza API. Rotacja klucza API w tej samej firmie nie tworzy nowej operacji; nadal wymagane są ważne uprawnienia i dostęp do zasobu. Inne dane z tym samym kluczem zwracają `409 idempotency_conflict`. Dla JSON porównywane są dane wejściowe przed walidacją: kolejność pól obiektu i formatowanie JSON nie mają znaczenia, ale kolejność elementów tablic, typy wartości i obecność pól już tak. Nie zmieniaj payloadu podczas ponowienia. Zasady porównania pliku opisano przy uploadzie załącznika.\n\nZapisy zarządzania Menedżerem Ads Allegro wymagają `Idempotency-Key` również dla `PATCH` i `DELETE`. Przy ponowieniu edycji zachowaj też tę samą rewizję `If-Match`; szczegóły opisano w sekcji zarządzania Ads.\n\n`PATCH` reguł Repricera nie korzysta z rejestru `Idempotency-Key`; zwraca stan po zastosowaniu zmiany."}, "servers": [{"url": "https://api.niezbedniksprzedawcy.pl", "description": "Produkcja"}], "tags": [{"name": "Kontekst API", "description": "Kontekst firmy i uprawnienia klucza API."}, {"name": "Połączenia", "description": "Konta sprzedażowe połączone z firmą."}, {"name": "Zamówienia", "description": "Tworzenie zamówień w nazwanych źródłach API skonfigurowanych wcześniej w panelu.\n\n## Pierwsze zamówienie\n\n1. Otwórz [ustawienia API](https://niezbedniksprzedawcy.pl/app/ustawienia/api/). Źródłami zarządza właściciel firmy lub pracownik Niezbędnika Sprzedawcy.\n2. W sekcji **Własne źródła zamówień API** dodaj źródło dla swojego sklepu lub systemu. Skopiuj **ID źródła** (UUID używany jako `source_id`) albo pełny **Endpoint tworzenia zamówień**.\n3. W sekcji **Klucze API** utwórz klucz ze scope’em `orders:write`.\n4. Wyślij `POST /v1/order-sources/{source_id}/orders` z `Authorization: Bearer <api_key>`, `Content-Type: application/json` i własnym `Idempotency-Key`. W `source.external_order_id` podaj stabilny identyfikator zamówienia w swoim systemie.\n\nŹródło musi pozostać aktywne również przy ponawianiu wcześniejszego żądania. Jego wyłączenie blokuje tworzenie i odtwarzanie odpowiedzi kodem `404 order_source_not_found`."}, {"name": "Komunikator", "description": "Własne kanały Komunikatora przyjmują wiadomości klientów przez Public API. Odpowiedź operatora jest dostarczana asynchronicznie metodą POST na webhook zapisany przy kanale.\n\n## Komunikator eCommerce — szybki start własnego kanału API\n\nW integracji występują trzy różne wartości:\n\n| Wartość | Zastosowanie | Poufność |\n| --- | --- | --- |\n| `channel_id` | Identyfikuje kanał w ścieżce endpointu | Nie jest sekretem |\n| Klucz Public API | Autoryzuje wywołania integrator → Niezbędnik | Sekret, pełna wartość jest pokazywana tylko raz |\n| Sekret webhooka | Autoryzuje wywołania Niezbędnik → integrator | Osobny sekret przypisany do kanału |\n\nKlucz Public API i sekret webhooka to niezależne dane uwierzytelniające i nie można ich stosować zamiennie.\n\n### Konfiguracja krok po kroku\n\n1. W [Ustawieniach Komunikatora](https://niezbedniksprzedawcy.pl/app/komunikator-ecommerce/ustawienia/) włącz źródło **Własne kanały API** i zapisz ustawienia.\n2. Dodaj kanał, podając nazwę oraz dokładny, publiczny adres HTTPS odbiornika, np. `https://sklep.example.com/webhooks/ns/messages`. Adres musi zawierać właściwą ścieżkę endpointu; przekierowania nie są śledzone. `localhost`, hosty prywatne, dane logowania i fragmenty URL są odrzucane.\n3. Po utworzeniu kanału skopiuj `channel_id` oraz sekret webhooka. Identyfikator i sekret są generowane automatycznie. Po obróceniu sekretu zaktualizuj konfigurację odbiornika: kolejne próby dostawy korzystają z nowego sekretu, a już rozpoczęte żądanie może zawierać poprzedni.\n4. W [ustawieniach API](https://niezbedniksprzedawcy.pl/app/ustawienia/api/) w sekcji **Klucze API** utwórz klucz i jawnie zaznacz scope `message_channels.inbound_messages:write`. Zapisz klucz od razu — pełna wartość nie będzie ponownie dostępna. Jeżeli sekcja nie jest widoczna, dostęp do Public API nie został udostępniony na tym koncie.\n5. Opcjonalnie sprawdź klucz przez `GET /v1/me`, a następnie wyślij wiadomość do endpointu kanału. Dla każdego logicznego żądania używaj stabilnego, unikalnego `Idempotency-Key`.\n\n### Minimalne wywołanie\n\n```bash\ncurl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/inbound-messages' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: contact-msg-000042' \\\n  --data '{\n    \"external_message_id\": \"msg-2026-000042\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"sent_at\": \"2026-08-28T12:15:00Z\",\n    \"sender\": {\n      \"external_id\": \"customer-987\",\n      \"name\": \"Jan Kowalski\",\n      \"email\": \"jan@example.com\"\n    },\n    \"subject\": \"Pytanie o zamówienie\",\n    \"text\": \"Czy moje zamówienie zostało już wysłane?\"\n  }'\n```\n\nAby wysłać plik, najpierw wywołaj endpoint `attachment-uploads`, a zwrócone `id` przekaż następnie w `attachment_ids` wiadomości.\n\n```bash\ncurl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/attachment-uploads' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Idempotency-Key: contact-file-000042' \\\n  --form 'file=@faktura.pdf'\n```\n\nNastępnie użyj `id` z odpowiedzi uploadu w osobnym żądaniu wiadomości. W przykładach upload i wiadomość mają osobne klucze idempotencji. Klucz jest rozpatrywany w obrębie firmy, metody i pełnej ścieżki endpointu, więc te dwie operacje mogą też użyć tej samej wartości.\n\n```bash\ncurl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/inbound-messages' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: contact-msg-000043' \\\n  --data '{\n    \"external_message_id\": \"msg-2026-000043\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"sent_at\": \"2026-08-28T12:16:00Z\",\n    \"sender\": {\n      \"external_id\": \"customer-987\",\n      \"name\": \"Jan Kowalski\",\n      \"email\": \"jan@example.com\"\n    },\n    \"text\": \"W załączniku przesyłam dokument.\",\n    \"attachment_ids\": [\n      \"22222222-2222-4222-8222-222222222222\"\n    ]\n  }'\n```\n\n## Odbiór odpowiedzi operatora\n\nNiezbędnik wysyła nagłówki:\n\n- `Authorization: Bearer <webhook_secret>`\n- `Content-Type: application/json`\n- `X-NS-Event-ID: <event_id>`\n- `User-Agent: NiezbednikSprzedawcy-CustomApiWebhook/1.0`\n\nZweryfikuj Bearer względem sekretu kanału i deduplikuj zdarzenia po `X-NS-Event-ID` albo polu `id`. Identyfikator pozostaje taki sam przy ponowieniach; tymczasowy `download_url` załącznika może zostać odświeżony.\n\n```json\n{\n  \"id\": \"33333333-3333-4333-8333-333333333333\",\n  \"type\": \"message.outbound.created\",\n  \"created_at\": \"2026-08-28T12:20:00Z\",\n  \"channel_id\": \"11111111-1111-4111-8111-111111111111\",\n  \"message\": {\n    \"id\": \"33333333-3333-4333-8333-333333333333\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"in_reply_to_external_message_id\": \"msg-2026-000042\",\n    \"text\": \"Dzień dobry, zamówienie zostało wysłane.\",\n    \"attachments\": [\n      {\n        \"id\": \"22222222-2222-4222-8222-222222222222\",\n        \"filename\": \"faktura.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"size_bytes\": 48231,\n        \"sha256\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n        \"download_url\": \"https://storage.example.com/messages/faktura.pdf?signature=temporary\",\n        \"expires_at\": \"2026-08-29T12:20:00Z\"\n      }\n    ],\n    \"sender\": {\n      \"name\": \"Anna Nowak\",\n      \"email\": \"anna@example.com\"\n    }\n  }\n}\n```\n\nKażda odpowiedź HTTP `2xx`, także `204`, potwierdza odbiór; treść odpowiedzi jest ignorowana. Odbiornik powinien szybko utrwalić lub zakolejkować zdarzenie i zwrócić `2xx`. Timeout połączenia wynosi 3,05 s, a timeout odczytu odpowiedzi 15 s; nie jest to jeden limit całkowitego czasu żądania. Niezbędnik nie śledzi przekierowań.\n\nBłędy transportowe oraz statusy `408`, `425`, `429` i `5xx` są ponawiane. Wykonywanych jest maksymalnie 6 prób: pierwsza oraz 5 ponowień po 1 min, 5 min, 30 min, 2 h i 12 h od poprzedniej próby. Statusy 3xx i pozostałe 4xx, w tym `400`, `401`, `403` i `404`, kończą dostawę bez ponowienia. Nagłówek `Retry-After` nie steruje harmonogramem ponowień.\n\nZałączniki nie są umieszczane binarnie w JSON. Pobierz każdy plik bezpośrednio z `download_url` przed `expires_at`, nie przekazując do hosta pliku klucza Public API ani sekretu webhooka, i opcjonalnie zweryfikuj sumę `sha256`."}, {"name": "Menedżer Ads Allegro", "description": "API Menedżera Ads Allegro obejmuje raporty i wyniki, zarządzanie kampaniami i grupami reklam oraz harmonogramy emisji.\n\nPołączenia raportowe odczytujesz z `/v1/allegro-ads/workspaces`, a połączenia do zarządzania z `/v1/allegro-ads/campaign-workspaces`. Używaj `workspace_id` z listy właściwej dla danej operacji.\n\n## Raporty i wyniki\n\nAPI udostępnia wyniki z zakładki **Wyniki** w Menedżerze Ads Allegro. Firma i właściciel klucza muszą mieć dostęp do Menedżera Ads Allegro oraz Rentowności sprzedaży.\n\n1. Pobierz `GET /v1/allegro-ads/workspaces` i wybierz `workspace_id` dla konta, reklamodawcy i rynku. Połączenia do raportowania konfigurujesz w ustawieniach Menedżera Ads Allegro.\n2. Aby pobrać nowy raport z Allegro, wyślij `POST` na `/v1/allegro-ads/workspaces/{workspace_id}/report-requests` z nagłówkiem `Idempotency-Key` i zakresem dni, np. `{\"date_from\":\"2026-11-01\",\"date_to\":\"2026-11-07\",\"report_type\":\"standard\"}`.\n3. Po odpowiedzi `202` odczytaj `status_url`. Każda próba ma swój okres i stan. Dłuższy okres może obejmować kilka prób.\n4. Pobierz `results_url`. Porównaj `api_covered_days` z `period_days`, aby sprawdzić, dla ilu dni zapisano raport tego typu z API Allegro. Możesz też od razu pobrać wcześniej zapisane wyniki.\n\nDla reklam graficznych i wideo wybierz `ad_program=SPONSORED_DISPLAY_AND_VIDEO` w odczycie wyników i stanu raportów oraz w JSON zlecenia. Jest to wspólny program raportowy dla obu formatów, dostępny na allegro-pl. Bez tego parametru API nadal zwraca Oferty sponsorowane.\n\n## Zarządzanie kampaniami i harmonogramami\n\nZarządzanie ofertami sponsorowanymi oraz istniejącymi reklamami graficznymi i wideo w Menedżerze Ads Allegro. Adres bazowy: `https://api.niezbedniksprzedawcy.pl`. [Dokumentacja API](https://api.niezbedniksprzedawcy.pl/docs) · [OpenAPI JSON](https://api.niezbedniksprzedawcy.pl/openapi.json).\n\nZmiany z API i panelu korzystają ze wspólnej historii, blokad oraz harmonogramów. Firma i właściciel klucza muszą mieć dostęp do Menedżera Ads Allegro oraz Rentowności. Przekazuj `Authorization: Bearer <api_key>`. Do zapisu JSON używaj `Content-Type: application/json`. Klucz tworzysz w panelu: **Ustawienia → Konto i rozliczenia → API → Utwórz klucz** (`/app/ustawienia/api`). Zapisz sekret z wyświetlonego okna — jest pokazywany tylko raz.\n\n### Szybki start\n\n1. Utwórz klucz ze scope’ami `connections:read`, `allegro_ads.campaigns:write` oraz — jeśli potrzebujesz harmonogramów — `allegro_ads.schedules:write`. Uprawnienia raportowe `allegro_ads.reports:read` i `allegro_ads.reports:write` są osobne.\n2. Pobierz `GET /v1/connections`. Wybierz wpis z `channel: \"allegro\"` i `status: \"connected\"`. Jego tekstowe `id` przekaż dalej jako liczbowe `account_id`; nie używaj do tego `external_id`. Następnie pobierz `GET /v1/allegro-ads/advertisers?account_id=19` i wybierz `rows[].id`.\n3. Pobierz `GET /v1/allegro-ads/campaign-workspaces`. Wybierz połączenie dla konta, reklamodawcy i rynku. Jeśli go nie ma, wyślij `POST` na tę samą ścieżkę z `{\"account_id\":19,\"advertiser_id\":\"<advertiser_id>\",\"marketplace_id\":\"allegro-pl\"}` i nowym `Idempotency-Key`. Odpowiedź `201` zawiera `workspace_id`.\n4. Wyślij `POST .../campaign-workspaces/{workspace_id}/campaigns` z `{\"name\":\"Kampania API\",\"status\":\"PAUSED\"}`. Po `202` odczytuj `status_url`, respektując `Retry-After`. Dopiero przy `status: \"completed\"` weź ID kampanii z `result.resources[]` dla `kind: \"campaign\"`; `id` na najwyższym poziomie jest ID polecenia.\n5. Utwórz grupę przez `POST .../{workspace_id}/adgroups`: `campaign.id` z poprzedniego kroku, status `PAUSED`, CPC, budżet, miejsca emisji, `offerSelection.mode: \"MANUAL\"` i `deliveryPeriod.start`. Ustaw start na dzisiejszą lub przyszłą datę wg `Europe/Warsaw`; datę 2099-05-01 w przykładach zastąp planowaną datą. Poczekaj na zakończenie i odbierz ID grupy z `result.resources[]`.\n6. Odczytaj `GET .../adgroups/{resource_id}` i zachowaj `ETag`. Dodaj oferty przez `POST .../adgroups/{resource_id}/offer-ads` z `{\"operation\":\"ADD\",\"offerIds\":[\"12345678901\"]}`, świeżym `If-Match` i nowym `Idempotency-Key`. Poczekaj na wynik.\n7. CPC i budżet zmieniaj przez `PATCH .../adgroups/{resource_id}` z kwotami tekstowymi, np. `bidding.maxCpc.grossAmount: \"1.80\"` i `budget.daily.grossAmount: \"60.00\"`, każda z `currency: \"PLN\"`. Przed każdą kolejną zmianą odczytaj nowy ETag. Włącz/wstrzymaj reklamę przez `POST .../campaigns/{resource_id}/status` lub odpowiedni endpoint grupy z `{\"status\":\"ACTIVE\"}` albo `{\"status\":\"PAUSED\"}`. Status kampanii obejmuje jej grupy; sama aktywna grupa nie uruchomi emisji w wstrzymanej kampanii.\n8. Harmonogram utwórz przez `POST .../{workspace_id}/schedules`. Jego ID po zakończeniu polecenia jest w `result.schedule.id`. Aby zatrzymać plan, odczytaj go i wyślij `PATCH .../schedules/{schedule_id}` z `{\"enabled\":false}`, jego `If-Match` i nowym `Idempotency-Key`; ta operacja zwraca `200`.\n\n### Potwierdzenie wykonania i powtórzenia\n\n`202` potwierdza przyjęcie, nie wykonanie zmiany. `GET status_url` zwraca HTTP `200` także wtedy, gdy polecenie ma `status: \"failed\"`; sprawdzaj `status`, `error` oraz wyniki kroków. Nie powtarzaj zapisu o stanie `outcome_unknown` z nowym kluczem.\n\nPrzy ponowieniu zachowaj ten sam `Idempotency-Key`, ten sam JSON (łącznie z tekstową postacią kwot, pominiętymi polami i kolejnością list) oraz tę samą rewizję `If-Match`. Zmiana rewizji lub payloadu przy tym samym kluczu powoduje `409 idempotency_conflict`. Przykładowo \"1.5\" i \"1.50\" są różnymi wartościami w żądaniu. Nowy zamiar po odczycie aktualnego stanu wymaga nowego klucza. Brak `If-Match` daje `428`, a nieaktualna rewizja `412` albo `error.status: 412` w wyniku polecenia.\n\nListy kampanii/grup są lokalną kopią z `synced_at`. `POST .../{workspace_id}/refresh` z pustym JSON `{}` zleca odświeżenie; po jego zakończeniu odczytaj listę ponownie. Przed zapisem korzystaj z pojedynczego GET i jego ETag. Archiwizacja nie należy do tego kontraktu.\n\n### Reklamy graficzne i wideo\n\nDla istniejących reklam na `allegro-pl` dostępny jest odczyt kampanii i grup, zmiana nazwy kampanii, CPM, budżetu dziennego/całkowitego grupy oraz statusów `ACTIVE`/`PAUSED`. Lista bez filtra zachowuje Oferty sponsorowane; przekaż `ad_program=SPONSORED_DISPLAY`, `SPONSORED_VIDEO` albo `ALL`, aby odczytać inne programy. Pole `adProgram` rozróżnia program, a `providerId` jest surowym identyfikatorem Allegro. Do kolejnych żądań NS zawsze używaj zwróconego `id`: `display:<id>` albo `video:<id>`. Zachowaj prefiks i zakoduj cały segment URL; nie zastępuj go polem `providerId`. Dotyczy to również `campaign.id` grupy i filtra `campaign_id`. Dla grafiki/wideo sprawdzaj też `program_sync`: `READY` potwierdza pobranie, `ERROR` oznacza zachowany poprzedni stan, a `NOT_SYNCED` brak potwierdzonego odczytu. Czas w `program_sync[program].synced_at` dotyczy wybranego programu.\n\nPo pobraniu świeżego ETag wyślij `PATCH .../adgroups/{resource_id}` z `{\"bidding\":{\"cpm\":{\"grossAmount\":\"12.00\",\"currency\":\"PLN\"}},\"budget\":{\"daily\":{\"grossAmount\":\"40.00\",\"currency\":\"PLN\"}}}`. Zamiast brutto można przekazać netto; wszystkie kwoty polecenia muszą używać tej samej podstawy. `budget.total: null` usuwa limit całkowity. Status zmienia osobny endpoint `/status`, z nowym `Idempotency-Key` i świeżym `If-Match`. Tworzenie, kreacje, nazwa grupy, miejsca i daty emisji oraz wybór ofert Display/Video nie są obsługiwane.\n\n### Harmonogramy i limity\n\nHarmonogramy NS obsługują Oferty sponsorowane, reklamę graficzną i wideo. `deliveryPeriod` grupy określa daty emisji w Allegro. Tygodniowe godziny, wyjątki, CPC/CPM i budżety obsługuje osobny harmonogram NS. Dla grup Display/Video użyj actions.cpm oraz ID z prefiksem display:/video:. Kwoty harmonogramu są brutto; CPM i budżet dzienny poza oknami wracają do zapisanej bazy. CPC i CPM nie mogą występować w jednym planie; kampanie obsługują tylko status. Harmonogram jest sprawdzany przez zadanie okresowe, bez gwarancji wykonania co do sekundy. Odczyt harmonogramu zawiera `execution_status` oraz bezpieczny `last_error`; stan wykonania nie zmienia rewizji edytowalnej konfiguracji. Wykonywanie wymaga włączonego głównego narzędzia i wybrania konta w ustawieniach Menedżera; samo `enabled: true` w planie tego nie zmienia. Zapis z API do pola kontrolowanego przez aktywny plan jest odrzucany jako `schedule_conflict`; najpierw wyłącz ten plan. Wyłączenie/usunięcie harmonogramu zatrzymuje przyszłe zmiany, nie cofa ostatnich ustawień ani zmian już przyjętych przez Allegro.\n\nOdczyty bieżących danych mają dodatkowy limit domyślnie **60 żądań/min na firmę**, wspólny dla jej kluczy: reklamodawcy, pojedyncze kampanie/grupy, katalog ofert i oferty grupy. Sprawdzenie reklamodawcy przy tworzeniu połączenia też korzysta z tej puli. Lokalne listy, harmonogramy i status polecenia nie zużywają tej puli. Po `429 live_read_limit` respektuj `Retry-After`."}, {"name": "Skaner Ofert Allegro", "description": "Historia pomiarów i zmian ofert Allegro zarejestrowanych przez skaner firmy."}, {"name": "Repricer", "description": "## Raport konkurencji — szybki start\n\nRaporty wymagają scope’u `repricer.competitor_reports:write`, także przy odczycie i pobieraniu eksportu.\n\n1. Odczytaj `GET /v1/repricer/usage` i sprawdź `competitor_checks.remaining`. To pula wspólna z repricerem w panelu.\n2. Wyślij `POST /v1/repricer/competitor-reports` z `Idempotency-Key`, `marketplace_id` i tablicą `eans` (1–10000 unikalnych kodów). Serwer atomowo rezerwuje jedno sprawdzenie na każdy EAN; brak salda na całą paczkę daje `402 competitor_checks_required`.\n3. Po `202` odpytuj ścieżkę z nagłówka `Location`, domyślnie co 5 sekund i respektując `Retry-After`, aż status będzie `completed`, `partially_failed` lub `failed`. Ponowny POST z tym samym kluczem i payloadem odtwarza pierwotną odpowiedź 202; aktualny stan odczytuj przez GET. Pozycje zachowują kolejność wejściowych EAN-ów; kolejne strony pobieraj przez `pagination.next_cursor` jako parametr `cursor`.\n4. Gdy `export.status` osiągnie `ready`, pobierz `export.download_url` z tym samym nagłówkiem Bearer. Eksport przygotowuje się osobno i może być jeszcze niedostępny po zakończeniu raportu; dla `pending` lub `building` kontynuuj odczyt statusu co najmniej co 5 sekund, respektując `Retry-After`. Odczyty i eksport nie zużywają kolejnych sprawdzeń. Nieudane pozycje są zwracane do salda; poprawny wynik bez ofert zużywa jedno sprawdzenie.\n\n```bash\ncurl 'https://api.niezbedniksprzedawcy.pl/v1/repricer/competitor-reports' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: report-2026-09-09-001' \\\n  --data '{\"marketplace_id\":\"allegro-pl\",\"eans\":[\"5901234123457\"]}'\n```\n\n## Reguły repricera\n\nOferty pobierz przez `GET /v1/repricer/offers` ze scope’em `repricer.listings:read` lub `repricer.listings:write`. Dodaj `include_operating_mode=true`, aby odczytać `automation.operating_mode` dla każdej zwróconej oferty. Aby odczytać tryb jednej oferty, podaj filtry `id` i `marketplace_id`. Do częściowej zmiany reguły przez `PATCH /v1/repricer/offers/{marketplace}/{offer_id}` potrzebny jest `repricer.listings:write`. Aby przełączyć ofertę na obserwację, wyślij `{\"operating_mode\":\"observe\"}`. Samo `{\"enabled\":true}` wznawia zapamiętany tryb.\n\nWiele ofert zmień jednym `POST /v1/repricer/offer-updates` z `Idempotency-Key` i `items` (1–1000 pozycji). Każda pozycja podaje `marketplace`, `offer_id` oraz `changes` w formacie pojedynczego PATCH; można przekazać różne ustawienia dla każdej oferty. Po `202` odczytuj `status_url` przez GET, domyślnie co 5 sekund. Zlecenie i odczyt jego wyników wymagają `repricer.listings:write`. Wynik i błąd są osobne dla każdej oferty; częściowy błąd nie cofa poprawnych zmian. Kolejne paczki jednej firmy zachowują kolejność przyjęcia. Pojedynczy PATCH działa od razu i nie uczestniczy w tej kolejce."}], "paths": {"/v1/allegro-ads/workspaces": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.reports:read", "allegro_ads.reports:write"], "operationId": "listAllegroAdsWorkspaces", "summary": "Pobierz konta i reklamodawców z historią raportów", "description": "Każdy wpis określa jedno konto Allegro, reklamodawcę i rynek skonfigurowane w Menedżerze Ads Allegro.", "parameters": [{"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100000, "default": 1}, "description": "Numer strony. Na jednej stronie mieści się do 50 wierszy."}], "responses": {"200": {"description": "Strona połączeń raportowych firmy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllegroAdsWorkspaces"}}}}, "400": {"description": "Nieprawidłowe parametry żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz lub jego właściciel nie ma wymaganego dostępu (insufficient_scope, permission_required). Przy zlecaniu raportu konto musi być połączone z Allegro (account_unavailable).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczono limit żądań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa jest chwilowo niedostępna.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/workspaces/{workspace_id}/report-requests": {"post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.reports:write"], "operationId": "requestAllegroAdsReport", "summary": "Zleć pobranie raportu z Allegro", "description": "Wybierz typ i zamknięty zakres dni od 1 czerwca 2015 r. do wczoraj. Różnica między datami może wynosić do 3660 dni. Menedżer Ads Allegro dzieli dłuższe okresy na części i pobiera je w tle. Dla reklam graficznych i wideo podaj ad_program=SPONSORED_DISPLAY_AND_VIDEO oraz report_type=standard; wymagany jest rynek allegro-pl. Pobieranie nowych raportów na sandboxie jest wyłączone (409 reports_unavailable_in_sandbox). Jeśli utracisz odpowiedź, ponów identyczny POST z tym samym kluczem idempotencji. Nowe status_url i results_url zachowują wybrany ad_program; odtworzenie starego potwierdzenia pozostawia jego wcześniejszą treść bez zmian.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "description": "Identyfikator z listy połączeń raportowych.", "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllegroAdsReportRequest"}, "examples": {"offers": {"summary": "Oferty sponsorowane (dotychczasowy zakres)", "value": {"date_from": "2026-11-01", "date_to": "2026-11-07", "report_type": "standard"}}, "displayVideo": {"summary": "Reklamy graficzne i wideo", "value": {"date_from": "2026-11-01", "date_to": "2026-11-07", "report_type": "standard", "ad_program": "SPONSORED_DISPLAY_AND_VIDEO"}}}}}}, "responses": {"202": {"description": "Przyjęto zlecenie. Location wskazuje status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"description": "Adres listy prób pobrania dla tego okresu, programu i typu.", "schema": {"type": "string", "format": "uri-reference"}}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"description": "Odstęp do kolejnego odczytu stanu, w sekundach.", "schema": {"type": "integer", "enum": [60]}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllegroAdsReportAccepted"}}}}, "400": {"description": "Nieprawidłowe parametry żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz lub jego właściciel nie ma wymaganego dostępu (insufficient_scope, permission_required). Przy zlecaniu raportu konto musi być połączone z Allegro (account_unavailable).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Połączenie raportowe nie istnieje dla tej firmy lub jest nieaktywne (workspace_not_found).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Konflikt klucza idempotencji lub próba zlecenia raportu na sandboxie.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different request payload."}, "request_id": "example-request-42"}}, "reports_unavailable_in_sandbox": {"summary": "reports_unavailable_in_sandbox", "value": {"error": {"code": "reports_unavailable_in_sandbox", "message": "Pobieranie raportów API jest wyłączone na sandboxie."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Body przekracza 512 KiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczono limit żądań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa jest chwilowo niedostępna.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/workspaces/{workspace_id}/report-runs": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.reports:read", "allegro_ads.reports:write"], "operationId": "listAllegroAdsReportRuns", "summary": "Sprawdź stan pobierania raportów", "description": "Zwraca ręczne i automatyczne próby wybranego programu i typu, których okres choć częściowo pokrywa się z wybranymi datami, od najnowszej. COMPLETED oznacza zapis danych tej próby. FAILED, CANCELLED i SKIPPED są stanami końcowymi. Bez ad_program zwraca wyłącznie SPONSORED_OFFERS. Odpowiedź i każdy wiersz zawierają ad_program, także gdy lista jest pusta.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "description": "Identyfikator z listy połączeń raportowych.", "schema": {"type": "string", "format": "uuid"}}, {"name": "date_from", "in": "query", "required": true, "schema": {"type": "string", "format": "date"}, "description": "Pierwszy dzień okresu (włącznie), od 1 stycznia 2000 r."}, {"name": "date_to", "in": "query", "required": true, "schema": {"type": "string", "format": "date"}, "description": "Ostatni dzień okresu (włącznie), najpóźniej wczoraj. Różnica dat do 3660 dni."}, {"name": "report_type", "in": "query", "schema": {"type": "string", "enum": ["standard", "purchasedOffers"], "default": "standard"}, "description": "Statystyki reklam (standard) albo zakupy przypisane klikniętym ofertom (purchasedOffers). Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard."}, {"name": "ad_program", "in": "query", "schema": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi.", "default": "SPONSORED_OFFERS"}, "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, {"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100000, "default": 1}, "description": "Numer strony. Na jednej stronie mieści się do 50 wierszy."}], "responses": {"200": {"description": "Strona prób pobrania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AllegroAdsReportRuns"}}}}, "400": {"description": "Nieprawidłowe parametry żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz lub jego właściciel nie ma wymaganego dostępu (insufficient_scope, permission_required). Przy zlecaniu raportu konto musi być połączone z Allegro (account_unavailable).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Połączenie raportowe nie istnieje dla tej firmy lub jest nieaktywne (workspace_not_found).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Przekroczono limit żądań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa jest chwilowo niedostępna.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/workspaces/{workspace_id}/results": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.reports:read", "allegro_ads.reports:write"], "operationId": "getAllegroAdsResults", "summary": "Pobierz wyniki reklam lub kupione oferty", "description": "Zwraca aktualnie zapisane wyniki wybranego programu, bez wywoływania Allegro. Bez ad_program zachowuje zakres SPONSORED_OFFERS. Dla standard dostępne są sumy za okres, trend dzienny, źródła API i XLSX oraz grupowanie po kampanii, grupie reklam lub ofercie. CTR jest podany w procentach, ROAS jako iloraz sprzedaży brutto i kosztu reklamy. Dla purchasedOffers każdy wiersz łączy klikniętą ofertę z kupioną w ramach kampanii i grupy. Wcześniejsze dane z XLSX są dostępne w raporcie standard Ofert sponsorowanych.\n\nReklamy graficzne i wideo: użyj `ad_program=SPONSORED_DISPLAY_AND_VIDEO` (allegro-pl), `report_type=standard` oraz `group=group` lub `group=campaign`. Domyślne grupowanie tego programu to group. NS nie obsługuje tutaj offer_id, group=offer ani purchasedOffers. Przykład: `GET /v1/allegro-ads/workspaces/{workspace_id}/results?date_from=2026-11-01&date_to=2026-11-07&ad_program=SPONSORED_DISPLAY_AND_VIDEO&group=campaign&granularity=day`. Odpowiedź zawiera CPM brutto/netto i assisted_sales (wartość sprzedaży wspomaganej brutto), bez CPC i sumowanego zasięgu reach. CPM jest liczony z sum kosztów i wyświetleń, a nie jako średnia CPM poszczególnych wierszy; przy zerowym mianowniku wskaźnik ma wartość null. To wspólny raport obu formatów; campaign_id i ad_group_id są surowymi identyfikatorami Allegro (providerId w API zarządzania), bez prefiksów display:/video:.\n\nAby pobrać dzienne wyniki jednej oferty za tydzień, wywołaj `GET /v1/allegro-ads/workspaces/{workspace_id}/results?date_from=2026-11-01&date_to=2026-11-07&offer_id=17400123456&granularity=day`. Każdy wiersz zawiera wtedy `metric_date`. Jeśli oferta występowała w kilku grupach reklam, tego samego dnia może mieć osobny wiersz w każdej grupie. Odpowiedź obejmuje dni z zapisanymi wierszami dla wybranych kryteriów. Pobierz kolejne strony od 1 do `total_pages`, aby odczytać cały zakres.\n\nFiltr `offer_id` obejmuje także sumy w `summary` i trend dzienny raportu standard Ofert sponsorowanych. Liczniki pokrycia dotyczą całego połączenia oraz wybranego programu i typu raportu. Pusta lista przy api_covered_days=0 oznacza brak pobranego raportu, a nie potwierdzenie zerowych wyników.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "description": "Identyfikator z listy połączeń raportowych.", "schema": {"type": "string", "format": "uuid"}}, {"name": "date_from", "in": "query", "required": true, "schema": {"type": "string", "format": "date"}, "description": "Pierwszy dzień okresu (włącznie), od 1 stycznia 2000 r."}, {"name": "date_to", "in": "query", "required": true, "schema": {"type": "string", "format": "date"}, "description": "Ostatni dzień okresu (włącznie), najpóźniej wczoraj. Różnica dat do 3660 dni."}, {"name": "report_type", "in": "query", "schema": {"type": "string", "enum": ["standard", "purchasedOffers"], "default": "standard"}, "description": "Statystyki reklam (standard) albo zakupy przypisane klikniętym ofertom (purchasedOffers). Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard."}, {"name": "ad_program", "in": "query", "schema": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi.", "default": "SPONSORED_OFFERS"}, "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, {"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100000, "default": 1}, "description": "Numer strony. Na jednej stronie mieści się do 50 wierszy."}, {"name": "group", "in": "query", "schema": {"type": "string", "enum": ["offer", "group", "campaign"]}, "description": "Poziom agregacji dla standard: domyślnie offer dla SPONSORED_OFFERS, group dla SPONSORED_DISPLAY_AND_VIDEO. Dla grafiki/wideo dozwolone tylko group i campaign. Dla purchasedOffers pomiń parametr."}, {"name": "offer_id", "in": "query", "schema": {"type": "string", "minLength": 1, "maxLength": 128}, "example": "17400123456", "description": "ID reklamowanej oferty (clicked_offer_id), wyłącznie dla SPONSORED_OFFERS. Białe znaki na brzegach są pomijane. Filtr działa dla obu typów raportów Ofert sponsorowanych i obu wartości granularity."}, {"name": "granularity", "in": "query", "schema": {"type": "string", "enum": ["period", "day"], "default": "period"}, "description": "period sumuje wiersze za cały zakres (różnica dat do 3660 dni). day dzieli wiersze wybranego grupowania według dnia i zwraca je od najstarszego. Zakres dzienny może obejmować do 30 dni, wliczając date_from i date_to. Limit obowiązuje dla obu programów i typów raportu, z filtrem offer_id i bez niego. Oba tryby zwracają do 50 wierszy na stronę."}], "responses": {"200": {"description": "Strona wyników wybranego typu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"oneOf": [{"$ref": "#/components/schemas/AllegroAdsStandardResults"}, {"$ref": "#/components/schemas/AllegroAdsPurchasedResults"}, {"$ref": "#/components/schemas/AllegroAdsDisplayVideoResults"}]}, "examples": {"displayVideoDailyGroups": {"summary": "Dzienny wynik grupy reklam graficznych lub wideo", "value": {"ad_program": "SPONSORED_DISPLAY_AND_VIDEO", "summary": {"sold_units": 2, "attributed_sales_gross": "240.00", "impressions": 1000, "clicks": 20, "interest": 4, "cost_gross": "12.30", "cost_net": "10.00", "ctr": "2.000000", "roas": "19.512195", "roas_net": "24.000000", "cpm_gross": "12.300000", "cpm_net": "10.000000", "assisted_sales": "123.00"}, "rows": [{"metric_date": "2026-11-01", "campaign_id": "campaign-provider-id", "campaign_name": "Kampania graficzna", "ad_group_id": "group-provider-id", "ad_group_name": "Grupa graficzna", "sold_units": 2, "attributed_sales_gross": "240.00", "impressions": 1000, "clicks": 20, "interest": 4, "cost_gross": "12.30", "cost_net": "10.00", "ctr": "2.000000", "roas": "19.512195", "roas_net": "24.000000", "cpm_gross": "12.300000", "cpm_net": "10.000000", "assisted_sales": "123.00"}], "trend": [{"metric_date": "2026-11-01", "sold_units": 2, "attributed_sales_gross": "240.00", "impressions": 1000, "clicks": 20, "interest": 4, "cost_gross": "12.30", "cost_net": "10.00", "ctr": "2.000000", "roas": "19.512195", "roas_net": "24.000000", "cpm_gross": "12.300000", "cpm_net": "10.000000", "assisted_sales": "123.00"}], "page": 1, "total_pages": 1, "total_rows": 1, "api_covered_days": 1, "period_days": 1, "currency": "PLN", "sources": ["API"]}}}}}}, "400": {"description": "Nieprawidłowe parametry. Dla granularity=day i zakresu ponad 30 dni odpowiedź zawiera error.code=invalid_request i szczegóły w error.details.date_to.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz lub jego właściciel nie ma wymaganego dostępu (insufficient_scope, permission_required). Przy zlecaniu raportu konto musi być połączone z Allegro (account_unavailable).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Połączenie raportowe nie istnieje dla tej firmy lub jest nieaktywne (workspace_not_found).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Przekroczono limit żądań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa jest chwilowo niedostępna.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/advertisers": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write", "allegro_ads.schedules:read", "allegro_ads.schedules:write"], "operationId": "listAdsManagementAdvertisers", "summary": "Pobierz reklamodawców konta Allegro", "description": "", "parameters": [{"name": "account_id", "in": "query", "required": true, "schema": {"type": "integer", "minimum": 1}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementAdvertisers"}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write", "allegro_ads.schedules:read", "allegro_ads.schedules:write"], "operationId": "listAdsManagementWorkspaces", "summary": "Pobierz połączenia do zarządzania kampaniami", "description": "", "parameters": [{"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementWorkspaces"}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "createAdsManagementWorkspace", "summary": "Przygotuj połączenie konta, reklamodawcy i rynku", "description": "", "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}], "responses": {"400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "201": {"description": "Połączenie gotowe; nie tworzy kampanii ani grup reklam.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementWorkspace"}, "examples": {"workspace": {"summary": "Gotowe połączenie zarządzania", "value": {"workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "account_id": 19, "account_name": "sklep_demo", "advertiser_id": "advertiser-id", "marketplace_id": "allegro-pl", "currency": "PLN", "connected": true, "synced_at": null}}}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementWorkspaceCreate"}, "examples": {"allegroPl": {"summary": "Połączenie z wybranym reklamodawcą", "description": "account_id pochodzi z id konta GET /v1/connections (jako liczba); advertiser_id z rows[].id listy reklamodawców.", "value": {"account_id": 19, "advertiser_id": "advertiser-id", "marketplace_id": "allegro-pl"}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/refresh": {"post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "refreshAdsManagementWorkspace", "summary": "Zleć odświeżenie kampanii i grup", "description": "Zwraca 202 z adresem polecenia. Po completed pobierz ponownie listy kampanii i grup; result.synced_at zawiera czas odświeżenia workspace. Dla grafiki/wideo sprawdź osobno program_sync na liście: błąd jednego programu zachowuje jego poprzedni stan. Nowy zamiar wymaga nowego klucza idempotencji.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "workspace.refresh", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {}, "additionalProperties": false}, "examples": {"refresh": {"summary": "Odśwież lokalne listy kampanii i grup", "value": {}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/offers": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "listAdsManagementOffers", "summary": "Wyszukaj oferty do reklamowania", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}, {"name": "search", "in": "query", "schema": {"type": "string", "maxLength": 50}}, {"name": "placement", "in": "query", "style": "form", "explode": true, "schema": {"type": "array", "items": {"type": "string", "enum": ["listing", "leftpanel", "showitem", "mainpage", "google"]}, "maxItems": 5}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementOffers"}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/schedules": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.schedules:read", "allegro_ads.schedules:write"], "operationId": "listAdsManagementSchedules", "summary": "Pobierz harmonogramy NS", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementSchedules"}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.schedules:write"], "operationId": "createAdsManagementSchedule", "summary": "Zleć utworzenie harmonogramu NS", "description": "Harmonogramy przyjmują Oferty sponsorowane, grafikę i wideo. Zachowaj prefiksy display:/video: w targets[].id. cpc dotyczy grup Ofert sponsorowanych, cpm grup graficznych/wideo; status i budżet dzienny obsługują wszystkie programy. Kampanie mogą sterować tylko statusem. Nie łącz cpc i cpm w jednym planie. Po completed ID planu znajduje się w result.schedule.id. Zakończenie polecenia potwierdza zapis planu, nie wykonanie przyszłych okien. Do emisji grupy potrzebna jest aktywna kampania nadrzędna oraz włączone narzędzie z wybranym kontem. Samo enabled=true nie zmienia ustawień całego Menedżera.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "schedule.create", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementScheduleCreate"}, "examples": {"weekdayEmission": {"summary": "Emisja od poniedziałku do piątku 08:00–18:00", "description": "Dni 0–6 oznaczają poniedziałek–niedzielę. Zastąp ID grupy. Plan wymaga włączonego narzędzia i wybranego konta w Menedżerze.", "value": {"name": "Emisja w dni robocze", "enabled": true, "targets": [{"kind": "adgroup", "id": "group-id-from-allegro"}], "config": {"timezone": "Europe/Warsaw", "windows": [{"days": [0, 1, 2, 3, 4], "start": "08:00", "end": "18:00"}], "exceptions": [], "actions": {"status": true}}}}, "displayVideoCpm": {"summary": "Grafika i wideo: emisja, CPM i budżet dzienny", "description": "Kwoty fixed są brutto. Procenty liczą się od zachowanej bazy, która wraca poza oknami. Zastąp oba ID wartościami z list NS, zachowując prefiksy.", "value": {"name": "Grafika i wideo w dni robocze", "enabled": true, "targets": [{"kind": "adgroup", "id": "display:display-group-id"}, {"kind": "adgroup", "id": "video:video-group-id"}], "config": {"timezone": "Europe/Warsaw", "windows": [{"days": [0, 1, 2, 3, 4], "start": "08:00", "end": "12:00"}, {"days": [0, 1, 2, 3, 4], "start": "12:00", "end": "18:00", "cpm": {"mode": "percent", "value": "10.00"}}], "exceptions": [], "actions": {"status": true, "cpm": {"mode": "fixed", "value": "12.00"}, "dailyBudget": {"mode": "fixed", "value": "40.00"}}}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/schedules/{schedule_id}": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.schedules:read", "allegro_ads.schedules:write"], "operationId": "getAdsManagementSchedule", "summary": "Pobierz harmonogram i jego wersję", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "schedule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "ETag": {"description": "Aktualna wersja zasobu do przesłania w If-Match.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementSchedule"}, "examples": {"savedPlan": {"summary": "Zapisany plan i stan ostatniego przebiegu", "value": {"id": "22222222-3333-4444-8555-666666666666", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "name": "Emisja w dni robocze", "enabled": true, "targets": [{"kind": "adgroup", "id": "group-id-from-allegro"}], "config": {"timezone": "Europe/Warsaw", "windows": [{"days": [0, 1, 2, 3, 4], "start": "08:00", "end": "18:00"}], "exceptions": [], "actions": {"status": true}, "startDate": null, "endDate": null}, "revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "next_run_at": "2026-11-13T17:00:00+00:00", "last_run_at": null, "execution_status": "scheduled", "last_error": null, "created_at": "2026-11-13T10:00:00+00:00", "updated_at": "2026-11-13T10:00:00+00:00"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "patch": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.schedules:write"], "operationId": "updateAdsManagementSchedule", "summary": "Zmień lub wyłącz harmonogram NS", "description": "Wymaga aktualnego If-Match i nowego Idempotency-Key. Dokładne body {\"enabled\":false} zatrzymuje przyszłe działania i zwraca 200. Pozostałe zmiany zwracają 202; sprawdź status_url. Zgodność celów z CPC/CPM i budżetem jest oceniana przez wykonawcę pod blokadą po połączeniu zmian z zapisanym planem i pominięciu celów zakończonych po archiwizacji. Dotyczy to również żądania zawierającego całe targets i config. config zastępuje cały obiekt konfiguracji. Zapisana baza istniejących celów pozostaje zachowana.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "schedule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "schedule.update", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "200": {"description": "Zatrzymano przyszłe działania harmonogramu. Ostatnie ustawienia i przyjęte operacje pozostają bez cofania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "ETag": {"description": "Aktualna wersja zasobu do przesłania w If-Match.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementScheduleStopped"}, "examples": {"disabled": {"summary": "Zatrzymano przyszłe działania; ostatni stan reklamy pozostaje", "value": {"schedule_id": "22222222-3333-4444-8555-666666666666", "enabled": false, "revision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}}}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementSchedulePatch"}, "examples": {"disable": {"summary": "Zatrzymaj przyszłe działania — HTTP 200", "description": "Dokładnie to body działa także przy rozłączonym koncie. Nie przywraca poprzednich stawek ani statusu reklamy.", "value": {"enabled": false}}, "rename": {"summary": "Zmień nazwę planu — HTTP 202", "value": {"name": "Plan emisji sklepu"}}, "replaceConfig": {"summary": "Zastąp konfigurację godzin — HTTP 202", "description": "config jest całym obiektem konfiguracji, nie patchem pojedynczego zagnieżdżonego pola.", "value": {"config": {"timezone": "Europe/Warsaw", "windows": [{"days": [0, 1, 2, 3, 4], "start": "09:00", "end": "17:00"}], "exceptions": [], "actions": {"status": true}}}}}}}}}, "delete": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.schedules:write"], "operationId": "deleteAdsManagementSchedule", "summary": "Usuń harmonogram NS bez cofania ostatnich ustawień", "description": "Wymaga aktualnego If-Match, Idempotency-Key, działającego połączenia i braku oczekujących zmian. Jeśli konto jest rozłączone, użyj PATCH z dokładnym body {\"enabled\":false}. Usunięcie planu zwraca 200 i nie cofa jego ostatnich ustawień.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "schedule_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "200": {"description": "Zatrzymano przyszłe działania harmonogramu. Ostatnie ustawienia i przyjęte operacje pozostają bez cofania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementScheduleDeleted"}, "examples": {"deleted": {"summary": "Plan usunięty", "value": {"schedule_id": "22222222-3333-4444-8555-666666666666", "deleted": true}}}}}}}}}, "/v1/allegro-ads/operations/{command_id}": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write", "allegro_ads.schedules:read", "allegro_ads.schedules:write"], "operationId": "getAdsManagementOperation", "summary": "Sprawdź wykonanie polecenia", "description": "Dodatkowo wymagany jest scope read lub write z rodziny tego polecenia: kampanie albo harmonogramy. outcome_unknown oznacza niepotwierdzony wynik; nie wysyłaj ponownie zapisu z nowym kluczem.", "parameters": [{"name": "command_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommand"}, "examples": {"campaignCreated": {"summary": "Kampania utworzona — jej ID jest w result.resources", "value": {"id": "11111111-2222-4333-8444-555555555555", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "campaign.create", "resource_id": null, "status": "completed", "result": {"resources": [{"kind": "campaign", "id": "campaign-id-from-allegro", "revision": "campaign-v1", "status": "COMPLETED", "steps": [{"action": "create", "status": "COMPLETED"}]}]}, "error": null, "request_id": "docs-example-request", "created_at": "2026-11-13T10:00:00+00:00", "completed_at": "2026-11-13T10:00:01+00:00"}}, "scheduleSaved": {"summary": "Plan zapisany — jego ID jest w result.schedule", "value": {"id": "11111111-2222-4333-8444-555555555555", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "schedule.create", "resource_id": null, "status": "completed", "result": {"schedule": {"id": "22222222-3333-4444-8555-666666666666", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "name": "Emisja w dni robocze", "enabled": true, "targets": [{"kind": "adgroup", "id": "group-id-from-allegro"}], "config": {"timezone": "Europe/Warsaw", "windows": [{"days": [0, 1, 2, 3, 4], "start": "08:00", "end": "18:00"}], "exceptions": [], "actions": {"status": true}, "startDate": null, "endDate": null}, "revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "next_run_at": "2026-11-13T17:00:00+00:00", "last_run_at": null, "execution_status": "scheduled", "last_error": null, "created_at": "2026-11-13T10:00:00+00:00", "updated_at": "2026-11-13T10:00:00+00:00"}}, "error": null, "request_id": "docs-example-request", "created_at": "2026-11-13T10:00:00+00:00", "completed_at": "2026-11-13T10:00:01+00:00"}}, "revisionConflict": {"summary": "HTTP 200 odczytu; wykonanie zakończone błędem rewizji 412", "value": {"id": "11111111-2222-4333-8444-555555555555", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "adgroup.update", "resource_id": "group-id-from-allegro", "status": "failed", "result": {}, "error": {"code": "stale_revision", "status": 412, "message": "The resource revision has changed. Read it again before editing."}, "request_id": "docs-example-request", "created_at": "2026-11-13T10:00:00+00:00", "completed_at": "2026-11-13T10:00:01+00:00"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/campaigns": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "listAdsManagementCampaigns", "summary": "Pobierz kampanie", "description": "Lokalna kopia; synced_at wskazuje ostatnie odświeżenie. Domyślnie zwraca Oferty sponsorowane. Program rozróżnia adProgram, nie type (Display/Video mogą mieć wspólne type). Przed zapisem odczytaj pojedynczy zasób.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["ACTIVE", "PAUSED", "ARCHIVED"]}}, {"name": "ad_program", "in": "query", "schema": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY", "SPONSORED_VIDEO", "ALL"], "default": "SPONSORED_OFFERS"}, "description": "Program reklamowy; ALL łączy wszystkie programy. Pominięcie zachowuje Oferty sponsorowane."}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCampaigns"}, "examples": {"selectedCpmProgram": {"summary": "Lista dla ad_program=SPONSORED_DISPLAY", "value": {"workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "rows": [{"id": "display:display-campaign-id", "providerId": "display-campaign-id", "adProgram": "SPONSORED_DISPLAY", "name": "Reklama graficzna", "status": "ACTIVE", "marketplaceId": "allegro-pl", "type": "SPONSORED_DISPLAY_AND_VIDEO"}], "pagination": {"offset": 0, "limit": 50, "total_rows": 1}, "synced_at": "2026-11-14T13:00:00+00:00", "archive_complete": true, "program_sync": {"SPONSORED_DISPLAY": {"status": "READY", "synced_at": "2026-11-14T13:00:00+00:00", "error": ""}}}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "createAdsManagementCampaign", "summary": "Zleć utworzenie kampanii", "description": "Tworzenie dotyczy wyłącznie Ofert sponsorowanych. Domyślny status to PAUSED. ID utworzonej kampanii odbierz dopiero po completed z result.resources[].id dla kind=campaign. Najwyższe id odpowiedzi jest identyfikatorem polecenia.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "campaign.create", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCampaignCreate"}, "examples": {"paused": {"summary": "Utwórz kampanię wstrzymaną", "description": "Po completed odbierz ID kampanii z result.resources[].id, nie z najwyższego pola id polecenia.", "value": {"name": "Kampania API", "status": "PAUSED"}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/campaigns/{resource_id}": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "getAdsManagementCampaign", "summary": "Pobierz aktualny zasób i jego ETag", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "ETag": {"description": "Aktualna wersja zasobu do przesłania w If-Match.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCampaign"}, "examples": {"existingCpmResource": {"summary": "Zachowaj id z prefiksem; użyj adProgram do rozróżnienia typu reklamy.", "value": {"id": "display:display-campaign-id", "providerId": "display-campaign-id", "adProgram": "SPONSORED_DISPLAY", "name": "Reklama graficzna", "status": "ACTIVE", "marketplaceId": "allegro-pl", "type": "SPONSORED_DISPLAY_AND_VIDEO"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "patch": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "updateAdsManagementCampaign", "summary": "Zleć edycję kampanii", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "campaign.update", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCampaignPatch"}, "examples": {"rename": {"summary": "Zmień nazwę kampanii", "value": {"name": "Kampania sezonowa"}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/campaigns/{resource_id}/status": {"post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "setAdsManagementCampaignStatus", "summary": "Włącz lub wstrzymaj kampanię i jej grupy", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "campaign.status", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementStatus"}, "examples": {"pause": {"summary": "Wstrzymaj emisję", "value": {"status": "PAUSED"}}, "activate": {"summary": "Włącz emisję", "description": "Zmiana statusu kampanii obejmuje jej grupy. Grupa wymaga aktywnej kampanii nadrzędnej i spełnienia warunków emisji.", "value": {"status": "ACTIVE"}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/adgroups": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "listAdsManagementAdGroups", "summary": "Pobierz grupy reklam", "description": "Lokalna kopia; synced_at wskazuje ostatnie odświeżenie. Domyślnie zwraca Oferty sponsorowane. Program rozróżnia adProgram, nie type (Display/Video mogą mieć wspólne type). Przed zapisem odczytaj pojedynczy zasób.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["ACTIVE", "PAUSED", "ARCHIVED"]}}, {"name": "ad_program", "in": "query", "schema": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY", "SPONSORED_VIDEO", "ALL"], "default": "SPONSORED_OFFERS"}, "description": "Program reklamowy; ALL łączy wszystkie programy. Pominięcie zachowuje Oferty sponsorowane."}, {"name": "campaign_id", "in": "query", "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id kampanii z odpowiednim prefiksem programu; ustaw też zgodny ad_program lub ALL."}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementAdGroups"}, "examples": {"selectedCpmProgram": {"summary": "Lista dla ad_program=SPONSORED_VIDEO", "value": {"workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "rows": [{"id": "video:video-group-id", "providerId": "video-group-id", "adProgram": "SPONSORED_VIDEO", "name": "Grupa reklam wideo", "status": "ACTIVE", "marketplaceId": "allegro-pl", "campaign": {"id": "video:video-campaign-id"}, "bidding": {"cpm": {"currency": "PLN", "grossAmount": "12.00", "netAmount": "9.76"}}, "budget": {"daily": {"currency": "PLN", "grossAmount": "40.00", "netAmount": "32.52"}, "total": null}}], "pagination": {"offset": 0, "limit": 50, "total_rows": 1}, "synced_at": "2026-11-14T13:00:00+00:00", "archive_complete": true, "program_sync": {"SPONSORED_VIDEO": {"status": "READY", "synced_at": "2026-11-14T13:00:00+00:00", "error": ""}}}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "createAdsManagementAdGroup", "summary": "Zleć utworzenie grupy", "description": "Tworzenie dotyczy wyłącznie Ofert sponsorowanych. campaign.id pochodzi z istniejącej kampanii tego programu albo zakończonego polecenia campaign.create. Zastąp datę przykładu dzisiejszą lub przyszłą datą według Europe/Warsaw. MANUAL tworzy pustą grupę; oferty dodaj dopiero po completed, używając ID z result.resources[].id.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "adgroup.create", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementAdGroupCreate"}, "examples": {"manualPaused": {"summary": "Wstrzymana grupa z ręcznym wyborem ofert", "description": "Zastąp ID kampanii i datę 2099-05-01. Start ma być dziś lub później wg Europe/Warsaw. Grupa powstaje bez ofert; dodaj je osobnym POST offer-ads po zakończeniu tego polecenia.", "value": {"campaign": {"id": "campaign-id-from-allegro"}, "name": "Oferty rowerowe", "status": "PAUSED", "bidding": {"maxCpc": {"grossAmount": "1.50", "currency": "PLN"}}, "budget": {"daily": {"grossAmount": "50.00", "currency": "PLN"}}, "placements": {"ids": ["listing", "showitem"]}, "deliveryPeriod": {"start": "2099-05-01"}, "offerSelection": {"mode": "MANUAL"}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/adgroups/{resource_id}": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "getAdsManagementAdGroup", "summary": "Pobierz aktualny zasób i jego ETag", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "ETag": {"description": "Aktualna wersja zasobu do przesłania w If-Match.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementAdGroup"}, "examples": {"existingCpmResource": {"summary": "Zachowaj id z prefiksem; użyj adProgram do rozróżnienia typu reklamy.", "value": {"id": "video:video-group-id", "providerId": "video-group-id", "adProgram": "SPONSORED_VIDEO", "name": "Grupa reklam wideo", "status": "ACTIVE", "marketplaceId": "allegro-pl", "campaign": {"id": "video:video-campaign-id"}, "bidding": {"cpm": {"currency": "PLN", "grossAmount": "12.00", "netAmount": "9.76"}}, "budget": {"daily": {"currency": "PLN", "grossAmount": "40.00", "netAmount": "32.52"}, "total": null}}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}, "patch": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "updateAdsManagementAdGroup", "summary": "Zleć edycję grupy", "description": "Poczekaj na zakończenie wcześniejszego polecenia i pobierz świeży ETag grupy. Dla grafiki/wideo zachowaj prefiks display:/video: w resource_id; edytowalne są wyłącznie bidding.cpm i budget.daily/total. Kwoty są tekstem dziesiętnym; wszystkie kwoty jednego polecenia muszą być netto albo brutto. Aktywny harmonogram kontrolujący zmieniane pola powoduje schedule_conflict.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "adgroup.update", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementAdGroupPatch"}, "examples": {"displayGrossCpmAndBudgets": {"summary": "Reklama graficzna: CPM i budżety brutto", "description": "Użyj id grupy z prefiksem display: w URL i jej świeżego ETag. Programu nie przekazuj w JSON.", "value": {"bidding": {"cpm": {"grossAmount": "10.00", "currency": "PLN"}}, "budget": {"daily": {"grossAmount": "30.00", "currency": "PLN"}, "total": {"grossAmount": "300.00", "currency": "PLN"}}}}, "videoNetCpmAndBudgets": {"summary": "Reklama wideo: CPM i budżety netto", "description": "Użyj id grupy z prefiksem video: w URL. Wszystkie kwoty jednego polecenia mają podstawę netto.", "value": {"bidding": {"cpm": {"netAmount": "10.00", "currency": "PLN"}}, "budget": {"daily": {"netAmount": "40.00", "currency": "PLN"}, "total": {"netAmount": "400.00", "currency": "PLN"}}}}, "removeDisplayVideoTotal": {"summary": "Grafika/wideo: usuń limit całkowity", "description": "null usuwa limit; budżet dzienny pozostaje bez zmian. Wymaga id z odpowiednim prefiksem i świeżego ETag.", "value": {"budget": {"total": null}}}, "grossCpcAndBudget": {"summary": "CPC i budżet dzienny brutto", "value": {"bidding": {"maxCpc": {"grossAmount": "1.80", "currency": "PLN"}}, "budget": {"daily": {"grossAmount": "60.00", "currency": "PLN"}}}}, "netCpcAndBudget": {"summary": "CPC i budżet dzienny netto", "description": "Wszystkie kwoty jednego polecenia używają netto; waluta odpowiada rynkowi połączenia.", "value": {"bidding": {"maxCpc": {"netAmount": "1.50", "currency": "PLN"}}, "budget": {"daily": {"netAmount": "50.00", "currency": "PLN"}}}}, "dailyBudgetOnly": {"summary": "Sam budżet dzienny, także dla Ads Express", "value": {"budget": {"daily": {"grossAmount": "50.00", "currency": "PLN"}}}}, "removeEndAndTotal": {"summary": "Usuń koniec emisji i budżet całkowity", "description": "null usuwa ograniczenie; pominięcie pola pozostawia je bez zmiany. Budżet dzienny pozostaje w mocy.", "value": {"deliveryPeriod": {"end": null}, "budget": {"total": null}}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/adgroups/{resource_id}/status": {"post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "setAdsManagementAdGroupStatus", "summary": "Włącz lub wstrzymaj grupę reklam", "description": "", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "adgroup.status", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementStatus"}, "examples": {"pause": {"summary": "Wstrzymaj emisję", "value": {"status": "PAUSED"}}, "activate": {"summary": "Włącz emisję", "description": "Zmiana statusu kampanii obejmuje jej grupy. Grupa wymaga aktywnej kampanii nadrzędnej i spełnienia warunków emisji.", "value": {"status": "ACTIVE"}}}}}}}}, "/v1/allegro-ads/campaign-workspaces/{workspace_id}/adgroups/{resource_id}/offer-ads": {"get": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["allegro_ads.campaigns:read", "allegro_ads.campaigns:write"], "operationId": "listAdsManagementOfferAds", "summary": "Pobierz oferty przypisane do grupy", "description": "Dostępne wyłącznie dla grup Ofert sponsorowanych.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 9999999, "default": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 50}}], "responses": {"200": {"description": "Wynik odczytu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "ETag": {"description": "Aktualna wersja zasobu do przesłania w If-Match.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementOfferAds"}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Lista ofert nie dotyczy reklam graficznych ani wideo (unsupported_ad_program).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"tags": ["Menedżer Ads Allegro"], "security": [{"BearerAuth": []}], "x-required-scopes": ["allegro_ads.campaigns:write"], "operationId": "changeAdsManagementOfferAds", "summary": "Dodaj lub usuń oferty w grupie", "description": "Dostępne wyłącznie dla Ofert sponsorowanych w trybach MANUAL, ADS_EXPRESS_MANUAL i OFFER_EDIT_FORM; od 1 do 1000 ofert.", "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "ID połączenia zarządzania, z campaign-workspaces; nie jest ID kampanii Allegro."}, {"name": "resource_id", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "description": "Pole id zwrócone przez NS: surowy identyfikator Ofert sponsorowanych albo display:<id>/video:<id>. Zachowaj prefiks; providerId nie zastępuje tego pola. Zakoduj cały identyfikator jako segment URL."}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "example": "ads-example-change-001"}, "description": "W obrębie firmy, metody i ścieżki ten sam klucz, JSON oraz rewizja If-Match odtwarzają przyjętą odpowiedź. Pominięte pola, tekstowa postać kwot i kolejność list są częścią żądania; kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia. Inny payload lub rewizja z tym samym kluczem: 409 idempotency_conflict. Nowy zamiar wymaga nowego klucza."}, {"name": "If-Match", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 258, "pattern": "^(?:\"[^\"\\s,]{1,256}\"|[^\"\\s,]{1,256})$", "example": "\"resource-revision-from-get\""}, "description": "Aktualny ETag zasobu lub revision harmonogramu: maksymalnie 256 znaków samej rewizji, opcjonalnie w cudzysłowie. Brak: 428; nieaktualna wersja: 412. Nie ponawiaj automatycznie po konflikcie."}], "responses": {"202": {"description": "Polecenie zapisane do wykonania; sprawdzaj status_url.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Location": {"$ref": "#/components/headers/Location"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementCommandAccepted"}, "examples": {"accepted": {"summary": "Przyjęto polecenie; sprawdź status_url", "value": {"id": "11111111-2222-4333-8444-555555555555", "status": "queued", "workspace_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee", "action": "offers.update", "status_url": "/v1/allegro-ads/operations/11111111-2222-4333-8444-555555555555"}}}}}}, "400": {"description": "Nieprawidłowy lub nieobsługiwany parametr/payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak ważnego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak scope’u lub dostępu produktu; konto nie ma wymaganej autoryzacji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zasób nie istnieje w firmie przypisanej do klucza.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Limit żądań lub okres oczekiwania wymagany przez Allegro.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "502": {"description": "Allegro zwróciło błąd lub nie udało się potwierdzić odpowiedzi dostawcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Usługa lub stan polecenia są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji, operacja w toku, zajęte konto albo konflikt harmonogramu.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "412": {"description": "Zasób zmienił się od czasu odczytu. Pobierz go i ponownie oceń zmianę.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Przekroczono dopuszczalny rozmiar żądania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "422": {"description": "Zmiana jest niedozwolona dla tego rodzaju kampanii lub grupy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "428": {"description": "Brakuje wymaganego If-Match.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdsManagementOfferAdsChange"}, "examples": {"add": {"summary": "Dodaj wskazane oferty", "description": "Zastąp identyfikatory ofert i użyj świeżego ETag grupy. Poczekaj na zakończenie przed następną zmianą.", "value": {"operation": "ADD", "offerIds": ["12345678901", "12345678902"]}}, "remove": {"summary": "Usuń ofertę z grupy", "description": "To nadal HTTP POST. DELETE jest wartością pola operation, nie metodą HTTP.", "value": {"operation": "DELETE", "offerIds": ["12345678901"]}}}}}}}}, "/v1/offers-scanner/offers/{offer_id}/history": {"get": {"tags": ["Skaner Ofert Allegro"], "operationId": "getScannerOfferHistory", "summary": "Pobierz historię skanera dla jednej oferty Allegro", "description": "Zwraca zapisane statystyki dzienne, porównania cen i zdarzenia dla oferty firmy przypisanej do klucza. Obie listy są uporządkowane od najnowszej daty. Dni bez danych są pomijane. Dla znanej oferty bez danych w okresie obie listy są puste.\n\nTablica `competition_measurements` udostępnia wszystkie rynki. Pole `competition` i dzienne pola pozycji i różnicy cen wskazują ostatnio zapisane udane porównanie tego dnia. Jeśli wszystkie próby są bez wyniku, wskazują ostatnio zapisaną próbę.\n\nAby pobrać ostatnie trzy dni, wywołaj `GET /v1/offers-scanner/offers/17400123456/history?days=3`.", "security": [{"BearerAuth": []}], "x-required-scopes": ["offers_scanner.history:read"], "parameters": [{"in": "path", "name": "offer_id", "required": true, "schema": {"type": "string", "pattern": "^[1-9][0-9]{0,18}$", "example": "17400123456", "description": "Numer oferty Allegro od 1 do 9223372036854775807."}}, {"in": "query", "name": "days", "required": true, "schema": {"type": "integer", "minimum": 1, "maximum": 90, "example": 3}, "description": "Liczba dni kalendarzowych łącznie z dzisiejszym, w strefie Europe/Warsaw. Dla days=1 zwracane są tylko dzisiejsze dane."}], "responses": {"200": {"description": "Historia oferty w wybranym okresie.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ScannerOfferHistory"}, "example": {"offer_id": "17400123456", "days": 3, "date_from": "2026-11-09", "date_to": "2026-11-11", "stats": [{"date": "2026-11-11", "price": "749.00", "price_currency": "CZK", "sold": 15, "stock": 35, "visits": 82, "watchers": 7, "score": null, "rating_observed_at": null, "rating_product_id": null, "rating_distribution": null, "is_emphasized": false, "is_department_emphasized": false, "ads_source": null, "ads_views": 0, "ads_clicks": 0, "ads_cost": "0.00", "ads_cost_currency": "PLN", "ads_return": "0.00", "ads_return_currency": "PLN", "price_position": null, "price_positions": null, "price_difference": null, "badges": [], "relevance_position": 12, "competition": null, "competition_measurements": []}, {"date": "2026-11-10", "price": "129.99", "price_currency": "PLN", "sold": 13, "stock": 37, "visits": 74, "watchers": 6, "score": 490, "rating_observed_at": "2026-11-10T06:18:32+01:00", "rating_product_id": "8db9f323-95e6-49b5-98fa-5539d5caa293", "rating_distribution": {"1": 0, "2": 0, "3": 0, "4": 1, "5": 9}, "is_emphasized": false, "is_department_emphasized": false, "ads_source": "xlsx", "ads_views": 720, "ads_clicks": 24, "ads_cost": "40.00", "ads_cost_currency": "PLN", "ads_return": "3.50", "ads_return_currency": "PLN", "price_position": 2, "price_positions": 8, "price_difference": "-5.00", "badges": [], "relevance_position": 15, "competition_measurements": [{"marketplace_id": "allegro-cz", "status": "reserved", "source": "scanner", "checked_at": null, "own_price": "749.00", "reference_price": null, "currency": "CZK", "reason": "", "price_position": null, "price_positions": null, "price_difference": null}, {"marketplace_id": "allegro-pl", "status": "ok", "source": "scanner", "checked_at": "2026-11-10T05:18:32+00:00", "own_price": "129.99", "reference_price": "124.99", "currency": "PLN", "reason": "", "price_position": 2, "price_positions": 8, "price_difference": "-5.00"}], "competition": {"marketplace_id": "allegro-pl", "status": "ok", "source": "scanner", "checked_at": "2026-11-10T05:18:32+00:00", "own_price": "129.99", "reference_price": "124.99", "currency": "PLN", "reason": "", "price_position": 2, "price_positions": 8, "price_difference": "-5.00"}}, {"date": "2026-11-09", "price": "129.99", "price_currency": "PLN", "sold": 12, "stock": 38, "visits": 61, "watchers": 5, "score": null, "rating_observed_at": null, "rating_product_id": null, "rating_distribution": null, "is_emphasized": false, "is_department_emphasized": false, "ads_source": "manager", "ads_views": 0, "ads_clicks": 0, "ads_cost": "0.00", "ads_cost_currency": "PLN", "ads_return": "0.00", "ads_return_currency": "PLN", "price_position": null, "price_positions": null, "price_difference": null, "badges": [], "relevance_position": 18, "competition": null, "competition_measurements": []}], "events": [{"date": "2026-11-10", "event_type": 3, "event_type_display": "Zmiana miniaturki", "event_data": {"before": "https://example.com/czajnik-1.jpg", "after": "https://example.com/czajnik-2.jpg"}, "id": null, "created": null}, {"date": "2026-11-10", "event_type": 2, "event_type_display": "Zmiana nazwy", "event_data": {"before": "Czajnik elektryczny 1,7 l", "after": "Czajnik elektryczny 1,7 l ze stali nierdzewnej"}, "id": null, "created": null}]}}}}, "400": {"description": "Niepoprawny identyfikator oferty lub parametry zapytania (invalid_request).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Brak dostępu do historii skanera.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Skaner firmy nie zawiera oferty o podanym numerze (offer_not_found).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Przekroczono limit żądań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa jest chwilowo niedostępna.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/me": {"get": {"operationId": "getCurrentApiContext", "summary": "Pobierz kontekst bieżącego klucza API", "description": "Zwraca firmę przypisaną do klucza, przyznane scope’y, wersje API i kontraktu oraz puste pole limits. Nie zwraca danych użytkownika ani sekretów. Operacja nie wymaga dodatkowego scope’u.", "tags": ["Kontekst API"], "security": [{"BearerAuth": []}], "x-required-scopes": [], "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl 'https://api.niezbedniksprzedawcy.pl/v1/me' \\\n  --header 'Authorization: Bearer <api_key>'"}], "responses": {"200": {"description": "Kontekst uwierzytelnionego klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicMe"}, "example": {"company": {"id": "123", "name": "Przykładowy Sprzedawca"}, "scopes": ["connections:read", "message_channels.inbound_messages:write", "orders:write", "repricer.competitor_reports:write", "repricer.listings:read", "repricer.listings:write"], "limits": [], "api_version": "v1", "contract_version": "1.20.0"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony infrastrukturalny limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Uwierzytelnianie jest chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/connections": {"get": {"operationId": "listConnections", "summary": "Pobierz połączenia firmy", "description": "Zwraca aktywne konta sprzedażowe firmy przypisanej do klucza. Połączenie wymagające ponownej autoryzacji pozostaje widoczne ze statusem disconnected. Odpowiedź nie zawiera tokenów, haseł ani scope’ów OAuth dostawcy. Kolekcja jest zwracana w całości, bez paginacji. Wymagany scope: connections:read.", "tags": ["Połączenia"], "security": [{"BearerAuth": []}], "x-required-scopes": ["connections:read"], "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl 'https://api.niezbedniksprzedawcy.pl/v1/connections' \\\n  --header 'Authorization: Bearer <api_key>'"}], "responses": {"200": {"description": "Lista aktywnych połączeń firmy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicConnections"}, "examples": {"connectedAccounts": {"summary": "Konto połączone i konto wymagające autoryzacji", "value": {"connections": [{"id": "19", "channel": "allegro", "marketplace_id": "allegro-pl", "name": "sklep_demo", "external_id": "12345678", "status": "connected"}, {"id": "20", "channel": "empik", "marketplace_id": null, "name": "sklep_demo_empik", "external_id": "54321", "status": "disconnected"}]}}, "noAccounts": {"summary": "Brak aktywnych kont", "value": {"connections": []}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u connections:read.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony infrastrukturalny limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Uwierzytelnianie lub odczyt połączeń jest chwilowo niedostępny.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/order-sources/{source_id}/orders": {"post": {"operationId": "createOrder", "summary": "Utwórz zamówienie", "description": "Tworzy lokalne zamówienie w aktywnym, nazwanym źródle API utworzonym wcześniej przez użytkownika w panelu. Identyfikator źródła jest związany z firmą klucza API i nie może wskazywać źródła innej firmy. Operacja wymaga scope’u orders:write oraz nagłówka Idempotency-Key. Ponowienie identycznego payloadu JSON z tym samym kluczem dla tego samego, nadal aktywnego źródła zwraca zapamiętaną odpowiedź 201 i Idempotency-Replayed: true. Użycie tego samego klucza z innym payloadem albo ponowna próba utworzenia tego samego zamówienia źródłowego zwraca 409. Endpoint nie inicjuje płatności, nie wysyła powiadomień oraz nie rezerwuje ani nie zmniejsza stanu magazynowego. Sekcja shipping wymaga stabilnego method_id. Nieznana metoda nie blokuje utworzenia zamówienia: odpowiedź zwraca status unmapped i ostrzeżenie, a metoda pojawia się w panelu Dopasowania dostaw. Po przypisaniu bezpośredniej usługi InPost albo DPD kolejne zamówienia otrzymują ją automatycznie. Opcjonalne packages zapisuje parametry paczek; bez tej listy używana jest jedna paczka z domyślnymi parametrami przewoźnika. Odpowiedź 201 nie zawiera danych osobowych klienta ani adresów.", "tags": ["Zamówienia"], "security": [{"BearerAuth": []}], "x-required-scopes": ["orders:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL — pełne zamówienie", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/order-sources/<source_id>/orders' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: order-PM-2026-00042' \\\n  --data '{\n  \"source\": {\n    \"external_order_id\": \"PM-2026-00042\",\n    \"url\": \"https://partner.example/orders/PM-2026-00042\"\n  },\n  \"ordered_at\": \"2026-08-06T09:15:00Z\",\n  \"currency\": \"PLN\",\n  \"prices_include_tax\": true,\n  \"inventory_behavior\": \"bypass\",\n  \"payment\": {\n    \"method\": \"online\",\n    \"status\": \"paid\",\n    \"paid_amount\": {\n      \"amount\": \"94.79\",\n      \"currency\": \"PLN\"\n    },\n    \"provider\": \"payu\",\n    \"transaction_id\": \"pay_123\",\n    \"paid_at\": \"2026-08-06T09:16:00Z\"\n  },\n  \"customer\": {\n    \"external_id\": \"customer-42\",\n    \"email\": \"jan.kowalski@example.com\",\n    \"phone\": \"+48123123123\",\n    \"first_name\": \"Jan\",\n    \"last_name\": \"Kowalski\"\n  },\n  \"shipping_address\": {\n    \"first_name\": \"Jan\",\n    \"last_name\": \"Kowalski\",\n    \"email\": \"jan.kowalski@example.com\",\n    \"phone\": \"+48123123123\",\n    \"address_line_1\": \"Prosta 1\",\n    \"city\": \"Warszawa\",\n    \"postal_code\": \"00-001\",\n    \"country_code\": \"PL\"\n  },\n  \"billing_address\": {\n    \"company\": \"Przykładowa Firma Sp. z o.o.\",\n    \"tax_id\": \"PL1234567890\",\n    \"address_line_1\": \"Prosta 1\",\n    \"city\": \"Warszawa\",\n    \"postal_code\": \"00-001\",\n    \"country_code\": \"PL\"\n  },\n  \"invoice_required\": true,\n  \"line_items\": [\n    {\n      \"external_line_id\": \"1\",\n      \"external_product_id\": \"product-123\",\n      \"sku\": \"KUB-001\",\n      \"gtin\": \"5901234123457\",\n      \"name\": \"Kubek ceramiczny\",\n      \"quantity\": 2,\n      \"unit\": \"pcs\",\n      \"unit_price\": {\n        \"amount\": \"39.90\",\n        \"currency\": \"PLN\"\n      },\n      \"tax_rate\": 23,\n      \"attributes\": [\n        {\n          \"name\": \"color\",\n          \"value\": \"blue\"\n        }\n      ]\n    }\n  ],\n  \"shipping\": {\n    \"method_id\": \"inpost-locker\",\n    \"method_name\": \"Kurier\",\n    \"cost\": {\n      \"amount\": \"14.99\",\n      \"currency\": \"PLN\"\n    },\n    \"tax_rate\": 23,\n    \"packages\": [\n      {\n        \"template\": \"small\",\n        \"weight_kg\": \"1.250\"\n      }\n    ]\n  },\n  \"expected_total\": {\n    \"amount\": \"94.79\",\n    \"currency\": \"PLN\"\n  },\n  \"customer_note\": \"Proszę zadzwonić przed dostawą.\",\n  \"warehouse_note\": \"Pakować ostrożnie.\"\n}'"}, {"lang": "Shell", "label": "cURL — minimalne zamówienie", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/order-sources/<source_id>/orders' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: order-PM-2026-00043' \\\n  --data '{\n  \"source\": {\n    \"external_order_id\": \"PM-2026-00043\"\n  },\n  \"currency\": \"PLN\",\n  \"payment\": {\n    \"method\": \"bank_transfer\",\n    \"status\": \"pending\"\n  },\n  \"line_items\": [\n    {\n      \"external_line_id\": \"1\",\n      \"name\": \"Kubek ceramiczny\",\n      \"quantity\": 1,\n      \"unit_price\": {\n        \"amount\": \"39.90\",\n        \"currency\": \"PLN\"\n      }\n    }\n  ]\n}'"}], "parameters": [{"name": "source_id", "in": "path", "required": true, "description": "UUID aktywnego źródła zamówień utworzonego w panelu Niezbędnika Sprzedawcy.", "schema": {"type": "string", "format": "uuid"}, "example": "11111111-1111-4111-8111-111111111111"}, {"name": "Idempotency-Key", "in": "header", "required": true, "description": "Klucz idempotencji dla utworzenia zamówienia w konkretnym źródle. Może zawierać litery, cyfry, kropki, podkreślenia, dwukropki i łączniki. Ten sam klucz i identyczny payload JSON zwracają pierwotny wynik; ten sam klucz z innym payloadem zwraca 409 idempotency_conflict. Nowy klucz dla istniejącego external_order_id w tym samym źródle zwraca 409 external_order_id_conflict; nie aktualizuje zamówienia. Różne źródła mają osobne przestrzenie identyfikatorów zamówień i kluczy idempotencji.", "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{8,128}$"}, "example": "order-PM-2026-00042"}], "requestBody": {"required": true, "description": "Dokument JSON o rozmiarze nieprzekraczającym 512 KiB. Przykład cURL „minimalne zamówienie” zawiera tylko wymagane pola: source, currency, payment i line_items. Tworzy zamówienie na jeden kubek za 39.90 PLN oczekujące na przelew, bez danych dostawy i faktury.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicOrderCreate"}, "example": {"source": {"external_order_id": "PM-2026-00042", "url": "https://partner.example/orders/PM-2026-00042"}, "ordered_at": "2026-08-06T09:15:00Z", "currency": "PLN", "prices_include_tax": true, "inventory_behavior": "bypass", "payment": {"method": "online", "status": "paid", "paid_amount": {"amount": "94.79", "currency": "PLN"}, "provider": "payu", "transaction_id": "pay_123", "paid_at": "2026-08-06T09:16:00Z"}, "customer": {"external_id": "customer-42", "email": "jan.kowalski@example.com", "phone": "+48123123123", "first_name": "Jan", "last_name": "Kowalski"}, "shipping_address": {"first_name": "Jan", "last_name": "Kowalski", "email": "jan.kowalski@example.com", "phone": "+48123123123", "address_line_1": "Prosta 1", "city": "Warszawa", "postal_code": "00-001", "country_code": "PL"}, "billing_address": {"company": "Przykładowa Firma Sp. z o.o.", "tax_id": "PL1234567890", "address_line_1": "Prosta 1", "city": "Warszawa", "postal_code": "00-001", "country_code": "PL"}, "invoice_required": true, "line_items": [{"external_line_id": "1", "external_product_id": "product-123", "sku": "KUB-001", "gtin": "5901234123457", "name": "Kubek ceramiczny", "quantity": 2, "unit": "pcs", "unit_price": {"amount": "39.90", "currency": "PLN"}, "tax_rate": 23, "attributes": [{"name": "color", "value": "blue"}]}], "shipping": {"method_id": "inpost-locker", "method_name": "Kurier", "cost": {"amount": "14.99", "currency": "PLN"}, "tax_rate": 23, "packages": [{"template": "small", "weight_kg": "1.250"}]}, "expected_total": {"amount": "94.79", "currency": "PLN"}, "customer_note": "Proszę zadzwonić przed dostawą.", "warehouse_note": "Pakować ostrożnie."}}}}, "responses": {"201": {"description": "Zamówienie utworzone albo odtworzona odpowiedź wcześniejszego identycznego żądania.", "headers": {"Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicOrderCreated"}, "example": {"id": "98765", "number": "10042", "source": {"source_id": "11111111-1111-4111-8111-111111111111", "name": "Partner Marketplace", "external_order_id": "PM-2026-00042", "url": "https://partner.example/orders/PM-2026-00042"}, "status": "ready_for_processing", "payment_status": "paid", "fulfillment_status": "unfulfilled", "inventory_behavior": "bypass", "currency": "PLN", "prices_include_tax": true, "totals": {"items": {"amount": "79.80", "currency": "PLN"}, "shipping": {"amount": "14.99", "currency": "PLN"}, "grand_total": {"amount": "94.79", "currency": "PLN"}}, "line_items": [{"id": "543210", "external_line_id": "1", "sku": "KUB-001", "name": "Kubek ceramiczny", "quantity": 2, "unit": "pcs", "unit_price": {"amount": "39.90", "currency": "PLN"}}], "shipping": {"method_id": "inpost-locker", "method_name": "Kurier", "mapping_status": "mapped", "package_count": 1}, "warnings": [], "ordered_at": "2026-08-06T09:15:00Z", "created_at": "2026-08-06T09:17:12Z"}}}}, "400": {"description": "error.code: idempotency_key_required (brak nagłówka), invalid_idempotency_key (niepoprawny format nagłówka) albo invalid_request (niepoprawny JSON lub payload). Błędy walidacji pól znajdują się w error.details.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}, "invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The order payload is invalid.", "details": {"source": ["This field is required."]}}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak klucza API: authentication_required; niepoprawny lub nieaktywny klucz: invalid_api_key.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "insufficient_scope: klucz nie ma scope’u orders:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "order_source_not_found: źródło nie istnieje, jest wyłączone albo nie należy do firmy klucza API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"order_source_not_found": {"summary": "order_source_not_found", "value": {"error": {"code": "order_source_not_found", "message": "The order source does not exist or is inactive."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "idempotency_conflict: ten sam klucz idempotencji został użyty z innym payloadem. external_order_id_conflict: przy nowym kluczu istnieje już zamówienie o tym samym źródle i external_order_id.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different request payload."}, "request_id": "example-request-42"}}, "external_order_id_conflict": {"summary": "external_order_id_conflict", "value": {"error": {"code": "external_order_id_conflict", "message": "An order with this source and external order ID already exists."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "request_too_large: body żądania przekracza obsługiwane 512 KiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "unsupported_media_type: nieobsługiwany Content-Type; wymagany jest application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "rate_limit_exceeded: przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "temporarily_unavailable: uwierzytelnianie lub baza zamówień są chwilowo niedostępne. idempotency_state_unavailable: zapisany stan wcześniejszego żądania jest niekompletny. Ponów to samo żądanie z tym samym Idempotency-Key po czasie Retry-After (30 sekund).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/message-channels/{channel_id}/inbound-messages": {"post": {"operationId": "createInboundMessage", "summary": "Dodaj wiadomość przychodzącą do własnego kanału", "description": "Tworzy albo aktualizuje wątek wskazany przez external_thread_id i dodaje wiadomość klienta. Identyfikatory integratora są zapisywane bez dodatkowych tabel mapujących. Operacja wymaga scope’u message_channels.inbound_messages:write i nagłówka Idempotency-Key. Ten sam klucz z identycznym JSON-em odtwarza pierwotną odpowiedź 201, a użycie tego klucza z innym JSON-em zwraca 409. Kolejność pól obiektu JSON i odstępy między nimi nie mają znaczenia dla porównania. Klucz jest wspólny dla kluczy API tej samej firmy, w obrębie metody i pełnej ścieżki endpointu. Załączniki należy najpierw przesłać osobnym endpointem multipart, a następnie podać ich attachment_ids.", "tags": ["Komunikator"], "security": [{"BearerAuth": []}], "x-required-scopes": ["message_channels.inbound_messages:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/inbound-messages' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: contact-msg-000042' \\\n  --data '{\n    \"external_message_id\": \"msg-2026-000042\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"sent_at\": \"2026-08-28T12:15:00Z\",\n    \"sender\": {\n      \"external_id\": \"customer-987\",\n      \"name\": \"Jan Kowalski\",\n      \"email\": \"jan@example.com\"\n    },\n    \"subject\": \"Pytanie o zamówienie\",\n    \"text\": \"Czy moje zamówienie zostało już wysłane?\"\n  }'"}, {"lang": "Shell", "label": "cURL — z załącznikiem", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/inbound-messages' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: contact-msg-000043' \\\n  --data '{\n    \"external_message_id\": \"msg-2026-000043\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"sent_at\": \"2026-08-28T12:16:00Z\",\n    \"sender\": {\n      \"external_id\": \"customer-987\",\n      \"name\": \"Jan Kowalski\",\n      \"email\": \"jan@example.com\"\n    },\n    \"text\": \"W załączniku przesyłam dokument.\",\n    \"attachment_ids\": [\n      \"22222222-2222-4222-8222-222222222222\"\n    ]\n  }'"}], "parameters": [{"name": "channel_id", "in": "path", "required": true, "description": "UUID widoczny przy kanale w panelu.", "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{8,128}$"}, "example": "contact-form-msg-000042"}], "requestBody": {"required": true, "description": "Dokument JSON o rozmiarze nieprzekraczającym 512 KiB.\n\nWiadomość musi zawierać tekst z co najmniej jednym znakiem innym niż biały albo co najmniej jeden załącznik. Pola tekstowe nie mogą zawierać znaków NUL. Białe znaki na początku i końcu identyfikatorów oraz tematu są usuwane; pole text zachowuje białe znaki.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicInboundMessage"}, "examples": {"textMessage": {"summary": "Wiadomość tekstowa", "value": {"external_message_id": "msg-2026-000042", "external_thread_id": "contact-form-000042", "sent_at": "2026-08-28T12:15:00Z", "sender": {"external_id": "customer-987", "name": "Jan Kowalski", "email": "jan@example.com"}, "subject": "Pytanie o zamówienie", "text": "Czy moje zamówienie zostało już wysłane?"}}, "messageWithAttachment": {"summary": "Wiadomość z przesłanym plikiem", "value": {"external_message_id": "msg-2026-000043", "external_thread_id": "contact-form-000042", "sent_at": "2026-08-28T12:15:00Z", "sender": {"external_id": "customer-987", "name": "Jan Kowalski", "email": "jan@example.com"}, "subject": "Pytanie o zamówienie", "text": "W załączniku przesyłam dokument.", "attachment_ids": ["22222222-2222-4222-8222-222222222222"]}}, "attachmentsOnly": {"summary": "Sam załącznik, bez pola text", "description": "Użyj identyfikatora ważnego, jeszcze niewykorzystanego uploadu w tym kanale.", "value": {"external_message_id": "msg-2026-000044", "external_thread_id": "contact-form-000042", "sent_at": "2026-08-28T12:17:00Z", "sender": {"external_id": "customer-987", "name": "Jan Kowalski"}, "attachment_ids": ["22222222-2222-4222-8222-222222222222"]}}}}}}, "responses": {"201": {"description": "Wiadomość utworzona albo odtworzona odpowiedź identycznego żądania.", "headers": {"Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicInboundMessageCreated"}, "example": {"id": "98765", "channel_id": "11111111-1111-4111-8111-111111111111", "external_thread_id": "contact-form-000042", "external_message_id": "msg-2026-000042", "attachment_ids": [], "created_at": "2026-08-28T12:15:01Z"}}}}, "400": {"description": "Niepoprawny nagłówek lub payload JSON albo suma rozmiarów załączników przekraczająca 25 MiB (attachment_total_too_large).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}, "invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The inbound message payload is invalid.", "details": {"sender": ["This field is required."]}}, "request_id": "example-request-42"}}, "attachment_total_too_large": {"summary": "attachment_total_too_large", "value": {"error": {"code": "attachment_total_too_large", "message": "Attachments in one message must not exceed 25 MB in total."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u message_channels.inbound_messages:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Kanał nie istnieje, jest wyłączony lub jest obcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"message_channel_not_found": {"summary": "message_channel_not_found", "value": {"error": {"code": "message_channel_not_found", "message": "The message channel was not found or is inactive."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji (idempotency_conflict), zduplikowany identyfikator wiadomości w tym wątku (external_message_id_conflict) albo upload, który nie istnieje, wygasł, został zużyty lub należy do innego kanału (attachment_unavailable).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different request payload."}, "request_id": "example-request-42"}}, "external_message_id_conflict": {"summary": "external_message_id_conflict", "value": {"error": {"code": "external_message_id_conflict", "message": "A message with this external_thread_id and external_message_id already exists."}, "request_id": "example-request-42"}}, "attachment_unavailable": {"summary": "attachment_unavailable", "value": {"error": {"code": "attachment_unavailable", "message": "One or more attachments were not found, expired, belong to another channel, or have already been used."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Body żądania przekracza obsługiwany rozmiar.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany jest Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa lub stan idempotencji są niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/message-channels/{channel_id}/attachment-uploads": {"post": {"operationId": "uploadMessageChannelAttachment", "summary": "Prześlij załącznik do własnego kanału", "description": "Przesyła jeden plik multipart/form-data i zwraca identyfikator, który można podać w attachment_ids wiadomości przychodzącej. Plik jest przypisany do wskazanego kanału, może zostać użyty tylko raz i wygasa po 24 godzinach. Maksymalny rozmiar pliku to 10 MiB (10485760 bajtów), a całego żądania multipart 11 MiB (11534336 bajtów). Plik nie może być pusty; nazwa po usunięciu ścieżki i znaków sterujących może mieć do 200 znaków. Obsługiwane rozszerzenia: jpg, jpeg, png, gif, webp, pdf, txt, csv, docx i xlsx. Wymagany jest scope message_channels.inbound_messages:write oraz Idempotency-Key. Wyślij dokładnie jeden plik w polu file, bez innych pól formularza. Zawartość pliku musi odpowiadać rozszerzeniu; content_type w odpowiedzi jest ustalany na podstawie zweryfikowanego rozszerzenia. Pliki txt i csv muszą być zakodowane w UTF-8 i nie mogą zawierać znaków NUL. Pliki docx i xlsx muszą być poprawnymi dokumentami OOXML bez makr.\n\nTen sam Idempotency-Key w tym kanale i endpoincie, dla tej samej firmy, odtwarza pierwotną odpowiedź 201, jeśli nazwa pliku po normalizacji i jego zawartość są takie same. Zmiana tych danych zwraca 409 idempotency_conflict. Odtworzenie odpowiedzi nie odnawia expires_at ani nie przywraca zużytego uploadu. Aby ponownie przesłać wygasły lub zużyty plik, użyj nowego klucza idempotencji.", "tags": ["Komunikator"], "security": [{"BearerAuth": []}], "x-required-scopes": ["message_channels.inbound_messages:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/message-channels/<channel_id>/attachment-uploads' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Idempotency-Key: contact-file-000042' \\\n  --form 'file=@faktura.pdf'"}], "parameters": [{"name": "channel_id", "in": "path", "required": true, "description": "UUID widoczny przy kanale w panelu.", "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{8,128}$"}, "example": "contact-file-000042"}], "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "additionalProperties": false, "required": ["file"], "properties": {"file": {"type": "string", "format": "binary"}}}}}}, "responses": {"201": {"description": "Nowy załącznik ważny przez 24 godziny od przyjęcia albo odtworzona pierwotna odpowiedź z niezmienionymi id i expires_at. Replay nie odnawia ważności ani dostępności uploadu.", "headers": {"Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicChannelAttachmentCreated"}, "example": {"id": "22222222-2222-4222-8222-222222222222", "channel_id": "11111111-1111-4111-8111-111111111111", "filename": "faktura.pdf", "content_type": "application/pdf", "size_bytes": 48231, "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "expires_at": "2026-08-29T12:14:00Z"}}}}, "400": {"description": "Niepoprawny nagłówek lub formularz albo niepoprawny plik (invalid_attachment), w tym pusty plik lub rozmiar przekraczający 10 MiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}, "invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "Send exactly one multipart file in the \"file\" field and do not include other form fields."}, "request_id": "example-request-42"}}, "invalid_attachment": {"summary": "invalid_attachment", "value": {"error": {"code": "invalid_attachment", "message": "Attachment must not exceed 10 MB."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u message_channels.inbound_messages:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Kanał nie istnieje, jest wyłączony lub jest obcy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"message_channel_not_found": {"summary": "message_channel_not_found", "value": {"error": {"code": "message_channel_not_found", "message": "The message channel was not found or is inactive."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt klucza idempotencji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different attachment."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Całe żądanie multipart przekracza limit 11 MiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany jest Content-Type multipart/form-data.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Usługa lub stan idempotencji są niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/usage": {"get": {"operationId": "getRepricerUsage", "summary": "Pobierz wykorzystanie pakietu repricera", "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl --request GET \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/usage' \\\n  --header 'Authorization: Bearer <api_key>'"}], "description": "Zwraca saldo, wykorzystanie i okres ważności pakietu sprawdzeń ofert konkurencyjnych. Odczyt nie zużywa sprawdzenia i także przy braku pakietu zwraca 200.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["repricer.competitor_reports:write", "repricer.listings:read", "repricer.listings:write"], "responses": {"200": {"description": "Bieżący stan pakietu sprawdzeń.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerUsage"}, "example": {"competitor_checks": {"active": true, "total": 1000, "used": 100, "remaining": 900, "valid_from": "2026-09-01T00:00:00Z", "valid_until": "2026-09-30T23:59:59Z"}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma żadnego ze scope’ów: repricer.competitor_reports:write, repricer.listings:read lub repricer.listings:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Rejestr rozliczeń jest niedostępny.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/competitor-reports": {"post": {"operationId": "createCompetitorReport", "summary": "Zleć raport konkurencji dla jednego EAN-u lub paczki", "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/competitor-reports' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: repricer-batch-2026-09-09-001' \\\n  --data '{\n  \"marketplace_id\": \"allegro-pl\",\n  \"eans\": [\n    \"5901234123457\",\n    \"5901234123458\"\n  ],\n  \"filters\": {\n    \"has_smart\": true,\n    \"condition\": \"new\",\n    \"shipping_country\": \"PL\"\n  }\n}'"}], "description": "Wyszukuje oferty konkurencji po kodzie EAN dla jednego kodu lub listy kodów. Wyniki nie gwarantują potwierdzonego dopasowania GTIN. Atomowo rezerwuje po jednym sprawdzeniu na każdy EAN i tworzy trwałe zlecenie asynchroniczne. Odpowiedź 202 potwierdza trwały zapis zlecenia; jeśli pierwsza publikacja do workera się nie powiedzie, polling i okresowy dispatcher ponowią ją bez ponownego obciążenia.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.competitor_reports:write"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "description": "Idempotencja jest związana z firmą, metodą, ścieżką i payloadem JSON. Kolejność kluczy obiektu i formatowanie JSON nie mają znaczenia; kolejność EAN-ów i jawnie podane wartości mają. Zmiana payloadu przy tym samym kluczu daje 409. Powtórzenie odtwarza pierwotną odpowiedź 202, a nie aktualny stan raportu.", "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{8,128}$"}, "example": "repricer-batch-2026-09-09-001"}], "requestBody": {"required": true, "description": "Kontrolowana paczka od 1 do 10000 unikalnych EAN-ów.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompetitorReportCreate"}, "example": {"marketplace_id": "allegro-pl", "eans": ["5901234123457", "5901234123458"], "filters": {"has_smart": true, "condition": "new", "shipping_country": "PL"}}}}}, "responses": {"202": {"description": "Zlecenie przyjęte albo odtworzona odpowiedź identycznego żądania. W przykładzie Location to /v1/repricer/competitor-reports/7d40f6a2-c93b-4b22-95c7-0cf55ee62e72, Retry-After: 5 i Idempotency-Replayed: false przy pierwszym przyjęciu.", "headers": {"Location": {"description": "Ścieżka odczytu stanu raportu.", "schema": {"type": "string"}, "example": "/v1/repricer/competitor-reports/7d40f6a2-c93b-4b22-95c7-0cf55ee62e72"}, "Retry-After": {"description": "Liczba sekund przed kolejnym odczytem stanu raportu.", "schema": {"type": "integer", "minimum": 1}, "example": 5}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompetitorReport"}, "example": {"id": "7d40f6a2-c93b-4b22-95c7-0cf55ee62e72", "status": "queued", "marketplace_id": "allegro-pl", "filters": {"has_smart": true, "condition": "new", "shipping_country": "PL"}, "cost": {"reserved": 2, "refunded": 0, "charged": 2, "unit": "check"}, "progress": {"total": 2, "completed": 0, "failed": 0, "pending": 2}, "items": [{"ean": "5901234123457", "status": "queued", "checked_at": null, "result": null, "error": null}, {"ean": "5901234123458", "status": "queued", "checked_at": null, "result": null, "error": null}], "pagination": {"limit": 100, "has_more": false, "next_cursor": null}, "export": {"status": "pending", "format": "csv_zip", "download_url": null, "size_bytes": null, "generated_at": null, "expires_at": null, "error_code": null}, "created_at": "2026-09-09T09:00:00Z", "started_at": null, "completed_at": null}}}}, "402": {"description": "Brak całego salda wymaganego do atomowej rezerwacji paczki.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompetitorReportPaymentRequired"}, "example": {"error": {"code": "competitor_checks_required", "message": "There are not enough competitor checks to reserve this report batch.", "details": {"required_checks": 2, "remaining_checks": 1}, "purchase_url": "https://niezbedniksprzedawcy.pl/app/sklep/konkurent-cen-allegro/"}, "request_id": "example-repricer-report-402"}}}}, "400": {"description": "Brak lub błędny Idempotency-Key albo niepoprawny payload.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}, "invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The competitor report payload is invalid.", "details": {"eans": ["This field is required."]}}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u repricer.competitor_reports:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Konflikt idempotencji.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different request payload."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Body przekracza obsługiwane 512 KiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Nieobsługiwany Content-Type; wymagany JSON.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Rozliczenia albo trwały stan idempotencji są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/competitor-reports/{report_id}": {"get": {"operationId": "getCompetitorReport", "summary": "Pobierz stan i wynik raportu konkurencji", "x-codeSamples": [{"lang": "Shell", "label": "cURL", "source": "curl --request GET \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/competitor-reports/7d40f6a2-c93b-4b22-95c7-0cf55ee62e72?limit=100' \\\n  --header 'Authorization: Bearer <api_key>'"}], "description": "Zwraca postęp całego raportu i jedną stronę maksymalnie 100 pozycji. Przy tworzeniu zbiorczego wyniku dostępne są najpierw liczniki progress. Do czasu przygotowania wyniku lista items może być pusta, has_more ma wartość false, a next_cursor jest pusty. Odczytaj stan ponownie po Retry-After. Kolejne strony gotowych wyników pobiera się przez next_cursor. Pozycje zachowują kolejność EAN-ów z żądania. progress.pending obejmuje pozycje queued i running. Dla queued/running odpowiedź zawiera Retry-After: 5. completed, partially_failed i failed są stanami końcowymi raportu. Eksport ma osobny status; gdy wynosi pending lub building, odpowiedź również zawiera Retry-After: 5, także po zakończeniu raportu. Domyślny odstęp pollingu wynosi 5 sekund; respektuj Retry-After.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.competitor_reports:write"], "parameters": [{"name": "report_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "example": "7d40f6a2-c93b-4b22-95c7-0cf55ee62e72"}, {"name": "limit", "in": "query", "required": false, "description": "Liczba pozycji raportu na stronie.", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 100}}, {"name": "cursor", "in": "query", "required": false, "description": "Wartość next_cursor z poprzedniej strony.", "schema": {"type": "string", "maxLength": 2048}}], "responses": {"200": {"description": "Aktualny stan i dostępne wyniki zlecenia.", "headers": {"Retry-After": {"$ref": "#/components/headers/RetryAfter"}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompetitorReport"}, "example": {"id": "7d40f6a2-c93b-4b22-95c7-0cf55ee62e72", "status": "completed", "marketplace_id": "allegro-pl", "filters": {"has_smart": true, "condition": "new", "shipping_country": "PL"}, "cost": {"reserved": 2, "refunded": 0, "charged": 2, "unit": "check"}, "progress": {"total": 2, "completed": 2, "failed": 0, "pending": 0}, "items": [{"ean": "5901234123457", "status": "completed", "checked_at": "2026-09-09T09:00:03Z", "result": {"ean": "5901234123457", "marketplace_id": "allegro-pl", "checked_at": "2026-09-09T09:00:03Z", "total": 1, "limit": 60, "offset": 0, "offers": [{"offer_id": "10000000001", "url": "https://allegro.pl/oferta/kubek-ceramiczny-330-ml-10000000001", "name": "Kubek ceramiczny 330 ml", "seller_id": "10001", "seller_login": "SklepPrzykladowy", "price": {"amount": "39.90", "currency": "PLN"}, "delivery_price": {"amount": "0.00", "currency": "PLN"}, "stock": 12, "popularity": 24, "image": "https://cdn.example.com/kubek.jpg", "category_id": "48962", "has_free_delivery": true, "is_superseller": true, "is_company": true, "promotion_emphasized": false, "promotion_bold": false, "promotion_highlight": false, "checked_at": "2026-09-09T09:00:03Z"}]}, "error": null}, {"ean": "5901234123458", "status": "completed", "checked_at": "2026-09-09T09:00:04Z", "result": {"ean": "5901234123458", "marketplace_id": "allegro-pl", "checked_at": "2026-09-09T09:00:04Z", "total": 0, "limit": 60, "offset": 0, "offers": []}, "error": null}], "pagination": {"limit": 100, "has_more": false, "next_cursor": null}, "export": {"status": "ready", "format": "csv_zip", "download_url": "/v1/repricer/competitor-reports/7d40f6a2-c93b-4b22-95c7-0cf55ee62e72/export", "size_bytes": 625, "generated_at": "2026-09-09T09:00:08Z", "expires_at": "2026-09-12T09:00:08Z", "error_code": null}, "created_at": "2026-09-09T09:00:00Z", "started_at": "2026-09-09T09:00:01Z", "completed_at": "2026-09-09T09:00:05Z"}}}}, "400": {"description": "Niepoprawny limit albo kursor strony.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"invalid_cursor": {"summary": "invalid_cursor", "value": {"error": {"code": "invalid_cursor", "message": "The competitor report page cursor is invalid."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma wymaganego scope’u.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zlecenie nie istnieje dla tej firmy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"report_not_found": {"summary": "report_not_found", "value": {"error": {"code": "report_not_found", "message": "The competitor report was not found."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "rate_limit_exceeded: przekroczony limit zapytań. Limit Nginx wspólny dla odczytów raportów i eksportów per IP zwraca JSON, Retry-After: 5, Cache-Control: no-store oraz request_id zgodny z X-Request-ID. Odpowiedzi 429 aplikacji zachowują własny Retry-After.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Stan zlecenia jest chwilowo niedostępny.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/competitor-reports/{report_id}/export": {"get": {"operationId": "downloadCompetitorReportExport", "summary": "Pobierz wynik raportu jako CSV w ZIP", "x-codeSamples": [{"lang": "Shell", "label": "cURL — zapisz ZIP", "source": "curl --fail --request GET \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/competitor-reports/7d40f6a2-c93b-4b22-95c7-0cf55ee62e72/export' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --output 'competitor-offers-7d40f6a2-c93b-4b22-95c7-0cf55ee62e72.csv.zip'"}], "description": "Zwraca strumieniowo plik ZIP zawierający CSV UTF-8 z BOM i separatorem średnikowym. Każda oferta zajmuje osobny wiersz (maksymalnie 60 ofert na EAN); EAN bez ofert lub zakończony błędem również ma jeden wiersz. Link jest dostępny w polu export dopiero dla statusu ready, wymaga Bearer API key tej samej firmy i domyślnie wygasa po 7 dniach od wygenerowania. Ostateczny termin odczytaj z export.expires_at. Null jest pustą komórką, wartości logiczne mają zapis true/false. Tekst rozpoczynający się (także po białych znakach) od =, +, - lub @ jest poprzedzany apostrofem, aby arkusz nie interpretował go jako formuły.\n\nPrzykładowy CSV odpowiada wynikowi completed w GET raportu: pierwszy EAN ma jedną ofertę, a drugi nie ma ofert. Znaku BOM nie pokazano poniżej.\n\n```csv\nean;item_status;item_checked_at;error_code;marketplace_id;result_checked_at;result_total;offer_index;offer_id;url;name;seller_id;seller_login;price_amount;price_currency;delivery_price_amount;delivery_price_currency;stock;popularity;image;category_id;has_free_delivery;is_superseller;is_company;promotion_emphasized;promotion_bold;promotion_highlight;offer_checked_at\n5901234123457;completed;2026-09-09T09:00:03Z;;allegro-pl;2026-09-09T09:00:03Z;1;1;10000000001;https://allegro.pl/oferta/kubek-ceramiczny-330-ml-10000000001;Kubek ceramiczny 330 ml;10001;SklepPrzykladowy;39.90;PLN;0.00;PLN;12;24;https://cdn.example.com/kubek.jpg;48962;true;true;true;false;false;false;2026-09-09T09:00:03Z\n5901234123458;completed;2026-09-09T09:00:04Z;;allegro-pl;2026-09-09T09:00:04Z;0;;;;;;;;;;;;;;;;;;;;;\n```\n\noffer_index zaczyna się od 1 w obrębie EAN-u; dla pozycji bez ofert pozostaje pusty. error_code w CSV opisuje błąd przetwarzania pozycji i może różnić się od ogólnego report_item_failed w odpowiedzi JSON.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.competitor_reports:write"], "parameters": [{"name": "report_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "example": "7d40f6a2-c93b-4b22-95c7-0cf55ee62e72"}], "responses": {"200": {"description": "Gotowy eksport CSV skompresowany ZIP.", "headers": {"Content-Disposition": {"schema": {"type": "string"}}, "X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/zip": {"schema": {"type": "string", "format": "binary"}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma wymaganego scope’u.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zlecenie nie istnieje dla tej firmy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"report_not_found": {"summary": "report_not_found", "value": {"error": {"code": "report_not_found", "message": "The competitor report was not found."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Eksport nie jest jeszcze gotowy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"report_export_not_ready": {"summary": "report_export_not_ready", "value": {"error": {"code": "report_export_not_ready", "message": "The competitor report export is not ready yet."}, "request_id": "example-request-42"}}}}}}, "410": {"description": "Eksport wygasł.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"report_export_expired": {"summary": "report_export_expired", "value": {"error": {"code": "report_export_expired", "message": "The competitor report export has expired."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "rate_limit_exceeded: przekroczony limit zapytań. Limit Nginx wspólny dla odczytów raportów i eksportów per IP zwraca JSON, Retry-After: 5, Cache-Control: no-store oraz request_id zgodny z X-Request-ID. Odpowiedzi 429 aplikacji zachowują własny Retry-After.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Eksport nie mógł zostać udostępniony.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/offer-updates": {"post": {"operationId": "createRepricerOfferUpdate", "summary": "Zleć zbiorczą zmianę ustawień ofert", "description": "Przyjmuje trwałą paczkę od 1 do 1000 ofert. Każda pozycja podaje marketplace, offer_id i własne changes o takim samym znaczeniu jak body pojedynczego PATCH. Tryb danej oferty ustawisz w items[].changes.operating_mode. Sprzeczne wartości enabled i operating_mode w jednej pozycji odrzucają całą paczkę przed przyjęciem zlecenia (400 invalid_request). Pominięte pola zachowują wartość aktualną w chwili wykonania. Nieznane pola, puste changes i powtórzona para marketplace/offer_id odrzucają całą paczkę kodem 400. Limit JSON wynosi 512 KiB; rozbudowane filtry mogą wymagać mniejszych paczek.\n\n202 potwierdza przyjęcie zadania, nie zapis ustawień wszystkich ofert. Status odczytaj przez GET pod adresem Location lub status_url. Zadania jednej firmy wykonują się w kolejności przyjęcia, a pozycje w kolejności wejściowej. Ta gwarancja dotyczy wyłącznie zbiorczych zleceń; pojedynczy PATCH działa natychmiast i nie czeka na kolejkę.\n\nZapis nie przelicza konkurencji ani nie zmienia ceny w Allegro. Wyniki konkurencji zostaną odświeżone przy kolejnym zwykłym sprawdzeniu oferty. Zlecenie nie rezerwuje sprawdzeń.\n\nPowtórzenie identycznego żądania z tym samym Idempotency-Key odtwarza pierwotne 202 bez ponownego zlecenia zmian. Kolejność items jest częścią payloadu; inny payload z tym kluczem daje 409.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.listings:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL — różne ustawienia dla dwóch ofert", "source": "curl --request POST \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/offer-updates' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'Idempotency-Key: offer-updates-20261012-001' \\\n  --data '{\n  \"items\": [\n    {\n      \"marketplace\": \"allegro-pl\",\n      \"offer_id\": \"123456789\",\n      \"changes\": {\n        \"operating_mode\": \"observe\",\n        \"check_interval_minutes\": 60\n      }\n    },\n    {\n      \"marketplace\": \"allegro-pl\",\n      \"offer_id\": \"987654321\",\n      \"changes\": {\n        \"enabled\": false\n      }\n    }\n  ]\n}'"}], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 8, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{8,128}$"}, "example": "offer-updates-20261012-001"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerOfferUpdateCreate"}, "example": {"items": [{"marketplace": "allegro-pl", "offer_id": "123456789", "changes": {"operating_mode": "observe", "check_interval_minutes": 60}}, {"marketplace": "allegro-pl", "offer_id": "987654321", "changes": {"enabled": false}}]}}}}, "responses": {"202": {"description": "Paczka przyjęta lub odtworzona pierwotna odpowiedź.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Idempotency-Replayed": {"$ref": "#/components/headers/IdempotencyReplayed"}, "Location": {"$ref": "#/components/headers/Location"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerOfferUpdateAccepted"}, "example": {"id": "384a357e-ab13-4bd2-88f0-807191039ec2", "status": "queued", "item_count": 2, "status_url": "/v1/repricer/offer-updates/384a357e-ab13-4bd2-88f0-807191039ec2"}}}}, "400": {"description": "Niepoprawny payload, powtórzona oferta lub niepoprawny/brakujący Idempotency-Key.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_key_required": {"summary": "idempotency_key_required", "value": {"error": {"code": "idempotency_key_required", "message": "The Idempotency-Key header is required."}, "request_id": "example-request-42"}}, "invalid_idempotency_key": {"summary": "invalid_idempotency_key", "value": {"error": {"code": "invalid_idempotency_key", "message": "Idempotency-Key must contain 8-128 letters, digits, dots, underscores, colons, or hyphens."}, "request_id": "example-request-42"}}, "invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The offer update payload is invalid."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u repricer.listings:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Idempotency-Key użyto z innym payloadem (idempotency_conflict).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"idempotency_conflict": {"summary": "idempotency_conflict", "value": {"error": {"code": "idempotency_conflict", "message": "This Idempotency-Key was already used with a different request payload."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Body przekracza obsługiwane 512 KiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Wymagany Content-Type application/json.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Zlecanie zmian lub stan idempotencji są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/offer-updates/{update_id}": {"get": {"operationId": "getRepricerOfferUpdate", "summary": "Pobierz postęp i wyniki zbiorczej zmiany ustawień", "description": "Zwraca zlecenie należące do firmy klucza. Także odczyt wymaga repricer.listings:write. queued i running oznaczają zadanie w toku; completed oznacza sukces wszystkich pozycji, partially_failed częściowy sukces, a failed błąd wszystkich pozycji. Błędy poszczególnych ofert znajdują się w items[].error; HTTP pozostaje 200. Po 5 kolejnych próbach wysłania zadania bez postępu zlecenie jest kończone; niewykonane pozycje otrzymują kod update_retry_limit_exceeded. Zapis wyniku pozycji zeruje ten limit. Wcześniej ukończone zmiany pozostają zapisane. processed_count = succeeded_count + failed_count.\n\nitems zachowują kolejność wejściową. Kolejne strony pobieraj przez offset=pagination.next_offset przy has_more=true. Strona zawiera najwyżej 100 pozycji. Odczyt nie zmienia ani nie ponawia ukończonych zmian. Odpytuj domyślnie co 5 sekund; dla queued/running odpowiedź zawiera Retry-After: 2. Ta ścieżka korzysta z ogólnej puli 20 żądań/s na IP.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.listings:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL — status i pierwsza strona wyników", "source": "curl 'https://api.niezbedniksprzedawcy.pl/v1/repricer/offer-updates/384a357e-ab13-4bd2-88f0-807191039ec2?offset=0&limit=100' \\\n  --header 'Authorization: Bearer <api_key>'"}], "parameters": [{"name": "update_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "maximum": 1000, "default": 0}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 100}}], "responses": {"200": {"description": "Postęp zlecenia i strona wyników ofert.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerOfferUpdate"}, "example": {"id": "384a357e-ab13-4bd2-88f0-807191039ec2", "status": "partially_failed", "item_count": 2, "processed_count": 2, "succeeded_count": 1, "failed_count": 1, "created_at": "2026-10-12T10:00:00Z", "started_at": "2026-10-12T10:00:01Z", "completed_at": "2026-10-12T10:00:02Z", "items": [{"position": 0, "marketplace": "allegro-pl", "offer_id": "123456789", "status": "completed", "error": null}, {"position": 1, "marketplace": "allegro-pl", "offer_id": "987654321", "status": "failed", "error": {"code": "listing_not_found", "message": "The repricer listing does not exist.", "status": 404}}], "pagination": {"limit": 100, "offset": 0, "has_more": false, "next_offset": null}}}}}, "400": {"description": "Niepoprawne parametry stronicowania.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The offer update query is invalid."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u repricer.listings:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Zlecenie nie istnieje dla tej firmy (offer_update_not_found).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"offer_update_not_found": {"summary": "offer_update_not_found", "value": {"error": {"code": "offer_update_not_found", "message": "The offer update was not found."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Odczyt zlecenia jest chwilowo niedostępny.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/offers": {"get": {"operationId": "listRepricerOffers", "summary": "Pobierz oferty i reguły repricera", "description": "Pole automation.enabled ma wartość true dla observe i auto, a false dla off. Aby odczytać dokładny tryb wszystkich ofert na stronie, użyj `GET /v1/repricer/offers?include_operating_mode=true`. Tryb jednej oferty odczytasz przez `GET /v1/repricer/offers?id=12345678901&marketplace_id=allegro-pl&include_operating_mode=true`. W obu przypadkach wynik znajduje się w offers[].automation.operating_mode. Cursor jest podpisany i związany z firmą oraz aktywnymi filtrami. Domyślnie wygasa po 24 godzinach (400 invalid_cursor). Kolejne strony pobieraj z tymi samymi filtrami. Dodaj include_operating_mode=true do każdego żądania strony, na której chcesz zobaczyć tryb. Lista obejmuje wyłącznie oferty z aktywnych połączeń Allegro; connection_id oznacza identyfikator połączenia z GET /v1/connections.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-any-scopes": ["repricer.listings:read", "repricer.listings:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL — oferty z wyłączonym monitoringiem", "source": "curl --request GET \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/offers?connection_id=42&marketplace_id=allegro-pl&enabled=false&limit=50' \\\n  --header 'Authorization: Bearer <api_key>'"}], "parameters": [{"name": "id", "in": "query", "required": false, "description": "Identyfikator oferty Allegro w zakresie 1–9223372036854775807.", "schema": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}}, {"name": "connection_id", "in": "query", "required": false, "description": "Identyfikator połączenia w zakresie 1–9223372036854775807.", "schema": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}}, {"name": "marketplace_id", "in": "query", "required": false, "schema": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}}, {"name": "sku", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 250}}, {"name": "gtin", "in": "query", "required": false, "schema": {"type": "string", "pattern": "^[0-9]{8,14}$"}}, {"name": "enabled", "in": "query", "required": false, "description": "enabled=true zwraca oferty z włączonym monitoringiem w obu trybach. enabled=false zwraca oferty z wyłączonym monitoringiem. Pominięcie parametru zwraca oba zbiory.", "schema": {"type": "boolean"}}, {"name": "include_operating_mode", "in": "query", "required": false, "description": "Wartość true dodaje automation.operating_mode do każdej zwróconej oferty. Parametr możesz łączyć ze wszystkimi filtrami. Domyślnie odpowiedź zawiera dotychczasowy zestaw pól.", "schema": {"type": "boolean", "default": false}}, {"name": "listing_status", "in": "query", "required": false, "schema": {"type": "string", "enum": ["active", "inactive", "activating", "ended", "archived"]}}, {"name": "cursor", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 2048}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 50, "minimum": 1, "maximum": 100}}], "responses": {"200": {"description": "Strona ofert repricera.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerListings"}, "examples": {"default": {"summary": "Domyślna odpowiedź", "value": {"offers": [{"id": "12345678901", "connection_id": "42", "marketplace_id": "allegro-pl", "sku": "KUBEK-TERM-500", "gtin": "5901234123457", "name": "Kubek termiczny 500 ml", "image_url": "https://images.example.com/products/kubek-termiczny-500.jpg", "listing_status": "active", "current_price": {"amount": "49.90", "currency": "PLN"}, "stock": 12, "automation": {"enabled": false, "rule": {"strategy": "lowest_competitor", "minimum_price": null, "maximum_price": null, "step": {"amount": "0.01", "currency": "PLN"}, "check_interval_minutes": 60, "filters": {"same_gtin": true, "product_gtins": false, "manufacturer_code": false, "excluded_external_listing_ids": []}}, "last_checked_at": null, "last_price_changed_at": null}}], "pagination": {"limit": 50, "has_more": false, "next_cursor": null}}}, "withOperatingMode": {"summary": "Odpowiedź dla include_operating_mode=true", "value": {"offers": [{"id": "12345678901", "connection_id": "42", "marketplace_id": "allegro-pl", "sku": "KUBEK-TERM-500", "gtin": "5901234123457", "name": "Kubek termiczny 500 ml", "image_url": "https://images.example.com/products/kubek-termiczny-500.jpg", "listing_status": "active", "current_price": {"amount": "49.90", "currency": "PLN"}, "stock": 12, "automation": {"enabled": true, "operating_mode": "auto", "rule": {"strategy": "lowest_competitor", "minimum_price": {"amount": "39.90", "currency": "PLN"}, "maximum_price": {"amount": "59.90", "currency": "PLN"}, "step": {"amount": "0.01", "currency": "PLN"}, "check_interval_minutes": 15, "filters": {"same_gtin": true, "product_gtins": true, "manufacturer_code": false, "excluded_external_listing_ids": []}}, "last_checked_at": null, "last_price_changed_at": null}}], "pagination": {"limit": 50, "has_more": false, "next_cursor": null}}}}}}}, "400": {"description": "Niepoprawne lub niespójne parametry.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"invalid_cursor": {"summary": "invalid_cursor", "value": {"error": {"code": "invalid_cursor", "message": "The listings cursor is invalid, expired, or belongs to another query."}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u repricer.listings:read ani repricer.listings:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Dane repricera są chwilowo niedostępne.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}, "/v1/repricer/offers/{marketplace}/{offer_id}": {"patch": {"operationId": "updateRepricerOffer", "summary": "Zmień tryb lub regułę repricera dla oferty", "description": "Częściowo zmienia lokalną konfigurację repricingu; nie ustawia ceny oferty bezpośrednio na Allegro. Nie przelicza konkurencji. Wyniki konkurencji zostaną odświeżone przy kolejnym zwykłym sprawdzeniu oferty. Pole operating_mode przyjmuje off, observe albo auto. Samo enabled=true wznawia monitoring w trybie zapisanym dla oferty. Podanie operating_mode w żądaniu dodaje automation.operating_mode do odpowiedzi. Pominięcie tego pola w żądaniu zachowuje dotychczasowy format odpowiedzi. Włączenie trybu auto wymaga pól minimum_price i maximum_price. Włączenie monitoringu dla wyłączonego wielopaku wymaga zakresu również w trybie observe. Samo przełączenie aktywnego wielopaku z auto na observe jest możliwe także przy niepełnym zakresie. Podana cena minimalna musi wynosić co najmniej 1 w walucie rynku. product_gtins wymaga same_gtin, a krok musi należeć do opublikowanej allowlisty. Pominięte pola, także wewnątrz filters, zachowują wcześniejsze wartości. Nieznane pola i puste obiekty PATCH/filters są odrzucane (400).\n\nWłączenie monitoringu oraz przejście z observe na auto wymagają aktywnego, połączonego konta Allegro, skonfigurowanego i włączonego repricera firmy oraz aktywnego pakietu z wolnymi sprawdzeniami. Oferta musi mieć stan nowy i status ACTIVE, bez aktywnych oznaczeń lub kampanii Allegro i bez błędu odczytu ich stanu; automatyzacja ceny Allegro musi być wyłączona.\n\nBłędy 409 mają kody: invalid_rule_currency (waluta niezgodna z rynkiem), invalid_rule_amount (kwota niecałkowita dla CZK/HUF), invalid_price_range (niedozwolone granice cen), invalid_price_step (niedozwolony krok), invalid_competitor_filter (wykluczenie własnej oferty lub product_gtins bez same_gtin), price_range_required (brak wymaganych granic ceny), connection_unavailable, repricer_unavailable, listing_condition_unsupported, listing_archived, listing_not_active, marketplace_badge_active, marketplace_badge_status_unavailable albo marketplace_price_automation_enabled.", "tags": ["Repricer"], "security": [{"BearerAuth": []}], "x-required-scopes": ["repricer.listings:write"], "x-codeSamples": [{"lang": "Shell", "label": "cURL — konfiguracja reguły i włączenie monitoringu", "source": "curl --request PATCH \\\n  'https://api.niezbedniksprzedawcy.pl/v1/repricer/offers/allegro-pl/12345678901' \\\n  --header 'Authorization: Bearer <api_key>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"operating_mode\": \"auto\",\n  \"minimum_price\": {\n    \"amount\": \"39.90\",\n    \"currency\": \"PLN\"\n  },\n  \"maximum_price\": {\n    \"amount\": \"59.90\",\n    \"currency\": \"PLN\"\n  },\n  \"step\": {\n    \"amount\": \"0.01\",\n    \"currency\": \"PLN\"\n  },\n  \"check_interval_minutes\": 15,\n  \"filters\": {\n    \"same_gtin\": true,\n    \"product_gtins\": true,\n    \"manufacturer_code\": false,\n    \"excluded_external_listing_ids\": []\n  }\n}'"}], "parameters": [{"name": "marketplace", "in": "path", "required": true, "description": "Rynek Allegro konfiguracji repricera.", "schema": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}}, {"name": "offer_id", "in": "path", "required": true, "description": "Identyfikator oferty Allegro w zakresie 1–9223372036854775807.", "schema": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerListingPatch"}, "example": {"operating_mode": "auto", "minimum_price": {"amount": "39.90", "currency": "PLN"}, "maximum_price": {"amount": "59.90", "currency": "PLN"}, "step": {"amount": "0.01", "currency": "PLN"}, "check_interval_minutes": 15, "filters": {"same_gtin": true, "product_gtins": true, "manufacturer_code": false, "excluded_external_listing_ids": []}}}}}, "responses": {"200": {"description": "Zmieniona oferta repricera.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepricerListing"}, "example": {"id": "12345678901", "connection_id": "42", "marketplace_id": "allegro-pl", "sku": "KUBEK-TERM-500", "gtin": "5901234123457", "name": "Kubek termiczny 500 ml", "image_url": "https://images.example.com/products/kubek-termiczny-500.jpg", "listing_status": "active", "current_price": {"amount": "49.90", "currency": "PLN"}, "stock": 12, "automation": {"enabled": true, "operating_mode": "auto", "rule": {"strategy": "lowest_competitor", "minimum_price": {"amount": "39.90", "currency": "PLN"}, "maximum_price": {"amount": "59.90", "currency": "PLN"}, "step": {"amount": "0.01", "currency": "PLN"}, "check_interval_minutes": 15, "filters": {"same_gtin": true, "product_gtins": true, "manufacturer_code": false, "excluded_external_listing_ids": []}}, "last_checked_at": null, "last_price_changed_at": null}}}}}, "402": {"description": "Brak aktywnego pakietu lub wyczerpane saldo sprawdzeń przy włączaniu monitoringu lub przejściu z observe na auto (competitor_checks_required).", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaidChecksError"}, "example": {"error": {"code": "competitor_checks_required", "message": "Brak wykupionych sprawdzeń Konkurenta Cen Allegro. Wykup sprawdzenia, aby włączyć monitoring tej oferty.", "purchase_url": "https://niezbedniksprzedawcy.pl/app/sklep/konkurent-cen-allegro/"}, "request_id": "0f1e2d3c4b5a69788796a5b4c3d2e1f0"}}}}, "400": {"description": "Niepoprawna konfiguracja.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"invalid_request": {"summary": "invalid_request", "value": {"error": {"code": "invalid_request", "message": "The repricer listing rule payload is invalid.", "details": {"enabled": ["A JSON boolean is required."]}}, "request_id": "example-request-42"}}}}}}, "401": {"description": "Brak lub niepoprawny klucz API.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"authentication_required": {"summary": "authentication_required", "value": {"error": {"code": "authentication_required", "message": "Authentication credentials were not provided."}, "request_id": "example-request-42"}}, "invalid_api_key": {"summary": "invalid_api_key", "value": {"error": {"code": "invalid_api_key", "message": "The API key is invalid or no longer active."}, "request_id": "example-request-42"}}}}}}, "403": {"description": "Klucz nie ma scope’u repricer.listings:write.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"insufficient_scope": {"summary": "insufficient_scope", "value": {"error": {"code": "insufficient_scope", "message": "The API key does not grant access to this operation."}, "request_id": "example-request-42"}}}}}}, "404": {"description": "Oferta nie istnieje dla tej firmy.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"listing_not_found": {"summary": "listing_not_found", "value": {"error": {"code": "listing_not_found", "message": "The repricer listing does not exist."}, "request_id": "example-request-42"}}}}}}, "409": {"description": "Reguły domenowe nie pozwalają zastosować zmiany.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"invalid_price_range": {"summary": "invalid_price_range", "value": {"error": {"code": "invalid_price_range", "message": "minimum_price cannot be greater than maximum_price."}, "request_id": "example-request-42"}}}}}}, "413": {"description": "Body przekracza obsługiwane 512 KiB.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"request_too_large": {"summary": "request_too_large", "value": {"error": {"code": "request_too_large", "message": "The request body exceeds the supported size."}, "request_id": "example-request-42"}}}}}}, "415": {"description": "Nieobsługiwany Content-Type; wymagany JSON.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"unsupported_media_type": {"summary": "unsupported_media_type", "value": {"error": {"code": "unsupported_media_type", "message": "Unsupported media type \"text/plain\" in request."}, "request_id": "example-request-42"}}}}}}, "429": {"description": "Przekroczony limit zapytań.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"rate_limit_exceeded": {"summary": "rate_limit_exceeded", "value": {"error": {"code": "rate_limit_exceeded", "message": "Przekroczono limit zapytań."}, "request_id": "example-request-42"}}}}}}, "503": {"description": "Zapis repricera jest chwilowo niedostępny.", "headers": {"X-Request-ID": {"$ref": "#/components/headers/RequestId"}, "Retry-After": {"$ref": "#/components/headers/RetryAfter"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "examples": {"temporarily_unavailable": {"summary": "temporarily_unavailable", "value": {"error": {"code": "temporarily_unavailable", "message": "Usługa jest chwilowo niedostępna."}, "request_id": "example-request-42"}}}}}}}}}}, "x-webhooks": {"messageOutboundCreated": {"post": {"operationId": "receiveMessageOutboundCreatedWebhook", "summary": "Odbierz odpowiedź operatora z Komunikatora", "description": "To operacja wykonywana przez Niezbędnik na publicznym adresie HTTPS skonfigurowanym przez integratora. Nie jest to endpoint na domenie api.niezbedniksprzedawcy.pl. Klucz Public API nie autoryzuje tego żądania — odbiornik weryfikuje osobny sekret webhooka przypisany do kanału. Zwróć dowolny status 2xx po trwałym zapisaniu albo bezpiecznym zakolejkowaniu zdarzenia.", "tags": ["Komunikator"], "security": [{"WebhookBearerAuth": []}], "parameters": [{"name": "X-NS-Event-ID", "in": "header", "required": true, "description": "Stabilny identyfikator do deduplikacji. Jest równy polu id w dokumencie JSON i nie zmienia się przy retry.", "schema": {"type": "string", "format": "uuid"}, "example": "33333333-3333-4333-8333-333333333333"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CustomApiOutboundWebhookEvent"}, "example": {"id": "33333333-3333-4333-8333-333333333333", "type": "message.outbound.created", "created_at": "2026-08-28T12:20:00Z", "channel_id": "11111111-1111-4111-8111-111111111111", "message": {"id": "33333333-3333-4333-8333-333333333333", "external_thread_id": "contact-form-000042", "in_reply_to_external_message_id": "msg-2026-000042", "text": "Dzień dobry, zamówienie zostało wysłane.", "attachments": [{"id": "22222222-2222-4222-8222-222222222222", "filename": "faktura.pdf", "content_type": "application/pdf", "size_bytes": 48231, "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "download_url": "https://storage.example.com/messages/faktura.pdf?signature=temporary", "expires_at": "2026-08-29T12:20:00Z"}], "sender": {"name": "Anna Nowak", "email": "anna@example.com"}}}}}}, "responses": {"204": {"description": "Zalecane potwierdzenie odbioru bez treści odpowiedzi. Przykład odpowiedzi odbiornika webhooka:\n\n```http\nHTTP/1.1 204 No Content\n\n```"}, "200": {"description": "Potwierdzenie odbioru; treść odpowiedzi jest ignorowana."}, "default": {"description": "408, 425, 429, 5xx i błędy transportowe są ponawiane. 3xx oraz pozostałe 4xx są błędami terminalnymi."}}, "x-codeSamples": [{"lang": "Shell", "label": "cURL — przykładowa dostawa", "source": "curl --request POST \\\n  'https://sklep.example.com/webhooks/ns/messages' \\\n  --header 'Authorization: Bearer <webhook_secret>' \\\n  --header 'Content-Type: application/json' \\\n  --header 'X-NS-Event-ID: 33333333-3333-4333-8333-333333333333' \\\n  --data '{\n  \"id\": \"33333333-3333-4333-8333-333333333333\",\n  \"type\": \"message.outbound.created\",\n  \"created_at\": \"2026-08-28T12:20:00Z\",\n  \"channel_id\": \"11111111-1111-4111-8111-111111111111\",\n  \"message\": {\n    \"id\": \"33333333-3333-4333-8333-333333333333\",\n    \"external_thread_id\": \"contact-form-000042\",\n    \"in_reply_to_external_message_id\": \"msg-2026-000042\",\n    \"text\": \"Dzień dobry, zamówienie zostało wysłane.\",\n    \"attachments\": [\n      {\n        \"id\": \"22222222-2222-4222-8222-222222222222\",\n        \"filename\": \"faktura.pdf\",\n        \"content_type\": \"application/pdf\",\n        \"size_bytes\": 48231,\n        \"sha256\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n        \"download_url\": \"https://storage.example.com/messages/faktura.pdf?signature=temporary\",\n        \"expires_at\": \"2026-08-29T12:20:00Z\"\n      }\n    ],\n    \"sender\": {\n      \"name\": \"Anna Nowak\",\n      \"email\": \"anna@example.com\"\n    }\n  }\n}'"}]}}}, "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "API key", "description": "Klucz Public API używany wyłącznie dla żądań integrator → Niezbędnik."}, "WebhookBearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "Webhook secret", "description": "Osobny sekret kanału używany wyłącznie dla dostaw webhooka Niezbędnik → integrator."}}, "headers": {"RequestId": {"description": "Identyfikator korelacyjny żądania.", "schema": {"type": "string"}}, "RetryAfter": {"description": "Minimalny czas oczekiwania w sekundach. Odczyt raportu konkurencji zwraca 5 dla statusu queued/running lub eksportu pending/building, również po zakończeniu raportu. Limit Nginx wspólny dla odczytów raportów konkurencji i eksportów per IP zwraca 429 z wartością 5. Ogólny limit 20 żądań/s, limit uploadów i limit równoległości zwracają 429 z wartością 1 poza ścieżkami odczytów raportów konkurencji i eksportów; na tych ścieżkach każde odrzucenie przez limiter Nginx ma wartość 5. Przyjęcie zbiorczej zmiany ustawień ofert oraz odczyt jej statusu queued/running zwracają wartość 2; domyślnie zalecane jest odpytywanie co 5 sekund. Przyjęcie zlecenia raportu Allegro Ads zwraca wartość 60. Infrastrukturalna niedostępność zwraca 503 z wartością 30. Przy odpowiedziach 429 aplikacji respektuj zwróconą wartość.", "schema": {"type": "integer", "minimum": 1}}, "IdempotencyReplayed": {"description": "true, jeśli odpowiedź została odtworzona z zakończonego wcześniejszego żądania o tym samym Idempotency-Key.", "schema": {"type": "boolean", "example": false}}, "Location": {"description": "Adres utworzonego zasobu.", "schema": {"type": "string", "format": "uri-reference"}}}, "schemas": {"AllegroAdsWorkspace": {"type": "object", "required": ["workspace_id", "account_id", "account_name", "advertiser_id", "marketplace_id", "currency"], "properties": {"workspace_id": {"type": "string", "format": "uuid"}, "account_id": {"type": "integer"}, "account_name": {"type": "string"}, "advertiser_id": {"type": "string"}, "marketplace_id": {"type": "string"}, "currency": {"type": "string", "example": "PLN"}}, "additionalProperties": false}, "AllegroAdsWorkspaces": {"type": "object", "required": ["rows", "page", "total_pages", "total_rows"], "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsWorkspace"}, "maxItems": 50}, "page": {"type": "integer", "minimum": 1}, "total_pages": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false}, "AllegroAdsReportRequest": {"type": "object", "required": ["date_from", "date_to"], "properties": {"date_from": {"type": "string", "format": "date"}, "date_to": {"type": "string", "format": "date"}, "report_type": {"type": "string", "enum": ["standard", "purchasedOffers"], "default": "standard"}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi.", "default": "SPONSORED_OFFERS"}}, "additionalProperties": false, "oneOf": [{"properties": {"ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}}}, {"required": ["ad_program"], "properties": {"ad_program": {"type": "string", "enum": ["SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, "report_type": {"type": "string", "enum": ["standard"]}}}]}, "AllegroAdsReportAccepted": {"type": "object", "required": ["workspace_id", "date_from", "date_to", "report_type", "status_url", "results_url"], "properties": {"workspace_id": {"type": "string", "format": "uuid"}, "date_from": {"type": "string", "format": "date"}, "date_to": {"type": "string", "format": "date"}, "report_type": {"type": "string", "enum": ["standard", "purchasedOffers"]}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi. Nowe odpowiedzi zawsze zawierają to pole; odtworzenie starszego potwierdzenia idempotencji może je pomijać."}, "status_url": {"type": "string", "format": "uri-reference"}, "results_url": {"type": "string", "format": "uri-reference"}}, "additionalProperties": false}, "AllegroAdsReportRun": {"type": "object", "required": ["id", "date_from", "date_to", "report_type", "ad_program", "status", "rows", "requested_at", "completed_at"], "properties": {"id": {"type": "string", "format": "uuid"}, "date_from": {"type": "string", "format": "date"}, "date_to": {"type": "string", "format": "date"}, "report_type": {"type": "string", "enum": ["standard", "purchasedOffers"]}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, "status": {"type": "string", "enum": ["QUEUED", "CREATING", "UNKNOWN", "PENDING", "COMPLETED", "FAILED", "CANCELLED", "SKIPPED"]}, "rows": {"type": "integer", "minimum": 0, "description": "Liczba wierszy zaimportowanych z tej próby."}, "requested_at": {"type": "string", "format": "date-time"}, "completed_at": {"type": "string", "format": "date-time", "nullable": true}}, "additionalProperties": false}, "AllegroAdsReportRuns": {"type": "object", "required": ["rows", "page", "total_pages", "total_rows", "ad_program"], "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsReportRun"}, "maxItems": 50}, "page": {"type": "integer", "minimum": 1}, "total_pages": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}}, "additionalProperties": false}, "AllegroAdsMetrics": {"type": "object", "required": ["sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "cpc_gross", "cpc_net", "roas", "roas_net"], "properties": {"sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_gross": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_net": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}}, "additionalProperties": false}, "AllegroAdsGroupedMetrics": {"type": "object", "required": ["campaign_id", "campaign_name", "sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "cpc_gross", "cpc_net", "roas", "roas_net"], "properties": {"metric_date": {"type": "string", "format": "date", "description": "Dzień wyniku. Pole występuje w każdym wierszu przy granularity=day."}, "campaign_id": {"type": "string"}, "campaign_name": {"type": "string"}, "ad_group_id": {"type": "string"}, "ad_group_name": {"type": "string"}, "clicked_offer_id": {"type": "string"}, "clicked_offer_title": {"type": "string"}, "sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_gross": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_net": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}}, "additionalProperties": false}, "AllegroAdsDailyMetrics": {"type": "object", "required": ["metric_date", "sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "cpc_gross", "cpc_net", "roas", "roas_net"], "properties": {"metric_date": {"type": "string", "format": "date"}, "sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_gross": {"type": "string", "nullable": true, "example": "4.000000"}, "cpc_net": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}}, "additionalProperties": false}, "AllegroAdsStandardResults": {"type": "object", "required": ["rows", "page", "total_pages", "total_rows", "api_covered_days", "period_days", "currency", "ad_program", "summary", "trend", "sources"], "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsGroupedMetrics"}, "maxItems": 50}, "page": {"type": "integer", "minimum": 1}, "total_pages": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}, "api_covered_days": {"type": "integer", "minimum": 0, "description": "Liczba dni objętych raportem API wybranego programu i typu dla całego połączenia, także dni bez sprzedaży. Filtr offer_id nie zmienia tego licznika."}, "period_days": {"type": "integer", "minimum": 1}, "currency": {"type": "string", "example": "PLN"}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, "summary": {"$ref": "#/components/schemas/AllegroAdsMetrics"}, "trend": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsDailyMetrics"}}, "sources": {"type": "array", "items": {"type": "string", "enum": ["API", "XLSX"]}}}, "additionalProperties": false}, "AllegroAdsDisplayVideoMetrics": {"type": "object", "required": ["sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "roas", "roas_net", "cpm_gross", "cpm_net", "assisted_sales"], "properties": {"sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}, "cpm_gross": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt brutto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "cpm_net": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt netto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "assisted_sales": {"type": "string", "example": "78.56", "description": "Wartość brutto sprzedaży wspomaganej z raportu Allegro, w walucie odpowiedzi."}}, "additionalProperties": false}, "AllegroAdsDisplayVideoGroupedMetrics": {"type": "object", "required": ["campaign_id", "campaign_name", "sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "roas", "roas_net", "cpm_gross", "cpm_net", "assisted_sales"], "properties": {"metric_date": {"type": "string", "format": "date", "description": "Dzień wyniku. Pole występuje w każdym wierszu przy granularity=day."}, "campaign_id": {"type": "string", "description": "Surowy identyfikator Allegro, zgodny z providerId w API zarządzania; bez prefiksu display: lub video:."}, "campaign_name": {"type": "string"}, "ad_group_id": {"type": "string", "description": "Surowy identyfikator Allegro, zgodny z providerId w API zarządzania; bez prefiksu display: lub video:."}, "ad_group_name": {"type": "string"}, "sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}, "cpm_gross": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt brutto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "cpm_net": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt netto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "assisted_sales": {"type": "string", "example": "78.56", "description": "Wartość brutto sprzedaży wspomaganej z raportu Allegro, w walucie odpowiedzi."}}, "additionalProperties": false}, "AllegroAdsDisplayVideoDailyMetrics": {"type": "object", "required": ["metric_date", "sold_units", "attributed_sales_gross", "impressions", "clicks", "interest", "cost_gross", "cost_net", "ctr", "roas", "roas_net", "cpm_gross", "cpm_net", "assisted_sales"], "properties": {"metric_date": {"type": "string", "format": "date"}, "sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}, "impressions": {"type": "integer", "minimum": 0}, "clicks": {"type": "integer", "minimum": 0}, "interest": {"type": "integer", "minimum": 0}, "cost_gross": {"type": "string", "example": "78.56"}, "cost_net": {"type": "string", "example": "78.56"}, "ctr": {"type": "string", "nullable": true, "example": "4.000000"}, "roas": {"type": "string", "nullable": true, "example": "4.000000"}, "roas_net": {"type": "string", "nullable": true, "example": "4.000000"}, "cpm_gross": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt brutto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "cpm_net": {"type": "string", "nullable": true, "example": "4.000000", "description": "Koszt netto / liczba wyświetleń × 1000; null przy braku wyświetleń."}, "assisted_sales": {"type": "string", "example": "78.56", "description": "Wartość brutto sprzedaży wspomaganej z raportu Allegro, w walucie odpowiedzi."}}, "additionalProperties": false}, "AllegroAdsDisplayVideoResults": {"type": "object", "required": ["rows", "page", "total_pages", "total_rows", "api_covered_days", "period_days", "currency", "ad_program", "summary", "trend", "sources"], "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsDisplayVideoGroupedMetrics"}, "maxItems": 50}, "page": {"type": "integer", "minimum": 1}, "total_pages": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}, "api_covered_days": {"type": "integer", "minimum": 0, "description": "Liczba dni objętych raportem API wybranego programu i typu dla całego połączenia, także dni bez sprzedaży. Filtr offer_id nie zmienia tego licznika."}, "period_days": {"type": "integer", "minimum": 1}, "currency": {"type": "string", "example": "PLN"}, "ad_program": {"type": "string", "enum": ["SPONSORED_DISPLAY_AND_VIDEO"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, "summary": {"$ref": "#/components/schemas/AllegroAdsDisplayVideoMetrics"}, "trend": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsDisplayVideoDailyMetrics"}}, "sources": {"type": "array", "items": {"type": "string", "enum": ["API"]}}}, "additionalProperties": false}, "AllegroAdsPurchasedOffer": {"type": "object", "required": ["campaign_id", "campaign_name", "ad_group_id", "ad_group_name", "clicked_offer_id", "clicked_offer_title", "purchased_offer_id", "purchased_offer_title", "sold_units", "attributed_sales_gross"], "properties": {"metric_date": {"type": "string", "format": "date", "description": "Dzień wyniku. Pole występuje w każdym wierszu przy granularity=day."}, "campaign_id": {"type": "string"}, "campaign_name": {"type": "string"}, "ad_group_id": {"type": "string"}, "ad_group_name": {"type": "string"}, "clicked_offer_id": {"type": "string"}, "clicked_offer_title": {"type": "string"}, "purchased_offer_id": {"type": "string"}, "purchased_offer_title": {"type": "string"}, "sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}}, "additionalProperties": false}, "AllegroAdsPurchasedResults": {"type": "object", "required": ["rows", "page", "total_pages", "total_rows", "api_covered_days", "period_days", "currency", "ad_program", "summary"], "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AllegroAdsPurchasedOffer"}, "maxItems": 50}, "page": {"type": "integer", "minimum": 1}, "total_pages": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}, "api_covered_days": {"type": "integer", "minimum": 0, "description": "Liczba dni objętych raportem API wybranego programu i typu dla całego połączenia, także dni bez sprzedaży. Filtr offer_id nie zmienia tego licznika."}, "period_days": {"type": "integer", "minimum": 1}, "currency": {"type": "string", "example": "PLN"}, "ad_program": {"type": "string", "enum": ["SPONSORED_OFFERS"], "description": "Program raportowy: Oferty sponsorowane albo wspólny raport reklam graficznych i wideo. Dla SPONSORED_DISPLAY_AND_VIDEO NS obsługuje tylko standard i rynek allegro-pl. Osobne SPONSORED_DISPLAY, SPONSORED_VIDEO i ALL z API zarządzania nie są programami raportowymi."}, "summary": {"type": "object", "required": ["sold_units", "attributed_sales_gross"], "properties": {"sold_units": {"type": "integer", "minimum": 0}, "attributed_sales_gross": {"type": "string", "example": "78.56"}}, "additionalProperties": false}}, "additionalProperties": false}, "AdsManagementMoneyWrite": {"type": "object", "properties": {"currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}, "grossAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "netAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}}, "additionalProperties": false, "oneOf": [{"required": ["grossAmount"]}, {"required": ["netAmount"]}], "description": "Podaj dokładnie jedną dodatnią kwotę do 10000000: grossAmount albo netAmount, oraz walutę rynku połączenia.", "required": ["currency"]}, "AdsManagementMoney": {"type": "object", "properties": {"currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}, "grossAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "netAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}}, "additionalProperties": false, "required": ["currency", "grossAmount", "netAmount"]}, "AdsManagementWorkspaceCreate": {"type": "object", "properties": {"account_id": {"type": "integer", "minimum": 1}, "advertiser_id": {"type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}}, "additionalProperties": false, "required": ["account_id", "advertiser_id", "marketplace_id"]}, "AdsManagementWorkspace": {"type": "object", "properties": {"workspace_id": {"type": "string", "format": "uuid"}, "account_id": {"type": "integer"}, "account_name": {"type": "string"}, "advertiser_id": {"type": "string"}, "marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}, "connected": {"type": "boolean"}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}}, "additionalProperties": false, "required": ["workspace_id", "account_id", "account_name", "advertiser_id", "marketplace_id", "currency", "connected", "synced_at"]}, "AdsManagementCampaignCreate": {"type": "object", "properties": {"name": {"type": "string", "minLength": 3, "maxLength": 60}, "status": {"type": "string", "enum": ["ACTIVE", "PAUSED"], "default": "PAUSED"}}, "additionalProperties": false, "description": "Rynek wynika z połączenia. Tworzenie dotyczy ofert sponsorowanych.", "required": ["name"]}, "AdsManagementCampaignPatch": {"type": "object", "properties": {"name": {"type": "string", "minLength": 3, "maxLength": 60}}, "additionalProperties": false, "description": "Zmiana nazwy kampanii Ofert sponsorowanych, graficznej lub wideo. Status zmienia osobny endpoint.", "required": ["name"]}, "AdsManagementStatus": {"type": "object", "properties": {"status": {"type": "string", "enum": ["ACTIVE", "PAUSED"]}}, "additionalProperties": false, "required": ["status"]}, "AdsManagementAdGroupCreate": {"type": "object", "properties": {"name": {"type": "string", "minLength": 3, "maxLength": 60}, "bidding": {"type": "object", "properties": {"maxCpc": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "dynamicCpc": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "autoCpc": {"type": "boolean", "enum": [true]}}, "additionalProperties": false, "oneOf": [{"required": ["maxCpc"]}, {"required": ["dynamicCpc"]}, {"required": ["autoCpc"]}]}, "placements": {"type": "object", "properties": {"ids": {"type": "array", "items": {"type": "string", "enum": ["listing", "leftpanel", "showitem", "mainpage", "google"]}, "minItems": 1, "maxItems": 10, "uniqueItems": true}}, "additionalProperties": false, "required": ["ids"]}, "budget": {"type": "object", "properties": {"daily": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "total": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}}, "additionalProperties": false, "required": ["daily"]}, "deliveryPeriod": {"type": "object", "properties": {"start": {"type": "string", "format": "date"}, "end": {"type": "string", "format": "date"}}, "additionalProperties": false, "required": ["start"]}, "offerSelection": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["MANUAL", "RULES", "BESTSELLERS"]}, "filters": {"type": "array", "items": {"type": "object", "properties": {"category": {"type": "object", "properties": {"id": {"type": "string", "pattern": "^[0-9]+$", "maxLength": 128}}, "additionalProperties": false, "required": ["id"]}, "nameContains": {"type": "array", "items": {"type": "string", "minLength": 1, "maxLength": 50}, "minItems": 1, "maxItems": 5, "uniqueItems": true}, "priceFrom": {"type": "object", "properties": {"amount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}}, "additionalProperties": false, "required": ["amount", "currency"]}, "priceTo": {"type": "object", "properties": {"amount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}}, "additionalProperties": false, "required": ["amount", "currency"]}}, "additionalProperties": false, "minProperties": 1}, "minItems": 1, "maxItems": 10, "nullable": true}}, "additionalProperties": false, "description": "Zmiana trybu usuwa poprzedni wybór ofert. filters dotyczą trybu RULES.", "required": ["mode"]}, "campaign": {"type": "object", "properties": {"id": {"type": "string", "minLength": 1, "maxLength": 258, "pattern": "^[A-Za-z0-9_+/-]{1,256}={0,2}$"}}, "additionalProperties": false, "required": ["id"]}, "status": {"type": "string", "enum": ["ACTIVE", "PAUSED"], "default": "PAUSED"}}, "additionalProperties": false, "description": "Tworzenie dotyczy wyłącznie Ofert sponsorowanych. Wszystkie kwoty w tworzonej grupie muszą używać tej samej podstawy: netto albo brutto.", "required": ["campaign", "name", "bidding", "placements", "budget", "deliveryPeriod", "offerSelection"]}, "AdsManagementAdGroupPatch": {"type": "object", "properties": {"name": {"type": "string", "minLength": 3, "maxLength": 60}, "bidding": {"type": "object", "properties": {"maxCpc": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "dynamicCpc": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "autoCpc": {"type": "boolean", "enum": [true]}, "cpm": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}}, "additionalProperties": false, "oneOf": [{"required": ["maxCpc"]}, {"required": ["dynamicCpc"]}, {"required": ["autoCpc"]}, {"required": ["cpm"]}], "description": "Oferty sponsorowane używają CPC; grupy graficzne i wideo wyłącznie cpm. Nie łącz strategii."}, "placements": {"type": "object", "properties": {"ids": {"type": "array", "items": {"type": "string", "enum": ["listing", "leftpanel", "showitem", "mainpage", "google"]}, "minItems": 1, "maxItems": 10, "uniqueItems": true}}, "additionalProperties": false, "required": ["ids"]}, "budget": {"type": "object", "properties": {"daily": {"$ref": "#/components/schemas/AdsManagementMoneyWrite"}, "total": {"type": "object", "properties": {"currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}, "grossAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "netAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}}, "additionalProperties": false, "oneOf": [{"required": ["grossAmount"]}, {"required": ["netAmount"]}], "description": "Podaj dokładnie jedną dodatnią kwotę do 10000000: grossAmount albo netAmount, oraz walutę rynku połączenia.", "required": ["currency"], "nullable": true}}, "additionalProperties": false, "minProperties": 1}, "deliveryPeriod": {"type": "object", "properties": {"start": {"type": "string", "format": "date"}, "end": {"type": "string", "format": "date", "nullable": true}}, "additionalProperties": false, "minProperties": 1}, "offerSelection": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["MANUAL", "RULES", "BESTSELLERS"]}, "filters": {"type": "array", "items": {"type": "object", "properties": {"category": {"type": "object", "properties": {"id": {"type": "string", "pattern": "^[0-9]+$", "maxLength": 128}}, "additionalProperties": false, "required": ["id"]}, "nameContains": {"type": "array", "items": {"type": "string", "minLength": 1, "maxLength": 50}, "minItems": 1, "maxItems": 5, "uniqueItems": true}, "priceFrom": {"type": "object", "properties": {"amount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}}, "additionalProperties": false, "required": ["amount", "currency"]}, "priceTo": {"type": "object", "properties": {"amount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}}, "additionalProperties": false, "required": ["amount", "currency"]}}, "additionalProperties": false, "minProperties": 1}, "minItems": 1, "maxItems": 10, "nullable": true}}, "additionalProperties": false, "description": "Zmiana trybu usuwa poprzedni wybór ofert. filters dotyczą trybu RULES.", "required": ["mode"]}}, "additionalProperties": false, "minProperties": 1, "description": "Dla grup graficznych/wideo edytowalne są wyłącznie bidding.cpm i budget.daily/total; nazwa, miejsca i daty emisji oraz wybór ofert są poza zakresem edycji. Dla Ads Express i OFFER_EDIT_FORM edytowalny jest tylko budget.daily. Status zmienia osobny endpoint."}, "AdsManagementCampaign": {"type": "object", "properties": {"id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "providerId": {"type": "string", "minLength": 1, "maxLength": 258, "pattern": "^[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "adProgram": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY", "SPONSORED_VIDEO"]}, "name": {"type": "string"}, "status": {"type": "string", "enum": ["ACTIVE", "PAUSED", "ARCHIVED"]}, "marketplaceId": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "type": {"type": "string"}}, "additionalProperties": false, "required": ["id", "providerId", "adProgram", "name", "status", "marketplaceId"]}, "AdsManagementAdGroup": {"type": "object", "properties": {"id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "providerId": {"type": "string", "minLength": 1, "maxLength": 258, "pattern": "^[A-Za-z0-9_+/-]{1,256}={0,2}$"}, "adProgram": {"type": "string", "enum": ["SPONSORED_OFFERS", "SPONSORED_DISPLAY", "SPONSORED_VIDEO"]}, "name": {"type": "string"}, "status": {"type": "string", "enum": ["ACTIVE", "PAUSED", "ARCHIVED"]}, "type": {"type": "string"}, "marketplaceId": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "campaign": {"type": "object", "properties": {"id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}}, "additionalProperties": false, "required": ["id"]}, "bidding": {"type": "object", "properties": {"maxCpc": {"$ref": "#/components/schemas/AdsManagementMoney"}, "dynamicCpc": {"$ref": "#/components/schemas/AdsManagementMoney"}, "cpm": {"$ref": "#/components/schemas/AdsManagementMoney"}, "autoCpc": {"type": "boolean"}}, "additionalProperties": false}, "budget": {"type": "object", "properties": {"daily": {"$ref": "#/components/schemas/AdsManagementMoney"}, "total": {"type": "object", "properties": {"currency": {"type": "string", "pattern": "^[A-Z]{3}$", "example": "PLN"}, "grossAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}, "netAmount": {"type": "string", "maxLength": 16, "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "1.50"}}, "additionalProperties": false, "required": ["currency", "grossAmount", "netAmount"], "nullable": true}}, "additionalProperties": false}, "placements": {"type": "object", "properties": {"ids": {"type": "array", "items": {"type": "string", "enum": ["listing", "leftpanel", "showitem", "mainpage", "google"]}, "minItems": 1, "maxItems": 10, "uniqueItems": true}}, "additionalProperties": false, "required": ["ids"]}, "offerSelection": {"type": "object"}, "deliveryPeriod": {"type": "object", "properties": {"start": {"type": "string", "format": "date"}, "end": {"type": "string", "format": "date", "nullable": true}}, "additionalProperties": false}}, "additionalProperties": false, "required": ["id", "providerId", "adProgram", "name", "status", "marketplaceId", "campaign"]}, "AdsManagementOfferAdsChange": {"type": "object", "properties": {"operation": {"type": "string", "enum": ["ADD", "DELETE"]}, "offerIds": {"type": "array", "items": {"type": "string", "pattern": "^[0-9]+$", "maxLength": 32}, "minItems": 1, "maxItems": 1000, "uniqueItems": true}}, "additionalProperties": false, "required": ["operation", "offerIds"]}, "AdsManagementScheduleCreate": {"type": "object", "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 120}, "enabled": {"type": "boolean", "default": true}, "targets": {"type": "array", "items": {"type": "object", "properties": {"kind": {"type": "string", "enum": ["campaign", "adgroup"]}, "id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}}, "additionalProperties": false, "description": "Identyfikator NS: Oferty sponsorowane bez prefiksu, grafika display:<id>, wideo video:<id>. Kampanie obsługują tylko status; działania pieniężne dotyczą grup.", "required": ["kind", "id"]}, "minItems": 1, "maxItems": 100}, "config": {"type": "object", "properties": {"timezone": {"type": "string", "default": "Europe/Warsaw", "example": "Europe/Warsaw"}, "startDate": {"type": "string", "format": "date", "nullable": true}, "endDate": {"type": "string", "format": "date", "nullable": true}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false, "required": ["days", "start", "end"]}, "maxItems": 100}, "exceptions": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "format": "date"}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}}, "additionalProperties": false, "required": ["start", "end"]}, "maxItems": 100}}, "additionalProperties": false, "required": ["date"]}, "maxItems": 730}, "actions": {"type": "object", "properties": {"status": {"type": "boolean"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}}, "additionalProperties": false, "minProperties": 1, "not": {"required": ["cpc", "cpm"], "properties": {"cpc": {"type": "object"}, "cpm": {"type": "object"}}}}}, "additionalProperties": false, "description": "Dodaj przynajmniej jedno okno tygodniowe lub w wyjątkach. Dni: poniedziałek=0, niedziela=6. Wyjątek zastępuje godziny całej daty. status=true włącza emisję w oknach i wstrzymuje poza nimi. CPC/CPM/budżet poza oknami wracają do wartości bazowych zapisanych przy dodaniu celu. Budżet pozostaje limitem całego dnia. Działania pieniężne dotyczą tylko grup reklam. cpc wymaga Ofert sponsorowanych, cpm wymaga grafiki/wideo. Nie łącz cpc i cpm w jednym planie. Okna i wyjątki mogą nadpisywać stawkę lub budżet, jeśli odpowiednie działanie ma ustawioną wartość domyślną. Sam status lub budżet dzienny może obejmować grupy z różnych programów.", "required": ["actions"]}}, "additionalProperties": false, "required": ["name", "targets", "config"]}, "AdsManagementSchedulePatch": {"type": "object", "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 120}, "enabled": {"type": "boolean", "default": true}, "targets": {"type": "array", "items": {"type": "object", "properties": {"kind": {"type": "string", "enum": ["campaign", "adgroup"]}, "id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}}, "additionalProperties": false, "description": "Identyfikator NS: Oferty sponsorowane bez prefiksu, grafika display:<id>, wideo video:<id>. Kampanie obsługują tylko status; działania pieniężne dotyczą grup.", "required": ["kind", "id"]}, "minItems": 1, "maxItems": 100}, "config": {"type": "object", "properties": {"timezone": {"type": "string", "default": "Europe/Warsaw", "example": "Europe/Warsaw"}, "startDate": {"type": "string", "format": "date", "nullable": true}, "endDate": {"type": "string", "format": "date", "nullable": true}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false, "required": ["days", "start", "end"]}, "maxItems": 100}, "exceptions": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "format": "date"}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}}, "additionalProperties": false, "required": ["start", "end"]}, "maxItems": 100}}, "additionalProperties": false, "required": ["date"]}, "maxItems": 730}, "actions": {"type": "object", "properties": {"status": {"type": "boolean"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}}, "additionalProperties": false, "minProperties": 1, "not": {"required": ["cpc", "cpm"], "properties": {"cpc": {"type": "object"}, "cpm": {"type": "object"}}}}}, "additionalProperties": false, "description": "Dodaj przynajmniej jedno okno tygodniowe lub w wyjątkach. Dni: poniedziałek=0, niedziela=6. Wyjątek zastępuje godziny całej daty. status=true włącza emisję w oknach i wstrzymuje poza nimi. CPC/CPM/budżet poza oknami wracają do wartości bazowych zapisanych przy dodaniu celu. Budżet pozostaje limitem całego dnia. Działania pieniężne dotyczą tylko grup reklam. cpc wymaga Ofert sponsorowanych, cpm wymaga grafiki/wideo. Nie łącz cpc i cpm w jednym planie. Okna i wyjątki mogą nadpisywać stawkę lub budżet, jeśli odpowiednie działanie ma ustawioną wartość domyślną. Sam status lub budżet dzienny może obejmować grupy z różnych programów.", "required": ["actions"]}}, "additionalProperties": false, "minProperties": 1}, "AdsManagementSchedule": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "workspace_id": {"type": "string", "format": "uuid"}, "name": {"type": "string", "minLength": 1, "maxLength": 120}, "enabled": {"type": "boolean", "default": true}, "targets": {"type": "array", "items": {"type": "object", "properties": {"kind": {"type": "string", "enum": ["campaign", "adgroup"]}, "id": {"type": "string", "minLength": 1, "maxLength": 266, "pattern": "^(?:display:|video:)?[A-Za-z0-9_+/-]{1,256}={0,2}$"}}, "additionalProperties": false, "description": "Identyfikator NS: Oferty sponsorowane bez prefiksu, grafika display:<id>, wideo video:<id>. Kampanie obsługują tylko status; działania pieniężne dotyczą grup.", "required": ["kind", "id"]}, "minItems": 1, "maxItems": 100}, "config": {"type": "object", "properties": {"timezone": {"type": "string", "default": "Europe/Warsaw", "example": "Europe/Warsaw"}, "startDate": {"type": "string", "format": "date", "nullable": true}, "endDate": {"type": "string", "format": "date", "nullable": true}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "uniqueItems": true}}, "additionalProperties": false, "required": ["days", "start", "end"]}, "maxItems": 100}, "exceptions": {"type": "array", "items": {"type": "object", "properties": {"date": {"type": "string", "format": "date"}, "windows": {"type": "array", "items": {"type": "object", "properties": {"start": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$", "example": "08:00"}, "end": {"type": "string", "pattern": "^(?:(?:[01]\\d|2[0-3]):[0-5]\\d|24:00)$", "example": "18:00"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"]}}, "additionalProperties": false, "required": ["start", "end"]}, "maxItems": 100}}, "additionalProperties": false, "required": ["date"]}, "maxItems": 730}, "actions": {"type": "object", "properties": {"status": {"type": "boolean"}, "cpc": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "cpm": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}, "dailyBudget": {"type": "object", "properties": {"mode": {"type": "string", "enum": ["fixed", "percent"]}, "value": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,2})?$", "example": "10.00"}}, "additionalProperties": false, "description": "Kwota brutto 0,01–10000000 albo procentowa zmiana większa niż -100 i do 1000 względem zapisanej bazy; 10 oznacza +10%.", "required": ["mode", "value"], "nullable": true}}, "additionalProperties": false, "minProperties": 1, "not": {"required": ["cpc", "cpm"], "properties": {"cpc": {"type": "object"}, "cpm": {"type": "object"}}}}}, "additionalProperties": false, "description": "Dodaj przynajmniej jedno okno tygodniowe lub w wyjątkach. Dni: poniedziałek=0, niedziela=6. Wyjątek zastępuje godziny całej daty. status=true włącza emisję w oknach i wstrzymuje poza nimi. CPC/CPM/budżet poza oknami wracają do wartości bazowych zapisanych przy dodaniu celu. Budżet pozostaje limitem całego dnia. Działania pieniężne dotyczą tylko grup reklam. cpc wymaga Ofert sponsorowanych, cpm wymaga grafiki/wideo. Nie łącz cpc i cpm w jednym planie. Okna i wyjątki mogą nadpisywać stawkę lub budżet, jeśli odpowiednie działanie ma ustawioną wartość domyślną. Sam status lub budżet dzienny może obejmować grupy z różnych programów.", "required": ["actions"]}, "revision": {"type": "string"}, "next_run_at": {"type": "string", "format": "date-time", "nullable": true}, "last_run_at": {"type": "string", "format": "date-time", "nullable": true}, "execution_status": {"type": "string", "enum": ["disabled", "pending", "error", "completed", "scheduled"], "description": "disabled: wyłączone przyszłe działania; pending: czeka na potwierdzenie; error: ostatni przebieg zgłosił błąd; completed: wszystkie cele zakończone po archiwizacji; scheduled: zapisany plan bez tych stanów."}, "last_error": {"type": "object", "properties": {"code": {"type": "string", "enum": ["schedule_execution_failed"]}, "message": {"type": "string"}}, "additionalProperties": false, "nullable": true, "description": "Ogólny komunikat bez wewnętrznych danych, nazw innych planów i wiadomości Allegro; null przy braku ostatniego błędu.", "required": ["code", "message"]}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}, "additionalProperties": false, "required": ["id", "workspace_id", "name", "enabled", "targets", "config", "revision", "next_run_at", "last_run_at", "execution_status", "last_error", "created_at", "updated_at"]}, "AdsManagementScheduleStopped": {"type": "object", "properties": {"schedule_id": {"type": "string", "format": "uuid"}, "enabled": {"type": "boolean", "enum": [false]}, "revision": {"type": "string"}}, "additionalProperties": false, "required": ["schedule_id", "enabled", "revision"]}, "AdsManagementScheduleDeleted": {"type": "object", "properties": {"schedule_id": {"type": "string", "format": "uuid"}, "deleted": {"type": "boolean", "enum": [true]}}, "additionalProperties": false, "required": ["schedule_id", "deleted"]}, "AdsManagementCommandAccepted": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["queued"]}, "workspace_id": {"type": "string", "format": "uuid"}, "action": {"type": "string"}, "status_url": {"type": "string", "format": "uri-reference"}}, "additionalProperties": false, "required": ["id", "status", "workspace_id", "action", "status_url"]}, "AdsManagementCommand": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["queued", "running", "pending", "completed", "partially_failed", "failed", "outcome_unknown"]}, "workspace_id": {"type": "string", "format": "uuid"}, "action": {"type": "string"}, "status_url": {"type": "string", "format": "uri-reference"}, "resource_id": {"type": "string", "nullable": true}, "request_id": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}, "completed_at": {"type": "string", "format": "date-time", "nullable": true}, "result": {"type": "object", "nullable": true, "description": "Wynik: resources z kind, id, revision, status i steps; albo schedule; albo synced_at. Nie zawiera wewnętrznych snapshotów, tokenów ani adresów operacji Allegro."}, "error": {"type": "object", "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "status": {"type": "integer", "description": "Kod błędu wykonania; sam odczyt statusu polecenia nadal zwraca HTTP 200."}}, "additionalProperties": false, "nullable": true, "required": ["code", "message", "status"]}}, "additionalProperties": false, "required": ["id", "status", "workspace_id", "action", "resource_id", "request_id", "created_at", "completed_at", "result", "error"]}, "AdsManagementWorkspaces": {"type": "object", "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AdsManagementWorkspace"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}}, "additionalProperties": false, "required": ["rows", "pagination"]}, "AdsManagementAdvertisers": {"type": "object", "properties": {"rows": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "status": {"type": "string"}}, "additionalProperties": false}}, "account_id": {"type": "integer"}}, "additionalProperties": false, "required": ["rows", "account_id"]}, "AdsManagementCampaigns": {"type": "object", "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AdsManagementCampaign"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}, "workspace_id": {"type": "string", "format": "uuid"}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "archive_complete": {"type": "boolean"}, "program_sync": {"type": "object", "properties": {"SPONSORED_DISPLAY": {"type": "object", "properties": {"status": {"type": "string", "enum": ["READY", "ERROR", "NOT_SYNCED"]}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "error": {"type": "string"}}, "additionalProperties": false, "required": ["status", "synced_at", "error"]}, "SPONSORED_VIDEO": {"type": "object", "properties": {"status": {"type": "string", "enum": ["READY", "ERROR", "NOT_SYNCED"]}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "error": {"type": "string"}}, "additionalProperties": false, "required": ["status", "synced_at", "error"]}}, "additionalProperties": false, "description": "Obecne tylko dla ad_program grafiki/wideo lub ALL. Zawiera wybrane programy CPM. READY potwierdza kompletny odczyt; ERROR zachowuje poprzednie dane; NOT_SYNCED oznacza brak potwierdzonego odczytu. synced_at określa aktualność danego programu, niezależnie od czasu całego workspace."}}, "additionalProperties": false, "required": ["rows", "pagination", "workspace_id", "synced_at", "archive_complete"]}, "AdsManagementAdGroups": {"type": "object", "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AdsManagementAdGroup"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}, "workspace_id": {"type": "string", "format": "uuid"}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "archive_complete": {"type": "boolean"}, "program_sync": {"type": "object", "properties": {"SPONSORED_DISPLAY": {"type": "object", "properties": {"status": {"type": "string", "enum": ["READY", "ERROR", "NOT_SYNCED"]}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "error": {"type": "string"}}, "additionalProperties": false, "required": ["status", "synced_at", "error"]}, "SPONSORED_VIDEO": {"type": "object", "properties": {"status": {"type": "string", "enum": ["READY", "ERROR", "NOT_SYNCED"]}, "synced_at": {"type": "string", "format": "date-time", "nullable": true}, "error": {"type": "string"}}, "additionalProperties": false, "required": ["status", "synced_at", "error"]}}, "additionalProperties": false, "description": "Obecne tylko dla ad_program grafiki/wideo lub ALL. Zawiera wybrane programy CPM. READY potwierdza kompletny odczyt; ERROR zachowuje poprzednie dane; NOT_SYNCED oznacza brak potwierdzonego odczytu. synced_at określa aktualność danego programu, niezależnie od czasu całego workspace."}}, "additionalProperties": false, "required": ["rows", "pagination", "workspace_id", "synced_at", "archive_complete"]}, "AdsManagementSchedules": {"type": "object", "properties": {"rows": {"type": "array", "items": {"$ref": "#/components/schemas/AdsManagementSchedule"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}, "workspace_id": {"type": "string", "format": "uuid"}}, "additionalProperties": false, "required": ["rows", "pagination", "workspace_id"]}, "AdsManagementOffers": {"type": "object", "properties": {"rows": {"type": "array", "items": {"type": "object"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}, "workspace_id": {"type": "string", "format": "uuid"}}, "additionalProperties": false, "required": ["rows", "pagination", "workspace_id"]}, "AdsManagementOfferAds": {"type": "object", "properties": {"rows": {"type": "array", "items": {"type": "object"}}, "pagination": {"type": "object", "properties": {"offset": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "minimum": 1}, "total_rows": {"type": "integer", "minimum": 0, "nullable": true, "description": "null, gdy tryb automatycznego doboru nie udostępnia listy/liczby ofert."}}, "additionalProperties": false, "required": ["offset", "limit", "total_rows"]}, "workspace_id": {"type": "string", "format": "uuid"}, "mode": {"type": "string"}, "editable": {"type": "boolean"}, "list_available": {"type": "boolean"}, "reason": {"type": "string"}}, "additionalProperties": false, "required": ["rows", "pagination", "workspace_id", "mode", "editable", "list_available", "reason"]}, "ScannerCompetitionMeasurement": {"type": "object", "additionalProperties": false, "required": ["marketplace_id", "status", "source", "checked_at", "own_price", "reference_price", "currency", "reason", "price_position", "price_positions", "price_difference"], "properties": {"marketplace_id": {"type": "string", "nullable": true, "example": "allegro-pl", "description": "Rynek Allegro w chwili pomiaru. Dla wpisów archiwalnych ma wartość null."}, "status": {"type": "string", "nullable": true, "enum": ["reserved", "ok", "failed", "no_funds", "unavailable", null], "description": "reserved oznacza oczekiwanie na wynik, ok oznacza udany odczyt, failed oznacza błąd sprawdzenia, no_funds oznacza brak sprawdzeń na koncie, a unavailable oznacza brak danych do porównania. Wpisy archiwalne mają wartość null."}, "source": {"type": "string", "nullable": true, "enum": ["scanner", "pricer", "archive", null], "description": "scanner oznacza sprawdzenie zlecane przez skaner, pricer oznacza wykorzystanie wyniku Konkurenta Cen Allegro. Przy braku źródła pole ma wartość null. Starsze wpisy oznaczone jako archive mogą zawierać pozycję i różnicę cen innej oferty z tej samej partii skanowania."}, "checked_at": {"type": "string", "format": "date-time", "nullable": true}, "own_price": {"type": "string", "example": "49.99", "nullable": true}, "reference_price": {"type": "string", "example": "49.99", "nullable": true, "description": "Cena najtańszej innej oferty."}, "currency": {"type": "string", "example": "PLN"}, "reason": {"type": "string", "description": "Dodatkowa informacja o zakresie udanego porównania lub przyczynie braku wyniku, jeśli ją zapisano."}, "price_position": {"type": "integer", "minimum": 0, "nullable": true, "description": "1 + liczba ofert o niższej cenie."}, "price_positions": {"type": "integer", "minimum": 0, "nullable": true, "description": "Liczba porównanych ofert, łącznie z własną."}, "price_difference": {"type": "string", "example": "49.99", "nullable": true, "description": "Cena referencyjna minus cena własna, w walucie pomiaru. Przy braku porównania ma wartość null."}}}, "ScannerCompetition": {"type": "object", "additionalProperties": false, "required": ["marketplace_id", "status", "source", "checked_at", "own_price", "reference_price", "currency", "reason", "price_position", "price_positions", "price_difference"], "properties": {"marketplace_id": {"type": "string", "nullable": true, "example": "allegro-pl", "description": "Rynek Allegro w chwili pomiaru. Dla wpisów archiwalnych ma wartość null."}, "status": {"type": "string", "nullable": true, "enum": ["reserved", "ok", "failed", "no_funds", "unavailable", null], "description": "reserved oznacza oczekiwanie na wynik, ok oznacza udany odczyt, failed oznacza błąd sprawdzenia, no_funds oznacza brak sprawdzeń na koncie, a unavailable oznacza brak danych do porównania. Wpisy archiwalne mają wartość null."}, "source": {"type": "string", "nullable": true, "enum": ["scanner", "pricer", "archive", null], "description": "scanner oznacza sprawdzenie zlecane przez skaner, pricer oznacza wykorzystanie wyniku Konkurenta Cen Allegro. Przy braku źródła pole ma wartość null. Starsze wpisy oznaczone jako archive mogą zawierać pozycję i różnicę cen innej oferty z tej samej partii skanowania."}, "checked_at": {"type": "string", "format": "date-time", "nullable": true}, "own_price": {"type": "string", "example": "49.99", "nullable": true}, "reference_price": {"type": "string", "example": "49.99", "nullable": true, "description": "Cena najtańszej innej oferty."}, "currency": {"type": "string", "example": "PLN"}, "reason": {"type": "string", "description": "Dodatkowa informacja o zakresie udanego porównania lub przyczynie braku wyniku, jeśli ją zapisano."}, "price_position": {"type": "integer", "minimum": 0, "nullable": true, "description": "1 + liczba ofert o niższej cenie."}, "price_positions": {"type": "integer", "minimum": 0, "nullable": true, "description": "Liczba porównanych ofert, łącznie z własną."}, "price_difference": {"type": "string", "example": "49.99", "nullable": true, "description": "Cena referencyjna minus cena własna, w walucie pomiaru. Przy braku porównania ma wartość null."}}, "nullable": true}, "ScannerDailyStat": {"type": "object", "additionalProperties": false, "description": "Jeden wpis na dzień. Gdy zapisano tylko pomiar konkurencji, wiersz zawiera datę i pola porównania cen. Pola podstawowego skanu, w tym oceny i Ads, pojawiają się w dniach z zapisaną statystyką oferty.", "required": ["date", "price_position", "price_positions", "price_difference", "competition", "competition_measurements"], "properties": {"date": {"type": "string", "format": "date"}, "price": {"type": "string", "example": "49.99"}, "price_currency": {"type": "string", "example": "PLN"}, "sold": {"type": "integer", "minimum": 0}, "stock": {"type": "integer", "minimum": 0}, "visits": {"type": "integer", "minimum": 0}, "watchers": {"type": "integer", "minimum": 0}, "score": {"type": "integer", "minimum": 0, "nullable": true, "description": "Ocena produktu w setnych gwiazdki (485 oznacza 4,85). Brak średniej i dawna domyślna wartość 500 bez głosów są zwracane jako null."}, "rating_observed_at": {"type": "string", "format": "date-time", "nullable": true, "description": "Czas udanego odczytu ocen produktu. Starsze wpisy i dni bez potwierdzonego pomiaru mają wartość null."}, "rating_product_id": {"type": "string", "format": "uuid", "nullable": true, "description": "ID produktu katalogowego Allegro powiązanego z odczytem ocen. Ma wartość null, jeśli powiązanie było nieznane."}, "rating_distribution": {"type": "object", "nullable": true, "additionalProperties": false, "required": ["1", "2", "3", "4", "5"], "properties": {"1": {"type": "integer", "minimum": 0}, "2": {"type": "integer", "minimum": 0}, "3": {"type": "integer", "minimum": 0}, "4": {"type": "integer", "minimum": 0}, "5": {"type": "integer", "minimum": 0}}, "description": "Liczba ocen od 1 do 5 gwiazdek. Pięć zer oznacza potwierdzony brak głosów. Przy braku rozkładu pole ma wartość null. Starszy rozkład z głosami jest dostępny także wtedy, gdy czas odczytu jest nieznany."}, "is_emphasized": {"type": "boolean"}, "is_department_emphasized": {"type": "boolean"}, "relevance_position": {"type": "integer", "minimum": 0, "description": "Pozycja według trafności. 1000 oznacza pozycję poza pierwszą 600, a 10000 brak danych."}, "badges": {"type": "array", "items": {"type": "string"}}, "ads_source": {"type": "string", "nullable": true, "enum": ["manager", "xlsx", null], "description": "manager oznacza ostatni zapis dla oferty i dnia z raportu Menedżera Ads Allegro, a xlsx oznacza import ręczny. Wartości zerowe z oznaczonym źródłem pochodzą z raportu. Przy null źródło jest nieznane i same zera mogą być domyślnymi wartościami skanera."}, "ads_views": {"type": "integer", "minimum": 0}, "ads_clicks": {"type": "integer", "minimum": 0}, "ads_cost": {"type": "string", "example": "49.99"}, "ads_cost_currency": {"type": "string", "example": "PLN"}, "ads_return": {"type": "string", "example": "3.50", "description": "ROAS jako mnożnik. Dla dnia i oferty dzielimy łączną sprzedaż przypisaną reklamom przez łączny koszt. Przy zerowym koszcie zapisujemy 0,00. Dla starszego formatu XLSX sprzedaż obliczamy z kosztu i ROAS każdego wiersza. Przy ponownym imporcie XLSX skaner przelicza wskaźnik. Wartości z wcześniejszych importów mogą zawierać sumę kilku wskaźników."}, "ads_return_currency": {"type": "string", "example": "PLN", "description": "Waluta kwot raportu użytych do wyliczenia ROAS. Sam mnożnik jest bezwymiarowy."}, "price_position": {"type": "integer", "minimum": 0, "nullable": true, "description": "Pozycja cenowa oferty."}, "price_positions": {"type": "integer", "minimum": 0, "nullable": true, "description": "Liczba ofert w porównaniu."}, "price_difference": {"type": "string", "example": "49.99", "nullable": true, "description": "Cena referencyjna minus cena własna, w walucie competition.currency."}, "competition": {"$ref": "#/components/schemas/ScannerCompetition"}, "competition_measurements": {"type": "array", "items": {"$ref": "#/components/schemas/ScannerCompetitionMeasurement"}, "description": "Wszystkie zapisane porównania tego dnia, w kolejności identyfikatorów rynków. W dniu bez nowych porównań lista zawiera dostępny wpis archive lub jest pusta."}}}, "ScannerOfferEvent": {"type": "object", "additionalProperties": false, "required": ["date", "event_type", "event_type_display", "event_data"], "properties": {"id": {"type": "integer", "nullable": true}, "created": {"type": "string", "format": "date-time", "nullable": true}, "date": {"type": "string", "format": "date"}, "event_type": {"type": "integer", "enum": [1, 2, 3, 4, 5, 6, 7], "description": "1 — zmiana produktu, 2 — zmiana nazwy, 3 — zmiana miniaturki, 4 — zakończenie, 5 — wznowienie, 6 — zmiana EAN. Starsze wpisy z kodem 2 mogą dotyczyć miniaturki. Jeśli dawniej nazwa i miniaturka zmieniły się tego samego dnia, w historii mogło pozostać tylko jedno zdarzenie. 7 — zmiana danych oferty. Nowe wpisy zawierają changes (path, label, before, after) i observed_at w event_data. Każda różniąca się obserwacja jest zachowana, także tego samego dnia. Pierwszy poprawny odczyt ustala punkt odniesienia."}, "event_type_display": {"type": "string", "example": "Zmiana nazwy"}, "event_data": {"type": "object", "additionalProperties": true, "example": {"before": "Poprzednia nazwa", "after": "Nowa nazwa"}}}}, "ScannerOfferHistory": {"type": "object", "additionalProperties": false, "required": ["offer_id", "days", "date_from", "date_to", "stats", "events"], "properties": {"offer_id": {"type": "string", "pattern": "^[1-9][0-9]{0,18}$", "example": "17400123456", "description": "Numer oferty Allegro od 1 do 9223372036854775807."}, "days": {"type": "integer", "minimum": 1, "maximum": 90, "example": 3}, "date_from": {"type": "string", "format": "date", "description": "Pierwszy dzień okresu, włącznie."}, "date_to": {"type": "string", "format": "date", "description": "Ostatni dzień okresu, włącznie."}, "stats": {"type": "array", "maxItems": 90, "items": {"$ref": "#/components/schemas/ScannerDailyStat"}}, "events": {"type": "array", "items": {"$ref": "#/components/schemas/ScannerOfferEvent"}}}}, "Money": {"type": "object", "required": ["amount", "currency"], "properties": {"amount": {"type": "string", "nullable": true, "example": "123.45"}, "currency": {"type": "string", "example": "PLN"}}}, "CompetitorOffer": {"type": "object", "required": ["offer_id", "url", "name", "seller_id", "seller_login", "price", "delivery_price", "stock", "popularity", "image", "category_id", "has_free_delivery", "is_superseller", "is_company", "promotion_emphasized", "promotion_bold", "promotion_highlight", "checked_at"], "properties": {"offer_id": {"type": "string", "nullable": true}, "url": {"type": "string", "format": "uri", "nullable": true}, "name": {"type": "string", "nullable": true}, "seller_id": {"type": "string", "nullable": true}, "seller_login": {"type": "string", "nullable": true}, "price": {"$ref": "#/components/schemas/Money"}, "delivery_price": {"$ref": "#/components/schemas/Money"}, "stock": {"type": "integer", "nullable": true}, "popularity": {"type": "integer", "nullable": true}, "image": {"type": "string", "format": "uri", "nullable": true}, "category_id": {"type": "string", "nullable": true}, "has_free_delivery": {"type": "boolean", "nullable": true}, "is_superseller": {"type": "boolean", "nullable": true}, "is_company": {"type": "boolean", "nullable": true}, "promotion_emphasized": {"type": "boolean", "nullable": true}, "promotion_bold": {"type": "boolean", "nullable": true}, "promotion_highlight": {"type": "boolean", "nullable": true}, "checked_at": {"type": "string", "format": "date-time", "nullable": true}}}, "NullableCompetitorReportResult": {"type": "object", "additionalProperties": false, "nullable": true, "required": ["ean", "marketplace_id", "checked_at", "total", "limit", "offset", "offers"], "properties": {"ean": {"type": "string", "pattern": "^[0-9]{8,14}$"}, "marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "checked_at": {"type": "string", "format": "date-time", "nullable": true}, "total": {"type": "integer", "minimum": 0}, "limit": {"type": "integer", "enum": [60]}, "offset": {"type": "integer", "enum": [0]}, "offers": {"type": "array", "maxItems": 60, "items": {"$ref": "#/components/schemas/CompetitorOffer"}}}, "description": "Pierwsze maksymalnie 60 ofert snapshotu; jego odczyt nie zużywa kolejnego sprawdzenia. Null oznacza, że pozycja nie została jeszcze zakończona albo zakończyła się błędem."}, "RepricerUsagePool": {"type": "object", "additionalProperties": false, "required": ["active", "total", "used", "remaining", "valid_from", "valid_until"], "properties": {"active": {"type": "boolean", "description": "Czy firma ma obecnie aktywny pakiet sprawdzeń."}, "total": {"type": "integer", "minimum": 0}, "used": {"type": "integer", "minimum": 0, "description": "Sprawdzenia wykorzystane lub zarezerwowane w aktywnym okresie rozliczeniowym."}, "remaining": {"type": "integer", "minimum": 0}, "valid_from": {"type": "string", "format": "date-time", "nullable": true}, "valid_until": {"type": "string", "format": "date-time", "nullable": true}}}, "RepricerUsage": {"type": "object", "additionalProperties": false, "required": ["competitor_checks"], "properties": {"competitor_checks": {"$ref": "#/components/schemas/RepricerUsagePool"}}}, "CompetitorReportCreate": {"type": "object", "additionalProperties": false, "required": ["marketplace_id", "eans"], "properties": {"marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "eans": {"type": "array", "minItems": 1, "maxItems": 10000, "uniqueItems": true, "items": {"type": "string", "pattern": "^[0-9]{8,14}$"}}, "filters": {"$ref": "#/components/schemas/CompetitorReportFilters"}}}, "CompetitorReportFilters": {"type": "object", "additionalProperties": false, "description": "Filtry raportu. Pominięcie całego obiektu filters albo samego pola condition oznacza condition=any.", "properties": {"has_smart": {"type": "boolean", "description": "true uruchamia wyszukiwanie Allegro z option=SMART. false zwraca różnicę wyników wyszukiwania wszystkich ofert i wyników option=SMART. Pominięcie pola nie filtruje po SMART. SMART jest wyłącznie filtrem wyszukiwania i nie jest zwracany jako pole oferty."}, "condition": {"type": "string", "enum": ["any", "new", "used"], "default": "any", "description": "Stan oferty: dowolny, nowy albo używany. Pominięcie pola condition oznacza any, także gdy nie podano obiektu filters."}, "shipping_country": {"type": "string", "minLength": 2, "maxLength": 2, "pattern": "^[A-Za-z]{2}$", "enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW", "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar", "as", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", "bq", "br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf", "gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me", "mf", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv", "mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", "ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", "tt", "tv", "tw", "tz", "ua", "ug", "um", "us", "uy", "uz", "va", "vc", "ve", "vg", "vi", "vn", "vu", "wf", "ws", "ye", "yt", "za", "zm", "zw"], "example": "PL", "description": "Kraj docelowy dostawy jako kod ISO 3166-1 alpha-2, mapowany na filtr Allegro shipping.country. Małe litery są normalizowane do wielkich. Pominięcie pola nie filtruje ofert po kraju dostawy. Dostępność dostawy dla danej pary marketplace-kraj określa Allegro; kod kraju nie jest automatycznie wyprowadzany z marketplace_id."}}}, "CompetitorReportCost": {"type": "object", "additionalProperties": false, "required": ["reserved", "refunded", "charged", "unit"], "properties": {"reserved": {"type": "integer", "minimum": 0, "description": "Początkowo zarezerwowana liczba sprawdzeń."}, "refunded": {"type": "integer", "minimum": 0, "description": "Sprawdzenia zwrócone po nieudanych pozycjach."}, "charged": {"type": "integer", "minimum": 0, "description": "Bieżący koszt netto obciążający saldo: reserved minus refunded."}, "unit": {"type": "string", "enum": ["check"]}}}, "CompetitorReportProgress": {"type": "object", "additionalProperties": false, "required": ["total", "completed", "failed", "pending"], "properties": {"total": {"type": "integer", "minimum": 1, "maximum": 10000}, "completed": {"type": "integer", "minimum": 0, "maximum": 10000}, "failed": {"type": "integer", "minimum": 0, "maximum": 10000}, "pending": {"type": "integer", "minimum": 0, "maximum": 10000}}}, "CompetitorReportItemError": {"type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": {"code": {"type": "string", "enum": ["report_item_failed"]}, "message": {"type": "string"}}}, "NullableCompetitorReportItemError": {"type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": {"code": {"type": "string", "enum": ["report_item_failed"]}, "message": {"type": "string"}}, "nullable": true}, "CompetitorReportItem": {"type": "object", "additionalProperties": false, "required": ["ean", "status", "checked_at", "result", "error"], "properties": {"ean": {"type": "string", "pattern": "^[0-9]{8,14}$"}, "status": {"type": "string", "enum": ["queued", "running", "completed", "failed"]}, "checked_at": {"type": "string", "format": "date-time", "nullable": true}, "result": {"$ref": "#/components/schemas/NullableCompetitorReportResult"}, "error": {"$ref": "#/components/schemas/NullableCompetitorReportItemError"}}}, "CompetitorReportPagination": {"type": "object", "additionalProperties": false, "required": ["limit", "has_more", "next_cursor"], "properties": {"limit": {"type": "integer", "minimum": 1, "maximum": 100}, "has_more": {"type": "boolean"}, "next_cursor": {"type": "string", "nullable": true, "description": "Nieprzezroczysty, podpisany kursor następnej strony pozycji."}}}, "CompetitorReportExport": {"type": "object", "additionalProperties": false, "required": ["status", "format", "download_url", "size_bytes", "generated_at", "expires_at", "error_code"], "properties": {"status": {"type": "string", "enum": ["pending", "building", "ready", "failed", "expired"]}, "format": {"type": "string", "enum": ["csv_zip"]}, "download_url": {"type": "string", "nullable": true, "description": "Ścieżka pobrania wymagająca tego samego Bearer API key."}, "size_bytes": {"type": "integer", "minimum": 0, "nullable": true}, "generated_at": {"type": "string", "format": "date-time", "nullable": true}, "expires_at": {"type": "string", "format": "date-time", "nullable": true}, "error_code": {"type": "string", "nullable": true}}}, "CompetitorReport": {"type": "object", "additionalProperties": false, "required": ["id", "status", "marketplace_id", "filters", "cost", "progress", "items", "pagination", "export", "created_at", "started_at", "completed_at"], "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["queued", "running", "completed", "partially_failed", "failed"]}, "marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "filters": {"$ref": "#/components/schemas/CompetitorReportFilters"}, "cost": {"$ref": "#/components/schemas/CompetitorReportCost"}, "progress": {"$ref": "#/components/schemas/CompetitorReportProgress"}, "items": {"type": "array", "maxItems": 100, "items": {"$ref": "#/components/schemas/CompetitorReportItem"}}, "pagination": {"$ref": "#/components/schemas/CompetitorReportPagination"}, "export": {"$ref": "#/components/schemas/CompetitorReportExport"}, "created_at": {"type": "string", "format": "date-time"}, "started_at": {"type": "string", "format": "date-time", "nullable": true}, "completed_at": {"type": "string", "format": "date-time", "nullable": true}}}, "RepricerListingMoney": {"type": "object", "additionalProperties": false, "required": ["amount", "currency"], "description": "Kwota dziesiętna zapisana jako string. Przy zapisie waluta musi odpowiadać rynkowi: allegro-pl — PLN, allegro-cz — CZK, allegro-sk — EUR, allegro-hu — HUF. Dla CZK i HUF wszystkie zapisywane kwoty, także minimum i maksimum, muszą być całkowite (np. \"100.00\").", "properties": {"amount": {"type": "string", "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,2})?$"}, "currency": {"type": "string", "enum": ["PLN", "CZK", "EUR", "HUF"]}}}, "NullableRepricerListingMoney": {"type": "object", "additionalProperties": false, "required": ["amount", "currency"], "description": "Granica ceny. Możesz zapisać null, gdy końcowy tryb to off albo gdy oferta jednosztukowa ma końcowy tryb observe. Podana cena minimalna musi wynosić co najmniej 1 w walucie rynku i może być co najwyżej równa cenie maksymalnej. Waluta musi odpowiadać rynkowi (PLN/CZK/EUR/HUF odpowiednio dla allegro-pl/cz/sk/hu); minimum i maksimum w CZK lub HUF muszą być kwotami całkowitymi, np. \"100.00\".", "properties": {"amount": {"type": "string", "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,2})?$"}, "currency": {"type": "string", "enum": ["PLN", "CZK", "EUR", "HUF"]}}, "nullable": true}, "RepricerListingStepMoney": {"type": "object", "additionalProperties": false, "required": ["amount", "currency"], "description": "Kwota dziesiętna zapisana jako string. Przy zapisie waluta musi odpowiadać rynkowi: allegro-pl — PLN, allegro-cz — CZK, allegro-sk — EUR, allegro-hu — HUF. Dla CZK i HUF wszystkie zapisywane kwoty, także minimum i maksimum, muszą być całkowite (np. \"100.00\").", "properties": {"amount": {"type": "string", "pattern": "^-?(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,2})?$", "enum": ["0.00", "0.01", "0.05", "0.10", "0.50", "1.00", "2.00", "3.00", "5.00", "10.00", "20.00", "50.00", "-0.01", "-0.02", "-1.00", "-5.00", "-10.00", "-25.00", "-50.00", "-75.00", "-100.00"], "description": "Dozwolony krok repricera. Dla CZK i HUF dostępne są wyłącznie wartości całkowite z tej listy."}, "currency": {"type": "string", "enum": ["PLN", "CZK", "EUR", "HUF"]}}}, "RepricerListingFilters": {"type": "object", "additionalProperties": false, "required": ["same_gtin", "product_gtins", "manufacturer_code", "excluded_external_listing_ids"], "properties": {"same_gtin": {"type": "boolean"}, "product_gtins": {"type": "boolean"}, "manufacturer_code": {"type": "boolean"}, "excluded_external_listing_ids": {"type": "array", "uniqueItems": true, "maxItems": 500, "items": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}}}}, "RepricerListingRule": {"type": "object", "additionalProperties": false, "required": ["strategy", "minimum_price", "maximum_price", "step", "check_interval_minutes", "filters"], "properties": {"strategy": {"type": "string", "enum": ["lowest_competitor", "custom"], "readOnly": true}, "minimum_price": {"$ref": "#/components/schemas/NullableRepricerListingMoney"}, "maximum_price": {"$ref": "#/components/schemas/NullableRepricerListingMoney"}, "step": {"$ref": "#/components/schemas/RepricerListingStepMoney"}, "check_interval_minutes": {"type": "integer", "enum": [1, 5, 15, 30, 60, 120, 180, 240, 360, 720, 1440, 2880, 4320]}, "filters": {"$ref": "#/components/schemas/RepricerListingFilters"}}}, "RepricerListingAutomation": {"type": "object", "additionalProperties": false, "required": ["enabled", "rule", "last_checked_at", "last_price_changed_at"], "properties": {"enabled": {"type": "boolean", "description": "true oznacza „Monitoring włączony” zarówno w trybie „Tylko obserwuj”, jak i „Automatyczne ceny”. false oznacza „Monitoring wyłączony”."}, "operating_mode": {"type": "string", "enum": ["off", "observe", "auto"], "description": "Aktualny tryb oferty. GET zwraca to pole przy include_operating_mode=true. PATCH zwraca je, gdy żądanie zawiera operating_mode."}, "rule": {"$ref": "#/components/schemas/RepricerListingRule"}, "last_checked_at": {"type": "string", "format": "date-time", "nullable": true}, "last_price_changed_at": {"type": "string", "format": "date-time", "nullable": true}}}, "RepricerListing": {"type": "object", "additionalProperties": false, "required": ["id", "connection_id", "marketplace_id", "sku", "gtin", "name", "image_url", "listing_status", "current_price", "stock", "automation"], "properties": {"id": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$", "description": "Identyfikator oferty Allegro."}, "connection_id": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}, "marketplace_id": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "sku": {"type": "string"}, "gtin": {"type": "string"}, "name": {"type": "string"}, "image_url": {"type": "string", "format": "uri", "nullable": true}, "listing_status": {"type": "string", "enum": ["active", "inactive", "activating", "ended", "archived"]}, "current_price": {"$ref": "#/components/schemas/RepricerListingMoney"}, "stock": {"type": "integer", "minimum": 0}, "automation": {"$ref": "#/components/schemas/RepricerListingAutomation"}}}, "RepricerListingsPagination": {"type": "object", "additionalProperties": false, "required": ["limit", "has_more", "next_cursor"], "properties": {"limit": {"type": "integer", "minimum": 1, "maximum": 100}, "has_more": {"type": "boolean"}, "next_cursor": {"type": "string", "nullable": true}}}, "RepricerListings": {"type": "object", "additionalProperties": false, "required": ["offers", "pagination"], "properties": {"offers": {"type": "array", "items": {"$ref": "#/components/schemas/RepricerListing"}}, "pagination": {"$ref": "#/components/schemas/RepricerListingsPagination"}}}, "RepricerListingFiltersPatch": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"same_gtin": {"type": "boolean"}, "product_gtins": {"type": "boolean", "description": "Wartość true wymaga końcowego same_gtin=true."}, "manufacturer_code": {"type": "boolean"}, "excluded_external_listing_ids": {"type": "array", "maxItems": 500, "description": "Zastępuje całą listę wykluczonych ofert; [] ją czyści. Duplikaty są usuwane z zachowaniem kolejności. Nie wolno wykluczyć aktualizowanej oferty. Każdy identyfikator musi mieścić się w zakresie 1–9223372036854775807.", "items": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$"}}}}, "RepricerListingPatch": {"type": "object", "additionalProperties": false, "minProperties": 1, "description": "Możesz podać samo enabled, sam operating_mode albo oba pola. Gdy podajesz oba, off wymaga enabled=false, a observe i auto wymagają enabled=true. Sprzeczne wartości zwracają 400 invalid_request.", "properties": {"enabled": {"type": "boolean", "description": "Samo enabled=true wznawia monitoring w zapamiętanym trybie. enabled=false wyłącza monitoring i zachowuje wybrany tryb na później."}, "operating_mode": {"type": "string", "enum": ["off", "observe", "auto"], "description": "off wyłącza monitoring i zachowuje poprzedni tryb do wznowienia. observe włącza monitoring konkurencji i pozostawia cenę ustaloną przez sprzedawcę. auto włącza monitoring oraz automatyczne zmiany ceny według reguły oferty."}, "minimum_price": {"$ref": "#/components/schemas/NullableRepricerListingMoney"}, "maximum_price": {"$ref": "#/components/schemas/NullableRepricerListingMoney"}, "step": {"$ref": "#/components/schemas/RepricerListingStepMoney"}, "check_interval_minutes": {"type": "integer", "enum": [1, 5, 15, 30, 60, 120, 180, 240, 360, 720, 1440, 2880, 4320]}, "filters": {"$ref": "#/components/schemas/RepricerListingFiltersPatch"}}}, "RepricerOfferUpdateItemInput": {"type": "object", "additionalProperties": false, "required": ["marketplace", "offer_id", "changes"], "properties": {"marketplace": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "offer_id": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$", "description": "ID oferty Allegro w zakresie 1–9223372036854775807."}, "changes": {"$ref": "#/components/schemas/RepricerListingPatch"}}}, "RepricerOfferUpdateCreate": {"type": "object", "additionalProperties": false, "required": ["items"], "properties": {"items": {"type": "array", "minItems": 1, "maxItems": 1000, "description": "Para marketplace i offer_id musi być unikalna w paczce. Każda oferta może mieć inne changes. Limit całego body wynosi 512 KiB, niezależnie od limitu liczby ofert.", "items": {"$ref": "#/components/schemas/RepricerOfferUpdateItemInput"}}}}, "RepricerOfferUpdateAccepted": {"type": "object", "additionalProperties": false, "required": ["id", "status", "item_count", "status_url"], "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["queued"]}, "item_count": {"type": "integer", "minimum": 1, "maximum": 1000}, "status_url": {"type": "string", "format": "uri-reference"}}}, "RepricerOfferUpdateItem": {"type": "object", "additionalProperties": false, "required": ["position", "marketplace", "offer_id", "status", "error"], "properties": {"position": {"type": "integer", "minimum": 0, "maximum": 999, "description": "Pozycja w wejściowej tablicy items, liczona od zera."}, "marketplace": {"type": "string", "enum": ["allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu"]}, "offer_id": {"type": "string", "maxLength": 19, "pattern": "^[1-9][0-9]{0,18}$", "description": "ID oferty Allegro w zakresie 1–9223372036854775807."}, "status": {"type": "string", "enum": ["queued", "completed", "failed"]}, "error": {"type": "object", "nullable": true, "additionalProperties": false, "required": ["code", "message", "status"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "status": {"type": "integer", "minimum": 400, "maximum": 599}, "purchase_url": {"type": "string", "format": "uri"}}, "description": "null dla pozycji oczekującej lub zapisanej. Błędy domenowe mają te same kody co pojedynczy PATCH; obca lub nieistniejąca oferta daje listing_not_found. Brak sprawdzeń wymaganych przy aktywacji daje competitor_checks_required i purchase_url. status podaje odpowiednik HTTP błędu pozycji (np. 402, 404, 409), podczas gdy odczyt całej paczki zwraca HTTP 200. Utrata ważności lub uprawnień klucza przed wykonaniem daje api_key_unavailable (403); nieudane próby obsługi kończą się update_failed (503). Po wyczerpaniu limitu 5 kolejnych prób wysłania zadania bez postępu pozostałe pozycje otrzymują update_retry_limit_exceeded (503)."}}}, "RepricerOfferUpdate": {"type": "object", "additionalProperties": false, "required": ["id", "status", "item_count", "processed_count", "succeeded_count", "failed_count", "created_at", "started_at", "completed_at", "items", "pagination"], "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "enum": ["queued", "running", "completed", "partially_failed", "failed"]}, "item_count": {"type": "integer", "minimum": 1, "maximum": 1000}, "processed_count": {"type": "integer", "minimum": 0, "maximum": 1000}, "succeeded_count": {"type": "integer", "minimum": 0, "maximum": 1000}, "failed_count": {"type": "integer", "minimum": 0, "maximum": 1000}, "created_at": {"type": "string", "format": "date-time"}, "started_at": {"type": "string", "format": "date-time", "nullable": true}, "completed_at": {"type": "string", "format": "date-time", "nullable": true}, "items": {"type": "array", "maxItems": 100, "items": {"$ref": "#/components/schemas/RepricerOfferUpdateItem"}}, "pagination": {"type": "object", "additionalProperties": false, "required": ["limit", "offset", "has_more", "next_offset"], "properties": {"limit": {"type": "integer", "minimum": 1, "maximum": 100}, "offset": {"type": "integer", "minimum": 0, "maximum": 1000}, "has_more": {"type": "boolean"}, "next_offset": {"type": "integer", "minimum": 0, "maximum": 1000, "nullable": true}}}}}, "Error": {"type": "object", "required": ["error", "request_id"], "properties": {"error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "details": {"type": "object", "additionalProperties": true}}}, "request_id": {"type": "string"}}}, "PaidChecksError": {"type": "object", "required": ["error", "request_id"], "properties": {"error": {"type": "object", "required": ["code", "message", "purchase_url"], "properties": {"code": {"type": "string", "enum": ["competitor_checks_required"]}, "message": {"type": "string"}, "purchase_url": {"type": "string", "format": "uri"}, "details": {"type": "object", "additionalProperties": false, "required": ["required_checks", "remaining_checks"], "properties": {"required_checks": {"type": "integer", "minimum": 1}, "remaining_checks": {"type": "integer", "minimum": 0}}}}}, "request_id": {"type": "string"}}}, "CompetitorReportPaymentRequired": {"type": "object", "additionalProperties": false, "required": ["error", "request_id"], "properties": {"error": {"type": "object", "additionalProperties": false, "required": ["code", "message", "purchase_url", "details"], "properties": {"code": {"type": "string", "enum": ["competitor_checks_required"]}, "message": {"type": "string"}, "purchase_url": {"type": "string", "format": "uri"}, "details": {"type": "object", "additionalProperties": false, "required": ["required_checks", "remaining_checks"], "properties": {"required_checks": {"type": "integer", "minimum": 1}, "remaining_checks": {"type": "integer", "minimum": 0}}}}}, "request_id": {"type": "string"}}}, "PublicCompany": {"type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": {"id": {"type": "string", "description": "Publiczny identyfikator firmy. Należy traktować go jako nieprzezroczysty ciąg znaków.", "example": "123"}, "name": {"type": "string", "example": "Przykładowy Sprzedawca"}}}, "PublicApiLimit": {"type": "object", "additionalProperties": false, "required": ["id", "applies_to", "limit", "period"], "properties": {"id": {"type": "string", "description": "Stabilny identyfikator limitu."}, "applies_to": {"type": "string", "enum": ["api_key", "company"]}, "limit": {"type": "integer", "minimum": 1}, "period": {"type": "string", "description": "Okno limitu jako czas ISO 8601, np. PT60S, albo identyfikator okresu kalendarzowego, np. utc_day.", "example": "PT60S"}}}, "PublicMe": {"type": "object", "additionalProperties": false, "required": ["company", "scopes", "limits", "api_version", "contract_version"], "properties": {"company": {"$ref": "#/components/schemas/PublicCompany"}, "scopes": {"type": "array", "uniqueItems": true, "items": {"type": "string"}, "example": ["connections:read", "message_channels.inbound_messages:write", "orders:write", "repricer.competitor_reports:write"]}, "limits": {"type": "array", "description": "W obecnym kontrakcie pusta lista. Limity infrastruktury oraz liczby zadań workera nie są tu prezentowane.", "items": {"$ref": "#/components/schemas/PublicApiLimit"}, "example": []}, "api_version": {"type": "string", "enum": ["v1"]}, "contract_version": {"type": "string", "enum": ["1.20.0"]}}}, "PublicConnection": {"type": "object", "additionalProperties": false, "required": ["id", "channel", "marketplace_id", "name", "external_id", "status"], "properties": {"id": {"type": "string", "description": "Publiczny identyfikator połączenia. Należy traktować go jako nieprzezroczysty ciąg znaków.", "example": "456"}, "channel": {"type": "string", "enum": ["allegro", "emag", "erli", "empik", "inpost-buy", "facebook-page", "instagram", "olx"]}, "marketplace_id": {"type": "string", "nullable": true, "enum": [null, "allegro-pl", "allegro-cz", "allegro-sk", "allegro-hu", "allegro-business-cz", "olx"], "description": "Identyfikator marketplace’u zwracany tylko wtedy, gdy wartość jest wiarygodna w modelu źródłowym; w przeciwnym razie null.", "example": "allegro-pl"}, "name": {"type": "string", "description": "Nazwa konta widoczna w Niezbędniku Sprzedawcy.", "example": "sklep_demo"}, "external_id": {"type": "string", "description": "Identyfikator konta nadany przez kanał.", "example": "12345678"}, "status": {"type": "string", "enum": ["connected", "disconnected"]}}}, "PublicConnections": {"type": "object", "additionalProperties": false, "required": ["connections"], "properties": {"connections": {"type": "array", "items": {"$ref": "#/components/schemas/PublicConnection"}}}}, "PublicOrderMoney": {"type": "object", "additionalProperties": false, "required": ["amount", "currency"], "properties": {"amount": {"type": "string", "pattern": "^(?:0|[1-9][0-9]{0,11})(?:\\.[0-9]{1,2})?$", "description": "Nieujemna kwota dziesiętna zapisana jako string, z najwyżej dwoma cyframi po separatorze dziesiętnym.", "example": "39.90"}, "currency": {"type": "string", "minLength": 3, "maxLength": 3, "pattern": "^[A-Z]{3}$", "enum": ["ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "IMP", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLE", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VED", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAD", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XCG", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "XYZ", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWG", "ZWL", "ZWN", "ZWR"], "description": "Obsługiwany kod ISO 4217. API normalizuje kod do wielkich liter.", "example": "PLN"}}}, "PublicOrderSourceCreate": {"type": "object", "additionalProperties": false, "required": ["external_order_id"], "description": "Identyfikacja zamówienia w uprzednio utworzonym źródle API. Samo źródło wskazuje parametr source_id w ścieżce endpointu.", "properties": {"external_order_id": {"type": "string", "minLength": 1, "maxLength": 100, "description": "Stabilny identyfikator zamówienia nadany przez integratora.", "example": "PM-2026-00042"}, "url": {"type": "string", "format": "uri", "nullable": true, "maxLength": 500, "description": "Opcjonalny URL zamówienia w systemie źródłowym. Pole jest zapisywane i zwracane; nie umieszczaj w nim tokenów ani innych sekretów."}}}, "PublicOrderSource": {"type": "object", "additionalProperties": false, "required": ["source_id", "name", "external_order_id"], "description": "Kanoniczne źródło i identyfikacja utworzonego zamówienia.", "properties": {"source_id": {"type": "string", "format": "uuid", "description": "Identyfikator źródła utworzonego wcześniej w panelu Niezbędnika Sprzedawcy.", "example": "11111111-1111-4111-8111-111111111111"}, "name": {"type": "string", "maxLength": 50, "description": "Kanoniczna nazwa źródła z chwili pierwszego przetworzenia żądania, widoczna dla operatora.", "example": "Partner Marketplace"}, "external_order_id": {"type": "string", "minLength": 1, "maxLength": 100, "description": "Identyfikator zamówienia w systemie źródłowym.", "example": "PM-2026-00042"}, "url": {"type": "string", "format": "uri", "nullable": true, "maxLength": 500, "description": "Opcjonalny URL zamówienia w systemie źródłowym. Pole jest zapisywane i zwracane; nie umieszczaj w nim tokenów ani innych sekretów."}}}, "PublicOrderCustomer": {"type": "object", "additionalProperties": false, "description": "Opcjonalne dane klienta. Są zapisywane w zamówieniu, ale nie są zwracane w odpowiedzi 201.", "properties": {"external_id": {"type": "string", "nullable": true, "maxLength": 255}, "email": {"type": "string", "format": "email", "nullable": true, "maxLength": 254}, "phone": {"type": "string", "nullable": true, "format": "phone", "pattern": "^(?:$|[+0-9(][0-9 .()+/-]{5,}[0-9)](?:\\s*(?:[Ee][Xx][Tt]\\.?|[Xx])\\s*[0-9]+)?)$", "description": "Numer telefonu; zalecany format E.164.", "example": "+48123123123"}, "first_name": {"type": "string", "nullable": true, "maxLength": 250}, "last_name": {"type": "string", "nullable": true, "maxLength": 250}, "company": {"type": "string", "nullable": true, "maxLength": 250}}}, "PublicOrderShippingAddress": {"type": "object", "additionalProperties": false, "description": "Opcjonalny adres dostawy. Wszystkie pola są opcjonalne; pominięty country_code przyjmuje PL. Dane nie są zwracane w odpowiedzi 201.", "properties": {"first_name": {"type": "string", "nullable": true, "maxLength": 250}, "last_name": {"type": "string", "nullable": true, "maxLength": 250}, "company": {"type": "string", "nullable": true, "maxLength": 250}, "email": {"type": "string", "format": "email", "nullable": true, "maxLength": 254}, "phone": {"type": "string", "nullable": true, "format": "phone", "pattern": "^(?:$|[+0-9(][0-9 .()+/-]{5,}[0-9)](?:\\s*(?:[Ee][Xx][Tt]\\.?|[Xx])\\s*[0-9]+)?)$", "description": "Numer telefonu; zalecany format E.164."}, "address_line_1": {"type": "string", "nullable": true, "maxLength": 250}, "address_line_2": {"type": "string", "nullable": true, "maxLength": 250}, "city": {"type": "string", "nullable": true, "maxLength": 250}, "postal_code": {"type": "string", "nullable": true, "maxLength": 15}, "country_code": {"type": "string", "minLength": 2, "maxLength": 2, "pattern": "^[A-Z]{2}$", "enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"], "default": "PL", "description": "Kod kraju ISO 3166-1 alpha-2."}}}, "PublicOrderBillingAddress": {"type": "object", "additionalProperties": false, "description": "Dane do faktury. Wymagają company albo pary first_name i last_name. Łączna długość address_line_1 i address_line_2 wraz ze znakiem nowej linii nie może przekroczyć 250 znaków.", "required": ["address_line_1", "city", "postal_code"], "properties": {"first_name": {"type": "string", "nullable": true, "maxLength": 250}, "last_name": {"type": "string", "nullable": true, "maxLength": 250}, "company": {"type": "string", "nullable": true, "maxLength": 250}, "tax_id": {"type": "string", "nullable": true, "maxLength": 50}, "address_line_1": {"type": "string", "minLength": 1, "maxLength": 250}, "address_line_2": {"type": "string", "nullable": true, "maxLength": 250}, "city": {"type": "string", "minLength": 1, "maxLength": 250}, "postal_code": {"type": "string", "minLength": 1, "maxLength": 15}, "country_code": {"type": "string", "minLength": 2, "maxLength": 2, "pattern": "^[A-Z]{2}$", "enum": ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"], "default": "PL", "description": "Kod kraju ISO 3166-1 alpha-2."}}}, "PublicOrderPayment": {"type": "object", "additionalProperties": false, "required": ["method", "status"], "description": "Rejestruje stan płatności; endpoint nie inicjuje ani nie pobiera płatności. Dla pending paid_amount należy pominąć lub ustawić na zero, a paid_at pominąć. Dla partially_paid wymagane jest 0 < paid_amount < suma zamówienia. Dla paid paid_amount można pominąć albo musi być równe sumie zamówienia.", "properties": {"method": {"type": "string", "enum": ["online", "cash_on_delivery", "bank_transfer"]}, "status": {"type": "string", "enum": ["pending", "partially_paid", "paid"]}, "paid_amount": {"$ref": "#/components/schemas/PublicOrderMoney"}, "provider": {"type": "string", "maxLength": 30}, "transaction_id": {"type": "string", "maxLength": 100}, "paid_at": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$", "nullable": true, "description": "Czas RFC 3339 z jawną strefą: Z albo offset ±HH:MM."}}}, "PublicOrderPickupPoint": {"type": "object", "additionalProperties": false, "required": ["id"], "properties": {"id": {"type": "string", "minLength": 1, "maxLength": 50}, "name": {"type": "string", "maxLength": 250}, "description": {"type": "string", "maxLength": 600}, "address_line_1": {"type": "string", "maxLength": 250}, "postal_code": {"type": "string", "maxLength": 15}, "city": {"type": "string", "maxLength": 250}}}, "PublicOrderPackageDimensions": {"type": "object", "additionalProperties": false, "properties": {"length": {"type": "string", "pattern": "^(?:0\\.(?:00[1-9]|0[1-9][0-9]?|[1-9][0-9]{0,2})|[1-9][0-9]{0,6}(?:\\.[0-9]{1,3})?)$", "description": "Dodatnia liczba dziesiętna zapisana jako tekst, z maksymalnie trzema miejscami po przecinku."}, "width": {"type": "string", "pattern": "^(?:0\\.(?:00[1-9]|0[1-9][0-9]?|[1-9][0-9]{0,2})|[1-9][0-9]{0,6}(?:\\.[0-9]{1,3})?)$", "description": "Dodatnia liczba dziesiętna zapisana jako tekst, z maksymalnie trzema miejscami po przecinku."}, "height": {"type": "string", "pattern": "^(?:0\\.(?:00[1-9]|0[1-9][0-9]?|[1-9][0-9]{0,2})|[1-9][0-9]{0,6}(?:\\.[0-9]{1,3})?)$", "description": "Dodatnia liczba dziesiętna zapisana jako tekst, z maksymalnie trzema miejscami po przecinku."}}}, "PublicOrderPackage": {"type": "object", "additionalProperties": false, "properties": {"template": {"type": "string", "minLength": 1, "maxLength": 50}, "weight_kg": {"type": "string", "pattern": "^(?:0\\.(?:00[1-9]|0[1-9][0-9]?|[1-9][0-9]{0,2})|[1-9][0-9]{0,6}(?:\\.[0-9]{1,3})?)$", "description": "Dodatnia liczba dziesiętna zapisana jako tekst, z maksymalnie trzema miejscami po przecinku."}, "dimensions_cm": {"$ref": "#/components/schemas/PublicOrderPackageDimensions"}, "is_non_standard": {"type": "boolean"}}}, "PublicOrderShipping": {"type": "object", "additionalProperties": false, "required": ["method_id", "cost"], "properties": {"method_id": {"type": "string", "minLength": 1, "maxLength": 250, "description": "Stabilny identyfikator metody w obrębie źródła API. Służy do dopasowania usługi przewoźnika."}, "method_name": {"type": "string", "maxLength": 100}, "cost": {"$ref": "#/components/schemas/PublicOrderMoney"}, "tax_rate": {"type": "integer", "minimum": 0, "maximum": 100, "default": 23}, "pickup_point": {"$ref": "#/components/schemas/PublicOrderPickupPoint"}, "packages": {"type": "array", "minItems": 1, "maxItems": 99, "description": "Opcjonalne parametry paczek. Pominięcie oznacza jedną paczkę uzupełnianą z ustawień przewoźnika.", "items": {"$ref": "#/components/schemas/PublicOrderPackage"}}}}, "PublicOrderLineItemAttribute": {"type": "object", "additionalProperties": false, "required": ["name", "value"], "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 50}, "value": {"type": "string", "minLength": 1, "maxLength": 250}}}, "PublicOrderLineItemCreate": {"type": "object", "additionalProperties": false, "required": ["external_line_id", "name", "quantity", "unit_price"], "properties": {"external_line_id": {"type": "string", "minLength": 1, "maxLength": 255, "description": "Musi być unikalny w obrębie zamówienia."}, "external_product_id": {"type": "string", "nullable": true, "maxLength": 255}, "sku": {"type": "string", "nullable": true, "maxLength": 100}, "gtin": {"type": "string", "nullable": true, "maxLength": 14, "pattern": "^(?:[0-9]{8,14})?$"}, "name": {"type": "string", "minLength": 1, "maxLength": 250}, "quantity": {"type": "integer", "minimum": 1, "maximum": 100000}, "unit": {"type": "string", "minLength": 1, "maxLength": 20, "default": "pcs"}, "unit_price": {"$ref": "#/components/schemas/PublicOrderMoney"}, "tax_rate": {"type": "integer", "minimum": 0, "maximum": 100, "default": 23}, "attributes": {"type": "array", "maxItems": 20, "default": [], "items": {"$ref": "#/components/schemas/PublicOrderLineItemAttribute"}}}}, "PublicOrderCreate": {"type": "object", "additionalProperties": false, "required": ["source", "currency", "payment", "line_items"], "description": "Tworzy lokalne zamówienie w źródle API wskazanym w ścieżce. Źródło musi zostać wcześniej utworzone w panelu i pozostawać aktywne. Wszystkie kwoty muszą używać waluty zamówienia. Suma jest liczona jako suma unit_price × quantity oraz shipping.cost. Wyliczona suma nie może przekroczyć 999999999999.99; przekroczenie zwraca 400 invalid_request z opisem w error.details.line_items. expected_total, jeśli podane, musi być jej równe. billing_address jest wymagane dokładnie wtedy, gdy invoice_required=true. unit_price jest końcową ceną jednostkową brutto po rabatach; v1 nie obsługuje osobnych linii rabatów ani opłat.", "properties": {"source": {"$ref": "#/components/schemas/PublicOrderSourceCreate"}, "ordered_at": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$", "description": "Czas złożenia zamówienia w RFC 3339 z jawną strefą: Z albo offset ±HH:MM. Po pominięciu API używa czasu utworzenia."}, "currency": {"type": "string", "minLength": 3, "maxLength": 3, "pattern": "^[A-Z]{3}$", "enum": ["ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "IMP", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLE", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VED", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAD", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XCG", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "XYZ", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWG", "ZWL", "ZWN", "ZWR"], "description": "Obsługiwany kod ISO 4217.", "example": "PLN"}, "prices_include_tax": {"type": "boolean", "enum": [true], "default": true, "description": "Wersja v1 obsługuje wyłącznie ceny brutto."}, "inventory_behavior": {"type": "string", "enum": ["bypass"], "default": "bypass", "description": "Wersja v1 nie rezerwuje i nie zmniejsza stanu magazynowego."}, "payment": {"$ref": "#/components/schemas/PublicOrderPayment"}, "customer": {"$ref": "#/components/schemas/PublicOrderCustomer"}, "shipping_address": {"$ref": "#/components/schemas/PublicOrderShippingAddress"}, "billing_address": {"$ref": "#/components/schemas/PublicOrderBillingAddress"}, "invoice_required": {"type": "boolean", "default": false}, "line_items": {"type": "array", "minItems": 1, "maxItems": 100, "items": {"$ref": "#/components/schemas/PublicOrderLineItemCreate"}}, "shipping": {"$ref": "#/components/schemas/PublicOrderShipping"}, "expected_total": {"$ref": "#/components/schemas/PublicOrderMoney"}, "customer_note": {"type": "string", "maxLength": 2000}, "warehouse_note": {"type": "string", "maxLength": 2000}}}, "PublicOrderTotals": {"type": "object", "additionalProperties": false, "required": ["items", "shipping", "grand_total"], "properties": {"items": {"$ref": "#/components/schemas/PublicOrderMoney"}, "shipping": {"$ref": "#/components/schemas/PublicOrderMoney"}, "grand_total": {"$ref": "#/components/schemas/PublicOrderMoney"}}}, "PublicOrderLineItem": {"type": "object", "additionalProperties": false, "required": ["id", "external_line_id", "sku", "name", "quantity", "unit", "unit_price"], "properties": {"id": {"type": "string", "description": "Nieprzezroczysty identyfikator pozycji."}, "external_line_id": {"type": "string"}, "sku": {"type": "string", "nullable": true}, "name": {"type": "string"}, "quantity": {"type": "integer", "minimum": 1}, "unit": {"type": "string"}, "unit_price": {"$ref": "#/components/schemas/PublicOrderMoney"}}}, "PublicOrderCreatedShipping": {"type": "object", "nullable": true, "additionalProperties": false, "required": ["method_id", "method_name", "mapping_status", "package_count"], "properties": {"method_id": {"type": "string"}, "method_name": {"type": "string"}, "mapping_status": {"type": "string", "enum": ["mapped", "unmapped"]}, "package_count": {"type": "integer", "minimum": 1, "maximum": 99}}}, "PublicOrderWarning": {"type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": {"code": {"type": "string", "enum": ["delivery_method_unmapped"]}, "message": {"type": "string"}}}, "PublicOrderCreated": {"type": "object", "additionalProperties": false, "required": ["id", "number", "source", "status", "payment_status", "fulfillment_status", "inventory_behavior", "currency", "prices_include_tax", "totals", "line_items", "shipping", "warnings", "ordered_at", "created_at"], "properties": {"id": {"type": "string", "description": "Nieprzezroczysty identyfikator zamówienia."}, "number": {"type": "string"}, "source": {"$ref": "#/components/schemas/PublicOrderSource"}, "status": {"type": "string", "enum": ["unpaid", "ready_for_processing"], "description": "Początkowy stan zamówienia: ready_for_processing dla metody cash_on_delivery niezależnie od stanu płatności oraz dla każdej metody ze statusem płatności paid. Pozostałe kombinacje mają status unpaid. Dlatego pobranie może mieć jednocześnie payment_status=pending i status=ready_for_processing."}, "payment_status": {"type": "string", "enum": ["pending", "partially_paid", "paid"]}, "fulfillment_status": {"type": "string", "enum": ["unfulfilled"]}, "inventory_behavior": {"type": "string", "enum": ["bypass"]}, "currency": {"type": "string", "minLength": 3, "maxLength": 3, "pattern": "^[A-Z]{3}$"}, "prices_include_tax": {"type": "boolean", "enum": [true]}, "totals": {"$ref": "#/components/schemas/PublicOrderTotals"}, "line_items": {"type": "array", "minItems": 1, "maxItems": 100, "items": {"$ref": "#/components/schemas/PublicOrderLineItem"}}, "shipping": {"$ref": "#/components/schemas/PublicOrderCreatedShipping"}, "warnings": {"type": "array", "items": {"$ref": "#/components/schemas/PublicOrderWarning"}}, "ordered_at": {"type": "string", "format": "date-time"}, "created_at": {"type": "string", "format": "date-time"}}, "description": "Utworzone zamówienie bez danych osobowych klienta oraz adresów."}, "PublicInboundMessageSender": {"type": "object", "additionalProperties": false, "description": "Klient lub inny nadawca w systemie integratora. Białe znaki na początku i końcu pól są usuwane. Pola nie mogą zawierać znaków NUL.", "required": ["external_id", "name"], "properties": {"external_id": {"type": "string", "minLength": 1, "maxLength": 254, "pattern": "\\S", "description": "Stabilny identyfikator nadawcy w obrębie kanału integratora."}, "name": {"type": "string", "minLength": 1, "maxLength": 254, "pattern": "\\S", "description": "Nazwa klienta wyświetlana operatorowi."}, "email": {"type": "string", "maxLength": 254, "anyOf": [{"type": "string", "format": "email"}, {"type": "string", "enum": [""]}], "description": "Opcjonalny adres e-mail klienta. Można pominąć pole albo przekazać pusty string."}}}, "PublicInboundMessage": {"type": "object", "additionalProperties": false, "required": ["external_message_id", "external_thread_id", "sent_at", "sender"], "anyOf": [{"required": ["text"], "properties": {"text": {"type": "string", "pattern": "\\S"}}}, {"required": ["attachment_ids"], "properties": {"attachment_ids": {"type": "array", "minItems": 1}}}], "properties": {"external_message_id": {"type": "string", "minLength": 1, "maxLength": 36, "pattern": "\\S", "description": "Stabilny identyfikator wiadomości integratora."}, "external_thread_id": {"type": "string", "minLength": 1, "maxLength": 43, "pattern": "\\S", "description": "Stabilny identyfikator wątku integratora."}, "sent_at": {"type": "string", "format": "date-time", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\\.[0-9]+)?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$", "description": "Czas wysłania wiadomości przez klienta w RFC 3339 z jawną strefą: Z albo offset ±HH:MM."}, "sender": {"$ref": "#/components/schemas/PublicInboundMessageSender"}, "subject": {"type": "string", "maxLength": 50}, "text": {"type": "string", "maxLength": 100000, "description": "Zwykły tekst wiadomości, bez znaków NUL. Jeżeli attachment_ids jest puste lub pominięte, musi zawierać co najmniej jeden znak inny niż biały. Przy załącznikach można pominąć text albo przekazać pusty string."}, "attachment_ids": {"type": "array", "maxItems": 10, "uniqueItems": true, "description": "Identyfikatory plików przesłanych wcześniej do endpointu attachment-uploads w tym samym kanale. Każdy upload jest jednorazowy i musi być jeszcze ważny. Co najmniej text albo jeden identyfikator jest wymagany; pliki mogą mieć łącznie do 25 MiB (26214400 bajtów).", "items": {"type": "string", "format": "uuid"}}}}, "PublicInboundMessageCreated": {"type": "object", "additionalProperties": false, "required": ["id", "channel_id", "external_thread_id", "external_message_id", "attachment_ids", "created_at"], "properties": {"id": {"type": "string", "description": "Nieprzezroczysty identyfikator wiadomości utworzonej w NS."}, "channel_id": {"type": "string", "format": "uuid"}, "external_thread_id": {"type": "string"}, "external_message_id": {"type": "string"}, "attachment_ids": {"type": "array", "description": "Identyfikatory uploadów dołączonych i zużytych przez tę wiadomość; nie można użyć ich ponownie.", "items": {"type": "string", "format": "uuid"}}, "created_at": {"type": "string", "format": "date-time", "description": "Czas przyjęcia wiadomości przez NS."}}}, "PublicChannelAttachmentCreated": {"type": "object", "additionalProperties": false, "required": ["id", "channel_id", "filename", "content_type", "size_bytes", "sha256", "expires_at"], "properties": {"id": {"type": "string", "format": "uuid", "description": "Jednorazowy identyfikator uploadu przekazywany następnie w attachment_ids."}, "channel_id": {"type": "string", "format": "uuid"}, "filename": {"type": "string", "maxLength": 200}, "content_type": {"type": "string"}, "size_bytes": {"type": "integer", "minimum": 1, "maximum": 10485760, "description": "Rozmiar pliku w bajtach."}, "sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "expires_at": {"type": "string", "format": "date-time", "description": "Termin użycia uploadu w wiadomości przychodzącej: 24 godziny od pierwszego przyjęcia pliku. Odtworzenie odpowiedzi przez Idempotency-Key nie odnawia tego terminu ani dostępności zużytego uploadu."}}}, "CustomApiOutboundAttachment": {"type": "object", "additionalProperties": false, "required": ["id", "filename", "content_type", "size_bytes", "sha256", "download_url", "expires_at"], "properties": {"id": {"type": "string", "format": "uuid"}, "filename": {"type": "string", "maxLength": 200}, "content_type": {"type": "string"}, "size_bytes": {"type": "integer", "minimum": 1, "maximum": 10485760, "description": "Rozmiar pliku w bajtach."}, "sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "download_url": {"type": "string", "format": "uri"}, "expires_at": {"type": "string", "format": "date-time", "description": "Termin ważności pola download_url."}}}, "CustomApiOutboundWebhookEvent": {"type": "object", "additionalProperties": false, "description": "Zdarzenie wysyłane metodą POST na webhook skonfigurowany przy kanale, gdy operator odpowie klientowi w Komunikatorze. To samo stabilne id jest używane przy ponowieniach dostawy.", "required": ["id", "type", "created_at", "channel_id", "message"], "properties": {"id": {"type": "string", "format": "uuid", "description": "Stabilne ID zdarzenia, takie samo przy ponowieniach."}, "type": {"type": "string", "enum": ["message.outbound.created"]}, "created_at": {"type": "string", "format": "date-time", "description": "Czas wysłania odpowiedzi przez operatora."}, "channel_id": {"type": "string", "format": "uuid"}, "message": {"type": "object", "additionalProperties": false, "required": ["id", "external_thread_id", "in_reply_to_external_message_id", "text", "attachments", "sender"], "properties": {"id": {"type": "string", "format": "uuid", "description": "Identyfikator odpowiedzi operatora."}, "external_thread_id": {"type": "string", "maxLength": 43, "description": "Identyfikator wątku nadany wcześniej przez integratora."}, "in_reply_to_external_message_id": {"type": "string", "nullable": true, "maxLength": 36, "description": "Identyfikator najnowszej wiadomości klienta w tym wątku z sent_at nie późniejszym niż czas odpowiedzi operatora, albo null. Wartość jest wyliczana przy każdej próbie dostawy; późniejszy import historycznej wiadomości może ją zmienić przy tym samym ID zdarzenia."}, "text": {"type": "string", "maxLength": 100000, "description": "Zwykły tekst odpowiedzi operatora. Może być pusty, gdy odpowiedź zawiera załączniki."}, "attachments": {"type": "array", "maxItems": 10, "description": "Metadane i czasowe adresy pobrania; pliki nie są osadzane binarnie w JSON. Maksymalnie 10 MiB na plik i 25 MiB łącznie na wiadomość.", "items": {"$ref": "#/components/schemas/CustomApiOutboundAttachment"}}, "sender": {"type": "object", "additionalProperties": false, "description": "Operator, który wysłał odpowiedź.", "required": ["name"], "properties": {"name": {"type": "string"}, "email": {"type": "string", "format": "email", "description": "Opcjonalny adres e-mail operatora; pole jest pomijane, gdy adres nie jest dostępny."}}}}}}, "example": {"id": "33333333-3333-4333-8333-333333333333", "type": "message.outbound.created", "created_at": "2026-08-28T12:20:00Z", "channel_id": "11111111-1111-4111-8111-111111111111", "message": {"id": "33333333-3333-4333-8333-333333333333", "external_thread_id": "contact-form-000042", "in_reply_to_external_message_id": "msg-2026-000042", "text": "Dzień dobry, zamówienie zostało wysłane.", "attachments": [{"id": "22222222-2222-4222-8222-222222222222", "filename": "faktura.pdf", "content_type": "application/pdf", "size_bytes": 48231, "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "download_url": "https://storage.example.com/messages/faktura.pdf?signature=temporary", "expires_at": "2026-08-29T12:20:00Z"}], "sender": {"name": "Anna Nowak", "email": "anna@example.com"}}}}}}}