allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
213 stars 39 forks source link

API nie chce przyjąć podanych parametrów przy dodawaniu produktu #5876

Closed TimothyKoval closed 2 years ago

TimothyKoval commented 2 years ago

Występuje problem:

Request:

POST /sale/product-offers HTTP/2
Host: api.allegro.pl
accept-language: pl-PL
accept: application/vnd.allegro.public.v1+json
content-type: application/vnd.allegro.public.v1+json
authorization: bearer eyJhbGciOi ... lkWROI8-Uw
content-length: 2557
{
    "productSet": [{
        "product": {
            "name": "KOŃCÓWKA CYLINDRYCZNA WTYK WC 4/2,5",
            "category": {
                "id": "259605"
            },
            "id": "5903792632242",
            "idType": "GTIN",
            "images": ["https://a.allegroimg.com/original/1115ca/59804aed45c7930058e18506f69f"]
        },
        "quantity": {
            "value": 1
        },
        "parameters": [{
            "id": 127509,
            "valuesIds": ["127509_30"],
            "values": [],
            "rangeValue": null
        }, {
            "id": 225693,
            "valuesIds": [],
            "values": ["5903792632242"],
            "rangeValue": null
        }, {
            "id": 224017,
            "valuesIds": [],
            "values": ["675.00.9"],
            "rangeValue": null
        }]
    }],
    "name": "KOŃCÓWKA CYLINDRYCZNA WTYK WC 4/2,5",
    "category": {
        "id": "259605"
    },
    "images": ["https://a.allegroimg.com/original/1115ca/59804aed45c7930058e18506f69f"],
    "parameters": [{
        "id": 11323,
        "valuesIds": ["11323_1"],
        "values": [],
        "rangeValue": null
    }],
    "description": {
        "sections": [{
            "items": [{
                "type": "TEXT",
                "content": "<h1>KOŃCÓWKA CYLINDRYCZNA WTYK WC 4/2,5</h1><h2>KOŃCÓWKA CYLINDRYCZNA WTYK WC 4/2,5</h2>"
            }]
        }, {
            "items": [{
                "type": "TEXT",
                "content": "<p>Jeśli nie jesteś pewien czy dana część pasuje do Twojego auta - <b>zweryfikujemy to po numerze VIN pojazdu.</b></p>"
            }]
        }, {
            "items": [{
                "type": "IMAGE",
                "url": "https://a.allegroimg.com/original/1115ca/59804aed45c7930058e18506f69f"
            }]
        }, {
            "items": [{
                "type": "TEXT",
                "content": "<ul><li>Producent: <b>CONNECT POLSKA</b></li><li>Kod EAN: <b>5903792632242</b></li><li>Indeks: <b>675.00.9</b></li></ul>"
            }]
        }, {
            "items": [{
                "type": "TEXT",
                "content": "<h1>!!Jeśli nie znalazłeś tego czego szukasz sprawdź nasze pozostałe aukcje!!</h1>"
            }]
        }]
    },
    "compatibilityList": null,
    "sellingMode": {
        "format": "BUY_NOW",
        "price": {
            "amount": 1,
            "currency": "PLN"
        },
        "startingPrice": null,
        "minimalPrice": null
    },
    "stock": {
        "available": "52",
        "unit": "UNIT"
    },
    "publication": {
        "duration": null,
        "status": "INACTIVE",
        "startingAt": null,
        "endingAt": null,
        "endedBy": null
    },
    "delivery": {
        "shippingRates": {
            "id": "05e590a2-9b9f-4ae1-ba37-3a553cd911a4"
        },
        "handlingTime": "PT0S",
        "additionalInfo": "",
        "shipmentDate": null
    },
    "payments": {
        "invoice": "VAT"
    },
    "afterSalesServices": {
        "warranty": {
            "id": "d485e110-eace-4f23-ac6e-0cb4b3e8db2d"
        },
        "impliedWarranty": {
            "id": "18484352-3999-49ee-84fc-0d90cfd00cfe"
        },
        "returnPolicy": {
            "id": "4b54f974-1376-4271-8e16-028e1b4bfc27"
        }
    },
    "additionalServices": null,
    "sizeTable": null,
    "promotion": {
        "emphasized": false,
        "bold": false,
        "highlight": false,
        "departmentPage": false,
        "emphasizedHighlightBoldPackage": false
    },
    "location": {
        "countryCode": "PL",
        "province": null,
        "city": "",
        "postCode": ""
    },
    "external": {
        "id": "CON675.00.9"
    },
    "attachments": [],
    "contact": null,
    "tax": {
        "percentage": "23.00"
    }
}

Response:

HTTP\/2 422
expires: 0
cache-control: no-cache, no-store, max-age=0, must-revalidate
x-xss-protection: 1; mode=block
pragma: no-cache
x-frame-options: DENY
trace-id: 63ae248c4e792934
date: Tue, 12 Jul 2022 06:10:39 GMT
x-content-type-options: nosniff
strict-transport-security: max-age=31536000 ; includeSubDomains
content-type: application\/json
content-length: 365
{
    "errors": [{
        "code": "ProductValidationException",
        "message": "Unable to create product without proper values in all required parameters: [Marka, Kod producenta] in category: 259605",
        "details": null,
        "path": "productSet[0].product",
        "userMessage": "Nie można stworzyć produktu bez podania poprawnych wartości wszystkich parametrów wymaganych: [Marka, Kod producenta]"
    }]
}
AureliuszBrussy commented 2 years ago

@TimothyKoval wygląda to na błąd po naszej stronie - jeszcze to dokładnie weryfikujemy. Wrócę z wyjaśnieniem.

AureliuszBrussy commented 2 years ago

@TimothyKoval nie jest to jednak błąd po naszej stronie. W logach widzę, że w swoim wywołaniu listę "parameters" przekazałeś pod "productSet", a nie w zagnieżdżonym produkcie ("product").

stale[bot] commented 2 years ago

W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 7 dni, dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu kolejnych 7 dni nie pojawi się żadna odpowiedź, wątek zostanie zamknięty. Dziękujemy za zaangażowanie w dyskusję i zachęcamy Cię do wypełnienia ankiety dotyczącej naszego wsparcia na forum.


There was no new reply in this thread within 7 days, therefore, we automatically marked it as expired. If no response is received within the next 7 days, this thread will be closed. Thank you for engaging in the discussion. We encourage you to complete our forum support survey.