{
  "openapi": "3.1.0",
  "info": {
    "title": "luciddev.studio — Allegro API",
    "version": "1.0.0",
    "description": "Udane wywołania zużywają kredyty. Tester wykonuje request wyłącznie po kliknięciu Send. Rynek PL."
  },
  "servers": [
    {
      "url": "https://api.luciddev.studio"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/api/allegro/search": {
      "get": {
        "operationId": "allegro.search",
        "description": "Rynek PL. Koszt udanego niepustego wyniku według GET /api/portal/catalog (prices). Błędy bez opłaty.",
        "tags": [
          "Allegro"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "iphone 13",
            "description": "Fraza wyszukiwania ofert, np. rower."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(?:[0-9]{1,10}|[a-z0-9]+(?:-[a-z0-9]+)*)$",
              "maxLength": 120
            },
            "description": "ID lub alias kategorii Allegro."
          },
          {
            "name": "price_from",
            "in": "query",
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 100000000
            },
            "example": 1000,
            "description": "Minimalna cena oferty w PLN."
          },
          {
            "name": "price_to",
            "in": "query",
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 100000000
            },
            "example": 2500,
            "description": "Maksymalna cena oferty w PLN."
          },
          {
            "name": "condition",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "new",
                "used",
                "damaged",
                "refurbished",
                null
              ]
            },
            "description": "Stan produktu: new (nowy), used (używany), damaged (uszkodzony), refurbished (odnowiony)."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "relevance",
                "price_asc",
                "price_desc",
                "price_with_delivery_asc",
                "price_with_delivery_desc",
                "popularity",
                "newest",
                "time_left"
              ]
            },
            "example": "price_asc",
            "description": "Kolejność wyników: trafność, cena, cena z dostawą, popularność, najnowsze lub czas do końca."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Numer strony wyników, liczony od 1."
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PL",
                "CZ",
                "SK"
              ]
            },
            "description": "Obecnie obsługiwane PL. CZ i SK zwracają 422."
          },
          {
            "name": "buy_now",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filtr ofert z opcją Kup teraz."
          },
          {
            "name": "smart",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filtr ofert z dostawą Allegro Smart!."
          },
          {
            "name": "super_seller",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filtr ofert od Super Sprzedawców."
          },
          {
            "name": "seller_id",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[0-9]{1,15}$"
            },
            "description": "Numeryczny identyfikator sprzedawcy Allegro."
          }
        ],
        "responses": {
          "200": {
            "description": "Udany wynik",
            "headers": {
              "X-Credits-Charged": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-request-id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "price": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number"
                                  },
                                  "currency": {
                                    "type": "string"
                                  }
                                }
                              },
                              "title": {
                                "type": "string"
                              },
                              "images": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "seller": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "login": {
                                    "type": "string"
                                  },
                                  "is_company": {
                                    "type": "boolean"
                                  },
                                  "super_seller": {
                                    "type": "boolean"
                                  },
                                  "positive_feedback_percent": {
                                    "type": "number"
                                  }
                                }
                              },
                              "is_smart": {
                                "type": "boolean"
                              },
                              "offer_id": {
                                "type": "string"
                              },
                              "quantity": {
                                "type": "null"
                              },
                              "shipping": {
                                "type": "object",
                                "properties": {
                                  "lowest": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number"
                                      },
                                      "currency": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "free_return": {
                                    "type": "boolean"
                                  },
                                  "delivery_text": {
                                    "type": "string"
                                  },
                                  "free_delivery": {
                                    "type": "boolean"
                                  },
                                  "price_with_delivery": {
                                    "type": "object",
                                    "properties": {
                                      "amount": {
                                        "type": "number"
                                      },
                                      "currency": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "condition": {
                                "type": "null"
                              },
                              "sold_text": {
                                "type": "string"
                              },
                              "parameters": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              },
                              "product_id": {
                                "type": "string"
                              },
                              "sold_count": {
                                "type": "integer"
                              },
                              "category_id": {
                                "type": "string"
                              },
                              "is_sponsored": {
                                "type": "boolean"
                              },
                              "original_price": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number"
                                  },
                                  "currency": {
                                    "type": "string"
                                  }
                                }
                              },
                              "product_rating": {
                                "type": "object",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  },
                                  "average": {
                                    "type": "number"
                                  }
                                }
                              },
                              "discount_percent": {
                                "type": "integer"
                              },
                              "best_price_guarantee": {
                                "type": "boolean"
                              },
                              "product_offers_count": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "country": {
                          "type": "string"
                        },
                        "filters": {
                          "type": "object",
                          "properties": {
                            "sort": {
                              "type": "string"
                            },
                            "query": {
                              "type": "string"
                            },
                            "category": {
                              "type": "null"
                            },
                            "price_to": {
                              "type": "null"
                            },
                            "condition": {
                              "type": "null"
                            },
                            "seller_id": {
                              "type": "null"
                            },
                            "price_from": {
                              "type": "null"
                            }
                          }
                        },
                        "currency": {
                          "type": "string"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "has_next": {
                              "type": "boolean"
                            },
                            "per_page": {
                              "type": "integer"
                            },
                            "total_pages": {
                              "type": "integer"
                            },
                            "current_page": {
                              "type": "integer"
                            },
                            "total_results": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "integer"
                        },
                        "billable": {
                          "type": "boolean"
                        },
                        "endpoint_family": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Allegro search 200 response (inferred from official example)",
                  "description": "Inferred from the documented example; fields can be null or missing in real data.",
                  "required": [
                    "success",
                    "data",
                    "meta"
                  ]
                },
                "examples": {
                  "result": {
                    "summary": "Przykładowy wynik",
                    "value": {
                      "data": {
                        "items": [
                          {
                            "url": "https://allegro.pl/oferta/19092486054",
                            "price": {
                              "amount": 1628,
                              "currency": "PLN"
                            },
                            "title": "Smartfon Apple iPhone 13 4 GB / 128 GB 5G niebieski",
                            "images": [
                              "https://a.allegroimg.com/original/295d2b/f1335c204ea4abbaa4a6f5c59d67/Apple-iPhone-13-128GB-Niebieski",
                              "https://a.allegroimg.com/original/11300d/67fab13b4f17a0d1e6a3d9915d3e/Apple-iPhone-13-128GB-Niebieski-Marka-Apple",
                              "https://a.allegroimg.com/original/115426/595025964aa3a2b6033226fde2fa/Apple-iPhone-13-128GB-Niebieski-Wbudowana-pamiec-128-GB"
                            ],
                            "seller": {
                              "id": "120463582",
                              "login": "Elektroshock_EU",
                              "is_company": true,
                              "super_seller": true,
                              "positive_feedback_percent": 96.5
                            },
                            "is_smart": true,
                            "offer_id": "19092486054",
                            "quantity": null,
                            "shipping": {
                              "lowest": {
                                "amount": 0,
                                "currency": "PLN"
                              },
                              "free_return": false,
                              "delivery_text": "dostawa pt. 13 lis.",
                              "free_delivery": true,
                              "price_with_delivery": {
                                "amount": 1628,
                                "currency": "PLN"
                              }
                            },
                            "condition": null,
                            "sold_text": "51 osób kupiło ostatnio",
                            "parameters": [
                              {
                                "name": "Kolor",
                                "values": [
                                  "niebieski"
                                ]
                              },
                              {
                                "name": "Przekątna ekranu",
                                "values": [
                                  "6.1\""
                                ]
                              },
                              {
                                "name": "Wbudowana pamięć",
                                "values": [
                                  "128 GB"
                                ]
                              },
                              {
                                "name": "Pamięć RAM",
                                "values": [
                                  "4 GB"
                                ]
                              }
                            ],
                            "product_id": "9e8deda3-e7e4-470e-8238-531161ff3272",
                            "sold_count": 51,
                            "category_id": "320536",
                            "is_sponsored": false,
                            "original_price": {
                              "amount": 1824.16,
                              "currency": "PLN"
                            },
                            "product_rating": {
                              "count": 664,
                              "average": 4.83
                            },
                            "discount_percent": 10,
                            "best_price_guarantee": true,
                            "product_offers_count": 81
                          },
                          {
                            "url": "https://allegro.pl/oferta/18907224122",
                            "price": {
                              "amount": 2119.35,
                              "currency": "PLN"
                            },
                            "title": "Smartfon Apple iPhone 13 4 GB / 512 GB 5G biały",
                            "images": [
                              "https://a.allegroimg.com/original/11448b/f1cdbf30411089386073b7b46240/nowy-ORYG-Apple-iPhone-13-White-512-GB-nano-SIM-eSIM-Lightning",
                              "https://a.allegroimg.com/original/296bd2/30c63c3340b1bf246961d170e0b7/nowy-ORYG-Apple-iPhone-13-White-512-GB-nano-SIM-eSIM-Lightning-Stan-opakowania-oryginalne",
                              "https://a.allegroimg.com/original/11b5ff/88aefdad4f60ab586ada455895fe/nowy-ORYG-Apple-iPhone-13-White-512-GB-nano-SIM-eSIM-Lightning-Kod-producenta-MLQD3PM-A"
                            ],
                            "seller": {
                              "id": "19772085",
                              "login": "FirmaStarex",
                              "is_company": true,
                              "super_seller": false,
                              "positive_feedback_percent": 99.8
                            },
                            "is_smart": true,
                            "offer_id": "18907224122",
                            "quantity": null,
                            "shipping": {
                              "lowest": {
                                "amount": 10.49,
                                "currency": "PLN"
                              },
                              "free_return": false,
                              "delivery_text": "dostawa we wtorek",
                              "free_delivery": false,
                              "price_with_delivery": {
                                "amount": 2129.84,
                                "currency": "PLN"
                              }
                            },
                            "condition": null,
                            "sold_text": "7 osób kupiło ostatnio",
                            "parameters": [
                              {
                                "name": "Kolor",
                                "values": [
                                  "biały"
                                ]
                              },
                              {
                                "name": "Przekątna ekranu",
                                "values": [
                                  "6.1\""
                                ]
                              },
                              {
                                "name": "Wbudowana pamięć",
                                "values": [
                                  "512 GB"
                                ]
                              },
                              {
                                "name": "Pamięć RAM",
                                "values": [
                                  "4 GB"
                                ]
                              }
                            ],
                            "product_id": "f4e8247d-e2d0-45fa-a8da-a03e75b5a568",
                            "sold_count": 7,
                            "category_id": "320536",
                            "is_sponsored": false,
                            "original_price": {
                              "amount": 2184.9,
                              "currency": "PLN"
                            },
                            "product_rating": {
                              "count": 6,
                              "average": 5
                            },
                            "discount_percent": 3,
                            "best_price_guarantee": false,
                            "product_offers_count": 6
                          }
                        ],
                        "country": "PL",
                        "filters": {
                          "sort": "relevance",
                          "query": "iphone 13",
                          "category": null,
                          "price_to": null,
                          "condition": null,
                          "seller_id": null,
                          "price_from": null
                        },
                        "currency": "PLN",
                        "pagination": {
                          "has_next": true,
                          "per_page": 73,
                          "total_pages": 100,
                          "current_page": 1,
                          "total_results": 147543
                        }
                      },
                      "meta": {
                        "credits": 20,
                        "billable": true,
                        "endpoint_family": "search"
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "403": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "404": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errors"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "Kontrakt P3: limit konta (minutowy lub równoległości), bez obciążenia kredytami. Jeszcze niewdrożony.",
            "x-implementation-phase": "P3",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Sekundy do ponowienia, zgodne z retry_after.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error",
                    "meta",
                    "retry_after",
                    "request_id"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": "RATE_LIMITED"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "billable",
                        "retryable"
                      ],
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "const": true
                        }
                      }
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "x-credits": {
          "min": 20,
          "max": 20,
          "rule": "20 credits per successful request. Failed requests are free. An empty result is free."
        },
        "summary": "Wyszukiwanie ofert",
        "x-credit-operations": [
          "search"
        ]
      }
    },
    "/api/allegro/offer": {
      "get": {
        "operationId": "allegro.offer",
        "description": "Rynek PL. Koszt udanego niepustego wyniku według GET /api/portal/catalog (prices). Błędy bez opłaty.",
        "tags": [
          "Allegro"
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "Adres oferty Allegro. Podaj url albo offer_id.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 500
            }
          },
          {
            "name": "offer_id",
            "in": "query",
            "description": "Numeryczny identyfikator oferty. Podaj offer_id albo url.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[0-9]{6,15}$"
            },
            "example": "16571803677"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PL",
                "CZ",
                "SK"
              ]
            },
            "description": "Obecnie obsługiwane PL. CZ i SK zwracają 422."
          }
        ],
        "responses": {
          "200": {
            "description": "Udany wynik",
            "headers": {
              "X-Credits-Charged": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-request-id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "offer": {
                          "type": "object",
                          "properties": {
                            "sku": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "gtin": {
                              "type": "string"
                            },
                            "sold": {
                              "type": "object",
                              "properties": {
                                "text": {
                                  "type": "string"
                                },
                                "buyers_last_30_days": {
                                  "type": "integer"
                                }
                              }
                            },
                            "brand": {
                              "type": "string"
                            },
                            "price": {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "integer"
                                },
                                "currency": {
                                  "type": "string"
                                }
                              }
                            },
                            "stock": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "available": {
                                  "type": "integer"
                                },
                                "purchase_limit": {
                                  "type": "null"
                                }
                              }
                            },
                            "title": {
                              "type": "string"
                            },
                            "images": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "seller": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "city": {
                                  "type": "string"
                                },
                                "login": {
                                  "type": "string"
                                },
                                "is_company": {
                                  "type": "boolean"
                                },
                                "company_name": {
                                  "type": "string"
                                },
                                "country_code": {
                                  "type": "string"
                                },
                                "super_seller": {
                                  "type": "boolean"
                                },
                                "negative_feedback_count": {
                                  "type": "integer"
                                },
                                "positive_feedback_count": {
                                  "type": "integer"
                                },
                                "positive_feedback_percent": {
                                  "type": "number"
                                }
                              }
                            },
                            "returns": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "string"
                                },
                                "withdrawal_period": {
                                  "type": "string"
                                }
                              }
                            },
                            "category": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            },
                            "currency": {
                              "type": "string"
                            },
                            "delivery": {
                              "type": "object",
                              "properties": {
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "group": {
                                        "type": "string"
                                      },
                                      "price": {
                                        "type": "object",
                                        "properties": {
                                          "amount": {
                                            "type": "number"
                                          },
                                          "currency": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "free_return": {
                                        "type": "boolean"
                                      },
                                      "country_code": {
                                        "type": "string"
                                      },
                                      "delivery_time": {
                                        "type": "string"
                                      },
                                      "next_item_price": {
                                        "type": "object",
                                        "properties": {
                                          "amount": {
                                            "type": "integer"
                                          },
                                          "currency": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "price_with_smart": {
                                        "type": "object",
                                        "properties": {
                                          "amount": {
                                            "type": "integer"
                                          },
                                          "currency": {
                                            "type": "string"
                                          }
                                        }
                                      },
                                      "max_items_per_package": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                },
                                "cheapest": {
                                  "type": "object",
                                  "properties": {
                                    "amount": {
                                      "type": "integer"
                                    },
                                    "currency": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "ships_from": {
                                  "type": "string"
                                },
                                "handling_time": {
                                  "type": "string"
                                },
                                "ships_from_country_code": {
                                  "type": "string"
                                }
                              }
                            },
                            "offer_id": {
                              "type": "string"
                            },
                            "warranty": {
                              "type": "object",
                              "properties": {
                                "seller_warranty": {
                                  "type": "string"
                                },
                                "statutory_warranty": {
                                  "type": "string"
                                }
                              }
                            },
                            "condition": {
                              "type": "string"
                            },
                            "parameters": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "group": {
                                    "type": "string"
                                  },
                                  "parameters": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "values": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "product_id": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "availability": {
                              "type": "string"
                            },
                            "listing_type": {
                              "type": "string"
                            },
                            "category_path": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "original_price": {
                              "type": "null"
                            },
                            "product_rating": {
                              "type": "object",
                              "properties": {
                                "count": {
                                  "type": "integer"
                                },
                                "average": {
                                  "type": "number"
                                },
                                "distribution": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "count": {
                                        "type": "integer"
                                      },
                                      "stars": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "reviews_preview": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "cons": {
                                    "type": "string"
                                  },
                                  "pros": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "author": {
                                    "type": "string"
                                  },
                                  "images": {
                                    "type": "array",
                                    "items": {}
                                  },
                                  "rating": {
                                    "type": "integer"
                                  },
                                  "is_best": {
                                    "type": "boolean"
                                  },
                                  "language": {
                                    "type": "string"
                                  },
                                  "created_at": {
                                    "type": "string"
                                  },
                                  "seller_login": {
                                    "type": "string"
                                  },
                                  "helpful_count": {
                                    "type": "integer"
                                  },
                                  "not_helpful_count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "discount_percent": {
                              "type": "null"
                            }
                          }
                        },
                        "country": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "integer"
                        },
                        "billable": {
                          "type": "boolean"
                        },
                        "endpoint_family": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Allegro offer 200 response (inferred from official example)",
                  "description": "Inferred from the documented example; fields can be null or missing in real data.",
                  "required": [
                    "success",
                    "data",
                    "meta"
                  ]
                },
                "examples": {
                  "result": {
                    "summary": "Przykładowy wynik",
                    "value": {
                      "data": {
                        "offer": {
                          "sku": "16571803677",
                          "url": "https://allegro.pl/oferta/smartfon-apple-iphone-13-128gb-czerwony-stan-bardzo-dobry-16571803677",
                          "gtin": "0194252708095",
                          "sold": {
                            "text": "2 osoby kupiły 2 sztuki",
                            "buyers_last_30_days": 2
                          },
                          "brand": "Apple",
                          "price": {
                            "amount": 1239,
                            "currency": "PLN"
                          },
                          "stock": {
                            "label": "z 4 sztuk",
                            "available": 4,
                            "purchase_limit": null
                          },
                          "title": "Smartfon Apple iPhone 13 128GB Czerwony | Stan: bardzo dobry",
                          "images": [
                            "https://a.allegroimg.com/original/11dea8/1a721aa74b82833a8e1758b79b4d/Smartfon-Apple-iPhone-13-128GB-Czerwony-Stan-bardzo-dobry",
                            "https://a.allegroimg.com/original/116753/d0c252e34c17a7ef3b5c87915bbe/Smartfon-Apple-iPhone-13-128GB-Czerwony-Stan-bardzo-dobry-Ladowarka-w-komplecie-nie"
                          ],
                          "seller": {
                            "id": "46619855",
                            "url": "https://allegro.pl/uzytkownik/luxtrade-pl",
                            "city": "Pszczyna",
                            "login": "luxtrade-pl",
                            "is_company": true,
                            "company_name": "TKBW II SP. Z O.O.",
                            "country_code": "PL",
                            "super_seller": false,
                            "negative_feedback_count": 16,
                            "positive_feedback_count": 558,
                            "positive_feedback_percent": 97.2
                          },
                          "returns": {
                            "summary": "Masz 14 dni na odstąpienie od umowy.",
                            "withdrawal_period": "14 dni"
                          },
                          "category": {
                            "id": "320536",
                            "name": "iPhone 13"
                          },
                          "currency": "PLN",
                          "delivery": {
                            "options": [
                              {
                                "name": "Allegro One Box, Allegro One",
                                "group": "Odbiór w punkcie",
                                "price": {
                                  "amount": 10.49,
                                  "currency": "PLN"
                                },
                                "free_return": false,
                                "country_code": "PL",
                                "delivery_time": "czw. 12 lis. w punkcie",
                                "next_item_price": {
                                  "amount": 0,
                                  "currency": "PLN"
                                },
                                "price_with_smart": {
                                  "amount": 0,
                                  "currency": "PLN"
                                },
                                "max_items_per_package": 3
                              },
                              {
                                "name": "Allegro One Punkt, Allegro One",
                                "group": "Odbiór w punkcie",
                                "price": {
                                  "amount": 10.49,
                                  "currency": "PLN"
                                },
                                "free_return": false,
                                "country_code": "PL",
                                "delivery_time": "czw. 12 lis. w punkcie",
                                "next_item_price": {
                                  "amount": 0,
                                  "currency": "PLN"
                                },
                                "price_with_smart": {
                                  "amount": 0,
                                  "currency": "PLN"
                                },
                                "max_items_per_package": 3
                              }
                            ],
                            "cheapest": {
                              "amount": 0,
                              "currency": "PLN"
                            },
                            "ships_from": "Pszczyna",
                            "handling_time": "24 godziny",
                            "ships_from_country_code": "PL"
                          },
                          "offer_id": "16571803677",
                          "warranty": {
                            "seller_warranty": "Produkt jest objęty gwarancją sprzedającego przez 24 miesiące od zakupu.",
                            "statutory_warranty": "Sprzedawca odpowiada za wadliwy towar przez 2 lata od jego wydania."
                          },
                          "condition": "Powystawowy",
                          "parameters": [
                            {
                              "group": "Dane podstawowe",
                              "parameters": [
                                {
                                  "name": "Stan",
                                  "values": [
                                    "Powystawowy"
                                  ]
                                },
                                {
                                  "name": "Faktura",
                                  "values": [
                                    "Wystawiam fakturę VAT-marża"
                                  ]
                                },
                                {
                                  "name": "Kod producenta",
                                  "values": [
                                    "MLPJ3PM/A"
                                  ]
                                },
                                {
                                  "name": "Marka",
                                  "values": [
                                    "Apple"
                                  ]
                                },
                                {
                                  "name": "Model telefonu",
                                  "values": [
                                    "iPhone 13"
                                  ]
                                },
                                {
                                  "name": "Typ",
                                  "values": [
                                    "Smartfon"
                                  ]
                                },
                                {
                                  "name": "EAN (GTIN)",
                                  "values": [
                                    "0194252708095"
                                  ]
                                },
                                {
                                  "name": "Obsługa ładowania bezprzewodowego",
                                  "values": [
                                    "tak"
                                  ]
                                }
                              ]
                            }
                          ],
                          "product_id": "86530fbb-7c5a-41cc-92e2-6d622aa75509",
                          "description": "Apple iPhone 13 128 GB\nZostał wprowadzony na rynek we wrześniu 2021 roku. Wyposażony w aparat, który oferuje doskonałe możliwości fotograficzne, szczególnie w w...",
                          "availability": "in_stock",
                          "listing_type": "buy_now",
                          "category_path": [
                            {
                              "id": "954b95b6-43cf-4104-8354-dea4d9b10ddf",
                              "name": "Allegro"
                            },
                            {
                              "id": "42540aec-367a-4e5e-b411-17c09b08e41f",
                              "name": "Elektronika"
                            },
                            {
                              "id": "4",
                              "name": "Telefony i Akcesoria"
                            },
                            {
                              "id": "165",
                              "name": "Smartfony i telefony komórkowe"
                            },
                            {
                              "id": "48978",
                              "name": "Apple"
                            },
                            {
                              "id": "320536",
                              "name": "iPhone 13"
                            }
                          ],
                          "original_price": null,
                          "product_rating": {
                            "count": 336,
                            "average": 4.87,
                            "distribution": [
                              {
                                "count": 318,
                                "stars": 5
                              },
                              {
                                "count": 7,
                                "stars": 4
                              },
                              {
                                "count": 3,
                                "stars": 3
                              },
                              {
                                "count": 1,
                                "stars": 2
                              },
                              {
                                "count": 7,
                                "stars": 1
                              }
                            ]
                          },
                          "reviews_preview": [
                            {
                              "id": "624d54214c83d2711b4d6d53",
                              "cons": "Cena,  brak możliwości ustawiania dowolnie ikon,  konieczność aktywacji Apple Pay aby użyć NFC",
                              "pros": "Aparat,  bateria,  faceID,  dobry dźwięk,  świetny wyświetlacz,  szybkość działania,  wykończenie",
                              "text": "Mimo początkowych wątpliwości po przesiadce z Androida, jestem całkiem zadowolona. 13stka działa szybko i prezentuje się bardzo dobrze. Aparat to zdecydowany plus tego modelu. Po androidzie najbardziej boli brak możliwości dostosowania sobie układu ikon na ekranie. Ale sam interface jest dość udany, wiec pewnie to kwestia przyzwyczajenia. Bateria spokojnie wytrzyma 2 dni przy dość intensywnym użyciu .",
                              "author": "K...0",
                              "images": [],
                              "rating": 5,
                              "is_best": true,
                              "language": "pl-PL",
                              "created_at": "2022-04-06T08:49:37Z",
                              "seller_login": "Allegro",
                              "helpful_count": 6,
                              "not_helpful_count": 4
                            }
                          ],
                          "discount_percent": null
                        },
                        "country": "PL",
                        "currency": "PLN"
                      },
                      "meta": {
                        "credits": 20,
                        "billable": true,
                        "endpoint_family": "offer"
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "403": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "404": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errors"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "Kontrakt P3: limit konta (minutowy lub równoległości), bez obciążenia kredytami. Jeszcze niewdrożony.",
            "x-implementation-phase": "P3",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Sekundy do ponowienia, zgodne z retry_after.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error",
                    "meta",
                    "retry_after",
                    "request_id"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": "RATE_LIMITED"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "billable",
                        "retryable"
                      ],
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "const": true
                        }
                      }
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "x-required-one-of": [
          [
            "url",
            "offer_id"
          ]
        ],
        "x-credits": {
          "min": 20,
          "max": 20,
          "rule": "20 credits per successful request. Failed requests are free."
        },
        "summary": "Szczegóły oferty",
        "x-credit-operations": [
          "offer"
        ]
      }
    },
    "/api/allegro/reviews": {
      "get": {
        "operationId": "allegro.reviews",
        "description": "Rynek PL. Koszt udanego niepustego wyniku według GET /api/portal/catalog (prices). Błędy bez opłaty.",
        "tags": [
          "Allegro"
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "example": "86530fbb-7c5a-41cc-92e2-6d622aa75509",
            "description": "UUID produktu Allegro, którego opinie chcesz pobrać."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "example": 1,
            "description": "Numer strony wyników, liczony od 1."
          },
          {
            "name": "rating",
            "in": "query",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1,
              "maximum": 5
            },
            "description": "Filtr ocen produktu: liczba gwiazdek od 1 do 5."
          }
        ],
        "responses": {
          "200": {
            "description": "Udany wynik",
            "headers": {
              "X-Credits-Charged": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-request-id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "reviews": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "cons": {
                                "type": "string"
                              },
                              "pros": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              },
                              "author": {
                                "type": "string"
                              },
                              "images": {
                                "type": "array",
                                "items": {}
                              },
                              "rating": {
                                "type": "integer"
                              },
                              "is_best": {
                                "type": "boolean"
                              },
                              "language": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "seller_login": {
                                "type": "string"
                              },
                              "helpful_count": {
                                "type": "integer"
                              },
                              "not_helpful_count": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "mentions": {
                                "type": "integer"
                              },
                              "sentiment": {
                                "type": "string"
                              },
                              "negative_mentions": {
                                "type": "integer"
                              },
                              "positive_mentions": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "has_next": {
                              "type": "boolean"
                            },
                            "total_pages": {
                              "type": "integer"
                            },
                            "current_page": {
                              "type": "integer"
                            },
                            "total_results": {
                              "type": "integer"
                            }
                          }
                        },
                        "product_id": {
                          "type": "string"
                        },
                        "rating_filter": {
                          "type": "null"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "integer"
                        },
                        "billable": {
                          "type": "boolean"
                        },
                        "endpoint_family": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Allegro reviews 200 response (inferred from official example)",
                  "description": "Inferred from the documented example; fields can be null or missing in real data.",
                  "required": [
                    "success",
                    "data",
                    "meta"
                  ]
                },
                "examples": {
                  "result": {
                    "summary": "Przykładowy wynik",
                    "value": {
                      "data": {
                        "reviews": [
                          {
                            "id": "624d54214c83d2711b4d6d53",
                            "cons": "Cena,  brak możliwości ustawiania dowolnie ikon,  konieczność aktywacji Apple Pay aby użyć NFC",
                            "pros": "Aparat,  bateria,  faceID,  dobry dźwięk,  świetny wyświetlacz,  szybkość działania,  wykończenie",
                            "text": "Mimo początkowych wątpliwości po przesiadce z Androida, jestem całkiem zadowolona. 13stka działa szybko i prezentuje się bardzo dobrze. Aparat to zdecydowany plus tego modelu. Po androidzie najbardziej boli brak możliwości dostosowania sobie układu ikon na ekranie. Ale sam interface jest dość udany, wiec pewnie to kwestia przyzwyczajenia. Bateria spokojnie wytrzyma 2 dni przy dość intensywnym użyciu .",
                            "author": "K...0",
                            "images": [],
                            "rating": 5,
                            "is_best": true,
                            "language": "pl-PL",
                            "created_at": "2022-04-06T08:49:37Z",
                            "seller_login": "Allegro",
                            "helpful_count": 6,
                            "not_helpful_count": 4
                          }
                        ],
                        "features": [
                          {
                            "label": "Jakość wykonania",
                            "mentions": 12,
                            "sentiment": "positive",
                            "negative_mentions": 1,
                            "positive_mentions": 11
                          },
                          {
                            "label": "Wydajność",
                            "mentions": 10,
                            "sentiment": "positive",
                            "negative_mentions": 2,
                            "positive_mentions": 8
                          }
                        ],
                        "pagination": {
                          "has_next": true,
                          "total_pages": 4,
                          "current_page": 1,
                          "total_results": 69
                        },
                        "product_id": "86530fbb-7c5a-41cc-92e2-6d622aa75509",
                        "rating_filter": null
                      },
                      "meta": {
                        "credits": 1,
                        "billable": true,
                        "endpoint_family": "reviews"
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "403": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "404": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errors"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "Kontrakt P3: limit konta (minutowy lub równoległości), bez obciążenia kredytami. Jeszcze niewdrożony.",
            "x-implementation-phase": "P3",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Sekundy do ponowienia, zgodne z retry_after.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error",
                    "meta",
                    "retry_after",
                    "request_id"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": "RATE_LIMITED"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "billable",
                        "retryable"
                      ],
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "const": true
                        }
                      }
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "x-credits": {
          "min": 1,
          "max": 1,
          "rule": "1 credit per successful request. Failed requests are free."
        },
        "summary": "Opinie produktu",
        "x-credit-operations": [
          "reviews"
        ]
      }
    },
    "/api/allegro/categories": {
      "get": {
        "operationId": "allegro.categories",
        "description": "Rynek PL. Koszt udanego niepustego wyniku według GET /api/portal/catalog (prices). Błędy bez opłaty.",
        "tags": [
          "Allegro"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(?:[0-9]{1,10}|[a-z0-9]+(?:-[a-z0-9]+)*)$",
              "maxLength": 120
            },
            "example": "165",
            "description": "ID lub alias kategorii Allegro. Pozostaw puste, aby pobrać kategorie główne."
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "PL",
                "CZ",
                "SK"
              ]
            },
            "description": "Obecnie obsługiwane PL. CZ i SK zwracają 422."
          }
        ],
        "responses": {
          "200": {
            "description": "Udany wynik",
            "headers": {
              "X-Credits-Charged": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-request-id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "path": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "alias": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "country": {
                              "type": "string"
                            },
                            "category": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "alias": {
                                  "type": "string"
                                }
                              }
                            },
                            "children": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "alias": {
                                    "type": "string"
                                  },
                                  "offers_count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          },
                          "required": [
                            "path",
                            "country",
                            "category",
                            "children"
                          ]
                        },
                        {
                          "type": "object",
                          "required": [
                            "categories",
                            "country"
                          ],
                          "properties": {
                            "categories": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "id",
                                  "name",
                                  "alias"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "alias": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "country": {
                              "const": "PL"
                            }
                          }
                        }
                      ]
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "credits": {
                          "type": "integer"
                        },
                        "billable": {
                          "type": "boolean"
                        },
                        "endpoint_family": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Allegro categories 200 response (inferred from official example)",
                  "description": "Inferred from the documented example; fields can be null or missing in real data.",
                  "required": [
                    "success",
                    "data",
                    "meta"
                  ]
                },
                "examples": {
                  "result": {
                    "summary": "Przykładowy wynik",
                    "value": {
                      "data": {
                        "path": [
                          {
                            "id": "42540aec-367a-4e5e-b411-17c09b08e41f",
                            "name": "Elektronika",
                            "alias": "elektronika"
                          },
                          {
                            "id": "4",
                            "name": "Telefony i Akcesoria",
                            "alias": "telefony-i-akcesoria"
                          },
                          {
                            "id": "165",
                            "name": "Smartfony i telefony komórkowe",
                            "alias": "smartfony-i-telefony-komorkowe-165"
                          }
                        ],
                        "country": "PL",
                        "category": {
                          "id": "165",
                          "name": "Smartfony i telefony komórkowe",
                          "alias": "smartfony-i-telefony-komorkowe-165"
                        },
                        "children": [
                          {
                            "id": "4937",
                            "name": "Alcatel",
                            "alias": "smartfony-i-telefony-komorkowe-alcatel-4937",
                            "offers_count": 127
                          },
                          {
                            "id": "48978",
                            "name": "Apple",
                            "alias": "smartfony-i-telefony-komorkowe-apple-48978",
                            "offers_count": 9999
                          },
                          {
                            "id": "250568",
                            "name": "Asus",
                            "alias": "smartfony-i-telefony-komorkowe-asus-250568",
                            "offers_count": 39
                          },
                          {
                            "id": "257985",
                            "name": "Blackview",
                            "alias": "smartfony-i-telefony-komorkowe-blackview-257985",
                            "offers_count": 441
                          },
                          {
                            "id": "253022",
                            "name": "Cat Phones",
                            "alias": "smartfony-i-telefony-komorkowe-cat-phones-253022",
                            "offers_count": 33
                          },
                          {
                            "id": "258336",
                            "name": "Cubot",
                            "alias": "smartfony-i-telefony-komorkowe-cubot-258336",
                            "offers_count": 295
                          }
                        ]
                      },
                      "meta": {
                        "credits": 20,
                        "billable": true,
                        "endpoint_family": "categories"
                      },
                      "success": true
                    }
                  },
                  "roots": {
                    "summary": "Kategorie główne (1 kredyt)",
                    "value": {
                      "success": true,
                      "data": {
                        "categories": [
                          {
                            "alias": "dom-i-ogrod",
                            "id": "5",
                            "name": "Dom i Ogród"
                          },
                          {
                            "alias": "dziecko",
                            "id": "11763",
                            "name": "Dziecko"
                          },
                          {
                            "alias": "elektronika",
                            "id": "42540aec-367a-4e5e-b411-17c09b08e41f",
                            "name": "Elektronika"
                          },
                          {
                            "alias": "firma",
                            "id": "4bd97d96-f0ff-46cb-a52c-2992bd972bb1",
                            "name": "Firma"
                          },
                          {
                            "alias": "kolekcje-i-sztuka",
                            "id": "a408e75a-cede-4587-8526-54e9be600d9f",
                            "name": "Kolekcje i sztuka"
                          },
                          {
                            "alias": "kultura-i-rozrywka",
                            "id": "38d588fd-7e9c-4c42-a4ae-6831775eca45",
                            "name": "Kultura i rozrywka"
                          },
                          {
                            "alias": "moda",
                            "id": "ea5b98dd-4b6f-4bd0-8c80-22c2629132d0",
                            "name": "Moda"
                          },
                          {
                            "alias": "motoryzacja",
                            "id": "3",
                            "name": "Motoryzacja"
                          },
                          {
                            "alias": "nieruchomosci",
                            "id": "20782",
                            "name": "Nieruchomości"
                          },
                          {
                            "alias": "sport-i-turystyka",
                            "id": "3919",
                            "name": "Sport i turystyka"
                          },
                          {
                            "alias": "supermarket",
                            "id": "258832",
                            "name": "Supermarket"
                          },
                          {
                            "alias": "uroda",
                            "id": "1429",
                            "name": "Uroda"
                          },
                          {
                            "alias": "zdrowie",
                            "id": "121882",
                            "name": "Zdrowie"
                          }
                        ],
                        "country": "PL"
                      },
                      "meta": {
                        "endpoint_family": "categories",
                        "billable": true,
                        "credits": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "403": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "404": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "errors"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "Kontrakt P3: limit konta (minutowy lub równoległości), bez obciążenia kredytami. Jeszcze niewdrożony.",
            "x-implementation-phase": "P3",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Sekundy do ponowienia, zgodne z retry_after.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error",
                    "meta",
                    "retry_after",
                    "request_id"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": "RATE_LIMITED"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "billable",
                        "retryable"
                      ],
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "const": true
                        }
                      }
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "Błąd, bez opłaty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "meta"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        },
        "x-credits": {
          "min": 1,
          "max": 20,
          "rule": "1 credit for the root list, 20 credits for one category tree. Failed requests are free."
        },
        "summary": "Kategorie Allegro",
        "x-credit-operations": [
          "categories.roots",
          "categories.tree"
        ]
      }
    },
    "/api/account/usage": {
      "get": {
        "operationId": "account.usage",
        "summary": "Saldo i zużycie kredytów",
        "description": "Wspólny portfel konta. To nie jest licznik requestów. Koszt: 0.",
        "responses": {
          "200": {
            "description": "Saldo konta",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "balance",
                    "credits",
                    "usage",
                    "generated_at"
                  ],
                  "properties": {
                    "balance": {
                      "type": "integer"
                    },
                    "generated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "credits": {
                      "type": "object",
                      "properties": {
                        "usable": {
                          "type": "integer"
                        },
                        "available": {
                          "type": "integer"
                        },
                        "free_remaining": {
                          "type": "integer"
                        },
                        "active_paid_remaining": {
                          "type": "integer"
                        },
                        "inactive_paid_remaining": {
                          "type": "integer"
                        },
                        "free_used_this_month": {
                          "type": "integer"
                        },
                        "free_blocked_by_verification": {
                          "type": "boolean"
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "current_month": {
                          "type": "integer"
                        },
                        "last_1_hour": {
                          "type": "integer"
                        },
                        "last_24_hours": {
                          "type": "integer"
                        },
                        "last_7_days": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "401": {
            "description": "Nieprawidłowy klucz",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "code",
                    "status"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "Kontrakt P3: limit konta (minutowy lub równoległości), bez obciążenia kredytami. Jeszcze niewdrożony.",
            "x-implementation-phase": "P3",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit requestów na minutę dla konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Pozostałe requesty w bieżącym oknie konta; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Koniec okna, Unix timestamp w sekundach UTC; wdrożenie P3.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Sekundy do ponowienia, zgodne z retry_after.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error",
                    "meta",
                    "retry_after",
                    "request_id"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "const": "RATE_LIMITED"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "billable",
                        "retryable"
                      ],
                      "properties": {
                        "billable": {
                          "const": false
                        },
                        "retryable": {
                          "const": true
                        }
                      }
                    },
                    "retry_after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  }
}
