HTTP responsecode 422 adding product

Hi all, not sure if I should ask the question here. But why is this xml for adding a product to the Lightspeed POS gives a 422 Unprocessable Entity error? Something wrong with the xml?

<?xml version="1.0"?><Item><defaultCost currency="EUR">3.85</defaultCost><discountable>true</discountable><tax>true</tax><customSku>ZARO003</customSku><itemType>default</itemType><description>Zuid-Afrika, Stellenbosch Shiraz MAN 2017</description><ean>6009669350444</ean><taxClassID>0</taxClassID><Prices><ItemPrice><amount>8.09</amount><useTypeID>1</useTypeID><useType>Default</useType></ItemPrice><ItemPrice><amount>8.09</amount><useTypeID>1</useTypeID><useType>MSRP</useType></ItemPrice></Prices></Item>

Thank you for your response.

3 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 642 moderator

    Hey @webwinkelfacturen,

    If you remove the '<?xml version="1.0"?>' then it will work :)

    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • webwinkelfacturenwebwinkelfacturen Member Posts: 3

    Thank you Adrian, but that change doesn't work.

    <Item><defaultCost currency="EUR">9.15</defaultCost><discountable>true</discountable><tax>true</tax><customSku>ITRO013</customSku><itemType>default</itemType><description>Piëmonte, Barbera dAlba Ruvei, Marchesi di Barolo 2017</description><ean>8004910304038</ean><taxClassID>0</taxClassID><Prices><ItemPrice><amount>19.40</amount><useTypeID>1</useTypeID><useType>Default</useType></ItemPrice><ItemPrice><amount>19.40</amount><useTypeID>1</useTypeID><useType>MSRP</useType></ItemPrice></Prices></Item>

    gives the same 422 HTTP response code.

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 642 moderator

    Hey @webwinkelfacturen, then it's likely your API client is doing something else under the hood that's preventing it. I'm running the same request you've listed above in postman and I'm not having any issues.


    Check your request configuration and work from there

    Adrian Samuel

    Software Developer

    Lightspeed HQ

Sign In or Register to comment.