Warunki
Warunki zwrotów, reklamacji (rękojmia) i gwarancji.
- GET
/after-sales-service-conditions/return-policies— Warunki zwrotów — lista - POST
/after-sales-service-conditions/return-policies— Warunki zwrotów — nowe - GET
/after-sales-service-conditions/return-policies/{returnPolicyId}— Warunki zwrotów - PUT
/after-sales-service-conditions/return-policies/{returnPolicyId}— Warunki zwrotów — zmiana - DELETE
/after-sales-service-conditions/return-policies/{returnPolicyId}— Warunki zwrotów — usunięcie - GET
/after-sales-service-conditions/implied-warranties— Warunki reklamacji (rękojmia) — lista - POST
/after-sales-service-conditions/implied-warranties— Warunki reklamacji (rękojmia) — nowe - GET
/after-sales-service-conditions/implied-warranties/{impliedWarrantyId}— Warunki reklamacji (rękojmia) - PUT
/after-sales-service-conditions/implied-warranties/{impliedWarrantyId}— Warunki reklamacji (rękojmia) — zmiana - DELETE
/after-sales-service-conditions/implied-warranties/{impliedWarrantyId}— Warunki reklamacji (rękojmia) — usunięcie - GET
/after-sales-service-conditions/warranties— Gwarancja — lista - POST
/after-sales-service-conditions/warranties— Gwarancja — nowe - GET
/after-sales-service-conditions/warranties/{warrantyId}— Gwarancja - PUT
/after-sales-service-conditions/warranties/{warrantyId}— Gwarancja — zmiana - DELETE
/after-sales-service-conditions/warranties/{warrantyId}— Gwarancja — usunięcie
Warunki zwrotów — lista
GET /after-sales-service-conditions/return-policies
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Twoje wpisy warunków zwrotów (id i nazwa). Klucz listy: returnPolicies.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/return-policies.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Odpowiedzi
200 Lista. · ReturnPolicyList
returnPolicies array<object> zawszePola obiektu
id string · uuid zawszename string zawszecount 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ę). |
| 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}/after-sales-service-conditions/return-policies" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/return-policies (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/return-policies');
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 /after-sales-service-conditions/return-policies (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 + "/after-sales-service-conditions/return-policies", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/return-policies (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies`, {
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 /after-sales-service-conditions/return-policies (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 + "/after-sales-service-conditions/return-policies");
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 /after-sales-service-conditions/return-policies (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 + "/after-sales-service-conditions/return-policies"))
.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 /after-sales-service-conditions/return-policies (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+"/after-sales-service-conditions/return-policies", 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{
"returnPolicies": [
{
"id": "0d2fcf15-119d-479c-9d97-ba1794013def",
"name": "Zwroty 30 dni"
},
{
"id": "42133d83-0ba2-472e-9f21-25f2c35b69e4",
"name": "Zwroty demo"
}
],
"count": 2
}Warunki zwrotów — nowe
POST /after-sales-service-conditions/return-policies
zgodna z Allegroallegro:api:sale:settings:writelimit: write
name (1–100 znaków) i pola w kształcie Allegro z białej listy (np. okres P14D, kto pokrywa koszt zwrotu, adres) — wartości sprawdzamy, a pola spoza listy pomijamy.
201 — nowy wpis. 200 — ta sama name i identyczna treść (bezpieczne ponowienie). Ta sama name, inna treść → 422 NAME_HAS_TO_BE_UNIQUE (details = id istniejącego). Najwyżej 50 wpisów każdego rodzaju.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — POST /after-sales-service-conditions/return-policies.
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–100 znaków, unikalna w obrębie sprzedawcy.
availability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription stringOdpowiedzi
200 Identyczny wpis już był. · ReturnPolicy
id string · uuid zawszename string zawszeavailability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription string201 Utworzono. · ReturnPolicy
id string · uuid zawszename string zawszeavailability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/return-policies" \
-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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/return-policies (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Zwroty 30 dni',
'availability' => [
'range' => 'FULL',
],
'withdrawalPeriod' => 'P30D',
'returnCost' => [
'coveredBy' => 'SELLER',
],
'address' => [
'name' => 'Sklep Przykładowy',
'street' => 'Magazynowa 1',
'postCode' => '00-001',
'city' => 'Warszawa',
'countryCode' => 'PL',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/return-policies');
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 /after-sales-service-conditions/return-policies (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": "Zwroty 30 dni",
"availability": {
"range": "FULL",
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER",
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/return-policies", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/return-policies (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies`, {
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 /after-sales-service-conditions/return-policies (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 + "/after-sales-service-conditions/return-policies");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
""";
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 /after-sales-service-conditions/return-policies (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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/return-policies"))
.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 /after-sales-service-conditions/return-policies (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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/return-policies", 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": "0d2fcf15-119d-479c-9d97-ba1794013def",
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}Przykład: Warunki do usunięcia
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/after-sales-service-conditions/return-policies" \
-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": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/return-policies (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Zwroty 14 dni (stare)',
'availability' => [
'range' => 'FULL',
],
'withdrawalPeriod' => 'P14D',
'returnCost' => [
'coveredBy' => 'BUYER',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/return-policies');
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 /after-sales-service-conditions/return-policies (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": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL",
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/return-policies", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/return-policies (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies`, {
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 /after-sales-service-conditions/return-policies (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 + "/after-sales-service-conditions/return-policies");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
}
""";
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 /after-sales-service-conditions/return-policies (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": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/return-policies"))
.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 /after-sales-service-conditions/return-policies (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": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/return-policies", 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": "134c9af0-5758-4921-92d0-6e9e2a8f595f",
"name": "Zwroty 14 dni (stare)",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P14D",
"returnCost": {
"coveredBy": "BUYER"
}
}Warunki zwrotów
GET /after-sales-service-conditions/return-policies/{returnPolicyId}
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Pełny wpis warunków zwrotów. Cudzy → 403, brak (albo inny rodzaj) → 404.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/return-policies/{id}.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry ścieżki
returnPolicyId string wymaganyIdentyfikator (UUID).
Odpowiedzi
200 Wpis. · ReturnPolicy
id string · uuid zawszename string zawszeavailability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription stringBłę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}/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def');
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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 + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def`, {
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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 + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def");
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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 + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def"))
.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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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+"/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def", 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": "0d2fcf15-119d-479c-9d97-ba1794013def",
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 1",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}Warunki zwrotów — zmiana
PUT /after-sales-service-conditions/return-policies/{returnPolicyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Pełna podmiana treści (biała lista pól Allegro dla rodzaju; nieznane pole → 422 UnknownJSONProperty). Oferty wskazujące ten wpis widzą nową treść.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — PUT /after-sales-service-conditions/return-policies/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
returnPolicyId string wymaganyIdentyfikator (UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–100 znaków, unikalna w obrębie sprzedawcy.
availability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription stringOdpowiedzi
200 Zmieniono. · ReturnPolicy
id string · uuid zawszename string zawszeavailability objectPola obiektu
range stringFULL, RESTRICTED, DISABLEDrestrictionCause objectPola obiektu
name stringdescription stringwithdrawalPeriod stringOkres ISO 8601, np. P14D, P1Y, P2Y.
returnCost objectPola obiektu
coveredBy stringSELLER, BUYERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emailcontact objectPola obiektu
phoneNumber stringemail string · emailoptions objectPola obiektu
cashOnDeliveryNotAllowed booleanfreeAccessoriesReturnRequired booleanrefundLoweredByReceivedDiscount booleanbusinessReturnAllowed booleancollectBySellerOnly booleandescription stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def" \
-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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
JSON<?php
// allee API: PUT /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Zwroty 30 dni',
'availability' => [
'range' => 'FULL',
],
'withdrawalPeriod' => 'P30D',
'returnCost' => [
'coveredBy' => 'SELLER',
],
'address' => [
'name' => 'Sklep Przykładowy',
'street' => 'Magazynowa 2',
'postCode' => '00-001',
'city' => 'Warszawa',
'countryCode' => 'PL',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def');
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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": "Zwroty 30 dni",
"availability": {
"range": "FULL",
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER",
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL",
},
}
r = requests.request("PUT", BASE + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: PUT /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def`, {
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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 + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
""";
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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def"))
.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 /after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def (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": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}`
req, err := http.NewRequest("PUT", base+"/after-sales-service-conditions/return-policies/0d2fcf15-119d-479c-9d97-ba1794013def", 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": "0d2fcf15-119d-479c-9d97-ba1794013def",
"name": "Zwroty 30 dni",
"availability": {
"range": "FULL"
},
"withdrawalPeriod": "P30D",
"returnCost": {
"coveredBy": "SELLER"
},
"address": {
"name": "Sklep Przykładowy",
"street": "Magazynowa 2",
"postCode": "00-001",
"city": "Warszawa",
"countryCode": "PL"
}
}Warunki zwrotów — usunięcie
DELETE /after-sales-service-conditions/return-policies/{returnPolicyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Usuwa wpis. Wpis wskazany w którejś ofercie → 409 IN_USE (najpierw odepnij go od ofert).
Zgodność: zgodna z Allegro REST API (ten sam kształt) — DELETE /after-sales-service-conditions/return-policies/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
returnPolicyId 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}/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f');
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 /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (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 + "/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f`, {
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 /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (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 + "/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f");
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 /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (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 + "/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f"))
.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 /after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f (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+"/after-sales-service-conditions/return-policies/134c9af0-5758-4921-92d0-6e9e2a8f595f", 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)Warunki reklamacji (rękojmia) — lista
GET /after-sales-service-conditions/implied-warranties
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Twoje wpisy warunków reklamacji (id i nazwa). Klucz listy: impliedWarranties.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/implied-warranties.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Odpowiedzi
200 Lista. · ImpliedWarrantyList
impliedWarranties array<object> zawszePola obiektu
id string · uuid zawszename string zawszecount 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ę). |
| 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}/after-sales-service-conditions/implied-warranties" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/implied-warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties');
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 /after-sales-service-conditions/implied-warranties (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 + "/after-sales-service-conditions/implied-warranties", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/implied-warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties`, {
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 /after-sales-service-conditions/implied-warranties (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 + "/after-sales-service-conditions/implied-warranties");
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 /after-sales-service-conditions/implied-warranties (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 + "/after-sales-service-conditions/implied-warranties"))
.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 /after-sales-service-conditions/implied-warranties (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+"/after-sales-service-conditions/implied-warranties", 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{
"impliedWarranties": [
{
"id": "eab748ba-c9ec-444f-8f18-eb3b4174ebca",
"name": "Reklamacje demo"
},
{
"id": "d82f8496-f284-4cdf-9575-242222870c5f",
"name": "Rękojmia 2 lata"
}
],
"count": 2
}Warunki reklamacji (rękojmia) — nowe
POST /after-sales-service-conditions/implied-warranties
zgodna z Allegroallegro:api:sale:settings:writelimit: write
name (1–100 znaków) i pola w kształcie Allegro z białej listy (np. okres P14D, kto pokrywa koszt zwrotu, adres) — wartości sprawdzamy, a pola spoza listy pomijamy.
201 — nowy wpis. 200 — ta sama name i identyczna treść (bezpieczne ponowienie). Ta sama name, inna treść → 422 NAME_HAS_TO_BE_UNIQUE (details = id istniejącego). Najwyżej 50 wpisów każdego rodzaju.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — POST /after-sales-service-conditions/implied-warranties.
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–100 znaków, unikalna.
individual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription stringOdpowiedzi
200 Identyczny wpis już był. · ImpliedWarranty
id string · uuid zawszename string zawszeindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription string201 Utworzono. · ImpliedWarranty
id string · uuid zawszename string zawszeindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/implied-warranties" \
-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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/implied-warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Rękojmia 2 lata',
'individual' => [
'period' => 'P2Y',
],
'corporate' => [
'period' => 'P1Y',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties');
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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y",
},
"corporate": {
"period": "P1Y",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/implied-warranties", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/implied-warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties`, {
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 /after-sales-service-conditions/implied-warranties (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 + "/after-sales-service-conditions/implied-warranties");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
""";
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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/implied-warranties"))
.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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/implied-warranties", 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": "d82f8496-f284-4cdf-9575-242222870c5f",
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}Przykład: Warunki reklamacji do usunięcia
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/after-sales-service-conditions/implied-warranties" \
-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": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/implied-warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Rękojmia (stara)',
'individual' => [
'period' => 'P2Y',
],
'corporate' => [
'period' => 'P1Y',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties');
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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia (stara)",
"individual": {
"period": "P2Y",
},
"corporate": {
"period": "P1Y",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/implied-warranties", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/implied-warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties`, {
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 /after-sales-service-conditions/implied-warranties (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 + "/after-sales-service-conditions/implied-warranties");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
""";
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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/implied-warranties"))
.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 /after-sales-service-conditions/implied-warranties (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": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/implied-warranties", 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": "c3d63ea5-5893-4e48-a3e3-63cb41d238f3",
"name": "Rękojmia (stara)",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}Warunki reklamacji (rękojmia)
GET /after-sales-service-conditions/implied-warranties/{impliedWarrantyId}
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Pełny wpis warunków reklamacji. Cudzy → 403, brak (albo inny rodzaj) → 404.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/implied-warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry ścieżki
impliedWarrantyId string wymaganyIdentyfikator (UUID).
Odpowiedzi
200 Wpis. · ImpliedWarranty
id string · uuid zawszename string zawszeindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription stringBłę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}/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f');
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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 + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f`, {
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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 + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f");
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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 + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f"))
.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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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+"/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f", 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": "d82f8496-f284-4cdf-9575-242222870c5f",
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P1Y"
}
}Warunki reklamacji (rękojmia) — zmiana
PUT /after-sales-service-conditions/implied-warranties/{impliedWarrantyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Pełna podmiana treści (biała lista pól Allegro dla rodzaju; nieznane pole → 422 UnknownJSONProperty). Oferty wskazujące ten wpis widzą nową treść.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — PUT /after-sales-service-conditions/implied-warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
impliedWarrantyId string wymaganyIdentyfikator (UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–100 znaków, unikalna.
individual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription stringOdpowiedzi
200 Zmieniono. · ImpliedWarranty
id string · uuid zawszename string zawszeindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERaddress objectAdres (kształt Allegro).
Pola obiektu
name stringstreet stringpostCode stringpostalCode stringcity stringcountryCode stringKod kraju ISO 3166-1 alfa-2.
phoneNumber stringemail string · emaildescription stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f" \
-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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
}
JSON<?php
// allee API: PUT /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Rękojmia 2 lata',
'individual' => [
'period' => 'P2Y',
],
'corporate' => [
'period' => 'P2Y',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f');
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y",
},
"corporate": {
"period": "P2Y",
},
}
r = requests.request("PUT", BASE + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: PUT /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f`, {
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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 + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
}
""";
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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f"))
.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 /after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f (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": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
}`
req, err := http.NewRequest("PUT", base+"/after-sales-service-conditions/implied-warranties/d82f8496-f284-4cdf-9575-242222870c5f", 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": "d82f8496-f284-4cdf-9575-242222870c5f",
"name": "Rękojmia 2 lata",
"individual": {
"period": "P2Y"
},
"corporate": {
"period": "P2Y"
}
}Warunki reklamacji (rękojmia) — usunięcie
DELETE /after-sales-service-conditions/implied-warranties/{impliedWarrantyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Usuwa wpis. Wpis wskazany w którejś ofercie → 409 IN_USE (najpierw odepnij go od ofert).
Zgodność: zgodna z Allegro REST API (ten sam kształt) — DELETE /after-sales-service-conditions/implied-warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
impliedWarrantyId 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}/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3');
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 /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (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 + "/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3`, {
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 /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (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 + "/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3");
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 /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (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 + "/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3"))
.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 /after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3 (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+"/after-sales-service-conditions/implied-warranties/c3d63ea5-5893-4e48-a3e3-63cb41d238f3", 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)Gwarancja — lista
GET /after-sales-service-conditions/warranties
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Twoje wpisy gwarancji (id i nazwa). Klucz listy: warranties.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/warranties.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Odpowiedzi
200 Lista. · WarrantyList
warranties array<object> zawszePola obiektu
id string · uuid zawszename string zawszecount 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ę). |
| 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}/after-sales-service-conditions/warranties" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/warranties');
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 /after-sales-service-conditions/warranties (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 + "/after-sales-service-conditions/warranties", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties`, {
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 /after-sales-service-conditions/warranties (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 + "/after-sales-service-conditions/warranties");
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 /after-sales-service-conditions/warranties (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 + "/after-sales-service-conditions/warranties"))
.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 /after-sales-service-conditions/warranties (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+"/after-sales-service-conditions/warranties", 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{
"warranties": [
{
"id": "e0b5c0de-c9d1-4be5-a5be-595e95db67ad",
"name": "Gwarancja demo"
},
{
"id": "5be961ca-7c55-4d2a-9332-93d58877d4a2",
"name": "Gwarancja producenta"
}
],
"count": 2
}Gwarancja — nowe
POST /after-sales-service-conditions/warranties
zgodna z Allegroallegro:api:sale:settings:writelimit: write
name (1–100 znaków) i pola w kształcie Allegro z białej listy (np. okres P14D, kto pokrywa koszt zwrotu, adres) — wartości sprawdzamy, a pola spoza listy pomijamy.
201 — nowy wpis. 200 — ta sama name i identyczna treść (bezpieczne ponowienie). Ta sama name, inna treść → 422 NAME_HAS_TO_BE_UNIQUE (details = id istniejącego). Najwyżej 50 wpisów każdego rodzaju.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — POST /after-sales-service-conditions/warranties.
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–100 znaków, unikalna.
type stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description stringOdpowiedzi
200 Identyczny wpis już był. · Warranty
id string · uuid zawszename string zawszetype stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description string201 Utworzono. · Warranty
id string · uuid zawszename string zawszetype stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/warranties" \
-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": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Gwarancja producenta',
'individual' => [
'period' => 'P2Y',
'type' => 'MANUFACTURER',
],
'corporate' => [
'period' => 'P1Y',
'type' => 'MANUFACTURER',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/warranties');
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 /after-sales-service-conditions/warranties (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": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER",
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/warranties", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties`, {
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 /after-sales-service-conditions/warranties (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 + "/after-sales-service-conditions/warranties");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
""";
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 /after-sales-service-conditions/warranties (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": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/warranties"))
.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 /after-sales-service-conditions/warranties (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": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/warranties", 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": "5be961ca-7c55-4d2a-9332-93d58877d4a2",
"name": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}Przykład: Gwarancja do usunięcia
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/after-sales-service-conditions/warranties" \
-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": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
}
JSON<?php
// allee API: POST /after-sales-service-conditions/warranties (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Gwarancja sprzedawcy (stara)',
'individual' => [
'period' => 'P1Y',
'type' => 'SELLER',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/warranties');
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 /after-sales-service-conditions/warranties (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": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER",
},
}
r = requests.request("POST", BASE + "/after-sales-service-conditions/warranties", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /after-sales-service-conditions/warranties (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties`, {
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 /after-sales-service-conditions/warranties (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 + "/after-sales-service-conditions/warranties");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
}
""";
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 /after-sales-service-conditions/warranties (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": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/warranties"))
.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 /after-sales-service-conditions/warranties (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": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
}`
req, err := http.NewRequest("POST", base+"/after-sales-service-conditions/warranties", 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": "2ebf18a5-0d1e-4ece-a9e0-66861011ca83",
"name": "Gwarancja sprzedawcy (stara)",
"individual": {
"period": "P1Y",
"type": "SELLER"
}
}Gwarancja
GET /after-sales-service-conditions/warranties/{warrantyId}
zgodna z Allegroallegro:api:sale:settings:readlimit: read
Pełny wpis gwarancji. Cudzy → 403, brak (albo inny rodzaj) → 404.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — GET /after-sales-service-conditions/warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:read.
Grupa limitu: read.
Parametry ścieżki
warrantyId string wymaganyIdentyfikator (UUID).
Odpowiedzi
200 Wpis. · Warranty
id string · uuid zawszename string zawszetype stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description stringBłę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}/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2');
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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 + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2`, {
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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 + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2");
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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 + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2"))
.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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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+"/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2", 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": "5be961ca-7c55-4d2a-9332-93d58877d4a2",
"name": "Gwarancja producenta",
"individual": {
"period": "P2Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}Gwarancja — zmiana
PUT /after-sales-service-conditions/warranties/{warrantyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Pełna podmiana treści (biała lista pól Allegro dla rodzaju; nieznane pole → 422 UnknownJSONProperty). Oferty wskazujące ten wpis widzą nową treść.
Zgodność: zgodna z Allegro REST API (ten sam kształt) — PUT /after-sales-service-conditions/warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
warrantyId string wymaganyIdentyfikator (UUID).
Treść żądania application/vnd.allegro.public.v1+json
name string wymagane1–100 znaków, unikalna.
type stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description stringOdpowiedzi
200 Zmieniono. · Warranty
id string · uuid zawszename string zawszetype stringMANUFACTURER, SELLERindividual objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERcorporate objectPola obiektu
period stringOkres ISO 8601, np. P14D, P1Y, P2Y.
lifetime booleanDożywotnio.
type stringMANUFACTURER, SELLERattachment objectPola obiektu
name stringurl string · uriAdres https.
description stringBłę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 | NAME_HAS_TO_BE_UNIQUE | Nazwa zajęta (details = id istniejącego wpisu). |
| 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}/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2" \
-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": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
JSON<?php
// allee API: PUT /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'name' => 'Gwarancja producenta',
'individual' => [
'period' => 'P3Y',
'type' => 'MANUFACTURER',
],
'corporate' => [
'period' => 'P1Y',
'type' => 'MANUFACTURER',
],
];
$ch = curl_init($base . '/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2');
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER",
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER",
},
}
r = requests.request("PUT", BASE + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: PUT /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"name": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
};
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2`, {
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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 + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"name": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
""";
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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2"))
.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 /after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2 (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": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}`
req, err := http.NewRequest("PUT", base+"/after-sales-service-conditions/warranties/5be961ca-7c55-4d2a-9332-93d58877d4a2", 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": "5be961ca-7c55-4d2a-9332-93d58877d4a2",
"name": "Gwarancja producenta",
"individual": {
"period": "P3Y",
"type": "MANUFACTURER"
},
"corporate": {
"period": "P1Y",
"type": "MANUFACTURER"
}
}Gwarancja — usunięcie
DELETE /after-sales-service-conditions/warranties/{warrantyId}
zgodna z Allegroallegro:api:sale:settings:writelimit: write
Usuwa wpis. Wpis wskazany w którejś ofercie → 409 IN_USE (najpierw odepnij go od ofert).
Zgodność: zgodna z Allegro REST API (ten sam kształt) — DELETE /after-sales-service-conditions/warranties/{id}.
Uprawnienie: zakres allegro:api:sale:settings:write.
Grupa limitu: write.
Parametry ścieżki
warrantyId 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}/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83');
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 /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (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 + "/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83`, {
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 /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (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 + "/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83");
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 /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (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 + "/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83"))
.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 /after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83 (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+"/after-sales-service-conditions/warranties/2ebf18a5-0d1e-4ece-a9e0-66861011ca83", 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)