allegro / allegro-api

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

Request contains invalid data #10197

Open windfollower2024 opened 3 weeks ago

windfollower2024 commented 3 weeks ago

[By]sending a request:

https://api.{environment}/sale/product-offers {"productSet":[{"product":{"name":"New casual men's shoulder bag, Street Fashion small shoulder bag","category":{"id":"300561"},"parameters":[{"id":"3766","valuesIds":["3766_11"]},{"id":"203937","valuesIds":["203937_381729"]},{"id":"218669","valuesIds":["218669_1"]},{"id":"225693","values":["763508344297"]},{"id":"249512","valuesIds":["249512_1647414"]},{"id":"249513","valuesIds":["249513_1647430"]},{"id":"249516","valuesIds":["249516_1647636"]},{"id":"3786","valuesIds":["3786_1704209"]},{"id":"7997","valuesIds":["7997_256"]},{"id":"203925","valuesIds":["203925_218421"]},{"id":"203941","valuesIds":["203941_381737"]}],"images":["http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104613\/07d3f9d7224418f5800978bf9c2e97dd_192db510839Z4QtepuOch.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104449\/36b9b78ec9250833e809e198029f5c1d_192db4fbf25ZFKJOAr1WP.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104509\/d925d9174e4ae75a5ffa6a6fecfa7848_192db500c14rHnZRPJrCw.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104549\/ca9cc3b4f7c238f467a90ada5a6b4947_192db50a8c5Mduaz1zMMM.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104557\/d401c8f869cdb0cd5768f7a72a1add30_192db50c705ZMsKvgkXih.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104606\/02038589a61f8e8c7ecd59c4c49d63ee_192db50ea39NKYaJQZshC.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104623\/4483e9c671e080e1f9f182e825b6a6f6_192db512df5Ac32WzjhxB.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104628\/7a9bd8fffd3e9b4288efb23c3b5a6bc4_192db5140deyklxu4nuxF.jpeg"]}}],"name":"New casual men's shoulder bag, Street Fashion small shoulder bag","language":"pl-PL","parameters":[{"id":"229205","valuesIds":["229205_340245"]},{"id":"11323","valuesIds":["11323_1"]}],"images":["http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104613\/07d3f9d7224418f5800978bf9c2e97dd_192db510839Z4QtepuOch.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104449\/36b9b78ec9250833e809e198029f5c1d_192db4fbf25ZFKJOAr1WP.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104509\/d925d9174e4ae75a5ffa6a6fecfa7848_192db500c14rHnZRPJrCw.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104549\/ca9cc3b4f7c238f467a90ada5a6b4947_192db50a8c5Mduaz1zMMM.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104557\/d401c8f869cdb0cd5768f7a72a1add30_192db50c705ZMsKvgkXih.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104606\/02038589a61f8e8c7ecd59c4c49d63ee_192db50ea39NKYaJQZshC.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104623\/4483e9c671e080e1f9f182e825b6a6f6_192db512df5Ac32WzjhxB.jpeg","http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104628\/7a9bd8fffd3e9b4288efb23c3b5a6bc4_192db5140deyklxu4nuxF.jpeg"],"delivery":{"shippingRates":{"id":"690f6413-0db2-42e5-9d75-3f0182ffa7e1"},"handlingTime":"PT120H"},"afterSalesServices":{"impliedWarranty":{"id":"60b11eca-ab80-4e56-9658-1042c267b07f"},"returnPolicy":{"id":"78d0e8b8-314c-44ed-bd3c-fc6283a20f84"}},"payments":{"invoice":"NO_INVOICE"},"sellingMode":{"format":"BUY_NOW","price":{"amount":"89","currency":"PLN"}},"location":{"countryCode":"CN","city":"GUANGZHOU","postCode":"510000"},"stock":{"available":93490,"unit":"UNIT"},"description":{"sections":[{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104549\/ca9cc3b4f7c238f467a90ada5a6b4947_192db50a8c5Mduaz1zMMM.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104623\/4483e9c671e080e1f9f182e825b6a6f6_192db512df5Ac32WzjhxB.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104613\/07d3f9d7224418f5800978bf9c2e97dd_192db510839Z4QtepuOch.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104631\/d6127aac7ec8cfcb1d88dd9567e028e5_192db514f016wJWZXmuLz.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104606\/02038589a61f8e8c7ecd59c4c49d63ee_192db50ea39NKYaJQZshC.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104635\/c90e7d260e4826241f13fb1d4e9a6f8b_192db515cf7LmLPoIpH0W.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104642\/d5eca121426d863e7467063435fb4810_192db51799ejzgE6LJtfh.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104645\/2c9b7bb76e9510aad745d63f7e9b7a5b_192db5185438mNRjMPGgB.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104648\/2e020f376bd0119df249aabfe811bba5_192db518fccf2X1SmJh4J.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104623\/4483e9c671e080e1f9f182e825b6a6f6_192db512df5Ac32WzjhxB.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104613\/07d3f9d7224418f5800978bf9c2e97dd_192db510839Z4QtepuOch.jpeg"}]},{"items":[{"type":"IMAGE","url":"http:\/\/earth-sg-rt.oss-ap-southeast-1.aliyuncs.com\/temp\/mserp\/20241030104631\/d6127aac7ec8cfcb1d88dd9567e028e5_192db514f016wJWZXmuLz.jpeg"}]}]},"external":{"id":"676137089750"},"taxSettings":{"rates":[{"rate":"8.00"}],"subject":"GOODS"}}

