Raporty
Raporty asynchroniczne CSV/JSON (Amazon Reports).
- POST
/allee/reports— Zamówienie raportu - GET
/allee/reports— Lista raportów - GET
/allee/reports/{reportId}— Raport - DELETE
/allee/reports/{reportId}— Anulowanie raportu - GET
/allee/reports/{reportId}/document— Adres pobrania raportu - GET
/allee/report-documents/{reportDocumentId}/file— Pobranie pliku raportu (podpisany link)
Zamówienie raportu
POST /allee/reports
wzór Amazon SP-APIallee:api:reportslimit: bulk
Raport przygotowywany w tle (CSV albo JSON, gzip). Typy i potrzebne zakresy: OFFERS_ALL, OFFERS_ISSUES (sale:offers:read), ORDERS_BY_DATE, RETURNS (orders:read + obsługa zamówień), BILLING_ENTRIES (billing:read), API_USAGE (tylko reports).
Okres domyślnie 30 dni, najwyżej 92. Dane osobowe kupujących tylko z allee:api:orders:pii. Do 5 raportów w kolejce. Koniec: GET /allee/reports/{id} albo powiadomienie REPORT_PROCESSING_FINISHED.
Zgodność: wzorowana na Amazon Selling Partner API — Reports — createReport.
Uprawnienie: zakres allee:api:reports.
Grupa limitu: bulk.
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
reportType string wymaganeOFFERS_ALL, OFFERS_ISSUES, ORDERS_BY_DATE, BILLING_ENTRIES, RETURNS, API_USAGEdataStartTime string · date-timePoczątek okresu (domyślnie 30 dni wstecz; najwyżej 92 dni).
dataEndTime string · date-timeKoniec okresu (domyślnie teraz).
reportOptions objectPola obiektu
format stringCSV, JSONmarketplaceIds array<string>Odpowiedzi
202 Przyjęto. · Report
reportId string · uuid zawszereportType string zawszemarketplaceIds array<string> zawszedataStartTime string · date-time · null zawszedataEndTime string · date-time · null zawszecreatedTime string · date-time zawszeprocessingStatus string zawszeIN_QUEUE, IN_PROGRESS, DONE, CANCELLED, FATALprocessingStartTime string · date-time · null zawszeprocessingEndTime string · date-time · null zawszereportDocumentId string · null zawszeallee object zawszePola obiektu
format string zawszeCSV, JSONrows integer · null zawszeLiczba wierszy (gdy DONE).
personalData boolean zawszeCzy raport zawiera dane osobowe kupujących (zakres orders:pii).
documentExpiresAt string · date-time · null zawszeDokument jest usuwany po 7 dniach.
error string · null zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 400 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 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ę). |
| 403 | ORDERS_OWNED_BY_OTHER_INTEGRATION | Zamówienia sprzedawcy obsługuje inna integracja (details.owner). |
| 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 | 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_CONCURRENT | Za dużo ciężkich operacji naraz (wsady, raporty, duże polecenia). |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
| 503 | NOT_DEPLOYED | Funkcja jeszcze nie uruchomiona (np. sandbox, wsady). |
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports" \
-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'
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
JSON<?php
// allee API: POST /allee/reports (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'reportType' => 'OFFERS_ALL',
'reportOptions' => [
'format' => 'CSV',
],
];
$ch = curl_init($base . '/allee/reports');
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 /allee/reports (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 = {
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV",
},
}
r = requests.request("POST", BASE + "/allee/reports", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /allee/reports (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
};
const res = await fetch(`${BASE}/allee/reports`, {
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 /allee/reports (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 + "/allee/reports");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
""";
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 /allee/reports (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 = """
{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/reports"))
.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 /allee/reports (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 := `{
"reportType": "OFFERS_ALL",
"reportOptions": {
"format": "CSV"
}
}`
req, err := http.NewRequest("POST", base+"/allee/reports", 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{
"reportId": "75a25ea7-2e91-4f0b-9042-a3c733f9a492",
"reportType": "OFFERS_ALL",
"marketplaceIds": [
"allee-pl"
],
"dataStartTime": null,
"dataEndTime": null,
"createdTime": "2026-11-10T11:10:05.616Z",
"processingStatus": "IN_QUEUE",
"processingStartTime": null,
"processingEndTime": null,
"reportDocumentId": null,
"allee": {
"format": "CSV",
"rows": null,
"personalData": false,
"documentExpiresAt": null,
"error": null
}
}Przykład: Raport zamówień z ostatnich 7 dni (JSON)
curl -sS -X POST "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports" \
-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'
{
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON"
}
}
JSON<?php
// allee API: POST /allee/reports (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$body = [
'reportType' => 'ORDERS_BY_DATE',
'dataStartTime' => '2026-11-03T00:00:00Z',
'reportOptions' => [
'format' => 'JSON',
],
];
$ch = curl_init($base . '/allee/reports');
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 /allee/reports (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 = {
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON",
},
}
r = requests.request("POST", BASE + "/allee/reports", headers=headers, json=body, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: POST /allee/reports (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const body = {
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON"
}
};
const res = await fetch(`${BASE}/allee/reports`, {
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 /allee/reports (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 + "/allee/reports");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("ALLEE_API_KEY"));
req.Headers.Accept.ParseAdd("application/vnd.allegro.public.v1+json");
var json = """
{
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON"
}
}
""";
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 /allee/reports (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 = """
{
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON"
}
}
""";
HttpRequest req = HttpRequest.newBuilder(URI.create(base + "/allee/reports"))
.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 /allee/reports (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 := `{
"reportType": "ORDERS_BY_DATE",
"dataStartTime": "2026-11-03T00:00:00Z",
"reportOptions": {
"format": "JSON"
}
}`
req, err := http.NewRequest("POST", base+"/allee/reports", 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{
"reportId": "ee5a5bf7-694e-44bc-9900-05135ea9cf0c",
"reportType": "ORDERS_BY_DATE",
"marketplaceIds": [
"allee-pl"
],
"dataStartTime": "2026-11-03T00:00:00.000Z",
"dataEndTime": "2026-11-10T11:10:05.000Z",
"createdTime": "2026-11-10T11:10:05.621Z",
"processingStatus": "IN_QUEUE",
"processingStartTime": null,
"processingEndTime": null,
"reportDocumentId": null,
"allee": {
"format": "JSON",
"rows": null,
"personalData": true,
"documentExpiresAt": null,
"error": null
}
}Lista raportów
GET /allee/reports
wzór Amazon SP-APIallee:api:reportslimit: read
Raporty tej aplikacji (klucza) u sprzedawcy, najnowsze pierwsze.
Zgodność: wzorowana na Amazon Selling Partner API — Reports — getReports.
Uprawnienie: zakres allee:api:reports.
Grupa limitu: read.
Parametry zapytania
reportTypes stringTypy rozdzielone przecinkiem.
processingStatuses stringStatusy rozdzielone przecinkiem.
pageSize integer1–100.
nextToken stringToken następnej strony.
Odpowiedzi
200 Raporty. · ReportList
reports array<Report> zawszePola obiektu
reportId string · uuid zawszereportType string zawszemarketplaceIds array<string> zawszedataStartTime string · date-time · null zawszedataEndTime string · date-time · null zawszecreatedTime string · date-time zawszeprocessingStatus string zawszeIN_QUEUE, IN_PROGRESS, DONE, CANCELLED, FATALprocessingStartTime string · date-time · null zawszeprocessingEndTime string · date-time · null zawszereportDocumentId string · null zawszeallee object zawszePola obiektu
format string zawszeCSV, JSONrows integer · null zawszeLiczba wierszy (gdy DONE).
personalData boolean zawszeCzy raport zawiera dane osobowe kupujących (zakres orders:pii).
documentExpiresAt string · date-time · null zawszeDokument jest usuwany po 7 dniach.
error string · null zawszenextToken string · null zawszeBłędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 400 | VALIDATION_ERROR | Zła wartość parametru zapytania (400) albo pola treści (422); path wskazuje miejsce. |
| 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. |
| 503 | NOT_DEPLOYED | Funkcja jeszcze nie uruchomiona (np. sandbox, wsady). |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports?reportTypes=OFFERS_ALL&pageSize=10" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/reports (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/reports?reportTypes=OFFERS_ALL&pageSize=10');
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 /allee/reports (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 + "/allee/reports?reportTypes=OFFERS_ALL&pageSize=10", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/reports (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/reports?reportTypes=OFFERS_ALL&pageSize=10`, {
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 /allee/reports (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 + "/allee/reports?reportTypes=OFFERS_ALL&pageSize=10");
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 /allee/reports (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 + "/allee/reports?reportTypes=OFFERS_ALL&pageSize=10"))
.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 /allee/reports (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+"/allee/reports?reportTypes=OFFERS_ALL&pageSize=10", 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{
"reports": [
{
"reportId": "75a25ea7-2e91-4f0b-9042-a3c733f9a492",
"reportType": "OFFERS_ALL",
"marketplaceIds": [
"allee-pl"
],
"dataStartTime": null,
"dataEndTime": null,
"createdTime": "2026-11-10T11:10:05.616Z",
"processingStatus": "DONE",
"processingStartTime": "2026-11-10T11:10:05.664Z",
"processingEndTime": "2026-11-10T11:10:05.669Z",
"reportDocumentId": "a6c80abf-5393-43af-b634-b9ec56eae431",
"allee": {
"format": "CSV",
"rows": 25,
"personalData": false,
"documentExpiresAt": "2026-11-17T11:10:05.000Z",
"error": null
}
}
],
"nextToken": null
}Raport
GET /allee/reports/{reportId}
wzór Amazon SP-APIallee:api:reportslimit: read
Stan raportu.
Zgodność: wzorowana na Amazon Selling Partner API — Reports — getReport.
Uprawnienie: zakres allee:api:reports.
Grupa limitu: read.
Parametry ścieżki
reportId string · uuid wymaganyIdentyfikator raportu.
Odpowiedzi
200 Raport. · Report
reportId string · uuid zawszereportType string zawszemarketplaceIds array<string> zawszedataStartTime string · date-time · null zawszedataEndTime string · date-time · null zawszecreatedTime string · date-time zawszeprocessingStatus string zawszeIN_QUEUE, IN_PROGRESS, DONE, CANCELLED, FATALprocessingStartTime string · date-time · null zawszeprocessingEndTime string · date-time · null zawszereportDocumentId string · null zawszeallee object zawszePola obiektu
format string zawszeCSV, JSONrows integer · null zawszeLiczba wierszy (gdy DONE).
personalData boolean zawszeCzy raport zawiera dane osobowe kupujących (zakres orders:pii).
documentExpiresAt string · date-time · null zawszeDokument jest usuwany po 7 dniach.
error string · null 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ę). |
| 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. |
| 503 | NOT_DEPLOYED | Funkcja jeszcze nie uruchomiona (np. sandbox, wsady). |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492');
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492`, {
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492");
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492"))
.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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492 (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+"/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492", 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{
"reportId": "75a25ea7-2e91-4f0b-9042-a3c733f9a492",
"reportType": "OFFERS_ALL",
"marketplaceIds": [
"allee-pl"
],
"dataStartTime": null,
"dataEndTime": null,
"createdTime": "2026-11-10T11:10:05.616Z",
"processingStatus": "IN_QUEUE",
"processingStartTime": null,
"processingEndTime": null,
"reportDocumentId": null,
"allee": {
"format": "CSV",
"rows": null,
"personalData": false,
"documentExpiresAt": null,
"error": null
}
}Anulowanie raportu
DELETE /allee/reports/{reportId}
wzór Amazon SP-APIallee:api:reportslimit: write
Tylko raport w kolejce (IN_QUEUE), inaczej 409.
Zgodność: wzorowana na Amazon Selling Partner API — Reports — cancelReport.
Uprawnienie: zakres allee:api:reports.
Grupa limitu: write.
Parametry ścieżki
reportId string · uuid wymaganyIdentyfikator raportu.
Odpowiedzi
200 Anulowano. · Report
reportId string · uuid zawszereportType string zawszemarketplaceIds array<string> zawszedataStartTime string · date-time · null zawszedataEndTime string · date-time · null zawszecreatedTime string · date-time zawszeprocessingStatus string zawszeIN_QUEUE, IN_PROGRESS, DONE, CANCELLED, FATALprocessingStartTime string · date-time · null zawszeprocessingEndTime string · date-time · null zawszereportDocumentId string · null zawszeallee object zawszePola obiektu
format string zawszeCSV, JSONrows integer · null zawszeLiczba wierszy (gdy DONE).
personalData boolean zawszeCzy raport zawiera dane osobowe kupujących (zakres orders:pii).
documentExpiresAt string · date-time · null zawszeDokument jest usuwany po 7 dniach.
error string · null 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ę). |
| 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 | REPORT_NOT_CANCELLABLE | Raport nie jest już w kolejce. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
| 503 | NOT_DEPLOYED | Funkcja jeszcze nie uruchomiona (np. sandbox, wsady). |
curl -sS -X DELETE "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: DELETE /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c');
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 /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (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 + "/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: DELETE /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c`, {
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 /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (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 + "/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c");
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 /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (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 + "/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c"))
.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 /allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c (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+"/allee/reports/ee5a5bf7-694e-44bc-9900-05135ea9cf0c", 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{
"reportId": "ee5a5bf7-694e-44bc-9900-05135ea9cf0c",
"reportType": "ORDERS_BY_DATE",
"marketplaceIds": [
"allee-pl"
],
"dataStartTime": "2026-11-03T00:00:00.000Z",
"dataEndTime": "2026-11-10T11:10:05.000Z",
"createdTime": "2026-11-10T11:10:05.621Z",
"processingStatus": "CANCELLED",
"processingStartTime": null,
"processingEndTime": "2026-11-10T11:10:05.624Z",
"reportDocumentId": null,
"allee": {
"format": "JSON",
"rows": null,
"personalData": true,
"documentExpiresAt": null,
"error": null
}
}Adres pobrania raportu
GET /allee/reports/{reportId}/document
wzór Amazon SP-APIallee:api:reportslimit: read
Podpisany adres pliku (ważny 5 min, bez tokenu), plik w gzip. Raport z danymi osobowymi pobierze tylko dostęp z allee:api:orders:pii. Dokument jest usuwany po 7 dniach (410).
Zgodność: wzorowana na Amazon Selling Partner API — Reports — getReportDocument.
Uprawnienie: zakres allee:api:reports.
Grupa limitu: read.
Parametry ścieżki
reportId string · uuid wymaganyIdentyfikator raportu.
Odpowiedzi
200 Adres. · ReportDocument
reportDocumentId string zawszeurl string · uri zawszePodpisany adres pobrania (ważny 5 minut, bez tokenu).
compressionAlgorithm string zawszeGZIPcontentType string zawszetext/csv, application/jsonexpiresAt string · date-time 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ę). |
| 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 | REPORT_NOT_READY | Raport jeszcze nie gotowy. |
| 410 | DOCUMENT_EXPIRED | Dokument raportu usunięty po 7 dniach. |
| 429 | TOO_MANY_REQUESTS | Przekroczony limit (minutowy, grupy operacji albo IP). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
| 503 | NOT_DEPLOYED | Funkcja jeszcze nie uruchomiona (np. sandbox, wsady). |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document" \
-H "Authorization: Bearer $ALLEE_API_KEY" \
-H "Accept: application/vnd.allegro.public.v1+json" \
-w '\nHTTP %{http_code}\n'<?php
// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document');
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document", headers=headers, timeout=60, allow_redirects=False)
print("HTTP", r.status_code)
print(r.text)// allee API: GET /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (Node.js 18+, wbudowany fetch; plik .mjs)
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document`, {
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document");
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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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 + "/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document"))
.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 /allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document (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+"/allee/reports/75a25ea7-2e91-4f0b-9042-a3c733f9a492/document", 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{
"reportDocumentId": "a6c80abf-5393-43af-b634-b9ec56eae431",
"url": "https://api.allee.pl/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…",
"compressionAlgorithm": "GZIP",
"contentType": "text/csv",
"expiresAt": "2026-11-10T11:15:05Z"
}Pobranie pliku raportu (podpisany link)
GET /allee/report-documents/{reportDocumentId}/file
wzór Amazon SP-APIlimit: read
Adres z GET /allee/reports/{id}/document — bez tokenu. Po terminie → 403 LINK_EXPIRED_OR_INVALID. Treść: gzip (CSV albo JSON). Link z sandboxu ma dodatkowo mode=test (objęte podpisem) — pobierasz go tak samo; nie zmieniaj parametrów adresu.
Zgodność: wzorowana na Amazon Selling Partner API — pobranie dokumentu raportu z url.
Uwierzytelnienie: podpis w adresie (link ważny 5 minut) — bez tokenu.
Parametry ścieżki
reportDocumentId string · uuid wymaganyIdentyfikator dokumentu.
Parametry zapytania
expires string wymaganyZ podpisanego adresu.
mode stringZ podpisanego adresu — tylko linki z sandboxu (objęte podpisem).
testsignature string wymaganyZ podpisanego adresu.
Odpowiedzi
200 Plik gzip (Content-Disposition: attachment). · string · binary
Błędy
| HTTP | Kod | Znaczenie |
|---|---|---|
| 403 | LINK_EXPIRED_OR_INVALID | Podpisany link wygasł (5 min) albo jest zmieniony. |
| 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). |
| 500 | INTERNAL_ERROR | Błąd serwera allee. |
| 503 | STORAGE_UNAVAILABLE | Magazyn plików chwilowo niedostępny. |
curl -sS -X GET "${ALLEE_API_URL:-https://api.allee.pl}/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…" \
-H "Accept: application/gzip" \
-o raport.csv.gz -w 'HTTP %{http_code}\n'<?php
// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (PHP 8, rozszerzenie curl)
$base = getenv('ALLEE_API_URL') ?: 'https://api.allee.pl';
$ch = curl_init($base . '/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Accept: application/gzip',
],
CURLOPT_RETURNTRANSFER => true,
]);
$odp = curl_exec($ch);
$kod = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($kod === 200) file_put_contents('raport.csv.gz', $odp);
echo 'HTTP ', $kod, "\n";# allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Python 3, biblioteka requests)
import os
import requests
BASE = os.environ.get("ALLEE_API_URL", "https://api.allee.pl")
headers = {
"Accept": "application/gzip",
}
r = requests.request("GET", BASE + "/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…", headers=headers, timeout=60, allow_redirects=False)
if r.status_code == 200:
with open("raport.csv.gz", "wb") as f:
f.write(r.content)
print("HTTP", r.status_code)// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Node.js 18+, wbudowany fetch; plik .mjs)
import { readFile, writeFile } from "node:fs/promises";
const BASE = process.env.ALLEE_API_URL ?? "https://api.allee.pl";
const res = await fetch(`${BASE}/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…`, {
method: "GET",
headers: {
"Accept": "application/gzip",
},
redirect: "manual",
});
if (res.status === 200) await writeFile("raport.csv.gz", Buffer.from(await res.arrayBuffer()));
console.log("HTTP", res.status);// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (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 + "/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…");
req.Headers.Accept.ParseAdd("application/gzip");
using var res = await http.SendAsync(req);
if ((int)res.StatusCode == 200) File.WriteAllBytes("raport.csv.gz", await res.Content.ReadAsByteArrayAsync());
Console.WriteLine($"HTTP {(int)res.StatusCode}");// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (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;
import java.nio.file.Path;
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 + "/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…"))
.header("Accept", "application/gzip")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpClient http = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();
HttpResponse<Path> res = http.send(req, HttpResponse.BodyHandlers.ofFile(Path.of("raport.csv.gz")));
System.out.println("HTTP " + res.statusCode());
}
}// allee API: GET /allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file (Go 1.20+, net/http; uruchom: go run main.go)
package main
import (
"fmt"
"net/http"
"os"
)
func main() {
base := os.Getenv("ALLEE_API_URL")
if base == "" {
base = "https://api.allee.pl"
}
req, err := http.NewRequest("GET", base+"/allee/report-documents/a6c80abf-5393-43af-b634-b9ec56eae431/file?expires=1794309305&mode=test&signature=…", nil)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/gzip")
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()
if res.StatusCode == 200 {
f, err := os.Create("raport.csv.gz")
if err != nil {
panic(err)
}
defer f.Close()
if _, err := f.ReadFrom(res.Body); err != nil {
panic(err)
}
}
fmt.Println("HTTP", res.StatusCode)
}application/gzip(plik raport.csv.gz: 1318 B, application/gzip)