GPSR
Producenci i osoby odpowiedzialne (rozporządzenie GPSR).
- GET
/sale/responsible-producers— Producent odpowiedzialny — lista - POST
/sale/responsible-producers— Producent odpowiedzialny — nowy wpis - GET
/sale/responsible-producers/{responsibleProducerId}— Producent odpowiedzialny - PUT
/sale/responsible-producers/{responsibleProducerId}— Producent odpowiedzialny — zmiana - DELETE
/sale/responsible-producers/{responsibleProducerId}— Producent odpowiedzialny — usunięcie - GET
/sale/responsible-persons— Osoba odpowiedzialna — lista - POST
/sale/responsible-persons— Osoba odpowiedzialna — nowy wpis - GET
/sale/responsible-persons/{responsiblePersonId}— Osoba odpowiedzialna - PUT
/sale/responsible-persons/{responsiblePersonId}— Osoba odpowiedzialna — zmiana - DELETE
/sale/responsible-persons/{responsiblePersonId}— Osoba odpowiedzialna — usunięcie
Producent odpowiedzialny — lista
GET /sale/responsible-producers
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Twoje wpisy producentów, posortowane po nazwie. Bez parametrów — wszystkie naraz; offset/limit jak w Allegro (S2, 10.11): count = wpisy w odpowiedzi, totalCount = wszystkie.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /sale/responsible-producers.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry zapytania
offset integerPominięte wpisy od początku listy.
limit integer1–1000; brak = wszystkie.
Odpowiedzi
200 Lista. · ResponsibleProducerList
responsibleProducers array<ResponsibleProducer> zawszePola obiektu
id string · uuid zawszename string zawszeNazwa wpisu u sprzedawcy (1–50 znaków).
producerData object zawszeDane producenta.
Pola obiektu
tradeName stringNazwa handlowa producenta.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
count integer zawszetotalCount integer zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /sale/responsible-producers (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-producers');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /sale/responsible-producers (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/sale/responsible-producers", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /sale/responsible-producers (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-producers`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /sale/responsible-producers (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/sale/responsible-producers");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /sale/responsible-producers (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /sale/responsible-producers (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/sale/responsible-producers", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"responsibleProducers": [
{
"id": "e157086a-a704-46a9-8922-770c82c9a7d6",
"name": "Producent demo",
"producerData": {
"tradeName": "Fabryka Demo",
"address": {
"street": "ul. Przykładowa 1",
"postalCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
},
"contact": {
"email": "[email protected]",
"formUrl": "https://example.invalid/kontakt"
}
}
},
{
"id": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
],
"count": 2,
"totalCount": 2
}Przykład: Producenci — strona listy (offset/limit jak Allegro)
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers?offset=0&limit=20" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /sale/responsible-producers (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-producers?offset=0&limit=20');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /sale/responsible-producers (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/sale/responsible-producers?offset=0&limit=20", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /sale/responsible-producers (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-producers?offset=0&limit=20`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /sale/responsible-producers (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/sale/responsible-producers?offset=0&limit=20");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /sale/responsible-producers (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers?offset=0&limit=20"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /sale/responsible-producers (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/sale/responsible-producers?offset=0&limit=20", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"responsibleProducers": [
{
"id": "e157086a-a704-46a9-8922-770c82c9a7d6",
"name": "Producent demo",
"producerData": {
"tradeName": "Fabryka Demo",
"address": {
"street": "ul. Przykładowa 1",
"postalCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
},
"contact": {
"email": "[email protected]",
"formUrl": "https://example.invalid/kontakt"
}
}
},
{
"id": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
],
"count": 2,
"totalCount": 2
}Producent odpowiedzialny — nowy wpis
POST /sale/responsible-producers
zgodna z Allegroallegro:api:sale:settings:writelimit: write
name 1–50 znaków (unikalna), producerData z białej listy pól Allegro (nazwa, adres, kontakt — wartości sprawdzane, inne pola pomijane). Wymagane producerData.tradeName. Najwyżej 1000 wpisów. Dubel nazwy → 422 PRODUCER_NAME_HAS_TO_BE_UNIQUE (details = id istniejącego wpisu — użyj go).
Zgodność: zgodna z Allegro REST API (ten sam kształt) — POST /sale/responsible-producers.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Nagłówki
Idempotency-Key stringOchrona przed podwójnym wykonaniem (jak Stripe/Amazon): powtórzony POST z tym samym kluczem i tą samą treścią w ciągu 24 h zwraca zapisaną odpowiedź z nagłówkiem Idempotent-Replayed: true i niczego nie wykonuje drugi raz. Inna treść → 422 IDEMPOTENCY_KEY_REUSED; żądanie jeszcze trwa → 409 IDEMPOTENCY_KEY_IN_USE. 1–100 znaków ASCII (np. UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–50 znaków, unikalna.
producerData object wymaganePola obiektu
tradeName string wymaganeWymagane (do 200 znaków).
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Odpowiedzi
201 Utworzono. · ResponsibleProducer
id string · uuid zawszename string zawszeNazwa wpisu u sprzedawcy (1–50 znaków).
producerData object zawszeDane producenta.
Pola obiektu
tradeName stringNazwa handlowa producenta.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 413 | PAYLOAD_TOO_LARGE | Treść żądania za duża (JSON 5 MB, faktura PDF 3 MB). |
| 415 | UNSUPPORTED_MEDIA_TYPE | Zły Content-Type treści. |
| 422 | JsonMappingException | Treść nie jest poprawnym JSON albo ma zły kształt (np. images jako obiekty). |
| 422 | LIMIT_EXCEEDED | Limit wpisów osiągnięty (np. 50 warunków danego rodzaju). |
| 422 | PRODUCER_NAME_HAS_TO_BE_UNIQUE | Wpis GPSR o tej nazwie już jest (details = jego id). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
JSON<?php
// allee API: POST /sale/responsible-producers (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Wytwórnia Filmowa',
'producerData' => [
'tradeName' => 'Wytwórnia Filmowa Sp. z o.o.',
'address' => [
'countryCode' => 'PL',
'street' => 'Filmowa 5',
'postalCode' => '00-950',
'city' => 'Warszawa',
],
'contact' => [
'email' => '[email protected]',
'phoneNumber' => '+48 22 100 00 00',
],
],
];
$ch = curl_init($base . '/sale/responsible-producers');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: POST /sale/responsible-producers (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa",
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00",
},
},
}
r = requests.request("POST", BASE + "/sale/responsible-producers", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /sale/responsible-producers (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
};
const res = await fetch(`${BASE}/sale/responsible-producers`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: POST /sale/responsible-producers (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("POST"), baseUrl + "/sale/responsible-producers");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: POST /sale/responsible-producers (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
String body = """
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: POST /sale/responsible-producers (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}`
req, err := http.NewRequest("POST", base+"/sale/responsible-producers", strings.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
req.Header.Set("Content-Type", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}Przykład: wariant
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
}
JSON<?php
// allee API: POST /sale/responsible-producers (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Producent do usunięcia',
'producerData' => [
'tradeName' => 'Stary Dostawca Sp. z o.o.',
'address' => [
'countryCode' => 'PL',
'street' => 'Boczna 1',
'postalCode' => '00-001',
'city' => 'Warszawa',
],
'contact' => [
'email' => '[email protected]',
],
],
];
$ch = curl_init($base . '/sale/responsible-producers');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: POST /sale/responsible-producers (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa",
},
"contact": {
"email": "[email protected]",
},
},
}
r = requests.request("POST", BASE + "/sale/responsible-producers", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /sale/responsible-producers (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
};
const res = await fetch(`${BASE}/sale/responsible-producers`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: POST /sale/responsible-producers (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("POST"), baseUrl + "/sale/responsible-producers");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: POST /sale/responsible-producers (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
String body = """
{
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: POST /sale/responsible-producers (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
}`
req, err := http.NewRequest("POST", base+"/sale/responsible-producers", strings.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
req.Header.Set("Content-Type", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "779d5493-2252-4fa5-b0f1-04968b912e73",
"name": "Producent do usunięcia",
"producerData": {
"tradeName": "Stary Dostawca Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Boczna 1",
"postalCode": "00-001",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]"
}
}
}Producent odpowiedzialny
GET /sale/responsible-producers/{responsibleProducerId}
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Pełny wpis. Cudzy → 403, brak → 404.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /sale/responsible-producers/{id}.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry ścieżki
responsibleProducerId string wymaganyIdentyfikator (UUID).
Odpowiedzi
200 Wpis. · ResponsibleProducer
id string · uuid zawszename string zawszeNazwa wpisu u sprzedawcy (1–50 znaków).
producerData object zawszeDane producenta.
Pola obiektu
tradeName stringNazwa handlowa producenta.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 5",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}Producent odpowiedzialny — zmiana
PUT /sale/responsible-producers/{responsibleProducerId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Pełna podmiana wpisu (nieznane pole → 422); karty ofert wskazujących ten wpis pokazują nowe dane w sekcji „Bezpieczeństwo produktu”.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — PUT /sale/responsible-producers/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
responsibleProducerId string wymaganyIdentyfikator (UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–50 znaków, unikalna.
producerData object wymaganePola obiektu
tradeName string wymaganeWymagane (do 200 znaków).
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Odpowiedzi
200 Zmieniono. · ResponsibleProducer
id string · uuid zawszename string zawszeNazwa wpisu u sprzedawcy (1–50 znaków).
producerData object zawszeDane producenta.
Pola obiektu
tradeName stringNazwa handlowa producenta.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 413 | PAYLOAD_TOO_LARGE | Treść żądania za duża (JSON 5 MB, faktura PDF 3 MB). |
| 415 | UNSUPPORTED_MEDIA_TYPE | Zły Content-Type treści. |
| 422 | JsonMappingException | Treść nie jest poprawnym JSON albo ma zły kształt (np. images jako obiekty). |
| 422 | PRODUCER_NAME_HAS_TO_BE_UNIQUE | Wpis GPSR o tej nazwie już jest (details = jego id). |
| 422 | UnknownJSONProperty | Pole nieznane w tym miejscu (path wskazuje które). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X PUT "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
JSON<?php
// allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Wytwórnia Filmowa',
'producerData' => [
'tradeName' => 'Wytwórnia Filmowa Sp. z o.o.',
'address' => [
'countryCode' => 'PL',
'street' => 'Filmowa 7',
'postalCode' => '00-950',
'city' => 'Warszawa',
],
'contact' => [
'email' => '[email protected]',
'phoneNumber' => '+48 22 100 00 00',
],
],
];
$ch = curl_init($base . '/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa",
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00",
},
},
}
r = requests.request("PUT", BASE + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
};
const res = await fetch(`${BASE}/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e`, {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("PUT"), baseUrl + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
String body = """
{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: PUT /sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}`
req, err := http.NewRequest("PUT", base+"/sale/responsible-producers/472bad66-e704-4344-a2d6-9bd85b1f9a5e", strings.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
req.Header.Set("Content-Type", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "472bad66-e704-4344-a2d6-9bd85b1f9a5e",
"name": "Wytwórnia Filmowa",
"producerData": {
"tradeName": "Wytwórnia Filmowa Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Filmowa 7",
"postalCode": "00-950",
"city": "Warszawa"
},
"contact": {
"email": "[email protected]",
"phoneNumber": "+48 22 100 00 00"
}
}
}Producent odpowiedzialny — usunięcie
DELETE /sale/responsible-producers/{responsibleProducerId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Usuwa wpis. Wskazany w ofercie → 409 IN_USE.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — DELETE /sale/responsible-producers/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
responsibleProducerId string wymaganyIdentyfikator (UUID).
Odpowiedzi
204 Usunięto.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 409 | IN_USE | Wpis jest wskazany w ofercie. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X DELETE "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("DELETE", BASE + "/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73`, {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("DELETE"), baseUrl + "/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: DELETE /sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73 (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("DELETE", base+"/sale/responsible-producers/779d5493-2252-4fa5-b0f1-04968b912e73", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}text/html; charset=UTF-8(0 B: text/html; charset=UTF-8)Osoba odpowiedzialna — lista
GET /sale/responsible-persons
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Twoje wpisy osób odpowiedzialnych, posortowane po nazwie. Bez parametrów — wszystkie naraz; offset/limit jak w Allegro (S2, 10.11): count = wpisy w odpowiedzi, totalCount = wszystkie.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /sale/responsible-persons.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry zapytania
offset integerPominięte wpisy od początku listy.
limit integer1–1000; brak = wszystkie.
Odpowiedzi
200 Lista. · ResponsiblePersonList
responsiblePersons array<ResponsiblePerson> zawszePola obiektu
id string · uuid zawszename string zawszepersonalData object zawszeDane osoby odpowiedzialnej.
Pola obiektu
name stringNazwa podmiotu odpowiedzialnego w UE.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
count integer zawszetotalCount integer zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-persons" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /sale/responsible-persons (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-persons');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /sale/responsible-persons (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/sale/responsible-persons", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /sale/responsible-persons (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-persons`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /sale/responsible-persons (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/sale/responsible-persons");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /sale/responsible-persons (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-persons"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /sale/responsible-persons (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/sale/responsible-persons", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"responsiblePersons": [
{
"id": "6a29e43e-96c9-4bd6-b999-82c3413fdfa1",
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
},
{
"id": "30c5cc4a-ff63-4507-8c9c-e9410008b8f0",
"name": "Osoba odpowiedzialna demo",
"personalData": {
"name": "Importer Demo",
"address": {
"street": "ul. Przykładowa 1",
"postalCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
},
"contact": {
"email": "[email protected]",
"formUrl": "https://example.invalid/kontakt"
}
}
}
],
"count": 2,
"totalCount": 2
}Osoba odpowiedzialna — nowy wpis
POST /sale/responsible-persons
zgodna z Allegroallegro:api:sale:settings:writelimit: write
name 1–50 znaków (unikalna), personalData z białej listy pól Allegro (nazwa, adres, kontakt — wartości sprawdzane, inne pola pomijane). Najwyżej 1000 wpisów. Dubel nazwy → 422 PRODUCER_NAME_HAS_TO_BE_UNIQUE (details = id istniejącego wpisu — użyj go).
Zgodność: zgodna z Allegro REST API (ten sam kształt) — POST /sale/responsible-persons.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Nagłówki
Idempotency-Key stringOchrona przed podwójnym wykonaniem (jak Stripe/Amazon): powtórzony POST z tym samym kluczem i tą samą treścią w ciągu 24 h zwraca zapisaną odpowiedź z nagłówkiem Idempotent-Replayed: true i niczego nie wykonuje drugi raz. Inna treść → 422 IDEMPOTENCY_KEY_REUSED; żądanie jeszcze trwa → 409 IDEMPOTENCY_KEY_IN_USE. 1–100 znaków ASCII (np. UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–50 znaków, unikalna.
personalData object wymaganePola obiektu
name stringaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Odpowiedzi
201 Utworzono. · ResponsiblePerson
id string · uuid zawszename string zawszepersonalData object zawszeDane osoby odpowiedzialnej.
Pola obiektu
name stringNazwa podmiotu odpowiedzialnego w UE.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 413 | PAYLOAD_TOO_LARGE | Treść żądania za duża (JSON 5 MB, faktura PDF 3 MB). |
| 415 | UNSUPPORTED_MEDIA_TYPE | Zły Content-Type treści. |
| 422 | JsonMappingException | Treść nie jest poprawnym JSON albo ma zły kształt (np. images jako obiekty). |
| 422 | LIMIT_EXCEEDED | Limit wpisów osiągnięty (np. 50 warunków danego rodzaju). |
| 422 | PRODUCER_NAME_HAS_TO_BE_UNIQUE | Wpis GPSR o tej nazwie już jest (details = jego id). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-persons" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
JSON<?php
// allee API: POST /sale/responsible-persons (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Importer UE',
'personalData' => [
'name' => 'Import Filmów Sp. z o.o.',
'address' => [
'countryCode' => 'PL',
'street' => 'Portowa 3',
'postalCode' => '80-001',
'city' => 'Gdańsk',
],
'contact' => [
'email' => '[email protected]',
],
],
];
$ch = curl_init($base . '/sale/responsible-persons');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: POST /sale/responsible-persons (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk",
},
"contact": {
"email": "[email protected]",
},
},
}
r = requests.request("POST", BASE + "/sale/responsible-persons", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /sale/responsible-persons (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
};
const res = await fetch(`${BASE}/sale/responsible-persons`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: POST /sale/responsible-persons (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("POST"), baseUrl + "/sale/responsible-persons");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: POST /sale/responsible-persons (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
String body = """
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-persons"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: POST /sale/responsible-persons (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}`
req, err := http.NewRequest("POST", base+"/sale/responsible-persons", strings.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
req.Header.Set("Content-Type", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "6a29e43e-96c9-4bd6-b999-82c3413fdfa1",
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}Osoba odpowiedzialna
GET /sale/responsible-persons/{responsiblePersonId}
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Pełny wpis. Cudzy → 403, brak → 404.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /sale/responsible-persons/{id}.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry ścieżki
responsiblePersonId string wymaganyIdentyfikator (UUID).
Odpowiedzi
200 Wpis. · ResponsiblePerson
id string · uuid zawszename string zawszepersonalData object zawszeDane osoby odpowiedzialnej.
Pola obiektu
name stringNazwa podmiotu odpowiedzialnego w UE.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("GET", BASE + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1`, {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("GET"), baseUrl + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: GET /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "6a29e43e-96c9-4bd6-b999-82c3413fdfa1",
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 3",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}Osoba odpowiedzialna — zmiana
PUT /sale/responsible-persons/{responsiblePersonId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Pełna podmiana wpisu (nieznane pole → 422); karty ofert wskazujących ten wpis pokazują nowe dane w sekcji „Bezpieczeństwo produktu”.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — PUT /sale/responsible-persons/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
responsiblePersonId string wymaganyIdentyfikator (UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–50 znaków, unikalna.
personalData object wymaganePola obiektu
name stringaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Odpowiedzi
200 Zmieniono. · ResponsiblePerson
id string · uuid zawszename string zawszepersonalData object zawszeDane osoby odpowiedzialnej.
Pola obiektu
name stringNazwa podmiotu odpowiedzialnego w UE.
address objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectDane kontaktowe.
Pola obiektu
email string · emailphoneNumber stringformUrl string · uriAdres https formularza kontaktowego.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 413 | PAYLOAD_TOO_LARGE | Treść żądania za duża (JSON 5 MB, faktura PDF 3 MB). |
| 415 | UNSUPPORTED_MEDIA_TYPE | Zły Content-Type treści. |
| 422 | JsonMappingException | Treść nie jest poprawnym JSON albo ma zły kształt (np. images jako obiekty). |
| 422 | PRODUCER_NAME_HAS_TO_BE_UNIQUE | Wpis GPSR o tej nazwie już jest (details = jego id). |
| 422 | UnknownJSONProperty | Pole nieznane w tym miejscu (path wskazuje które). |
| 422 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X PUT "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-H "Content-Type: application/vnd.allegro.public.v1+json" \
--data-binary @- \
-w '\nHTTP %{http_code}\n' <<'JSON'
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
JSON<?php
// allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Importer UE',
'personalData' => [
'name' => 'Import Filmów Sp. z o.o.',
'address' => [
'countryCode' => 'PL',
'street' => 'Portowa 4',
'postalCode' => '80-001',
'city' => 'Gdańsk',
],
'contact' => [
'email' => '[email protected]',
],
],
];
$ch = curl_init($base . '/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
'Content-Type: application/vnd.allegro.public.v1+json',
],
CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
}
body = {
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk",
},
"contact": {
"email": "[email protected]",
},
},
}
r = requests.request("PUT", BASE + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
};
const res = await fetch(`${BASE}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1`, {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
"Content-Type": "application/vnd.allegro.public.v1+json",
},
body: JSON.stringify(body),
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("PUT"), baseUrl + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
req.Content = new StringContent(json, Encoding.UTF8);
req.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
String body = """
{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.header("Content-Type", "application/vnd.allegro.public.v1+json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: PUT /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
body := `{
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}`
req, err := http.NewRequest("PUT", base+"/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", strings.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
req.Header.Set("Content-Type", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}application/vnd.allegro.public.v1+json{
"id": "6a29e43e-96c9-4bd6-b999-82c3413fdfa1",
"name": "Importer UE",
"personalData": {
"name": "Import Filmów Sp. z o.o.",
"address": {
"countryCode": "PL",
"street": "Portowa 4",
"postalCode": "80-001",
"city": "Gdańsk"
},
"contact": {
"email": "[email protected]"
}
}
}Osoba odpowiedzialna — usunięcie
DELETE /sale/responsible-persons/{responsiblePersonId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Usuwa wpis. Wskazany w ofercie → 409 IN_USE.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — DELETE /sale/responsible-persons/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
responsiblePersonId string wymaganyIdentyfikator (UUID).
Odpowiedzi
204 Usunięto.
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 401 | invalid_token | Brak, zły, wygasły albo odwołany token lub klucz (format OAuth, nagłówek WWW-Authenticate). |
| 403 | ACCOUNT_INACTIVE | Konto sprzedawcy jest nieaktywne. |
| 403 | AccessDenied | Brak zakresu albo zasób innego sprzedawcy. |
| 403 | KEY_QUARANTINED | Kwarantanna: działa tylko odczyt (wykryto nietypowe użycie). |
| 403 | KEY_SUSPENDED | Klucz albo dostęp aplikacji wstrzymany (przez sprzedawcę albo ochronę). |
| 404 | NOT_FOUND | Nie ma takiego zasobu (albo należy do innego sprzedawcy — dla wątków, zwrotów i spraw odpowiedź jest ta sama). |
| 409 | IN_USE | Wpis jest wskazany w ofercie. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
curl -sS -X DELETE "${ALLEE_API_URL:-https://api.allee.pl}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ALLEE_API_KEY'),
'Accept: application/vnd.allegro.public.v1+json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
echo 'HTTP ', curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $odp, "\n";# allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Authorization": "Bearer " + os.environ["ALLEE_API_KEY"],
"Accept": "application/vnd.allegro.public.v1+json",
}
r = requests.request("DELETE", BASE + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1`, {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.ALLEE_API_KEY}`,
"Accept": "application/vnd.allegro.public.v1+json",
},
redirect: "manual",
});
console.log("HTTP", res.status);
console.log(await res.text());// allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (C#, .NET 8+, HttpClient)
using System.Net.Http.Headers;
using System.Text;
var baseUrl = Environment.GetEnvironmentVariable("ALLEE_API_URL") ?? "https://api.allee.pl";
using var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });
using var req = new HttpRequestMessage(new HttpMethod("DELETE"), baseUrl + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
using var res = await http.SendAsync(req);
Console.WriteLine($"HTTP {(int)res.StatusCode}");
Console.WriteLine(await res.Content.ReadAsStringAsync());// allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Java 11+, java.net.http; uruchom: java Main.java)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String base = System.getenv().getOrDefault("ALLEE_API_URL", "https://api.allee.pl");
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1"))
.header("Authorization", "Bearer " + System.getenv("ALLEE_API_KEY"))
.header("Accept", "application/vnd.allegro.public.v1+json")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<String> res = http.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println("HTTP " + res.statusCode());
System.out.println(res.body());
}
}// allee API: DELETE /sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1 (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("DELETE", base+"/sale/responsible-persons/6a29e43e-96c9-4bd6-b999-82c3413fdfa1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("ALLEE_API_KEY"))
req.Header.Set("Accept", "application/vnd.allegro.public.v1+json")
klient := &http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
res, err := klient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
dane, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println("HTTP", res.StatusCode)
fmt.Println(string(dane))
}text/html; charset=UTF-8(0 B: text/html; charset=UTF-8)