I get a response:

{ "errors": [ { "code": "JsonMappingException", "message": "Request contains invalid data. Contact the application author.Message is not readable."} ] }

What is the reason?

Lukasz-Zurek commented 3 weeks ago

@windfollower2024 The reason is an incorrect countryCode for this taxSettings. It should be one of the following: "PL" "CZ" "SK" "HU". "Country CN is not supported.

deviimpro commented 3 weeks ago

Hi,

We have sent this offer creation request and getting an error response.

API URL: https://api.allegro.pl/sale/product-offers

Request:

{ "productSet":[ { "product":{ "name":"SS805A Samsung MultiXpress SCX-8030ND Toner Cartri", "category":{ "id":"260341" }, "images":[ "https:\/\/www.promotoner.com\/media\/catalog\/product\/2\/9\/294424_1.jpg" ], "parameters":[ { "name":"EAN", "values":[ "0191628461943" ] }, { "id":224017, "values":[ "SS805A" ], "valuesIds":[

              ]
           },
           {
              "id":17589,
              "values":[

              ],
              "valuesIds":[
                 "17589_1"
              ]
           },
           {
              "id":203433,
              "values":[

              ],
              "valuesIds":[
                 "203433_596285"
              ]
           }
        ]
     }
  }

], "publication":{ "status":"ACTIVE", "startingAt":null, "startedAt":null, "endingAt":null, "endedAt":null }, "additionalMarketplaces":{ "allegro-cz":{ "publication":{ "state":"APPROVED" }, "sellingMode":{ "price":{ "amount":1240, "currency":"CZK" } } }, "allegro-sk":{ "publication":{ "state":"APPROVED" }, "sellingMode":{ "price":{ "amount":48.59, "currency":"EUR" } } } }, "additionalServices":null, "external":{ "id":"123201_AB" }, "delivery":{ "shippingRates":{ "id":"2e61029a-0c34-454b-b1b0-98969b234df6" } }, "parameters":[ { "id":11323, "values":[

     ],
     "valuesIds":[
        "11323_1"
     ]
  }

], "category":{ "id":"260341" }, "name":"SS805A Samsung MultiXpress SCX-8030ND Toner Cartri", "payments":{ "invoice":"VAT" }, "sellingMode":{ "format":"BUY_NOW", "price":{ "amount":216.93, "currency":"PLN" }, "minimalPrice":{ "amount":216.93, "currency":"PLN" }, "startingPrice":{ "amount":216.93, "currency":"PLN" } }, "location":{ "city":"Wommelgem", "countryCode":"BE", "postCode":"2160", "province":"Antwerpen" }, "images":[ "https:\/\/www.promotoner.com\/media\/catalog\/product\/2\/9\/294424_1.jpg" ], "description":{ "sections":[ { "items":[ { "type":"TEXT", "content":"\u003Cp\u003ESAMSUNG K606 TONER CARTRIDGE BLACK 35K SS805A\u003C\/p\u003E" } ] } ] }, "stock":{ "available":1, "unit":"UNIT" }, "taxSettings":{ "rates":[ { "rate":"23.00", "countryCode":"PL" }, { "rate":"21.00", "countryCode":"CZ" }, { "rate":"20.00", "countryCode":"SK" } ], "subject":"GOODS" } }

Response:

{"response":"Error","error_code":"UnknownJSONProperty","message":"Unknown properties found in the request.","userMessage":"The uploaded data includes unsupported properties. Contact your software vendor."}

Please check and let us know the reason for this error.

Lukasz-Zurek commented 3 weeks ago

@deviimpro Please check the "metadata" field in our response:

{
    "errors": [
        {
            "code": "UnknownJSONProperty",
            "message": "Unknown properties found in the request.",
            "details": null,
            "path": null,
            "userMessage": "The uploaded data includes unsupported properties. Contact your software vendor.",
            "metadata": {
                "unknownProperties": "...startedAt, ...endingAt, ...endedAt, ...publication"
            }
        }
    ]
}