v4.8.x API Fehler bei stockType "only-positive"

Thema wurde von sirtet, 12. April 2024 erstellt.

  1. sirtet

    sirtet Erfahrener Benutzer

    Registriert seit:
    4. Juli 2012
    Beiträge:
    1.120
    Danke erhalten:
    88
    Danke vergeben:
    89
    4.8.0.2
    Wenn versucht wird, eine Variante mit negativem Bestand zu aktualisieren, gibt's einen Fehler...
    Die Variante hat in Gambio Bestand -1, wie auch immer das entstand.
    Aber es wird ja versucht, den Bestand auf 0 zu setzen, das sollte doch keinen Fehler auslösen, oder?

    Code:
    11.04.2024 07:39:42 [TGambioAPI] PUT  https://www.paddlershop.ch/catalog/api.php/v3/products/285/variants
    
    [HEADER]: Authorization=Basic dmFyaW.......
    [HEADER]: Content-Type=application/json
    
    CONTENT:
    [
        {
            "id": 916,
            "combination": [
                {
                    "optionId": 17,
                    "optionValueId": 174
                },
                {
                    "optionId": 3,
                    "optionValueId": 37
                }
            ],
            "sortOrder": 632000,
            "modelNumber": "6011-2-SW-US6",
            "GTIN": "",
            "ASIN": "",
            "EAN": "842274104417",
            "stockType": "only-positive",
            "stock": 0,
            "weightType": "replacing",
            "weight": 0,
            "priceType": "replacing",
            "price": -0.0003,
            "vpeScalarValue": 0,
            "vpeUnitId": null,
            "deliveryTimeId": 11,
            "imageListId": null
        }
    ]
    
    11.04.2024 07:39:42 [TGambioAPI] STATUS:
        422 Unprocessable Entity
    
    HEADER:
        Cache-Control: public, max-age=0
        Connection: Keep-Alive
        Date: Thu, 11 Apr 2024 05:39:42 GMT
        Keep-Alive: timeout=5, max=100
        Content-Length: 102
        Content-Type: application/json; charset=UTF-8
        Expires: Thu, 11 Apr 2024 05:39:42 GMT
        x-rate-limit-limit: 5000
        x-rate-limit-remaining: 4941
        x-rate-limit-reset: 1712780502
        x-shop-version: v4.8.0.2
        x-api-version: 3.0.0
        x-content-type-options: nosniff
    
    CONTENT:
    {
        "errors": [
            "Stock must be greater than or equal to 0, if the stock type only allows positiv values."
        ]
    }